Operational Semantics Using the Partiality Monad

Operational Semantics Using the Partiality Monad
Nils Anders Danielsson
Proceedings of the 17th ACM SIGPLAN international conference on Functional programming (ICFP 2012). © ACM, 2012. This is the author's version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in ICFP '12, http://doi.acm.org/10.1145/2364527.2364546. [pdf, highlighted Agda code, tarball with code (also MiniAgda code)]

Abstract

The operational semantics of a partial, functional language is often given as a relation rather than as a function. The latter approach is arguably more natural: if the language is functional, why not take advantage of this when defining the semantics? One can immediately see that a functional semantics is deterministic and, in a constructive setting, computable.

This paper shows how one can use the coinductive partiality monad to define big-step or small-step operational semantics for lambda-calculi and virtual machines as total, computable functions (total definitional interpreters). To demonstrate that the resulting semantics are useful type soundness and compiler correctness results are also proved. The results have been implemented and checked using Agda, a dependently typed programming language and proof assistant.

Nils Anders Danielsson
Last updated Mon Jul 16 20:28:06 UTC 2012.