Premium
Operational machine specification in a functional programming language
Author(s) -
Koopman P. W. M.,
Eekelen M. C. J. D. Van,
Plasmeijer M. J.
Publication year - 1995
Publication title -
software: practice and experience
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.437
H-Index - 70
eISSN - 1097-024X
pISSN - 0038-0644
DOI - 10.1002/spe.4380250502
Subject(s) - computer science , programming language , specification language , programming language specification , functional programming , formal specification , executable , correctness , compiler , denotational semantics , abstract machine , formal methods , operational semantics , functional specification , semantics (computer science) , programming paradigm , software development , programming domain , inductive programming , software , software construction
This paper advocates the use functional programming languages for the formal specification of (abstract) machines. The presented description method describes machines by a two‐level model. At the bottom layer machine components and the micro instructions to handle them are described by using an abstract data type. The top layer describes the machine instructions in terms of these micro instructions. Using a functional language as specification language has several advantages. The abstraction mechanisms offered by a functional programming language are that good that one can abstract from irrelevant details as is required for a specification language. Functional languages have a well‐defined semantics such that the meaning of the specification is clear as well. Moreover, they offer the advantages of a programming language: the compiler can check the specification for partial correctness, eliminating for example type errors and unbound identifiers (errors which occur in many published descriptions). Furthermore, the specification can be executed such that one obtains a prototype implementation almost for free. Such an executable formal specification can, for instance, be used to investigate the dynamic behaviour of the described machine. For a simple machine, the proposed description method is compared with several other description methods: a traditional style, a denotational semantics and a formal specification in the language Z. To show that the proposed method is indeed useful to describe large and complicated machines, the method is applied for the specification of an abstract imperative graph rewrite machine (the ABC‐machine) which has been used in the construction of the compiler for the functional language Concurrent Clean.