Towards Banishing the Cut from Prolog

  • Authors:
  • Saumya K. Debray;David S. Warren

  • Affiliations:
  • Univ. of Arizona, Tucson;Univ. of New York at Stony Brook, Stony Brook

  • Venue:
  • IEEE Transactions on Software Engineering
  • Year:
  • 1990

Quantified Score

Hi-index 0.00

Visualization

Abstract

Logic programs can often be inefficient. The usual solution to this problem has been to return some control to the user in the form of impure language features like cut. The authors argue that it is not necessary to resort to such impure features for efficiency. This point is illustrated by considering how most of the common uses of cut can be eliminated from Prolog source programs, relying on static analysis to generate them at compile time. Three common situations where the cut is used are considered. Static analysis techniques are given to detect such situations, and applicable program transformations are described. Two language constructs, firstof and oneof, for situations involving don't-care nondeterminism, are suggested. These constructs have better declarative readings than the cut and extend better to parallel evaluation strategies. Together, these proposals result in a system where users need rely much less on cuts for efficiency, thereby promoting a purer programming style without sacrificing efficiency.