Skip to main content

Patterns for Prolog Programming

  • Chapter
  • First Online:
Computational Logic: Logic Programming and Beyond

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 2407))

Abstract

An approach to Prolog programming based on patterns is presented. Two classes of patterns are identified. Skeletons are programs constituting a specific control flow and act as reusable starting components for program development in Prolog. Techniques are standard operations that can be performed on a wide range of skeletons. The result of applying a technique to a skeleton is a new program which performs additional Prolog computations while following the control flow of the skeleton. Both classes of patterns are straightforward to understand and reuse due to the high level of abstraction of logic programming languages. Taking a pattern-directed view makes Prolog programs easier to build, for which some anecdotal evidence is given. In honour of Professor Bob Kowalski, the patterns are traced back where possible to Kowalski’s original monograph on logic programming.

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 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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. Bowen, K. and Kowalski, R.: Amalgamating Language and Meta-Language, in Logic Programming, (eds. Clark, K. and Tarnlund, S.-A.), pp. 153–172, Academic Press, 1982

    Google Scholar 

  2. Deville, Y.: Logic programming: Systematic Program Development, Addison-Wesley, 1990

    Google Scholar 

  3. Flach, P.: Simply Logical, John Wiley, 1994

    Google Scholar 

  4. Gamma, E., Helm, R., Johnson, R. and Vlissides, J.: Design Patterns, Addison-Wesley, 1995

    Google Scholar 

  5. Gegg-Harrison, T.: Learning Prolog in a Schema-Based Environment, Instructional Science, 20:173–192, 1991.

    Article  Google Scholar 

  6. Gegg-Harrison, T. Representing Logic Program Schemata in Prolog, Proc. 12th International Logic Programming Conference (ed. L. Sterling), pp. 467–481, MIT Press, 1995

    Google Scholar 

  7. Kirschenbaum, M., Michaylov, S. and Sterling, L.S.: Skeletons and Techniques as a Normative View of Developing Logic Programs, Proc. ACSC’96, Australian Computer Science Communications, 18(1), pp. 516–524, 1996

    Google Scholar 

  8. Knuth, D.: The Art of Computer Programming, Vol. 1, Addison-Wesley, 1968

    Google Scholar 

  9. Kowalski, R.: Logic for Problem Solving, Elsevier-North Holland, 1979.

    Google Scholar 

  10. Lakhotia, A.: A Workbench for Developing Logic Programs by Stepwise Enhancement, Ph.D. Thesis, Case Western Reserve University, 1989.

    Google Scholar 

  11. Lakhotia, A., Sterling, L. and Bojantchev, D.: Development of a Prolog Tracer by Stepwise Enhancement, Proc. 3rd Intl. Conference on Practical Applications of Prolog, Paris, pp. 371–393, 1995

    Google Scholar 

  12. Michaylov, S.: Skeletons and Techniques for the systematic development of constraint logic programs, Proc. 6th IEEE Conference on Tools for Artificial Intelligence, New Orleans, Nov. 1994. Also appears as Technical Report OSU-CISRC-6/94-TR30, Department of Computer and Information Science, The Ohio State University, 1994

    Google Scholar 

  13. Michaylov, S. and Ordez, I.: Time and Money: A Case Study in Systematic Development of Constraint Logic Programs, Proc. 7th Workshop on Logic Programming Environments, Portland, Oregon, 1995

    Google Scholar 

  14. Naish, L.: Higher-order Logic Programming, Proc. Workshop on Multi-paradigm Logic Programming, JICSLP’96, Also available as Tech. Report 96/2, Department of Computer Science, University of Melbourne, 1996

    Google Scholar 

  15. Naish, L. and Sterling, L.: Stepwise Enhancement and Higher Order Programming in Prolog, Journal Functional and Logic Programming, MIT Press, 4, 2000

    Google Scholar 

  16. O’Keefe, R.: The Craft of Prolog, MIT Press, 1990.

    Google Scholar 

  17. Pereira and Shieber: Prolog and Natural Language Analysis, CSLI Lecture Notes, Report #10, Stanford, 1987

    Google Scholar 

  18. Pressman, R.: Software Engineering: A Practitioner’s Approach, 5th Ed. McGraw-Hill, 2000

    Google Scholar 

  19. Schach, S.: Classical and Object-Oriented Software Engineering, 4th Ed. McGraw-Hill, 1999

    Google Scholar 

  20. Sergot, M.: A’ Query the User’ Facility for Logic Programming, in Integrated Interactive Computer Systems, North-Holland, Amsterdam, 1983

    Google Scholar 

  21. Sterling, L.S. and Beer, R.D.: Meta-Interpreters for Expert System Construction, Journal of Logic Programming, 6(1–2), pp. 163–178, 1989

    Article  Google Scholar 

  22. Sterling, L., Harous, S., Kirschenbaum, M., Leis, B. and White, L.: Developing Software Testing Programs Using Stepwise Enhancement, Proc. Short Paper sessions, Intl. Conf. Software Engineering, Melbourne, pp. 8–9, May, 1992

    Google Scholar 

  23. Sterling, L. and Kirschenbaum, M.: Applying Techniques to Skeletons, in Constructing Logic Programs, (ed. J.M. Jacquet), pp. 127–140, John Wiley, 1993.

    Google Scholar 

  24. Sterling, L.S. and Sitt Sen, Chok: A Tool to Support Stepwise Enhancement in Prolog, Workshop on Logic Programming Environments, pp. 21–26, ILPS’93, Vancouver, October, 1993

    Google Scholar 

  25. Sterling, L.S. and Shapiro, E.Y. The Art of Prolog, 2nd edition, MIT Press, 1994.

    Google Scholar 

  26. Yalinalp, L..: Meta-Programming for Knowledge-Based Systems in Prolog, Ph.D. Thesis, Case Western Reserve University, 1991.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Sterling, L. (2002). Patterns for Prolog Programming. In: Kakas, A.C., Sadri, F. (eds) Computational Logic: Logic Programming and Beyond. Lecture Notes in Computer Science(), vol 2407. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45628-7_15

Download citation

  • DOI: https://doi.org/10.1007/3-540-45628-7_15

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-43959-2

  • Online ISBN: 978-3-540-45628-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics