Abstract interpretations and abstract machines : contributions to a methodology for the implementation of logic programs

University dissertation from Linköping : Linköping University Electronic Press

Abstract: Because of the conceptual gap between high-level logic programming languages and existing hardware, the problem of compilation is hard. This thesis addresses two ways of narrowing this gap – program analysis through abstract interpretation and the introduction of intermediate languages and abstract machines.By means of abstract interpretations it is possible to infer program properties which are not explicitly represented in the program – properties that can be used by a compiler to generate specialized code. We describe a framework for constructing and computing abstract interpretations of logic programs with equality. The core of the framework is an abstract interpretation called the base interpretation which provides a model of the run-time behaviour of the program. The model characterized by the base interpretation consists of the set of all reachable computation states of a transition system specifying an operational semantics reminiscent of SLD-resolution. This model is in general not effectively computable. However, the base interpretation can be used for constructing new abstract interpretations which approximate this model. Our base interpretation combines both a simple and concise formulation. with the ability of inferring a wide range of program properties. The framework supports a variety of computation strategies including, in particular, efficient computing of approximate models using a chaotic iteration strategy.We also show that abstract interpretations may form a basis for implementation of deductive data bases. We relate the magic templates approach to bottom-up evaluation of deductive databases with the base interpretation of C. Mellish and prove that they not only specify isomorphic models but also that the computations which lead up to those models are isomorphic. This implies that methods (for instance, evaluation and transformation techniques) which are applicable in one of the fields are also applicable in the other. As a side-effect we are also able to relate so-called "top-down" and "bottom-up" abstract interpretations.Abstract machines and intermediate languages are often used to bridge the conceptual gap between language and hardware. Unfortunately – because of the way they are presented – it is often difficult to see the relationship between the high-level and intermediate language. In the final part of the thesis we propose a methodology for designing abstract machines for logic programming languages in such a way that much of the relationship is preserved throughout the process. Using partial deduction and other transformation techniques, a source program and an interpreter are "compiled" into a new program consisting of "machine code" for the source program and an abstract machine for the machine code. Based upon the appearance of the abstract machine the user may choose to modify the interpreter and repeat the process until the abstract machine reaches a suitable level of abstraction. We demonstrate how these techniques can be applied to derive several of the control instructions of Warren's Abstract Machine, thus complementing previous work by P. Kursawe who reconstructed several of the unification instructions using similar techniques.

  This dissertation MIGHT be available in PDF-format. Check this page to see if it is available for download.