Results 1 
9 of
9
On the unity of duality
 Special issue on “Classical Logic and Computation
, 2008
"... Most type systems are agnostic regarding the evaluation strategy for the underlying languages, with the value restriction for ML which is absent in Haskell as a notable exception. As type systems become more precise, however, detailed properties of the operational semantics may become visible becaus ..."
Abstract

Cited by 12 (2 self)
 Add to MetaCart
Most type systems are agnostic regarding the evaluation strategy for the underlying languages, with the value restriction for ML which is absent in Haskell as a notable exception. As type systems become more precise, however, detailed properties of the operational semantics may become visible because properties captured by the types may be sound under one strategy but not the other. For example, intersection types distinguish between callbyname and callbyvalue functions, because the subtyping law (A → B) ∩ (A → C) ≤ A → (B ∩ C) is unsound for the latter in the presence of effects. In this paper we develop a prooftheoretic framework for analyzing the interaction of types with evaluation order, based on the notion of polarity. Polarity was discovered through linear logic, but we propose a fresh origin in Dummett’s program of justifying the logical laws through alternative verificationist or pragmatist “meaningtheories”, which include a bias towards either introduction or elimination rules. We revisit Dummett’s analysis using the tools of MartinLöf’s judgmental method, and then show how to extend it to a unified polarized logic, with Girard’s “shift ” connectives acting as intermediaries. This logic safely combines intuitionistic and dual intuitionistic reasoning principles, while simultaneously admitting a focusing interpretation for the classical sequent calculus. Then, by applying the CurryHoward isomorphism to polarized logic, we obtain a single programming language in which evaluation order is reflected at the level of types. Different logical notions correspond directly to natural programming constructs, such as patternmatching, explicit substitutions, values and callbyvalue continuations. We give examples demonstrating the expressiveness of the language and type system, and prove a basic but modular type safety result. We conclude with a brief discussion of extensions to the language with additional effects and types, and sketch the sort of explanation this can provide for operationallysensitive typing phenomena. 1
Relational parametricity for references and recursive types
 In Proceedings Fourth ACM Workshop on Types in Language Design and Implementation, TLDI’09
, 2009
"... We present a possible world semantics for a callbyvalue higherorder programming language with impredicative polymorphism, general references, and recursive types. The model is one of the first relationally parametric models of a programming language with all these features. To model impredicative ..."
Abstract

Cited by 11 (4 self)
 Add to MetaCart
We present a possible world semantics for a callbyvalue higherorder programming language with impredicative polymorphism, general references, and recursive types. The model is one of the first relationally parametric models of a programming language with all these features. To model impredicative polymorphism we define the semantics of types via parameterized (worldindexed) logical relations over a universal domain. It is wellknown that it is nontrivial to show the existence of logical relations in the presence of recursive types. Here the problems are exacerbated because of general references. We explain what the problems are and present our solution, which makes use of a novel approach to modeling references. We prove that the resulting semantics is adequate with respect to a standard operational semantics and include simple examples of reasoning about contextual equivalence via parametricity.
Monads in Action
"... In functional programming, monadic characterizations of computational effects are normally understood denotationally: they describe how an effectful program can be systematically expanded or translated into a larger, pure program, which can then be evaluated according to an effectfree semantics. An ..."
Abstract

Cited by 6 (0 self)
 Add to MetaCart
In functional programming, monadic characterizations of computational effects are normally understood denotationally: they describe how an effectful program can be systematically expanded or translated into a larger, pure program, which can then be evaluated according to an effectfree semantics. Any effectspecific operations expressible in the monad are also given purely functional definitions, but these definitions are only directly executable in the context of an already translated program. This approach thus takes an inherently Churchstyle view of effects: the nominal meaning of every effectful term in the program depends crucially on its type. We present here a complementary, operational view of monadic effects, in which an effect definition directly induces an imperative behavior of the new operations expressible in the monad. This behavior is formalized as additional operational rules for only the new constructs; it does not require any structural changes to the evaluation judgment. Specifically, we give a smallstep operational semantics of a prototypical functional language supporting programmerdefinable, layered effects, and show how this semantics naturally supports reasoning by familiar syntactic techniques, such as showing soundness of a Currystyle effecttype system by the progress+preservation method.
Algebraic foundations for effectdependent optimisations
 In POPL
, 2012
"... We present a general theory of Giffordstyle type and effect annotations, where effect annotations are sets of effects. Generality is achieved by recourse to the theory of algebraic effects, a development of Moggi’s monadic theory of computational effects that emphasises the operations causing the e ..."
Abstract

Cited by 6 (1 self)
 Add to MetaCart
