Skip to main content

A Guide for Manual Construction of Difference-List Procedures

  • Conference paper
Applications of Declarative Programming and Knowledge Management (INAP 2007, WLP 2007)

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 (elements in append order) or in bottom-up manner (elements in inverse order) in a simple schematic way.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Albert, E., Ferri, C., Steiner, F., Vidal, G.: Improving functional logic programs by difference-lists. In: He, J., Sato, M. (eds.) ASIAN 2000. LNCS, vol. 1961, pp. 237–254. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  2. Colhoe, H., Cotta, J.C.: Prolog by Example. Springer, Heidelberg (1988)

    Book  Google Scholar 

  3. Clocksin, W.F.: Clause and Effect. Prolog Programming for the Working Programmer. Springer, Heidelberg (1997)

    Book  MATH  Google Scholar 

  4. Clocksin, W.F.: Prolog Programming. Lecture Prolog for Artificial Intelligence 2001-02 at University of Cambridge, Computer Laboratory (2002)

    Google Scholar 

  5. Clocksin, W.F., Mellish, C.S.: Programming in Prolog. Springer, Heidelberg (1981, 1984, 1987)

    MATH  Google Scholar 

  6. Clark, K.L., McCabe, F.G.: Micro-Prolog: Programming in Logic. Prentice Hall International, Englewood Cliffs (1984)

    Google Scholar 

  7. Clark, K.L., Tärnlund, S.Å.: A First Order Theory of Data and Programs. In: Gilchrist, B. (ed.) Information Processing, pp. 939–944. North Holland, Amsterdam (1977)

    Google Scholar 

  8. Dodd, T.: Prolog. A Logical Approach. Oxford University Press, Oxford (1990)

    MATH  Google Scholar 

  9. Geske, U.: How to teach difference-lists. Tutorial. In: Online Proceedings – WLP 2006 (2006) (last visited, September 06, 2007), http://www.kr.tuwien.ac.at/wlp06/T02-final.ps.gz

  10. Marriott, K., Søndergaard, H.: Prolog Transformation by Introduction of Difference-Lists. TR 88/14. Dept. CS, The University of Melbourne (1988)

    Google Scholar 

  11. Marriott, K., Søndergaard, H.: Prolog Difference-list transformation for Prolog. New Generation Computing 11, 125–157 (1993)

    Article  MATH  Google Scholar 

  12. Maier, D., Warren, D.S.: Computing with Logic. The Benjamin/Cummings Publisher Company, Inc. (1988)

    Google Scholar 

  13. O’Keefe, R.A.: The Craft of Prolog. The MIT Press, Cambridge (1990)

    Google Scholar 

  14. Sterling, L., Shapiro, E.: The Art of Prolog. MIT Press, Cambridge (1986); seventh printing (1991)

    MATH  Google Scholar 

  15. Zhang, J., Grant, P.W.: An automatic difference-list transformation algorithm for Prolog. In: Kodratoff, Y. (ed.) Proc. 1988 European Conf. Artificial Intelligence, pp. 320–325. Pittman (1988)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Geske, U., Goltz, HJ. (2009). A Guide for Manual Construction of Difference-List Procedures. In: Seipel, D., Hanus, M., Wolf, A. (eds) Applications of Declarative Programming and Knowledge Management. INAP WLP 2007 2007. Lecture Notes in Computer Science(), vol 5437. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-00675-3_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-00675-3_1

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-00674-6

  • Online ISBN: 978-3-642-00675-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics