Ott: Effective tool support for the working semanticist

Semantic definitions of full-scale programming languages are rarely given, despite the many potential benefits. Partly this is because the available metalanguages for expressing semantics – usually either 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, and Isabelle/HOL, together with 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 (OCamllight, 310 rules), with mechanised 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.

[1]  George C. Necula,et al.  Elkhound: A Fast, Practical GLR Parser Generator , 2003, CC.

[2]  Viktor Vafeiadis,et al.  Acute: high-level programming language design for distributed computation , 2005, ICFP '05.

[3]  Savi Maharaj,et al.  Studying the ML Module System in HOL , 1995, Comput. J..

[4]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[5]  Robert J. Simmons,et al.  SASyLF: an educational proof assistant for language theory , 2008, FDPE '08.

[6]  Thomas Reps,et al.  The synthesizer generator , 1984 .

[7]  Benjamin C. Pierce,et al.  Contracts made manifest , 2010, POPL '10.

[8]  Christian Urban Nominal Techniques in Isabelle/HOL , 2008, Journal of Automated Reasoning.

[9]  William R. Cook,et al.  A machine-checked model of safe composition , 2009, FOAL '09.

[10]  Benjamin C. Pierce,et al.  TinkerType: a language for playing with formal systems , 2003, Journal of Functional Programming.

[11]  Don Syme,et al.  Reasoning with the Formal Definition of Standard ML in HOL , 1993, HUG.

[12]  Eelco Visser,et al.  Syntax definition for language prototyping , 1997 .

[13]  Andrew M. Pitts,et al.  FreshML: programming with binders made simple , 2003, ICFP '03.

[14]  François Pottier An Overview of Calphaml , 2006, Electron. Notes Theor. Comput. Sci..

[15]  Stefan Kahrs,et al.  Mistakes and Ambiguities in the definition of Standard ML , 1993 .

[16]  Yong Xiao,et al.  From Syntactic Theories to Interpreters: A Specification Language and Its Compilation , 2000, ArXiv.

[17]  Scott Owens,et al.  A Sound Semantics for OCamllight , 2008, ESOP.

[18]  Matthias Felleisen,et al.  A Visual Environment for Developing Context-Sensitive Term Rewriting Systems , 2004, RTA.

[19]  Xavier Leroy,et al.  Formal Verification of a C Compiler Front-End , 2006, FM.

[20]  Peter D. Mosses,et al.  Pragmatics of Modular SOS , 2002, AMAST.

[21]  Tobias Nipkow,et al.  A machine-checked model for a Java-like language, virtual machine, and compiler , 2006, TOPL.

[22]  Arthur Charguéraud,et al.  Engineering formal metatheory , 2008, POPL '08.

[23]  Nataliya Guts,et al.  A Formal Implementation of Value Commitment , 2008, ESOP.

[24]  Xavier Leroy,et al.  A syntactic theory of type generativity and sharing , 1996, Journal of Functional Programming.

[25]  R. Kent Dybvig,et al.  Revised6 Report on the Algorithmic Language Scheme , 2009 .

[26]  Matthew J. Parkinson,et al.  The java module system: core design and semantic definition , 2007, OOPSLA.

[27]  Andrew M. Pitts,et al.  Observable Properties of Higher Order Functions that Dynamically Create Local Names, or What's new? , 1993, MFCS.

[28]  Martin Odersky,et al.  Safe type-level abstraction in Scala , 2008 .

[29]  Viktor Vafeiadis,et al.  A Marriage of Rely/Guarantee and Separation Logic , 2007, CONCUR.

[30]  Robin Milner,et al.  Definition of standard ML , 1990 .

[31]  Delphine Terrasse,et al.  Encoding Natural Semantics in Coq , 1995, AMAST.

[32]  Carl A. Gunter,et al.  The machine-assisted proof of programming language properties , 1996 .

[33]  Viktor Vafeiadis,et al.  Acute: High-level programming language design for distributed computation , 2007, J. Funct. Program..

[34]  Patrick Borras,et al.  Centaur: the system , 1988, Software Development Environments.

[35]  Stephanie Weirich,et al.  LNgen: Tool Support for Locally Nameless Representations , 2010 .

[36]  Matthew Flatt,et al.  From structures and functors to modules and units , 2006, ICFP '06.

[37]  Jean-Jacques Lévy,et al.  A Calculus of Mobile Agents , 1996, CONCUR.

[38]  Christian Urban,et al.  A Head-to-Head Comparison of de Bruijn Indices and Names , 2007, Electron. Notes Theor. Comput. Sci..

[39]  Giorgio Ghelli,et al.  Subtyping + Extensionality: Confluence of beta-eta-top reduction in F<= , 1991, TACS.

[40]  David Aspinall,et al.  Proof General: A Generic Tool for Proof Development , 2000, TACAS.

[41]  Steve Zdancewic,et al.  Concise Concrete Syntax , 2008 .

[42]  Robin Milner Implementation and applications of Scott's logic for computable functions , 1972 .

[43]  Karl Crary,et al.  Towards a mechanized metatheory of standard ML , 2007, POPL '07.

[44]  Limin Jia,et al.  Dependent types and program equivalence , 2010, POPL '10.

[45]  Kathryn E. Gray Safe Cross-Language Inheritance , 2008, ECOOP.

[46]  Peter Lee,et al.  The ergo support system: an integrated set of tools for prototyping integrated environments , 1988, SDE 3.

[47]  R. Kent Dybvig,et al.  Revised5 Report on the Algorithmic Language Scheme , 1986, SIGP.

[48]  Andrew M. Pitts,et al.  A Metalanguage for Structural Operational Semantics , 2007, Trends in Functional Programming.

[49]  Paul Klint,et al.  A meta-environment for generating programming environments , 1989, TSEM.

[50]  Tom Ridge,et al.  Ott: effective tool support for the working semanticist , 2007, ICFP '07.

[51]  Christopher Owens,et al.  Coding Binding and Substitution Explicitly in Isabelle , 2003 .

[52]  Xavier Leroy,et al.  Mechanized Semantics for the Clight Subset of the C Language , 2009, Journal of Automated Reasoning.

[53]  Michael Norrish,et al.  Deterministic Expressions in C , 1999, ESOP.

[54]  J. Rekers,et al.  Parser Generation for Interactive Environments , 1992 .

[55]  Luca Cardelli,et al.  An Extension of System F with Subtyping , 1994, Inf. Comput..

[56]  Amr Sabry,et al.  From Syntactic Theories to Interpreters: Automating the Proof of Unique Decomposition , 2001, High. Order Symb. Comput..

[57]  Christian Urban,et al.  alpha-Prolog: A Logic Programming Language with Names, Binding and a-Equivalence , 2004, ICLP.

[58]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[59]  S. Doaitse Swierstra,et al.  Ruler: Programming Type Rules , 2006, FLOPS.

[60]  Richard J. Boulton,et al.  A Tool to Support Formal Reasoning about Computer Languages , 1997, TACAS.

[61]  Sibylle Schupp,et al.  A Semantic Definition of Separate Type Checking in C++ with Concepts , 2009, J. Object Technol..

[62]  Benjamin C. Pierce,et al.  Mechanized Metatheory for the Masses: The PoplMark Challenge , 2005, TPHOLs.