Abstract
The semantics of an imperative programming language can be expressed as a program in a declarative constraint language. Not only does this render the semantics executable, but it opens up the possibility of applying to imperative languages the advances made in program analysis and transformation of declarative languages. We propose a method for carrying out partial evaluation of imperative programs, using partial evaluation in a declarative language, but returning the results in the syntax of the imperative program which is to be partially evaluated. The approach uses a special form of the semantics and program points to aid partial evaluation in the reconstruction of a specialised imperative program from a partially evaluated semantics program. Constraints provide a means through which information is propagated inside both branches of a conditional, the body of a loop, and along chains of def-use chains in the program. The method provides a framework for constructing a partial evaluator for any imperative programming language, by writing down its semantics as a declarative program (a constraint logic program, in the approach shown here).
Translated title of the contribution | Imperative Program Specialisation: An Approach Using CLP |
---|---|
Original language | English |
Title of host publication | Logic-Based Program Synthesis and Transformation (LOPSTR'99), (ed. A. Bossi) |
Publisher | Springer Berlin Heidelberg |
Pages | 103 - 118 |
Number of pages | 15 |
ISBN (Print) | 3540676287 |
Publication status | Published - 2000 |
Bibliographical note
Other page information: 103-118Conference Proceedings/Title of Journal: Logic-Based Program Synthesis and Transformation (LOPSTR'99), (ed. A. Bossi)
Other identifier: 1000449