Advertisement

Patterns for Prolog Programming

  • Leon Sterling
Chapter
Part of the Lecture Notes in Computer Science book series (LNCS, 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.

Keywords

Logic Program Binary Tree Logic Programming Relation Scheme Proof Tree 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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, 1982Google Scholar
  2. 2.
    Deville, Y.: Logic programming: Systematic Program Development, Addison-Wesley, 1990Google Scholar
  3. 3.
    Flach, P.: Simply Logical, John Wiley, 1994Google Scholar
  4. 4.
    Gamma, E., Helm, R., Johnson, R. and Vlissides, J.: Design Patterns, Addison-Wesley, 1995Google Scholar
  5. 5.
    Gegg-Harrison, T.: Learning Prolog in a Schema-Based Environment, Instructional Science, 20:173–192, 1991.CrossRefGoogle Scholar
  6. 6.
    Gegg-Harrison, T. Representing Logic Program Schemata in Prolog, Proc. 12th International Logic Programming Conference (ed. L. Sterling), pp. 467–481, MIT Press, 1995Google Scholar
  7. 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, 1996Google Scholar
  8. 8.
    Knuth, D.: The Art of Computer Programming, Vol. 1, Addison-Wesley, 1968Google Scholar
  9. 9.
    Kowalski, R.: Logic for Problem Solving, Elsevier-North Holland, 1979.Google Scholar
  10. 10.
    Lakhotia, A.: A Workbench for Developing Logic Programs by Stepwise Enhancement, Ph.D. Thesis, Case Western Reserve University, 1989.Google Scholar
  11. 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, 1995Google Scholar
  12. 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, 1994Google Scholar
  13. 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, 1995Google Scholar
  14. 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, 1996Google Scholar
  15. 15.
    Naish, L. and Sterling, L.: Stepwise Enhancement and Higher Order Programming in Prolog, Journal Functional and Logic Programming, MIT Press, 4, 2000Google Scholar
  16. 16.
    O’Keefe, R.: The Craft of Prolog, MIT Press, 1990.Google Scholar
  17. 17.
    Pereira and Shieber: Prolog and Natural Language Analysis, CSLI Lecture Notes, Report #10, Stanford, 1987Google Scholar
  18. 18.
    Pressman, R.: Software Engineering: A Practitioner’s Approach, 5th Ed. McGraw-Hill, 2000Google Scholar
  19. 19.
    Schach, S.: Classical and Object-Oriented Software Engineering, 4th Ed. McGraw-Hill, 1999Google Scholar
  20. 20.
    Sergot, M.: A’ Query the User’ Facility for Logic Programming, in Integrated Interactive Computer Systems, North-Holland, Amsterdam, 1983Google Scholar
  21. 21.
    Sterling, L.S. and Beer, R.D.: Meta-Interpreters for Expert System Construction, Journal of Logic Programming, 6(1–2), pp. 163–178, 1989CrossRefGoogle Scholar
  22. 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, 1992Google Scholar
  23. 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. 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, 1993Google Scholar
  25. 25.
    Sterling, L.S. and Shapiro, E.Y. The Art of Prolog, 2nd edition, MIT Press, 1994.Google Scholar
  26. 26.
    Yalinalp, L..: Meta-Programming for Knowledge-Based Systems in Prolog, Ph.D. Thesis, Case Western Reserve University, 1991.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • Leon Sterling
    • 1
  1. 1.Department of Computer Science and Software EngineeringUniversity of MelbourneAustralia

Personalised recommendations