Abstract
Introductory courses in Theory of Computation usually include a study of abstract machines such as finite state machines and Turing machines. This paper demonstrates that a neat and useful way of presenting these automata is to use a logic programming language such as Prolog, making the approach useful from a teaching point of view. Not only does a Prolog specification provide a precise definition of an automoton's behaviour, but it also gives an immediately-executable simulator. The reversible execution property of Prolog programs can make these simulators inherently more powerful than traditional simulators. The paper includes Prolog specifications for finite state machines, Turing machines, linear bounded automata, and pushdown automata.
Index Terms
- Using Prolog to present abstract machines
Recommendations
Towards description and optimization of abstract machines in an extension of prolog
LOPSTR'06: Proceedings of the 16th international conference on Logic-based program synthesis and transformationCompetitive abstract machines for Prolog are usually large, intricate, and incorporate sophisticated optimizations. This makes them difficult to code, optimize, and, especially, maintain and extend. This is partly due to the fact that efficiency ...
Refunctionalization of abstract abstract machines: bridging the gap between abstract abstract machines and abstract definitional interpreters (functional pearl)
Abstracting abstract machines is a systematic methodology for constructing sound static analyses for higher-order languages, by deriving small-step abstract abstract machines (AAMs) that perform abstract interpretation from abstract machines that ...
Certified abstract machines for skeletal semantics
CPP 2022: Proceedings of the 11th ACM SIGPLAN International Conference on Certified Programs and ProofsSkeletal semantics is a framework to describe semantics of programming languages. We propose an automatic generation of a certified OCaml interpreter for any language written in skeletal semantics. To this end, we introduce two new interpretations, i.e.,...
Comments