A lightweight tool is proposed to aid in the development of operational semantics. To use LETOS an operational semantics must be expressed in its meta-language, which itself is a superset of Miranda. The LETOS compiler is smaller than comparable tools, yet LETOS is powerful enough to support publication quality rendering using L AT E X, fast enough to provide competitive execution using Haskell, and versatile enough to support browsing of execution traces using Netscape. LETOS can be characterised as an experiment in 'creative laziness', showing how far one can get by gluing existing components together. The major specifications built using LETOS to-date are a smart card version of the Java Virtual Machine, a deterministic version of the π-calculus, and an electronic payment protocol. In addition, we have specified the semantics of many small programming languages and systems, totaling over 9000 lines of formal text. LETOS is unique in that it helps to check that a specification is operationally conservative.
P. H. HARTELimplement her semantics. The RML system [6] covers middle ground in that RML offers only one facility: the compilation of operational semantics specifications into C. Concentrating on one aspect pays off; the RML system executes an operational semantics faster than its competitors.The three approaches above represent as many points in a spectrum of possibilities. The sophisticated tools provide comprehensive facilities, but not without imposing limitations. The ASF+SDF system, for example, is not polymorphic, and it is also first order. This makes it awkward to work with denotational semantics [7]. The complexity of a system such as ASF+SDF makes it less than straightforward to experiment with, say, a higher order version of the system. The Typol subsystem [8] of Centaur is slow [6]. Recent work on the Minotaur [9] version of Typol has shown that imposing restrictions on the full generality of the Typol inference rules makes speed improvements of a factor of about 10-15 possible. This still leaves the performance of Typol wanting. The RML system does well on one aspect: speed of execution. However, the lack of rendering and execution tracing facilities does not make for a user-friendly system [6].The systems referred to above have one factor in common: they are not small. For example, in 1988 the Centaur system was reported to consist of 32,000 lines of code [10] and in 1996 the RML compiler and runtime system together comprised 15,000 lines of code [11].The approach advocated in this paper is to build a lightweight tool that offers the most important facilities at a minimal cost. This implies a small size of the meta-language compiler and minimal runtime support, a quick edit-compile-run cycle and a short learning period. The low cost is achieved by making maximum use of existing components, and by judiciously selecting essential features. The proposed LETOS program is small (2000 lines of lex, yacc and C). It takes as input a superset of Miranda. LETOS is capable of producing a proper declarati...