Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/1328438.1328482acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Focusing and higher-order abstract syntax

Published: 07 January 2008 Publication History

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.

References

[1]
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.
[2]
Jean-Marc Andreoli. Logic programming with focusing proofs in linear logic. Journal of Logic and Computation, 2(3):297--347, 1992.
[3]
Michael Brandt and Fritz Henglein. Coinductive axiomatization of recursive type equaility and subtyping. Fundamenta Informaticae, 20:1--24, 1998.
[4]
W. Buchholz, S. Feferman, W. Pohlers, and W. Sieg. Iterated Inductive Definitions and Subsystems of Analysis: Recent Proof-Theoretical Studies. Springer-Verlag, 1981.
[5]
Serenella Cerrito and Delia Kesner. Pattern matching as cut elimination. Theoretical Computer Science, 323(1--3):71--127, 2004.
[6]
The Coq Development Team. The Coq Proof Assistant Reference Manual Version 8.1. INRIA, 2006. http://coq.inria.fr/doc/main.html.
[7]
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.
[8]
Thierry Coquand and Gérard Huet. The calculus of constructions. Information and Computation, 76(2/3):95--120, 1988.
[9]
Thierry Coquand and Christine Paulin-Mohring. Inductively defined types. In LNCS 389. Springer-Verlag, 1989.
[10]
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.
[11]
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.
[12]
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.
[13]
Michael Dummett. The Logical Basis of Metaphysics. The William James Lectures, 1976. Harvard University Press, Cambridge, Massachusetts, 1991. ISBN 0-674-53785-8.
[14]
Roy Dyckhoff and Stephane Lengrand. LJQ: A strongly focused calculus for intuitionistic logic. In Proceedings of the Second Conference on Computability in Europe, 2006.
[15]
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.
[16]
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.
[17]
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.
[18]
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.
[19]
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.
[20]
Steven C. Kleene. Introduction to Metamathematics. Van Nostrand, New York, 1952.
[21]
Olivier Laurent. Etude de la polarisation en logique. Thése de doctorat, Université Aix-Marseille II, March 2002.
[22]
Olivier Laurent. Classical isomorphisms of types. Mathematical Structures in Computer Science, 15(5):969--1004, October 2005.
[23]
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.
[24]
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.
[25]
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.
[26]
Eugenio Moggi. Notions of computation and monads. Information and Compution, 93(1):55--92, 1991.
[27]
Aleksandar Nanevski, Frank Pfenning, and Brigitte Pientka. Contextual modal type theory. Transactions on Computational Logic, 2007. To appear.
[28]
Frank Pfenning and Rowan Davies. A judgmental reconstruction of modal logic. Mathematical Structures in Computer Science, 11(4):511--540, 2001.
[29]
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.
[30]
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.
[31]
John C. Reynolds. Definitional interpreters for higher-order programming languages. In ACM '72: Proceedings of the ACM annual conference, pages 717--740, 1972.
[32]
Carsten Schürmann, Joëlle Despeyroux, and Frank Pfenning. Primitive recursion for higher-order abstract syntax. Theoretical Computer Science, 266:1--57, 2001.
[33]
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.
[34]
Anne S. Troelstra and Helmut Schwichtenberg. Basic Proof Theory, volume Cambridge Tracts in Theoretical Computer Science 43. Cambridge University Press, 1996.
[35]
Twelf 2007. The Twelf Project, 2007. http://twelf.plparty.org/.
[36]
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.
[37]
Philip Wadler. A taste of linear logic. In MFCS: Symposium on Mathematical Foundations of Computer Science, 1993.
[38]
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".

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '08: Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
January 2008
448 pages
ISBN:9781595936899
DOI:10.1145/1328438
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 43, Issue 1
    POPL '08
    January 2008
    420 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1328897
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 07 January 2008

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. focusing
  2. higher-order abstract syntax
  3. pattern-matching

Qualifiers

  • Research-article

Conference

POPL08

Acceptance Rates

Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)15
  • Downloads (Last 6 weeks)2
Reflects downloads up to 13 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Extending the Quantitative Pattern-Matching ParadigmProgramming Languages and Systems10.1007/978-981-97-8943-6_5(84-105)Online publication date: 23-Oct-2024
  • (2024)Layered Modal Type TheoryProgramming Languages and Systems10.1007/978-3-031-57262-3_3(52-82)Online publication date: 6-Apr-2024
  • (2023)A Bowtie for a Beast: Overloading, Eta Expansion, and Extensible Data Types in F⋈Proceedings of the ACM on Programming Languages10.1145/35712117:POPL(515-543)Online publication date: 11-Jan-2023
  • (2020)Elaborating dependent (co)pattern matching: No pattern left behindJournal of Functional Programming10.1017/S095679681900018230Online publication date: 21-Jan-2020
  • (2018)Elaborating dependent (co)pattern matchingProceedings of the ACM on Programming Languages10.1145/32367702:ICFP(1-30)Online publication date: 30-Jul-2018
  • (2018)A Syntactic View of Computational AdequacyFoundations of Software Science and Computation Structures10.1007/978-3-319-89366-2_4(71-87)Online publication date: 14-Apr-2018
  • (2017)Copattern matching and first-class observations in OCaml, with a macroProceedings of the 19th International Symposium on Principles and Practice of Declarative Programming10.1145/3131851.3131869(97-108)Online publication date: 9-Oct-2017
  • (2016)Indexed codata typesACM SIGPLAN Notices10.1145/3022670.295192951:9(351-363)Online publication date: 4-Sep-2016
  • (2016)Indexed codata typesProceedings of the 21st ACM SIGPLAN International Conference on Functional Programming10.1145/2951913.2951929(351-363)Online publication date: 4-Sep-2016
  • (2016)Focused and Synthetic Nested SequentsFoundations of Software Science and Computation Structures10.1007/978-3-662-49630-5_23(390-407)Online publication date: 2016
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media