skip to main content
research-article

Programming with binders and indexed data-types

Published:25 January 2012Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle ScholarCross RefCross Ref
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle ScholarCross RefCross Ref
  7. Yves Bertot and Pierre Castéran. Interactive Theorem Proving and Program Development. Coq'Art: The Calculus of Inductive Constructions. Springer, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Robert Harper and Daniel R. Licata. Mechanizing Metatheory in a Logical Framework. Journal of Functional Programming, 17 (4--5): 613--673, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Robert Harper, Furio Honsell, and Gordon Plotkin. A framework for defining logics. Journal of the ACM, 40 (1): 143--184, January 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Xavier Leroy and Hervé Grall. Coinductive big-step operational semantics. Information and Computation, pages 284--304, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Daniel R. Licata. Dependently Typed Programming with Domain-Specific Logics. PhD thesis, Carnegie Mellon University, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Aleksandar Nanevski, Frank Pfenning, and Brigitte Pientka. Contextual modal type theory. ACM Transactions on Computational Logic, 9 (3): 1--49, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Brigitte Pientka. Programming proofs: A novel approach based on contextual types. submitted, 2011.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle ScholarCross RefCross Ref
  38. Tim Sheard. Languages of the future. SIGPLAN Notices, 39 (12): 119--132, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Hongwei Xi. Applied type system. In phTYPES 2003, volume 3085 of Lecture Notes in Computer Science, pages 394--408. Springer, 2004.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Christoph Zenger. Indexed types. Theoretical Computer Science, 187 (1--2): 147--165, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Programming with binders and indexed data-types

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      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
      • 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

      Copyright © 2012 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 25 January 2012

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!