27,008 research outputs found

    Gradual Liquid Type Inference

    Full text link
    Liquid typing provides a decidable refinement inference mechanism that is convenient but subject to two major issues: (1) inference is global and requires top-level annotations, making it unsuitable for inference of modular code components and prohibiting its applicability to library code, and (2) inference failure results in obscure error messages. These difficulties seriously hamper the migration of existing code to use refinements. This paper shows that gradual liquid type inference---a novel combination of liquid inference and gradual refinement types---addresses both issues. Gradual refinement types, which support imprecise predicates that are optimistically interpreted, can be used in argument positions to constrain liquid inference so that the global inference process e effectively infers modular specifications usable for library components. Dually, when gradual refinements appear as the result of inference, they signal an inconsistency in the use of static refinements. Because liquid refinements are drawn from a nite set of predicates, in gradual liquid type inference we can enumerate the safe concretizations of each imprecise refinement, i.e. the static refinements that justify why a program is gradually well-typed. This enumeration is useful for static liquid type error explanation, since the safe concretizations exhibit all the potential inconsistencies that lead to static type errors. We develop the theory of gradual liquid type inference and explore its pragmatics in the setting of Liquid Haskell.Comment: To appear at OOPSLA 201

    Equilibrium fluctuation theorems compatible with anomalous response

    Full text link
    Previously, we have derived a generalization of the canonical fluctuation relation between heat capacity and energy fluctuations C=β2<δU2>C=\beta^{2}<\delta U^{2}>, which is able to describe the existence of macrostates with negative heat capacities C<0C<0. In this work, we extend our previous results for an equilibrium situation with several control parameters to account for the existence of states with anomalous values in other response functions. Our analysis leads to the derivation of three different equilibrium fluctuation theorems: the \textit{fundamental and the complementary fluctuation theorems}, which represent the generalization of two fluctuation identities already obtained in previous works, and the \textit{associated fluctuation theorem}, a result that has no counterpart in the framework of Boltzmann-Gibbs distributions. These results are applied to study the anomalous susceptibility of a ferromagnetic system, in particular, the case of 2D Ising model.Comment: Extended version of the paper published in JSTA

    Trust, but Verify: Two-Phase Typing for Dynamic Languages

    Get PDF
    A key challenge when statically typing so-called dynamic languages is the ubiquity of value-based overloading, where a given function can dynamically reflect upon and behave according to the types of its arguments. Thus, to establish basic types, the analysis must reason precisely about values, but in the presence of higher-order functions and polymorphism, this reasoning itself can require basic types. In this paper we address this chicken-and-egg problem by introducing the framework of two-phased typing. The first "trust" phase performs classical, i.e. flow-, path- and value-insensitive type checking to assign basic types to various program expressions. When the check inevitably runs into "errors" due to value-insensitivity, it wraps problematic expressions with DEAD-casts, which explicate the trust obligations that must be discharged by the second phase. The second phase uses refinement typing, a flow- and path-sensitive analysis, that decorates the first phase's types with logical predicates to track value relationships and thereby verify the casts and establish other correctness properties for dynamically typed languages

    The how and why of syntactic relations

    Get PDF
    Human communication takes place when one person does something that when seen or heard by another person is taken to be done with the intention to communicate, and the other person, having seen the communicator show his or her intention to communicate, then uses inference to determine what the communicator intends to communicate. This is possible because the addressee assumes that the communicator is a rational person, that is, acts with goals in mind (see Grice 1975), and so must be doing the act for a reason, and it is worth the addressee’s effort to try to determine what that reason is, that is, determine the relevance of the act

    Bounded Refinement Types

    Full text link
    We present a notion of bounded quantification for refinement types and show how it expands the expressiveness of refinement typing by using it to develop typed combinators for: (1) relational algebra and safe database access, (2) Floyd-Hoare logic within a state transformer monad equipped with combinators for branching and looping, and (3) using the above to implement a refined IO monad that tracks capabilities and resource usage. This leap in expressiveness comes via a translation to "ghost" functions, which lets us retain the automated and decidable SMT based checking and inference that makes refinement typing effective in practice.Comment: 14 pages, International Conference on Functional Programming, ICFP 201

    'Obsessed with goals': functions and mechanisms of teleological interpretation of actions in humans

    Get PDF
    Humans show a strong and early inclination to interpret observed behaviours of others as goal-directed actions. We identify two main epistemic functions that this ‘teleological obsession’ serves: on-line prediction and social learning. We show how teleological action interpretations can serve these functions by drawing on two kinds of inference (‘action-to-goal’ or ‘goal-to-action’), and argue that both types of teleological inference constitute inverse problems that can only be solved by further assumptions. We pinpoint the assumptions that the three currently proposed mechanisms of goal attribution (action-effect associations, simulation procedures, and teleological reasoning) imply, and contrast them with the functions they are supposed to fulfil. We argue that while action-effect associations and simulation procedures are generally well suited to serve on-line action monitoring and prediction, social learning of new means actions and artefact functions requires the inferential productivity of teleological reasoning
    • …
    corecore