skip to main content
article

Ott: effective tool support for the working semanticist

Published:01 October 2007Publication History
Skip Abstract Section

Abstract

It is rare to give a semantic definition of a full-scale programming language, despite the many potential benefits. Partly this is because the available metalanguages for expressing semantics - usually either L<scp>a</scp>TEX for informal mathematics, or the formal mathematics of a proof assistant - make it much harder than necessary to work with large definitions.

We present a metalanguage specifically designed for this problem, and a tool, ott, that sanity-checks such definitions and compiles them into proof assistant code for Coq, HOL, Isabelle, and (in progress) Twelf, together with L<scp>a</scp>TEX code for production-quality typesetting, and OCaml boilerplate. The main innovations are:(1) metalanguage design to make definitions concise, and easy to read and edit;(2) an expressive but intuitive metalanguage for specifying binding structures; and (3) compilation to proof assistant code.

This has been tested in substantial case studies, including modular specifications of calculi from the TAPL text, a Lightweight Java with Java JSR 277/294 module system proposals, and a large fragment of OCaml (around 306 rules), with machine proofs of various soundness results. Our aim with this work is to enable a phase change: making it feasible to work routinely, without heroic effort, with rigorous semantic definitions of realistic languages.

References

  1. AFP. The archive of formal proofs. http://afp.sf.net.Google ScholarGoogle Scholar
  2. B. Aydemir, A. Charguéraud, B. C. Pierce, R. Pollack, and S. Weirich. Engineering formal metatheory, 2007. http://www.chargueraud.org/arthur/research/2007/binders/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. B. E. Aydemir, A. Bohannon, M. Fairbairn, J. N. Foster, B. C. Pierce, P. Sewell, D. Vytiniotis, G. Washburn, S. Weirich, and S. Zdancewic. Mechanized metatheory for the masses: The POPLmark Challenge. In Proc. TPHOLs, LNCS 3603, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Berghofer and C. Urban. A head-to-head comparison of de Bruijn indices and names. In Proc. Int. Workshop on Logical Frameworks and Meta-Languages: Theory and Practice, pages 46--59, 2006.Google ScholarGoogle Scholar
  5. S. Blazy, Z. Dargaye, and X. Leroy. Formal verification of a C compiler front-end. In Int. Symp. on Formal Methods, LNCS 2085, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. P. Borras, D. Clement, T. Despeyroux, J. Incerpi, G. Kahn, B. Lang, and V. Pascual. Centaur: the system. In Proc. SDE 3, pages 14--24, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. J. Boulton. A tool to support formal reasoning about computer languages. In Proc. TACAS, LNCS 1217, pages 81--95, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. Charguéraud. Annotated bibliography for formalization of lambda-calculus and type theory. http://fling-l.seas.upenn.edu/~plclub/cgi-bin/poplmark/index.php?title=Annotated_Bibliography, July 2006.Google ScholarGoogle Scholar
  9. J. Cheney and C. Urban. Alpha-Prolog: A logic programming language with names, binding and alpha-equivalence. In Proc. ICLP, LNCS 3132, pages 269--283, 2004.Google ScholarGoogle Scholar
  10. Coq. The Coq proof assistant, v.8.0. http://coq.inria.fr/.Google ScholarGoogle Scholar
  11. A. Dijkstra and S. D. Swierstra. Ruler: Programming type rules. In Proc. Functional and Logic Programming, LNCS 3945, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. B. Findler and J. Matthews. Revised 5:92 report on the algorithmic language Scheme, Chapter 10, Formal Semantics, Jan. 2007.Google ScholarGoogle Scholar
  13. C. Fournet, G. Gonthier, J.-J. Lévy, L. Maranget, and D. Rémy. A calculus of mobile agents. In Proc. CONCUR '96, LNCS 1119, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. E. Gunter and S. Maharaj. Studying the ML module system in HOL. The Computer Journal: Special Issue on Theorem Proving in Higher Order Logics, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. HOL. The HOL 4 system, Kananaskis-3 release. http://hol.sourceforge.net/.Google ScholarGoogle Scholar
  16. Isabelle. Isabelle 2005. http://isabelle.in.tum.de/.Google ScholarGoogle Scholar
  17. M. Johnson. Memoization in top-down parsing. Comput. Linguist., 21(3):405--417, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. S. Kahrs. Mistakes and ambiguities in the definition of Standard ML. Technical Report ECS-LFCS-93-257, University of Edinburgh, 1993.Google ScholarGoogle Scholar
  19. G. Klein and T. Nipkow. A machine-checked model for a Java-like language, virtual machine, and compiler. TOPLAS, 28(4):619--695, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Klint. A meta-environment for generating programming environments. ACM Trans. on Soft. Eng. and Methodology, 2(2):176--201, April 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. R. Lakin and A. M. Pitts. A metalanguage for structural operational semantics. In Symposium on Trends in Functional Programming, 2007.Google ScholarGoogle Scholar
  22. D. K. Lee, K. Crary, and R. Harper. Towards a mechanized metatheory of Standard ML. In Proc. POPL, January 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. P. Lee, F. Pfenning, G. Rollins, and W. Scherlis. The Ergo Support System: An integrated set of tools for prototyping integrated environments. In Proc. SDE 3, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. X. Leroy. A syntactic theory of type generativity and sharing. Journal of Functional Programming, 6(5):667--698, 1996.Google ScholarGoogle ScholarCross RefCross Ref
  25. X. Leroy et al. The Objective Caml system release 3.09 documentation and user's manual, Oct. 2005.Google ScholarGoogle Scholar
  26. M. Y. Levin and B. C. Pierce. Tinkertype: A language for playing with formal systems. Journal of Functional Programming, 13(2), Mar. 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J. Matthews, R. B. Findler, M. Flatt, and M. Felleisen. A visual environment for developing context-sensitive term rewriting systems. In Proc. RTA, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  28. R. Milner. Implementation and applications of Scott's logic for computable functions. In Proc. ACM conference on Proving assertions about programs, pages 1--6, 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. R. Milner, M. Tofte, and R. Harper. The Definition of Standard ML. MIT Press, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. P. D. Mosses. Pragmatics of Modular SOS. In Proc. AMAST, LNCS 2442, pages 21--40, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. M. Norrish. Deterministic expressions in C. In Proc. 8th ESOP (ETAPS), LNCS 1576, pages 147--161, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. C. Owens. Coding binding and substitution explicitly in Isabelle. In Proceedings of the First Isabelle Users Workshop, pages 36--52, 1995.Google ScholarGoogle Scholar
  33. S. Owens and M. Flatt. From structures and functors to modules and units. In Proc. ICFP, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. S. Peyton Jones, editor. Haskell 98 Language and Libraries. The Revised Report. CUP, 2003.Google ScholarGoogle Scholar
  35. B. C. Pierce. Types and Programming Languages. MIT Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. F. Pottier. An overview of Cml. In ACM Workshop on ML, ENTCS 148(2), pages 27--52, Mar. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. T. Reps and T. Teitelbaum. The synthesizer generator. In Proc. SDE 1, pages 42--48, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. A. Rossberg. Defects in the revised definition of Standard ML. Technical report, Saarland University, 2001. Updated 2007/01/22.Google ScholarGoogle Scholar
  39. P. Sewell and F. Zappa Nardelli. Ott, 2007. http://www.cl.cam.ac.uk/users/pes20/ott/.Google ScholarGoogle Scholar
  40. P. Sewell, J. J. Leifer, K. Wansbrough, M. Allen-Williams, F. Zappa Nardelli, P. Habouzit, and V. Vafeiadis. Acute: High-level programming language design for distributed computation. design rationale and language definition. Technical Report UCAM-CL-TR-605, University of Cambridge Computer Laboratory, Oct. 2004. See also the ICFP'05 paper.Google ScholarGoogle Scholar
  41. M. R. Shinwell, A. M. Pitts, and M. J. Gabbay. FreshML: Programming with binders made simple. In Proc. ICFP, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. C. Strachey. Towards a formal semantics. In Formal Language Description Languages for Computer Programming. North Holland, 1966.Google ScholarGoogle Scholar
  43. R. Strniša, P. Sewell, and M. Parkinson. The Java Module System: core design and semantic definition. In Proc. OOPSLA, 2007. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. D. Syme. Reasoning with the formal definition of Standard ML in HOL. In TPHOLs, LNCS 780, pages 43--59, 1993. Google ScholarGoogle Scholar
  45. D. Terrasse. Encoding Natural Semantics in Coq. In Proc. AMAST, LNCS 936, pages 230--244, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. S. Tse and S. Zdancewic. Concise concrete syntax, 2006. Submitted. http://www.cis.upenn.edu/~stse/javac.Google ScholarGoogle Scholar
  47. Twelf. Twelf 1.5. http://www.cs.cmu.edu/~twelf/.Google ScholarGoogle Scholar
  48. V. Vafeiadis and M. Parkinson. A marriage of rely/guarantee and separation logic. In Proc. CONCUR, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. M. VanInwegen. The Machine-Assisted Proof of Programming Language Properties. PhD thesis, Univ. of Pennsylvania, 1996. Computer and Information Science Tech Report MS-CIS-96-31. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Ott: effective tool support for the working semanticist

      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 9
        Proceedings of the ICFP '07 conference
        September 2007
        331 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1291220
        Issue’s Table of Contents
        • cover image ACM Conferences
          ICFP '07: Proceedings of the 12th ACM SIGPLAN international conference on Functional programming
          October 2007
          346 pages
          ISBN:9781595938152
          DOI:10.1145/1291151

        Copyright © 2007 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 October 2007

        Check for updates

        Qualifiers

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