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







Comments