Options
2009
Conference Paper
Titel
A guide for manual construction of difference-list procedures
Abstract
The difference-list technique is an effective method for extending lists to the right without using the append/3 procedure. There exist some proposals for automatic transformation of list programs into difference-list programs. However, we are interested in a construction of difference-list programs by the programmer, avoiding the need of a transformation. In [9] it was demonstrated, how left-recursive procedures with a dangling call of append/3 can be transformed into right-recursion using the unfolding technique. For some types of right-recursive procedures, the equivalence of the accumulator technique and difference-list technique was shown and rules for writing corresponding difference-list programs were given. In the present paper, improved and simplified rules are derived which substitute the formerly given ones. We can show that these rule allow us to write difference-list programs which supply result-lists that are either constructed in top-down -manner (element s in append order) or in bottom-up manner (elements in inverse order) in a simple schematic way.