Denotational semantics of a command interpreter and their implementation in standard ML

C. McDonald[1] and L. Allison[2]
The Computer Journal, Volume 32, Issue 5, pp.422-431, doi:10.1093/comjnl/32.5.422, December 1989

[1] Department of Computer Science, The University of Western Australia, Nedlands, Western Australia, 6009
[2] Department of Computer Science, Monash University, Clayton, Victoria, Australia, 3168

Several working groups have been established to study and standardize popular command interpreters. However, as with the standardization of many programming languages, the syntaxes of command interpreters have been rigorously defined in notation such as Backus-Naur Form (BNF) but the semantic definitions remain ambiguously defined in natural languages such as English. This paper defines a significant subset of the standard UNIX command interpreter, or shell, in terms of its denotational semantics. A complete implementation of this shell in Standard ML is described. This implementation enables direct execution of the denotational semantics and encourages experimentation with the semantic definition.