Use this URL to cite or link to this record in EThOS:
Title: An algebraic approach to syntax, semantics and compilation
Author: Stephenson, K.
Awarding Body: University College of Swansea
Current Institution: Swansea University
Date of Award: 1996
Availability of Full Text:
Access from EThOS:
In this thesis, we develop an algebraic strategy and tools for modelling the syntax and semantics of programming languages and for proving the correctness of the process of compiling one language into another. Our first step in algebraically specifying language syntax is to apply a variation of an established technique of transforming a context-free grammar into a closed term algebra. Next, we design equational definitions of additional functions that act as a filter for the context-sensitive features of a language. To reduce the work involved in devising such specifications, we provide parameterised descriptions of commonly occurring language features. We illustrate the practicability of these modular methods by considering the algebraic specification of a range of programming languages and constructions. We then develop a modular algebraic method for defining operational semantics. The key to this is the employment of a notion of time by means of a simple clock, to enumerate the sequences of states produced by executing a program. We determine this behaviour by generating a sequence of atomic programs, such that the execution of each atomic program provides the next state in the execution sequence. We use functions that decompose the syntax one step at a time to determine which atomic program we should execute at each moment in time to simulate the behaviour of the entire program. We illustrate our technique with a wide-ranging set of examples. Finally, we describe how we can structure the compilation process using hierarchies of algebras, and how we can use equational methods to prove compiler correctness. The basis of our proof is in establishing correctness over just one step of time. We illustrate our technique with a case study of translating a high-level while language into instructions for a low-level register machine.
Supervisor: Not available Sponsor: Not available
Qualification Name: Thesis (Ph.D.) Qualification Level: Doctoral
EThOS ID:  DOI: Not available