Article ID Journal Published Year Pages File Type
433448 Science of Computer Programming 2012 13 Pages PDF
Abstract

Low-level imperative programming languages typically have complex operational semantics (e.g. derived from an underlying processor architecture). In this paper, we describe an automatic method for extracting recursive functions from such low-level programs. The functions are derived by formal deduction from the semantics of the programming language. For each function extracted, a proof of correspondence to the original program is automatically constructed. Subsequent program verification can then be done without referring to the details of the low-level programming language semantics at all: it suffices to prove properties of the extracted function. The technique is explained for simple while programs and also for the machine code of a widely used processor. We show how heuristics can enhance the output from the function extractor/decompiler and how the technique aids implementation of a trustworthy compiler. Our tools have been implemented in the HOL4 theorem prover.

Research highlights► We explain an automatic method for extracting recursive functions from machine code. ► Properties proved about the extracted functions are also true of the original code. ► Our method has been used to implement a trustworthy compiler and Lisp interpreter. ► This paper combines and extends material from several earlier conference papers.

Related Topics
Physical Sciences and Engineering Computer Science Computational Theory and Mathematics
Authors
, ,