Purity of an ST monad: full abstraction by semantically typed back-translation


Koen Jacobs, Dominique Devriese, and Amin Timany: Purity of an ST monad: full abstraction by semantically typed back-translation. In OOPSLA 2022, December 2022. https://doi.org/10.1145/3527326
Journal Paper
Abstract.

In 1995, Launchbury and Peyton Jones extended Haskell with an ST monad that allows the programmer to use higher-order mutable state. They informally argued that these state computations were safely encapsulated, and as such, that the rich reasoning principles stemming from the purity of the language, were not threatened. In this paper, we give a formal account of the preservation of purity after adding an ST monad to a simply-typed call-by-value recursive lambda calculus. We state and prove full abstraction when embedding the pure language into its extension with ST; contextual equivalences from the pure language continue to hold in the presence of ST.

Proving full abstraction of compilers is usually done by emulating or back-translating the target features (here: ST computations) into the source language, a well-known challenge in the secure compilation community. We employ a novel proof technique for proving our full abstraction result that allows us to use a semantically (but not syntactically) typed back-translation into an intermediate language. We believe that this technique provides additional insight into our proof and that it is of general interest to researchers studying programming languages and compilers using full abstraction. The results presented here are fully formalized in the Coq proof assistant using the Iris framework.

The bibtex source for this publication:
@article{DBLP:journals/pacmpl/JacobsDT22,
 author = {Koen Jacobs and
 Dominique Devriese and
 Amin Timany},
 title = {Purity of an {ST} monad: full abstraction by semantically typed back-translation},
 journal = {Proc. {ACM} Program. Lang.},
 volume = {6},
 number = {{OOPSLA1}},
 pages = {1--27},
 year = {2022},
 url = {https://doi.org/10.1145/3527326},
 doi = {10.1145/3527326},
 timestamp = {Tue, 10 Jan 2023 16:19:50 +0100},
 biburl = {https://dblp.org/rec/journals/pacmpl/JacobsDT22.bib},
 bibsource = {dblp computer science bibliography, https://dblp.org}
 }