Reasoning about Programs using Operational Semantics and the Role of a Proof Support Tool (2011)
The full text of this thesis is available from the Newcastle University Library website: https://theses.ncl.ac.uk/dspace/handle/10443/1307
Hughes, J.R.D., School of Computing Science, University of Newcastle upon Tyne
A computer program is a text in a de ned programming language; each such program can be thought of as de ning state transitions | that is, the execution of a program in an initial state will result in a (or possibly one of a set of) nal state(s). A program speci cation de nes properties that relate initial and nal states. For example, a speci cation might state that some property will hold in the nal state after the program has been executed, as long as it was executed in an initial state where some other property held. De ning the semantics of a programming language xes the behaviour of the language and gives meaning to programs that are written in the language. One straightforward way of giving the semantics of a programming language is using operational semantics, which describes a language in terms of the e ect execution has on the state: a program still de nes state transitions, but for an abstract state. This thesis investigates the possibility of using the operational semantic description of a programming language to reason about programs that are written in that language. Programs are shown to be correct with respect to a speci cation, which consists of a precondition and a postcondition. Natural deduction proofs about a program are written to show that if it is executed in a state that satis es the precondition, then execution will result in a state that relates to the initial state such that the postcondition is true of the two states. The rules of an operational semantic description are used in the proof to show the steps a program will take to reach a nal state, and the e ect execution has on the state. This is contrasted with the use of axiomatic semantics, observing that using operational semantics allows us to handle a wider class of language features. The acceptability of this approach will almost certainly depend on appropriate tool support. A prototype proof support tool is therefore developed as a `proof of concept', to assist a user in creating these kinds of proof. The tool manages inference rules and semantic descriptions, and the layout of the proof, but does not automate the proof process.