On the unity of duality

Abstract 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 call-by-name and call-by-value 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 proof-theoretic 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 “meaning-theories”, which include a bias towards either introduction or elimination rules. We revisit Dummett’s analysis using the tools of Martin-Lof’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 Curry–Howard 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 pattern-matching, explicit substitutions, values and call-by-value 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 operationally sensitive typing phenomena.

[1]  Andrew K. Wright Simple imperative polymorphism , 1995, LISP Symb. Comput..

[2]  Philip Wadler,et al.  Call-by-Value Is Dual to Call-by-Name - Reloaded , 2005, RTA.

[3]  M. Nivat Fiftieth volume of theoretical computer science , 1988 .

[4]  S. Shelah,et al.  Annals of Pure and Applied Logic , 1991 .

[5]  J. Fenstad Proceedings of the Second Scandinavian Logic Symposium , 1971 .

[6]  A Computational Interpretation of Classical S 4 Modal Logic , 2005 .

[7]  Patrick Lincoln,et al.  Linear logic , 1992, SIGA.

[8]  Mariangiola Dezani-Ciancaglini,et al.  A filter lambda model and the completeness of type assignment , 1983, Journal of Symbolic Logic.

[9]  Andrzej Filinski On the relations between monadic semantics , 2007, Theor. Comput. Sci..

[10]  Mariangiola Dezani-Ciancaglini,et al.  Intersection and Union Types: Syntax and Semantics , 1995, Inf. Comput..

[11]  David Nelson,et al.  Constructible falsity , 1949, Journal of Symbolic Logic.

[12]  Michel Parigot,et al.  Lambda-Mu-Calculus: An Algorithmic Interpretation of Classical Natural Deduction , 1992, LPAR.

[13]  Jan von Plato,et al.  Natural deduction with general elimination rules , 2001, Arch. Math. Log..

[14]  Dag Prawitz Formulation des bétons autoplaçants : Optimisation du squelette granulaire par la méthode graphique de Dreux - Gorisse , 1974 .

[15]  Vincent Danos,et al.  A new deconstructive logic: linear logic , 1997, Journal of Symbolic Logic.

[16]  Michele Bugliesi,et al.  Automata, Languages and Programming: 33rd International Colloquium, ICALP 2006, Venice, Italy, July 10-14, 2006, Proceedings, Part II (Lecture Notes in Computer Science) , 2006 .

[17]  Jean-Marc Andreoli Focussing and proof construction , 2001, Ann. Pure Appl. Log..

[18]  Jean-Yves Girard,et al.  A new constructive logic: classic logic , 1991, Mathematical Structures in Computer Science.

[19]  Gianluigi Bellin,et al.  Towards a Logic for Pragmatics. Assertions and Conjectures , 2004, J. Log. Comput..

[20]  Robin Milner,et al.  Definition of standard ML , 1990 .

[21]  Frank Pfenning,et al.  A judgmental reconstruction of modal logic , 2001, Mathematical Structures in Computer Science.

[22]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[23]  Jean-Yves Girard,et al.  On the Unity of Logic , 1993, Ann. Pure Appl. Log..

[24]  David B. MacQueen,et al.  The Definition of Standard ML (Revised) , 1997 .

[25]  A. Heyting Mathematische Grundlagenforschung : Intuitionismus, Beweistheorie , 1935 .

[26]  Jean-Yves Girard Locus Solum: From the Rules of Logic to the Logic of Rules , 2001, CSL.

[27]  Michael Dummett,et al.  The logical basis of metaphysics , 1991 .

[28]  P. Martin-Löf Hauptsatz for the Intuitionistic Theory of Iterated Inductive Definitions , 1971 .

[29]  Andrzej Filinski Declarative Continuations and Categorical Duality , 1989 .

[30]  Johannes Czermak,et al.  A remark on Gentzen's calculus of sequents , 1977, Notre Dame J. Formal Log..

[31]  W. Buchholz Iterated Inductive Definitions and Subsystems of Analysis: Recent Proof-theoretical Studies , 1981 .

[32]  P. Martin-Löf On the meanings of the logical constants and the justi cations of the logical laws , 1996 .

[33]  Paul Blain Levy Jumbo λ-calculus , 2006 .

[34]  Roy Dyckhoff,et al.  LJQ: A Strongly Focused Calculus for Intuitionistic Logic , 2006, CiE.

[35]  S. C. Kleene,et al.  Introduction to Metamathematics , 1952 .

[36]  Frank Pfenning,et al.  Tridirectional typechecking , 2004, POPL.

[37]  Thomas Streicher,et al.  Classical logic, continuation semantics and abstract machines , 1998, Journal of Functional Programming.

[38]  Paul Blain Levy,et al.  Call-by-push-value , 2022, ACM SIGLOG News.

[39]  A. Kolmogoroff Zur Deutung der intuitionistischen Logik , 1932 .

[40]  Olivier Laurent,et al.  Étude de la polarisation en logique , 2001 .

[41]  D. Walker,et al.  A concurrent logical framework I: Judgments and properties , 2003 .

[42]  Hugo Herbelin,et al.  The duality of computation , 2000, ICFP '00.

[43]  Olivier Laurent Classical isomorphisms of types , 2005, Math. Struct. Comput. Sci..

[44]  G. Gentzen Untersuchungen über das logische Schließen. I , 1935 .

[45]  John C. Reynolds,et al.  Definitional Interpreters for Higher-Order Programming Languages , 1972, ACM '72.

[46]  Frank Pfenning,et al.  Refinement types for ML , 1991, PLDI '91.

[47]  P. Martin-Lof,et al.  ON THE MEANINGS OF THE LOGICAL CONSTANTS AND THE JUSTIFICATIONS OF THE LOGICAL LAWS(Logic and the Foundations of Mathematics) , 1986 .

[48]  Nicolas D. Goodman,et al.  The Logic of Contradiction , 1981, Math. Log. Q..

[49]  Samson Abramsky,et al.  Computational Interpretations of Linear Logic , 1993, Theor. Comput. Sci..

[50]  Timothy G. Griffin,et al.  A formulae-as-type notion of control , 1989, POPL '90.

[51]  Lev Gordeev,et al.  Basic proof theory , 1998 .

[52]  Frank Pfenning,et al.  Intersection types and computational effects , 2000, ICFP '00.

[53]  Thierry Coquand,et al.  Pattern Matching with Dependent Types , 1992 .

[54]  Dag Prawitz,et al.  On the idea of a general proof theory , 1974, Synthese.

[55]  JEAN-MARC ANDREOLI,et al.  Logic Programming with Focusing Proofs in Linear Logic , 1992, J. Log. Comput..

[56]  Peter Selinger,et al.  Control categories and duality: on the categorical semantics of the lambda-mu calculus , 2001, Mathematical Structures in Computer Science.