Abstract
Focusing is a proof-search strategy, originating in linear logic, that elegantly eliminates inessential nondeterminism, with one byproduct being a correspondence between focusing proofs and programs with explicit evaluation order. Higher-order abstract syntax (HOAS) is a technique for representing higher-order programming language constructs (e.g., λ's) by higher-order terms at the"meta-level", thereby avoiding some of the bureaucratic headaches of first-order representations (e.g., capture-avoiding substitution).
This paper begins with a fresh, judgmental analysis of focusing for intuitionistic logic (with a full suite of propositional connectives), recasting the "derived rules" of focusing as iterated inductive definitions. This leads to a uniform presentation, allowing concise, modular proofs of the identity and cut principles. Then we show how this formulation of focusing induces, through the Curry-Howard isomorphism, a new kind of higher-order encoding of abstract syntax: functions are encoded by maps from patterns to expressions. Dually, values are encoded as patterns together with explicit substitutions. This gives us pattern-matching "for free", and lets us reason about a rich type system with minimal syntactic overhead. We describe how to translate the language and proof of type safety almost directly into Coq using HOAS, and finally, show how the system's modular design pays off in enabling a very simple extension with recursion and recursive types.
- M. Abadi, L. Cardelli, P.-L. Curien, and J.-J. Lévy. Explicit substitutions. Journal of Functional Programming, 1(4):375--416, 1991. Jean-Marc Andreoli. Focussing and proof construction. Annals of Pure and Applied Logic, 107(1):131--163, 2001.Google Scholar
Cross Ref
- Jean-Marc Andreoli. Logic programming with focusing proofs in linear logic. Journal of Logic and Computation, 2(3):297--347, 1992.Google Scholar
Cross Ref
- Michael Brandt and Fritz Henglein. Coinductive axiomatization of recursive type equaility and subtyping. Fundamenta Informaticae, 20:1--24, 1998. Google Scholar
Digital Library
- W. Buchholz, S. Feferman, W. Pohlers, and W. Sieg. Iterated Inductive Definitions and Subsystems of Analysis: Recent Proof-Theoretical Studies. Springer-Verlag, 1981.Google Scholar
Cross Ref
- Serenella Cerrito and Delia Kesner. Pattern matching as cut elimination. Theoretical Computer Science, 323(1--3):71--127, 2004. Google Scholar
Digital Library
- The Coq Development Team. The Coq Proof Assistant Reference Manual Version 8.1. INRIA, 2006. http://coq.inria.fr/doc/main.html.Google Scholar
- Thierry Coquand. Pattern matching with dependent types. In Proceedings of the Workshop on Types for Proofs and Programs, pages 71--83, Båstad, Sweden, 1992.Google Scholar
- Thierry Coquand and Gérard Huet. The calculus of constructions. Information and Computation, 76(2/3):95--120, 1988. Google Scholar
Digital Library
- Thierry Coquand and Christine Paulin-Mohring. Inductively defined types. In LNCS 389. Springer-Verlag, 1989.Google Scholar
- Pierre-Louis Curien and Hugo Herbelin. The duality of computation. In ICFP '00: Proceedings of the SIGPLAN International Conference on Functional Programming, pages 233--243. 2000. Google Scholar
Digital Library
- Nicolaas G. de Bruijn. A lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the church-rosser theorem. Indagationes Mathematicae, 34:381--392, 1972.Google Scholar
Cross Ref
- Joëlle Despeyroux, Amy Felty, and André Hirschowitz. Higher-order abstract syntax in Coq. In M. Dezani-Ciancaglini and G. Plotkin, editors, Proceedings of the International Conference on Typed Lambda Calculi and Applications, volume 902 of LNCS, pages 124--138, Edinburgh, Scotland, 1995. Springer-Verlag. Google Scholar
Digital Library
- Michael Dummett. The Logical Basis of Metaphysics. The William James Lectures, 1976. Harvard University Press, Cambridge, Massachusetts, 1991. ISBN 0-674-53785-8.Google Scholar
- Roy Dyckhoff and Stephane Lengrand. LJQ: A strongly focused calculus for intuitionistic logic. In Proceedings of the Second Conference on Computability in Europe, 2006. Google Scholar
Digital Library
- Cormac Flanagan, Amr Sabry, Bruce Duba, and Matthias Felleisen. The essence of compiling with continuations. In PLDI '93: Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation, 1993. Google Scholar
Digital Library
- Gerhard Gentzen. Untersuchungen über das logische Schließen. Mathematische Zeitschrift, 39:176--210, 405--431, 1935. English translation in M. E. Szabo, editor, The Collected Papers of Gerhard Gentzen, pages 68--131, North-Holland, 1969.Google Scholar
Cross Ref
- Jean-Yves Girard. Locus solum: From the rules of logic to the logic of rules. Mathematical Structures in Computer Science, 11(3):301--506, 2001. Jean-Yves Girard. On the unity of logic. Annals of pure and applied logic, 59(3):201--217, 1993. Google Scholar
Digital Library
- Hugo Herbelin. A lambda-calculus structure isomorphic to Gentzen-style sequent calculus structure. In CSL '94: Proceedings of the 8th International Workshop on Computer Science Logic, 1995. Google Scholar
Digital Library
- Jacob M. Howe. Proof search issues in some non-classical logics. PhD thesis, University of St Andrews, December 1998. URL http://www.cs.kent.ac.uk/pubs/1998/946. Available as University of St Andrews Research Report CS/99/1.Google Scholar
- Steven C. Kleene. Introduction to Metamathematics. Van Nostrand, New York, 1952.Google Scholar
- Olivier Laurent. Etude de la polarisation en logique. Thése de doctorat, Université Aix-Marseille II, March 2002.Google Scholar
- Olivier Laurent. Classical isomorphisms of types. Mathematical Structures in Computer Science, 15(5):969--1004, October 2005. Google Scholar
Digital Library
- Per Martin-Löf. Hauptsatz for the intuitionistic theory of iterated inductive definitions. In J. E. Fenstad, editor, Proceedings of the Second Scandinavian Logic Symposium, pages 179--216, Amsterdam, 1971. North Holland.Google Scholar
Cross Ref
- Per Martin-Löf. On the meanings of the logical constants and the justifications of the logical laws. Nordic Journal of Philosophical Logic, 1(1):11--60, 1996. URL http://www.hf.uio.no/filosofi/njpl/vol1no1/meaning/meaning.html.Google Scholar
- Dale Miller and Chuck Liang. Focusing and polarization in intuitionistic logic. In CSL '07: Proceedings of the 21st International Workshop on Computer Science Logic. 2007. Google Scholar
Digital Library
- Eugenio Moggi. Notions of computation and monads. Information and Compution, 93(1):55--92, 1991. Google Scholar
Digital Library
- Aleksandar Nanevski, Frank Pfenning, and Brigitte Pientka. Contextual modal type theory. Transactions on Computational Logic, 2007. To appear. Google Scholar
Digital Library
- Frank Pfenning and Rowan Davies. A judgmental reconstruction of modal logic. Mathematical Structures in Computer Science, 11(4):511--540, 2001. Google Scholar
Digital Library
- Frank Pfenning and Conal Elliott. Higher-order abstract syntax. In PLDI '88: Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation, pages 199--208, 1988. Google Scholar
Digital Library
- Brigitte Pientka. A type-theoretic foundation for programming with higher-order abstract syntax and first-class substitutions. In POPL '08: Proceedings of the SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 2008. Google Scholar
Digital Library
- John C. Reynolds. Definitional interpreters for higher-order programming languages. In ACM '72: Proceedings of the ACM annual conference, pages 717--740, 1972. Google Scholar
Digital Library
- Carsten Schürmann, Joëlle Despeyroux, and Frank Pfenning. Primitive recursion for higher-order abstract syntax. Theoretical Computer Science, 266:1--57, 2001. Google Scholar
Digital Library
- Peter Selinger. Control categories and duality: on the categorical semantics of the lambda-mu calculus. Mathematical Structures in Computer Science, 11(2):207--260, 2001. Google Scholar
Digital Library
- Anne S. Troelstra and Helmut Schwichtenberg. Basic Proof Theory, volume Cambridge Tracts in Theoretical Computer Science 43. Cambridge University Press, 1996. Google Scholar
Digital Library
- Twelf 2007. The Twelf Project, 2007. http://twelf.plparty.org/.Google Scholar
- Philip Wadler. Call-by-value is dual to call-by-name. In ICFP '03: Proceedings of the SIGPLAN International Conference on Functional Programming, pages 189--201, 2003. Google Scholar
Digital Library
- Philip Wadler. A taste of linear logic. In MFCS: Symposium on Mathematical Foundations of Computer Science, 1993. Google Scholar
Digital Library
- Noam Zeilberger. On the unity of duality. Annals of Pure and Applied Logic, 2007. To appear in a special issue on "Classical Logic and Computation".Google Scholar
Index Terms
Focusing and higher-order abstract syntax
Recommendations
Focusing and higher-order abstract syntax
POPL '08: Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesFocusing is a proof-search strategy, originating in linear logic, that elegantly eliminates inessential nondeterminism, with one byproduct being a correspondence between focusing proofs and programs with explicit evaluation order. Higher-order abstract ...
Higher-order abstract syntax in classical higher-order logic
LFMTP '09: Proceedings of the Fourth International Workshop on Logical Frameworks and Meta-Languages: Theory and PracticeHigher-Order Abstract Syntax, or HOAS, is a technique for using a higher-order logic as a metalanguage for an object language with binding operators. It avoids formalizing syntactic details related to variable binding. This paper gives an extension to ...
Reasoning with higher-order abstract syntax in a logical framework
Logical frameworks based on intuitionistic or linear logics with higher-type quantification have been successfully used to give high-level, modular, and formal specifications of many important judgments in the area of programming languages and inference ...







Comments