skip to main content
article

Towards a mechanized metatheory of standard ML

Published:17 January 2007Publication History
Skip Abstract Section

Abstract

We present an internal language with equivalent expressive power to Standard ML, and discuss its formalization in LF and the machine-checked verification of its type safety in Twelf. The internal language is intended to serve as the target of elaboration in an elaborative semantics for Standard ML in the style of Harper and Stone. Therefore, it includes all the programming mechanisms necessary to implement Standard ML, including translucent modules, abstraction, polymorphism, higher kinds, references, exceptions, recursive types, and recursive functions. Our successful formalization of the proof involved a careful interplay between the precise formulations of the various mechanisms, and required the invention of new representation and proof techniques of general interest.

References

  1. H. P. Barendregt. The Lambda Calculus: Its Syntax and Semantics. Elsevier, 1984.Google ScholarGoogle Scholar
  2. Karl Crary and Susmit Sarkar. Foundational certified code in a metalogical framework. In Nineteenth International Conference on Automated Deduction, Miami, Florida, 2003. Extended version published as CMU technical report CMU-CS-03-108.Google ScholarGoogle ScholarCross RefCross Ref
  3. Luis Damas and Robin Milner. Principal type-schemes for functional programs. In Ninth ACM Symposium on Principles of Programming Languages, pages 207--212, Albuquerque, New Mexico, January 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Joëlle Despeyroux, Amy Felty, and Andr'e Hirschowitz. Higher-order syntax in Coq. In 1995 International Conference on Typed Lambda Calculi and Applications, volume 905 of Lecture Notes in Computer Science, Edinburgh, April 1995. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Derek Dreyer. Understanding and Evolving the ML Module System. PhD thesis, Carnegie Mellon University, School of Computer Science, Pittsburgh, Pennsylvania, May 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Derek Dreyer, Karl Crary, and Robert Harper. A type system for higher-order modules. In Thirtieth ACM Symposium on Principles of Programming Languages, pages 236--249, New Orleans, Louisiana, January 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Derek Dreyer, Robert Harper, Manuel M.T. Chakravarty, and Gabriele Keller. Modular type classes. Technical Report TR-2006-03, University of Chicago, April 2006.Google ScholarGoogle Scholar
  8. Sophia Drossopoulou and Susan Eisenbach. Towards an operational semantics and proof of type soundness for Java. In Formal Syntax and Semantics of Java. Springer-Verlag, March 1998.Google ScholarGoogle Scholar
  9. Sophia Drossopoulou, Tanya Valkevych, and Susan Eisenbach. Java type soundness revisited, September 2000 Technical report, Imperial College London.Google ScholarGoogle Scholar
  10. Michael J. C. Gordon and Tom F. Melham. Introduction to HOL: A Theorem Proving Environment for Higher-Order Logic. Cambridge University Press, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Robert Harper. A simplified account of polymorphic references. Information Processing Letters, 51(4):201--206, 1994. Follow-up note in Information Processing Letters, 57(1), 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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
  13. Robert Harper and Daniel R. Licata. Mechanizing language definitions. Submitted for publication, April 2006.Google ScholarGoogle Scholar
  14. Robert Harper and Mark Lillibridge. A type-theoretic approach to higher-order modules with sharing. In Twenty-First ACM Symposium on Principles of Programming Languages, pages 123--137, Portland, Oregon, January 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Robert Harper, John C. Mitchell, and Eugenio Moggi. Higher-order modules and the phase distinction. In Seventeenth ACM Symposium on Principles of Programming Languages, pages 341--354, San Francisco, January 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Robert Harper and Chris Stone. A type-theoretic interpretation of Standard ML. In Proof, Language and Interaction: Essays in Honour of Robin Milner. The MIT Press, 2000. Extended version published as CMU technical report CMU-CS-97-147. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Gerwin Klein and Tobias Nipkow. A machine-checked model for a Java-like language, virtual machine and compiler. Technical Report 0400001T.1, National ICT Australia, Sydney, March 2004.Google ScholarGoogle Scholar
  18. Daniel K. Lee, Karl Crary, and Robert Harper. Mechanizing the metatheory of Standard ML. Technical Report CMU-CS-06-138, Carnegie Mellon University, School of Computer Science, 2006.Google ScholarGoogle Scholar
  19. Xavier Leroy. Manifest types, modules and separate compilation. In Twenty-First ACM Symposium on Principles of Programming Languages, pages 109--122, Portland, Oregon, January 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Xavier Leroy. Applicative functors and fully transparent higher-order modules. In Twenty-Second ACM Symposium on Principles of Programming Languages, San Francisco, January 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Robin Milner, Mads Tofte, Robert Harper, and David MacQueen. The Definition of Standard ML (Revised). The MIT Press, Cambridge, Massachusetts, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Greg Morrisett, Matthias Felleisen, and Robert Harper. Abstract models of memory management. In Conference on Functional Programming Languages and Computer Architecture, pages 66--77, La Jolla, California, June 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Lawrence C. Paulson. The foundation of a generic theorem prover. Journal of Automated Reasoning, 5:363--397, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Leaf Petersen. Certfying Compilation for Standard ML in a Type Analysis Framework. PhD thesis, Carnegie Mellon University, School of Computer Science, Pittsburgh, Pennsylvania, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Leaf Petersen, Perry Cheng, Robert Harper, and Chris Stone. Implementing the TILT internal language. Technical Report CMU-CS-00-180, Carnegie Mellon University, School of Computer Science, December 2000.Google ScholarGoogle Scholar
  26. Frank Pfenning. Computation and deduction. Lecture notes, available electronically at http://www.cs.cmu.edu/char"7Etwelf.Google ScholarGoogle Scholar
  27. Frank Pfenning and Carsten Schürmann. Twelf User's Guide, Version 1.4, 2002. Available electronically at http://www.cs.cmu.edu/char"7Etwelf.Google ScholarGoogle Scholar
  28. Brigitte Pientka and Frank Pfenning. Termination and reduction checking in the logical framework. In Workshop of Automation of Proofs by Mathematical Induction, June 2000.Google ScholarGoogle Scholar
  29. Benjamin Pierce and Martin Steffen. Higher-order subtyping. Theoretical Computer Science, 176(1--2):235--282, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Benjamin C. Pierce. Types and Programming Languages, chapter 13. The MIT Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Gordon D. Plotkin. A structural approach to operational semantics. Technical Report DAIMI FN-19, University of Aarhus, 1981.Google ScholarGoogle Scholar
  32. John C. Reynolds. The essence of Algol. In J. W. de Bakker and J. C. van Vliet, editors, Proceedings of the International Symposium on Algorithmic Languages, pages 345--372, Amsterdam, October 1981. North-Holland.Google ScholarGoogle Scholar
  33. Jeffrey Sarnat and Carsten Schürmann. A proof-theoretic account of logical relations. Submitted for publication, 2006.Google ScholarGoogle Scholar
  34. Christopher A. Stone. Singleton Kinds and Singleton Types. PhD thesis, Carnegie Mellon University, School of Computer Science, Pittsburgh, Pennsylvania, August 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Christopher A. Stone and Robert Harper. Extensional equivalence and singleton types. ACM Transactions on Computational Logic, 2006? To appear. An earlier version appeared in the 2000 Symposium on Principles of Programming Languages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Donald Syme. Reasoning with the formal definition of Standard ML in HOL. In Sixth International Workshop on Higher Order Logic Theorem Proving and its Applications, pages 43--60, Vancouver, August 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. D. Tarditi, G. Morrisett, P. Cheng, C. Stone, R. Harper, and P. Lee. TIL: A type-directed optimizing compiler for ML. In 1996 SIGPLAN Conference on Programming Language Design and Implementation, pages 181--192, May 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Myra VanInwegen. The Machine-Assisted Proof of Programming Language Properties. PhD thesis, University of Pennsylvania, Philadelphia, Pennsylvania, May 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Myra VanInwegen and Elsa Gunter. Hol-ml. In Sixth International Workshop on Higher Order Logic Theorem Proving and its Applications, pages 61--74, Vancouver, August 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Kevin Watkins, Iliano Cervesato, Frank Pfenning, and David Walker. A concurrent logical framework: The propositional fragment. In S. Berardi, M. Coppo, and F. Damiani, editors, Types for Proofs and Programs, volume 3085 of Lecture Notes in Computer Science, pages 355--377. Springer-Verlag, 2004. Papers from the Third International Workshop on Types for Proofs and Programs, April 2003, Torino, Italy.Google ScholarGoogle Scholar

Index Terms

  1. Towards a mechanized metatheory of standard ML

          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 42, Issue 1
            Proceedings of the 2007 POPL Conference
            January 2007
            379 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1190215
            Issue’s Table of Contents
            • cover image ACM Conferences
              POPL '07: Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
              January 2007
              400 pages
              ISBN:1595935754
              DOI:10.1145/1190216

            Copyright © 2007 ACM

            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]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 17 January 2007

            Check for updates

            Qualifiers

            • article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader