Skip to main content
U.S. Department of Energy
Office of Scientific and Technical Information

Global optimization of logic programs

Thesis/Dissertation ·
OSTI ID:5233010
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 proliferation of impure language features whose use compromises precisely those properties of these languages that made them attractive in the first place. This dissertation takes 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 reason about the computational behavior of programs. A classical denotational semantics is developed for Prolog, and notions of strong and weak program equivalence are defined. A general framework for data-flow 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.
Research Organization:
State Univ. of New York, Stony Brook (USA)
OSTI ID:
5233010
Country of Publication:
United States
Language:
English