|
AuthorMarkus RoggenbachDepartment of Computer Science University of Bremen P.O. Box 330440 D-28334 Bremen roba@informatik.uni-bremen.de http://www.informatik.uni-bremen.de/~roba
Purpose and content of the specificationAt LFM 2000 I presented a CASL tutorial, where the specification of an interpreter for the following simple programming language was the running example:
Program ::= skip | Statement @ Program Statement ::= Assignment | Conditional | Loop Assignment ::= Variable := Expression Conditional ::= IF Condition THEN Program ELSE Program FI Loop ::= WHILE Condition DO Program OD ... The tutorial includes a stepwise development of the specification submitted to this repository. The slides of my tutorial are available at http://www.informatik.uni-bremen.de/~roba/tutorial.ps. Specifying an interpreter for an imperative programming language was also an exercise for students in a course on Algebraic Specification at the University of Bremen. The students liked this exercise and gave good solutions to it.
Tool SupportThe specification has been fully parsed and checked with CATS 0.4.1.With HOL-CASL it is possible to execute simple programs on the specified interpreter, for example the goal forall n: Nat . eval(a, execute ( (a:=conv(15)) @ (b:=conv(9)) @ WHILE NOT (a==b) DO IF a < b THEN (b:=(b-a)) @ skip ELSE (a:=(a-b)) @ skip FI @ skip OD @ skip, [] )) = nis simplified to 3 = ni.e. the ggt of a and b is computed. The simplifier sets for such computations in HOL-CASL are available on request.
Possible Improvements
Specification |