skip to main content
article

Ott: effective tool support for the working semanticist

Published: 01 October 2007 Publication History

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.
[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/.
[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.
[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.
[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.
[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.
[7]
R. J. Boulton. A tool to support formal reasoning about computer languages. In Proc. TACAS, LNCS 1217, pages 81--95, 1997.
[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.
[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.
[10]
Coq. The Coq proof assistant, v.8.0. http://coq.inria.fr/.
[11]
A. Dijkstra and S. D. Swierstra. Ruler: Programming type rules. In Proc. Functional and Logic Programming, LNCS 3945, 2006.
[12]
R. B. Findler and J. Matthews. Revised 5:92 report on the algorithmic language Scheme, Chapter 10, Formal Semantics, Jan. 2007.
[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.
[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.
[15]
HOL. The HOL 4 system, Kananaskis-3 release. http://hol.sourceforge.net/.
[16]
Isabelle. Isabelle 2005. http://isabelle.in.tum.de/.
[17]
M. Johnson. Memoization in top-down parsing. Comput. Linguist., 21(3):405--417, 1995.
[18]
S. Kahrs. Mistakes and ambiguities in the definition of Standard ML. Technical Report ECS-LFCS-93-257, University of Edinburgh, 1993.
[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.
[20]
P. Klint. A meta-environment for generating programming environments. ACM Trans. on Soft. Eng. and Methodology, 2(2):176--201, April 1993.
[21]
M. R. Lakin and A. M. Pitts. A metalanguage for structural operational semantics. In Symposium on Trends in Functional Programming, 2007.
[22]
D. K. Lee, K. Crary, and R. Harper. Towards a mechanized metatheory of Standard ML. In Proc. POPL, January 2007.
[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.
[24]
X. Leroy. A syntactic theory of type generativity and sharing. Journal of Functional Programming, 6(5):667--698, 1996.
[25]
X. Leroy et al. The Objective Caml system release 3.09 documentation and user's manual, Oct. 2005.
[26]
M. Y. Levin and B. C. Pierce. Tinkertype: A language for playing with formal systems. Journal of Functional Programming, 13(2), Mar. 2003.
[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.
[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.
[29]
R. Milner, M. Tofte, and R. Harper. The Definition of Standard ML. MIT Press, 1990.
[30]
P. D. Mosses. Pragmatics of Modular SOS. In Proc. AMAST, LNCS 2442, pages 21--40, 2002.
[31]
M. Norrish. Deterministic expressions in C. In Proc. 8th ESOP (ETAPS), LNCS 1576, pages 147--161, 1999.
[32]
C. Owens. Coding binding and substitution explicitly in Isabelle. In Proceedings of the First Isabelle Users Workshop, pages 36--52, 1995.
[33]
S. Owens and M. Flatt. From structures and functors to modules and units. In Proc. ICFP, 2006.
[34]
S. Peyton Jones, editor. Haskell 98 Language and Libraries. The Revised Report. CUP, 2003.
[35]
B. C. Pierce. Types and Programming Languages. MIT Press, 2002.
[36]
F. Pottier. An overview of Cml. In ACM Workshop on ML, ENTCS 148(2), pages 27--52, Mar. 2006.
[37]
T. Reps and T. Teitelbaum. The synthesizer generator. In Proc. SDE 1, pages 42--48, 1984.
[38]
A. Rossberg. Defects in the revised definition of Standard ML. Technical report, Saarland University, 2001. Updated 2007/01/22.
[39]
P. Sewell and F. Zappa Nardelli. Ott, 2007. http://www.cl.cam.ac.uk/users/pes20/ott/.
[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.
[41]
M. R. Shinwell, A. M. Pitts, and M. J. Gabbay. FreshML: Programming with binders made simple. In Proc. ICFP, 2003.
[42]
C. Strachey. Towards a formal semantics. In Formal Language Description Languages for Computer Programming. North Holland, 1966.
[43]
R. Strniša, P. Sewell, and M. Parkinson. The Java Module System: core design and semantic definition. In Proc. OOPSLA, 2007. To appear.
[44]
D. Syme. Reasoning with the formal definition of Standard ML in HOL. In TPHOLs, LNCS 780, pages 43--59, 1993.
[45]
D. Terrasse. Encoding Natural Semantics in Coq. In Proc. AMAST, LNCS 936, pages 230--244, 1995.
[46]
S. Tse and S. Zdancewic. Concise concrete syntax, 2006. Submitted. http://www.cis.upenn.edu/~stse/javac.
[47]
Twelf. Twelf 1.5. http://www.cs.cmu.edu/~twelf/.
[48]
V. Vafeiadis and M. Parkinson. A marriage of rely/guarantee and separation logic. In Proc. CONCUR, 2007.
[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.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

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
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: 01 October 2007
Published in SIGPLAN Volume 42, Issue 9

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)22
  • Downloads (Last 6 weeks)7
Reflects downloads up to 06 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

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