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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
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
Deville, Y.: Logic programming: Systematic Program Development, Addison-Wesley, 1990
Flach, P.: Simply Logical, John Wiley, 1994
Gamma, E., Helm, R., Johnson, R. and Vlissides, J.: Design Patterns, Addison-Wesley, 1995
Gegg-Harrison, T.: Learning Prolog in a Schema-Based Environment, Instructional Science, 20:173–192, 1991.
Gegg-Harrison, T. Representing Logic Program Schemata in Prolog, Proc. 12th International Logic Programming Conference (ed. L. Sterling), pp. 467–481, MIT Press, 1995
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
Knuth, D.: The Art of Computer Programming, Vol. 1, Addison-Wesley, 1968
Kowalski, R.: Logic for Problem Solving, Elsevier-North Holland, 1979.
Lakhotia, A.: A Workbench for Developing Logic Programs by Stepwise Enhancement, Ph.D. Thesis, Case Western Reserve University, 1989.
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
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
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
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
Naish, L. and Sterling, L.: Stepwise Enhancement and Higher Order Programming in Prolog, Journal Functional and Logic Programming, MIT Press, 4, 2000
O’Keefe, R.: The Craft of Prolog, MIT Press, 1990.
Pereira and Shieber: Prolog and Natural Language Analysis, CSLI Lecture Notes, Report #10, Stanford, 1987
Pressman, R.: Software Engineering: A Practitioner’s Approach, 5th Ed. McGraw-Hill, 2000
Schach, S.: Classical and Object-Oriented Software Engineering, 4th Ed. McGraw-Hill, 1999
Sergot, M.: A’ Query the User’ Facility for Logic Programming, in Integrated Interactive Computer Systems, North-Holland, Amsterdam, 1983
Sterling, L.S. and Beer, R.D.: Meta-Interpreters for Expert System Construction, Journal of Logic Programming, 6(1–2), pp. 163–178, 1989
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
Sterling, L. and Kirschenbaum, M.: Applying Techniques to Skeletons, in Constructing Logic Programs, (ed. J.M. Jacquet), pp. 127–140, John Wiley, 1993.
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
Sterling, L.S. and Shapiro, E.Y. The Art of Prolog, 2nd edition, MIT Press, 1994.
Yalinalp, L..: Meta-Programming for Knowledge-Based Systems in Prolog, Ph.D. Thesis, Case Western Reserve University, 1991.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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