Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
Global optimization of logic programs (analysis, transformation, compilation)
Publisher:
  • State University of New York at Stony Brook
  • Stony Brook, NY
  • United States
Order Number:AAI8707050
Pages:
246
Reflects downloads up to 15 Oct 2024Bibliometrics
Skip Abstract Section
Abstract

Logic programming languages have several very attractive features, such as separation of program logic from control, declarative reading of programs, and ease of understanding and maintenance. Despite this, however, the pragmatic problem of efficiency has hampered the widespread acceptance of such languages as general-purpose programming languages, and has led to the proliferation of "impure" language features whose use compromises precisely those properties of these languages that made them attractive in the first place.In this dissertation, we take the view that rather than leave the burden of writing efficient programs to the programmer, and force him to deal with impure language features, it is preferable to have the system perform such optimizations for him. It is argued that the model theory of first order logic, traditionally used to specify the semantics of logic programs, is too weak to allow us to reason about the computational behaviour of programs. A classical denotational semantics is developed for Prolog, and notions of strong and weak program equivalence are defined. A general framework for dataflow analysis of logic programs, based on this semantics, is developed. Several analysis problems considered in the literature, such as mode inference, data dependency analysis, type inference, functor propagation, and dead and unreachable code detection, are shown to be instances of this framework. The property of functionality, related to but more general than that of determinacy, is discussed, and an algorithm given for its inference. Several optimizing transformations of logic programs based on these analyses are discussed. Finally, some experimental results are given, showing the effects of such transformations on the performance of programs. These results support our view that it is possible, in general, to take "pure" logic programs and have an intelligent compiler generate code that is quite efficient, thereby achieving efficiency without having to sacrifice the advantages of purity.

Contributors
  • The University of Arizona

Recommendations