We present a general theory of Giffordstyle type and effect annotations, where effect annotations are sets of effects. Generality is achieved by recourse to the theory of algebraic effects, a development of Moggi’s monadic theory of computational effects that emphasises the operations causing the effects at hand and their equational theory. The key observation is that annotation effects can be identified with operation symbols. We develop an annotated version of Levy’s CallbyPushValue language with a kind of computations for every effect set; it can be thought of as a sequential, annotated intermediate language. We develop a range of validated optimisations (i.e., equivalences), generalising many existing ones and adding new ones. We classify these optimisations as structural, algebraic, or abstract: structural optimisations always hold; algebraic ones depend on the effect theory at hand; and abstract ones depend on the global nature of that theory (we give modularlycheckable sufficient conditions for their validity).
Inductive Reasoning About Effectful Data Types
 In Proceedings of the ACM SIGPLAN International Conference on Functional Programming
, 2007
"... We present a pair of reasoning principles, definition and proof by rigid induction, which can be seen as proper generalizations of lazydatatype induction to monadic effects other than partiality. We further show how these principles can be integrated into logicalrelations arguments, and obtain as ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
We present a pair of reasoning principles, definition and proof by rigid induction, which can be seen as proper generalizations of lazydatatype induction to monadic effects other than partiality. We further show how these principles can be integrated into logicalrelations arguments, and obtain as a particular instance a general and principled proof that the successstream and failurecontinuation models of backtracking are equivalent. As another application, we present a monadic model of general search trees, not necessarily traversed depthfirst. The results are applicable to both lazy and eager languages, and we emphasize this by presenting most examples in both Haskell and SML.
Handlers in Action
"... We lay operational foundations for effect handlers. Introduced by Plotkin and Pretnar, effect handlers are a novel programming construct that generalises exception handlers, handling a range of computational effects, such as I/O, state, and nondeterminism. We propose a smallstep structural operatio ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
We lay operational foundations for effect handlers. Introduced by Plotkin and Pretnar, effect handlers are a novel programming construct that generalises exception handlers, handling a range of computational effects, such as I/O, state, and nondeterminism. We propose a smallstep structural operational semantics for a higherorder calculus of effect handlers, along with a sound type and effect system. We explore two alternative effect handler implementation techniques: free monads, and delimited continuations. Finally, we show that Filinski’s monadic reflection can be straightforwardly simulated by effect handlers. 1.
Free Theorems Involving . . .
, 2009
"... Free theorems are a charm, allowing the derivation of useful statements about programs from their (polymorphic) types alone. We show how to reap such theorems not only from polymorphism over ordinary types, but also from polymorphism over type constructors restricted by class constraints. Our prime ..."
Abstract
 Add to MetaCart
Free theorems are a charm, allowing the derivation of useful statements about programs from their (polymorphic) types alone. We show how to reap such theorems not only from polymorphism over ordinary types, but also from polymorphism over type constructors restricted by class constraints. Our prime application area is that of monads, which form the probably most popular type constructor class of Haskell. To demonstrate the broader scope, we also deal with a transparent way of introducing difference lists into a program, endowed with a neat and general correctness proof.
Languages
"... This paper presents 3MT, a framework for developing modular mechanized metatheory of languages with effects. Using 3MT, individual language features and their corresponding definitions – semantic functions, theorem statements and proofs – can be built separately and then reused to create different ..."
Abstract
 Add to MetaCart
This paper presents 3MT, a framework for developing modular mechanized metatheory of languages with effects. Using 3MT, individual language features and their corresponding definitions – semantic functions, theorem statements and proofs – can be built separately and then reused to create different languages with fully mechanized metatheory. 3MT tackles the multifaceted problem of modularity in this setting by combining modular datatypes and monads to define effectful semantic functions on a perfeature basis, without fixing a particular set of effects or language constructs. The main challenge that 3MT addresses is how to modularize the theorems and proofs for these modular monadic definitions. Theorem statements like type soundness depend intimately on the effects used in a language, making modularity particularly challenging to achieve. 3MT overcomes this problem by splitting theorems into two parts: a reusable theorem that captures type soundness of a feature in a languageindependent way, and a languagespecific type soundness theorem. Proofs of the first only mention the effects of a specific feature, and proofs of the second need only to know that the first theorem holds for the features included in a language. To establish both theorems, 3MT uses two key reasoning techniques: modular induction and algebraic laws about effects. Several effectful language features, including references and errors, illustrate the capabilities of our framework. We reuse these features to build fully mechanized definitions and proofs for a number of languages, including a version of miniML with effects.
Contents
, 2013
"... We apply Andy Pitts’s methods of defining relations over domains to several classical results in the literature. We show that the Y combinator coincides with the domaintheoretic fixpoint operator, that parallelor and the Plotkin existential are not definable in PCF, that the continuation semantics ..."
Abstract
 Add to MetaCart
We apply Andy Pitts’s methods of defining relations over domains to several classical results in the literature. We show that the Y combinator coincides with the domaintheoretic fixpoint operator, that parallelor and the Plotkin existential are not definable in PCF, that the continuation semantics for PCF coincides with the direct semantics, and that our domaintheoretic semantics for PCF is adequate for reasoning about contextual equivalence in an operational semantics. Our version of PCF is untyped and has both strict and nonstrict function abstractions. The development is carried out in HOLCF.