Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2103656.2103705acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Programming with binders and indexed data-types

Published: 25 January 2012 Publication History

Abstract

We show how to combine a general purpose type system for an existing language with support for programming with binders and contexts by refining the type system of ML with a restricted form of dependent types where index objects are drawn from contextual LF. This allows the user to specify formal systems within the logical framework LF and index ML types with contextual LF objects. Our language design keeps the index language generic only requiring decidability of equality of the index language providing a modular design. To illustrate the elegance and effectiveness of our language, we give programs for closure conversion and normalization by evaluation.
Our three key technical contribution are: 1) We give a bi-directional type system for our core language which is centered around refinement substitutions instead of constraint solving. As a consequence, type checking is decidable and easy to trust, although constraint solving may be undecidable. 2) We give a big-step environment based operational semantics with environments which lends itself to efficient implementation. 3) We prove our language to be type safe and have mechanized our theoretical development in the proof assistant Coq using the fresh approach to binding.

Supplementary Material

JPG File (popl_6b_2.jpg)
MP4 File (popl_6b_2.mp4)

References

[1]
Martın Abadi, Michael Burrows, Butler W. Lampson, and Gordon D. Plotkin. A calculus for access control in distributed systems. ACM Transaction on Programming Language Systems, 15 (4): 706--734, 1993.
[2]
Martin Abadi, Anindya Banerjee, Nevin Heintze, and Jon G. Riecke. A core calculus of dependency. In 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '99), pages 147--160. ACM Press, 1999.
[3]
Andreas Abel. Mixed inductive/coinductive types and strong normalization. In Zhong Shao, editor, ph5th ASIAN Symposium on Programming Languages and Systems (APLAS'07), volume 4807 of Lecture Notes in Computer Science, pages 286--301. Springer, 2007.
[4]
Andreas Abel. Polarized subtyping for sized types. Mathematical Structures in Computer Science, 18 (5): 797--822, 2008. Special issue on subtyping, edited by Healfdene Goguen and Adriana Compagnoni.
[5]
David Baelde, Zach Snow, and Dale Miller. Focused inductive theorem proving. In Jürgen Giesl and Reiner Haehnle, editors, 5th International Joint Conference on Automated Reasoning (IJCAR'10), Lecture Notes in Artificial Intelligence (LNAI 6173), pages 278--292. Springer, 2010.
[6]
Ulrich Berger and Helmut Schwichtenberg. An inverse of the evaluation functional for typed lambda-calculus. In Logic in Computer Science, pages 203--211, 1991.
[7]
Yves Bertot and Pierre Castéran. Interactive Theorem Proving and Program Development. Coq'Art: The Calculus of Inductive Constructions. Springer, 2004.
[8]
Chiyan Chen and Hongwei Xi. Combining programming with theorem proving. In Olivier Danvy and Benjamin C. Pierce, editors, ph10th International Conference on Functional Programming, pages 66--77, 2005.
[9]
Patrick Cousot and Radhia Cousot. Inductive definitions, semantics and abstract interpretations. In 19th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'92), pages 83--94. ACM, 1992.
[10]
Kevin Donnelly and Hongwei Xi. Combining higher-order abstract syntax with first-order abstract syntax in ats. In Randy Pollack, editor, Workshop on Mechanized Reasoning about Languages with Variable Binding (MERLIN'05), pages 58--63. ACM, 2005.
[11]
Joshua Dunfield and Brigitte Pientka. Case analysis of higher-order data. In International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice (LFMTP'08), volume 228 of Electronic Notes in Theoretical Computer Science (ENTCS), pages 69--84. Elsevier, June 2009.
[12]
Andrew Gacek, Dale Miller, and Gopalan Nadathur. Combining generic judgments with recursive definitions. In F. Pfenning, editor, 23rd Symposium on Logic in Computer Science. IEEE Computer Society Press, 2008.
[13]
D. Garg and F. Pfenning. Non-interference in constructive authorization logic. In Proceedings of the 19th IEEE Computer Security Foundations Workshop (CSFW 19). IEEE Computer Society Press, 2006.
[14]
Louis-Julien Guillemette and Stefan Monnier. A type-preserving closure conversion in Haskell. In Proceedings of the ACM SIGPLAN Workshop on Haskell, Haskell '07, pages 83--92, 2007.
[15]
Robert Harper and Daniel R. Licata. Mechanizing Metatheory in a Logical Framework. Journal of Functional Programming, 17 (4--5): 613--673, 2007.
[16]
Robert Harper, Furio Honsell, and Gordon Plotkin. A framework for defining logics. Journal of the ACM, 40 (1): 143--184, January 1993.
[17]
Xavier Leroy and Hervé Grall. Coinductive big-step operational semantics. Information and Computation, pages 284--304, 2009.
[18]
Daniel R. Licata. Dependently Typed Programming with Domain-Specific Logics. PhD thesis, Carnegie Mellon University, 2011.
[19]
Daniel R. Licata and Robert Harper. A universe of binding and computation. In Graham Hutton and Andrew P. Tolmach, editors, 14th ACM SIGPLAN International Conference on Functional Programming, pages 123--134. ACM Press, 2009.
[20]
Daniel R. Licata, Noam Zeilberger, and Robert Harper. Focusing on binding and computation. In F. Pfenning, editor, 23rd Symposium on Logic in Computer Science, pages 241--252. IEEE Computer Society Press, 2008.
[21]
Raymond C. McDowell and Dale A. Miller. Reasoning with higher-order abstract syntax in a logical framework. ACM Transactions on Computational Logic, 3 (1): 80--136, 2002. ISSN 1529--3785.
[22]
Yasuhiko Minamide, Greg Morrisett, and Robert Harper. Typed closure conversion. In Twenty-Third ACM Symposium on Principles of Programming Languages, pages 271--283. ACM Press, 1996.
[23]
Kenji Miyamoto and Atsushi Igarashi. A modal foundation for secure information flow. In A. Sabelfeld, editor, Workshop on Foundations of Computer Security (FCS'04), pages 187--203, 2004.
[24]
Aleksandar Nanevski, J. Gregory Morrisett, and Lars Birkedal. Hoare type theory, polymorphism and separation. Journal of Functional Programming, 18 (5--6): 865--911, 2008.
[25]
Aleksandar Nanevski, Frank Pfenning, and Brigitte Pientka. Contextual modal type theory. ACM Transactions on Computational Logic, 9 (3): 1--49, 2008.
[26]
Ulf Norell. Towards a practical programming language based on dependent type theory. PhD thesis, Department of Computer Science and Engineering, Chalmers University of Technology, September 2007. Technical Report 33D.
[27]
Christine Paulin-Mohring. Inductive definitions in the system coq - rules and properties. In Marc Bezem and Jan Friso Groote, editors, International Conference on Typed Lambda Calculi and Applications(TLCA '93), volume 664 of Lecture Notes in Computer Science, pages 328--345. Springer, 1993.
[28]
Frank Pfenning and Carsten Schürmann. System description: Twelf -- a meta-logical framework for deductive systems. In H. Ganzinger, editor, ph16th International Conference on Automated Deduction (CADE-16), volume 1632 of Lecture Notes in Artificial Intelligence, pages 202--206. Springer, 1999.
[29]
Brigitte Pientka. A type-theoretic foundation for programming with higher-order abstract syntax and first-class substitutions. In 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'08), pages 371--382. ACM Press, 2008.
[30]
Brigitte Pientka. Programming proofs: A novel approach based on contextual types. submitted, 2011.
[31]
Brigitte Pientka and Joshua Dunfield. Beluga: a framework for programming and reasoning with deductive systems (System Description). In Jürgen Giesl and Reiner Haehnle, editors, 5th International Joint Conference on Automated Reasoning (IJCAR'10), Lecture Notes in Artificial Intelligence (LNAI 6173), pages 15--21. Springer-Verlag, 2010.
[32]
ann(2009)}Poswolsky:DelphinDesc08Adam Poswolsky and Carsten Schürmann. System description: Delphin--a functional programming language for deductive systems. In International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice (LFMTP'08), volume 228 of Electronic Notes in Theoretical Computer Science (ENTCS), pages 135--141. Elsevier, 2009.
[33]
Adam B. Poswolsky and Carsten Schürmann. Practical programming with higher-order encodings and dependent types. In 17th European Symposium on Programming (ESOP '08), volume 4960, pages 93--107. Springer, 2008.
[34]
François Pottier. Static name control for FreshML. In 22nd IEEE Symposium on Logic in Computer Science (LICS'07), pages 356--365. IEEE Computer Society, July 2007.
[35]
Nicolas Pouillard and François Pottier. A fresh look at programming with names and binders. In 15th ACM SIGPLAN International Conference on Functional Programming (ICFP 2010), pages 217--228, 2010.
[36]
Susmit Sarkar. A Dependently Typed Programming Language, with applications to Foundational Certified Code Systems. PhD thesis, Carnegie Mellon University, 2009. Carnegie Mellon University-CS-09--128.
[37]
Carsten Schürmann and Frank Pfenning. A coverage checking algorithm for LF. In D. Basin and B. Wolff, editors, Proceedings of the 16th International Conference on Theorem Proving in Higher Order Logics (TPHOLs'03), pages 120--135. Springer, 2003.
[38]
Tim Sheard. Languages of the future. SIGPLAN Notices, 39 (12): 119--132, 2004.
[39]
Mark R. Shinwell, Andrew M. Pitts, and Murdoch J. Gabbay. FreshML: programming with binders made simple. In 8th International Conference on Functional Programming (ICFP'03), pages 263--274. ACM Press, 2003.
[40]
Antonis Stampoulis and Zhong Shao. VeriML: typed computation of logical terms inside a language with effects. In Paul Hudak and Stephanie Weirich, editors, 15th ACM SIGPLAN International Conference on Functional Programming (ICFP'10), pages 333--344. ACM, 2010.
[41]
Martin Sulzmann, Manuel M. T. Chakravarty, Simon Peyton Jones, and Kevin Donnelly. System f with type equality coercions. In ACM SIGPLAN International Workshop on Types in Languages Design and Implementation (TLDI'07), pages 53--66. ACM, 2007.
[42]
E. Westbrook, A. Stump, and I. Wehrman. A Language-based Approach to Functionally Correct Imperative Programming. In Olivier Danvy and Benjamin C. Pierce, editors, 10th International Conference on Functional Programming (ICFP05), pages 268--279. ACM, 2005.
[43]
Hongwei Xi. Applied type system. In phTYPES 2003, volume 3085 of Lecture Notes in Computer Science, pages 394--408. Springer, 2004.
[44]
Hongwei Xi and Frank Pfenning. Dependent types in practical programming. In 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'99), pages 214--227. ACM Press, 1999.
[45]
Hongwei Xi, Chiyan Chen, and Gang Chen. Guarded recursive datatype constructors. In 30th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '03), pages 224--235. ACM Press, 2003.
[46]
Christoph Zenger. Indexed types. Theoretical Computer Science, 187 (1--2): 147--165, 1997.

Cited By

View all
  • (2024)A Core Calculus for Documents: Or, Lambda: The Ultimate DocumentProceedings of the ACM on Programming Languages10.1145/36328658:POPL(667-694)Online publication date: 5-Jan-2024
  • (2023)Semi-Automation of Meta-Theoretic Proofs in BelugaElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.396.3396(20-35)Online publication date: 17-Nov-2023
  • (2023)Contextual Refinement TypesElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.396.2396(4-19)Online publication date: 17-Nov-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '12: Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
January 2012
602 pages
ISBN:9781450310833
DOI:10.1145/2103656
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 47, Issue 1
    POPL '12
    January 2012
    569 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2103621
    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

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 25 January 2012

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. dependent types
  2. higher-order abstract syntax
  3. logical frameworks
  4. recursive types

Qualifiers

  • Research-article

Conference

POPL '12
Sponsor:

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)22
  • Downloads (Last 6 weeks)5
Reflects downloads up to 18 Aug 2024

Other Metrics

Citations

Cited By

View all
  • (2024)A Core Calculus for Documents: Or, Lambda: The Ultimate DocumentProceedings of the ACM on Programming Languages10.1145/36328658:POPL(667-694)Online publication date: 5-Jan-2024
  • (2023)Semi-Automation of Meta-Theoretic Proofs in BelugaElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.396.3396(20-35)Online publication date: 17-Nov-2023
  • (2023)Contextual Refinement TypesElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.396.2396(4-19)Online publication date: 17-Nov-2023
  • (2023)Mechanizing Session-Types using a Structural View: Enforcing Linearity without LinearityProceedings of the ACM on Programming Languages10.1145/36228107:OOPSLA2(374-399)Online publication date: 16-Oct-2023
  • (2021)Harpoon: Mechanizing Metatheory InteractivelyAutomated Deduction – CADE 2810.1007/978-3-030-79876-5_38(636-648)Online publication date: 5-Jul-2021
  • (2020)Contextual Types, ExplainedProceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science10.1145/3373718.3394735(35-37)Online publication date: 8-Jul-2020
  • (2019)POPLMark reloaded: Mechanizing proofs by logical relationsJournal of Functional Programming10.1017/S095679681900017029Online publication date: 10-Dec-2019
  • (2018)Mechanizing proofs with logical relations – Kripke-styleMathematical Structures in Computer Science10.1017/S096012951800015428:09(1606-1638)Online publication date: 2-Aug-2018
  • (2017)Benchmarks for reasoning with syntax trees containing binders and contexts of assumptionsMathematical Structures in Computer Science10.1017/S096012951700009328:09(1507-1540)Online publication date: 5-May-2017
  • (2017)LINCX: A Linear Logical Framework with First-Class ContextsProgramming Languages and Systems10.1007/978-3-662-54434-1_20(530-555)Online publication date: 19-Mar-2017
  • 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