5 research outputs found

    A Logic for Algebraic Effects

    Get PDF

    Logical Reasoning for Higher-Order Functions with Local State

    Full text link
    We introduce an extension of Hoare logic for call-by-value higher-order functions with ML-like local reference generation. Local references may be generated dynamically and exported outside their scope, may store higher-order functions and may be used to construct complex mutable data structures. This primitive is captured logically using a predicate asserting reachability of a reference name from a possibly higher-order datum and quantifiers over hidden references. We explore the logic's descriptive and reasoning power with non-trivial programming examples combining higher-order procedures and dynamically generated local state. Axioms for reachability and local invariant play a central role for reasoning about the examples.Comment: 68 page

    Logic and handling of algebraic effects

    Get PDF
    In the thesis, we explore reasoning about and handling of algebraic effects. Those are computational effects, which admit a representation by an equational theory. Their examples include exceptions, nondeterminism, interactive input and output, state, and their combinations. In the first part of the thesis, we propose a logic for algebraic effects. We begin by introducing the a-calculus, which is a minimal equational logic with the purpose of exposing distinct features of algebraic effects. Next, we give a powerful logic, which builds on results of the a-calculus. The types and terms of the logic are the ones of Levy’s call-by-push-value framework, while the reasoning rules are the standard ones of a classical multi-sorted first-order logic with predicates, extended with predicate fixed points and two principles that describe the universality of free models of the theory representing the effects at hand. Afterwards, we show the use of the logic in reasoning about properties of effectful programs, and in the translation of Moggi’s computational ¸-calculus, Hennessy-Milner logic, and Moggi’s refinement of Pitts’s evaluation logic. In the second part of the thesis, we introduce handlers of algebraic effects. Those not only provide an algebraic treatment of exception handlers, but generalise them to arbitrary algebraic effects. Each such handler corresponds to a model of the theory representing the effects, while the handling construct is interpreted by the homomorphism induced by the universal property of the free model. We use handlers to describe many previously unrelated concepts from both theory and practice, for example CSS renaming and hiding, stream redirection, timeout, and rollback

    A General Semantics for Evaluation Logic

    No full text
    The semantics of Evaluation Logic proposed in [14] relies on additional properties of monads. This paper proposes an alternative semantics, which drops all additional requirement on monads, at the expense of stronger assumptions on the underlying category. These assumptions are satised by any topos, but not by the category of cpos. However, in the setting of Synthetic Domain Theory (see [7, 23]) it is possible to reconcile the needs of Denotational Semantics with those of Logic. 1 Introduction Evaluation logic (EL T ) is a typed predicate logic originally proposed by [18], which is based on the metalanguage ML T for computational monads (see [12]) and permits statements about the evaluation of programs to values by the use of evaluation modalities: necessity and possibility. In particular, EL T might be used for axiomatizing computation-related properties of a monad or devising computationally adequate theories (see [18]), and it appears useful when addressing the question of logic..
    corecore