Abstract
Difference-lists are terms that represent lists. The use of difference-lists can speed up most list-processing programs considerably. Prolog programmers routinely use "difference-list versions" of programs, but very little investigation has taken place into difference-list transformation. Thus, to most programmers it is either unknown that the use of difference-lists is far from safe in all contexts, or else this fact is known but attributed to Prolog's infamous "occur check problem." In this paper we study the transformation of list-processing programs into programs that use differencelists. In particular we are concerned with finding circumstances under which the transformation is safe. We show that dataflow analysis can be used to determine whether the transformation is applicable to a given program, thereby allowing for automatic transformation. We prove that our transformation preserves strong operational equivalence.
Original language | English |
---|---|
Pages (from-to) | 125-157 |
Number of pages | 33 |
Journal | New Generation Computing |
Volume | 11 |
Issue number | 2 |
DOIs | |
Publication status | Published - 1 Jun 1993 |
Keywords
- Logic Programs
- Program Analysis
- Program Optimization