An Intrinsically-Typed Solution for the List-Machine Benchmark

Formal models are important tools in the programming language research community. However, such models are full of intricacies and, due to that, they are subject to subtle errors. Such failures motivated the usage of tools to ensure the correctness of these formalisms. One way to eliminate such errors is to encode models in a dependently-typed language in order to ensure its "correctness-by-construction". In this paper, we use this idea to build a verified interpreter for the list-machine benchmark in the Agda programming language, comparing the results with formalizations developed by Appel and Leroy. We formalize the 14 tasks of the benchmark using roughly 14%of LOC compared to a Twelf solution, and 47%of LOC compared to a Coq solution, even without the use of proof automation.

[1]  Ulf Norell,et al.  Dependently typed programming in Agda , 2009, TLDI '09.

[2]  Aaron Stump Verified Functional Programming in Agda , 2016 .

[3]  Philip Wadler,et al.  System F in Agda, for Fun and Profit , 2019, MPC.

[4]  Adam Chlipala,et al.  Certified Programming with Dependent Types - A Pragmatic Introduction to the Coq Proof Assistant , 2013 .

[5]  Geoff Sutcliffe The TPTP Problem Library and Associated Infrastructure , 2009, Journal of Automated Reasoning.

[6]  Amy P. Felty,et al.  Benchmarks for reasoning with syntax trees containing binders and contexts of assumptions , 2018, Math. Struct. Comput. Sci..

[7]  Chung-Kil Hur,et al.  Strongly Typed Term Representations in Coq , 2011, Journal of Automated Reasoning.

[8]  John C. Reynolds,et al.  Definitional Interpreters for Higher-Order Programming Languages , 1972, ACM '72.

[9]  Brigitte Pientka POPLMark reloaded: mechanizing logical relations proofs (invited talk) , 2018, CPP.

[10]  Karl Crary,et al.  Type Structure for Low-Level Programming Languages , 1999, ICALP.

[11]  Robbert Krebbers,et al.  Intrinsically-typed definitional interpreters for imperative languages , 2018, Proc. ACM Program. Lang..

[12]  Ramana Kumar,et al.  Functional Big-Step Semantics , 2016, ESOP.

[13]  de Ng Dick Bruijn,et al.  Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem , 1972 .

[14]  Manish Mahajan,et al.  Proof carrying code , 2015 .

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

[16]  Nada Amin,et al.  Type soundness proofs with definitional interpreters , 2017, POPL.

[17]  Peter Thiemann Intrinsically-Typed Mechanized Semantics for Session Types , 2019, PPDP.

[18]  Robbert Krebbers,et al.  Intrinsically-typed definitional interpreters for linear, session-typed languages , 2020, CPP.

[19]  Andrew W. Appel,et al.  A List-machine Benchmark for Mechanized Metatheory ( Extended Abstract ) , 2006 .