The WAM ‒ definition and compiler correctness. (English)
Beierle, Christoph (ed.) et al., Logic programming: formal methods and practical applications. Amsterdam: Elsevier. Stud. Comput. Sci. Artif. Intell. 11, 21-90 (1995).
Summary: This paper provides a mathematical analysis of the Warren Abstract Machine for executing Prolog and a correctness proof for a general compilation scheme of Prolog for the WAM. Starting from an abstract Prolog model which is close to the programmer’s intuition, we derive the WAM methodically by stepwise refinement of Prolog models, proving correctness and completeness for each refinement step. Along the way we explicitly formulate, as proof assumptions, a set of natural conditions for a compiler to be correct, thus making our proof applicable to a whole class of compilers. The proof method provides a rigorous mathematical framework for the study of Prolog compilation techniques. It can be applied in a natural way to extensions and variants of Prolog and related WAMs allowing for parallelism, constraint handling, types, functional components ‒ in some cases it has in fact been successfully extended. Our exposition assumes only a general understanding of Prolog. We reach full mathematical rigour, without heavy methodological overhead, by using Gurevich’s notion of evolving algebras.