Difference-List Transformation for Prolog. Marriott, K. & Søndergaard, H. New Generation Computing, 11(2):125–157, 1993.
doi  abstract   bibtex   
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 difference-lists. 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.
@Article{Mar-Son_NGC93,
  author    = {Kim Marriott and 
		Harald S{\o}ndergaard},
  title	    = {Difference-List Transformation for {Prolog}},
  journal   = {New Generation Computing},
  volume    = {11},
  number    = {2},
  pages     = {125--157}, 
  year	    = {1993},
  doi       = {10.1007/BF03037156},
  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 difference-lists. 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.},
  keywords  = {Program transformation, Static analysis, Logic programming, Prolog},
}

Downloads: 0