Ott: effective tool support for the working semanticist

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.

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

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

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

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

[5]  Nick Benton,et al.  A Mechanized Bisimulation for the Nu-Calculus , 2008 .

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

[7]  Mark Johnson,et al.  Squibs and Discussions: Memoization in Top-Down Parsing , 1995, CL.

[8]  V. Rich Personal communication , 1989, Nature.

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

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

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

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

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

[14]  G. Chierchia,et al.  Formal Semantics , 2020 .

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

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

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

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

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

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

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

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

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

[24]  Thomas W. Reps,et al.  The synthesizer generator , 1984, SDE 1.

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

[26]  Anna Philippou,et al.  Tools and Algorithms for the Construction and Analysis of Systems , 2018, Lecture Notes in Computer Science.

[27]  Robert Hieb,et al.  Revised 5 Report on the Algorithmic Language , 1999 .

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

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

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

[31]  Richard L. Wexelblat,et al.  Proceedings of the first ACM SIGPLAN international conference on Functional programming , 1996, ICFP 1996.

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

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

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

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

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

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

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

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

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

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

[42]  Andreas Rossberg Defects in the Revised Definition of Standard ML , 2001 .

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

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

[45]  Robin Milner,et al.  Implementation and applications of Scott's logic for computable functions , 1972, Proving Assertions About Programs.

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

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

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

[49]  X. Leroy The Objective Caml system release 3.09 Documentation and user''s manual , 2005 .

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

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

[52]  Savi Maharaj,et al.  Studying the ML Module System in Hol , 1994, TPHOLs.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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