Elsevier

The Journal of Logic Programming

Volume 29, Issues 1–3, October–December 1996, Pages 171-194
The Journal of Logic Programming

Regular paper
Detection and optimization of suspension-free logic programs

https://doi.org/10.1016/S0743-1066(96)00052-0Get rights and content
Under an Elsevier user license
open archive

Abstract

In recent years, language mechanisms to suspend, or delay, the execution of goals until certain variables become bound have become increasingly popular in logic programming languages. While convenient, such mechanisms can make control flow within a program difficult to predict at compile time, and therefore render many traditional compiler optimizations inapplicable. Unfortunately, this performance cost is also incurred by programs that do not use any delay primitives. In this paper, we describe a simple dataflow analysis for detecting computations where suspension effects can be ignored, and discuss several low-level optimizations that rely on this information. Our algorithm has been implemented in the jc system. Optimizations based on information it produces result in significant performance improvements, demonstrating speed comparable to or exceeding that of optimized C programs.

Cited by (0)

A preliminary version of this paper appeared in Proc. 1994 International Symposium on Logic Programming. This work was supported in part by the National Science Foundation under Grant CCR-9123520.