The spineless tagless G-machine
FPCA '89 Proceedings of the fourth international conference on Functional programming languages and computer architecture
A natural semantics for lazy evaluation
POPL '93 Proceedings of the 20th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
The spineless tagless G-machine, naturally
ICFP '98 Proceedings of the third ACM SIGPLAN international conference on Functional programming
Definitional Interpreters Revisited
Higher-Order and Symbolic Computation
Definitional Interpreters for Higher-Order Programming Languages
Higher-Order and Symbolic Computation
Proving the Correctness of the STG Machine
IFL '02 Selected Papers from the 13th International Workshop on Implementation of Functional Languages
Proceedings of the 3rd ACM SIGPLAN international conference on Principles and practice of declarative programming
Formally deriving an STG machine
Proceedings of the 5th ACM SIGPLAN international conference on Principles and practice of declaritive programming
Deriving a lazy abstract machine
Journal of Functional Programming
A functional correspondence between call-by-need evaluators and lazy abstract machines
Information Processing Letters
From natural semantics to c: A formal derivation of two stg machines
Journal of Functional Programming
Theoretical Computer Science
An interactive extension mechanism for reusing verified programs
Proceedings of the 28th Annual ACM Symposium on Applied Computing
An operational foundation for the tactic language of Coq
Proceedings of the 15th Symposium on Principles and Practice of Declarative Programming
A synthetic operational account of call-by-need evaluation
Proceedings of the 15th Symposium on Principles and Practice of Declarative Programming
Hi-index | 0.01 |
Shared Term Graph (STG) is a lazy functional language used as an intermediate language in the Glasgow Haskell Compiler (GHC). In this article, we present a natural operational semantics for STG and we mechanically derive a lazy abstract machine from this semantics, which turns out to coincide with Peyton-Jones and Salkild's Spineless Tagless G-machine (STG machine) used in GHC. Unlike other constructions of STG-like machines present in the literature, ours is based on a systematic and scalable derivation method (inspired by Danvy et al.'s functional correspondence between evaluators and abstract machines) and it leads to an abstract machine that differs from the original STG machine only in inessential details. In particular, it handles non-trivial update scenarios and partial applications identically as the STG machine. The entire derivation has been formalized in the Coq proof assistant. Thus, in effect, we provide a machine checkable proof of the correctness of the STG machine with respect to the natural semantics.