Abstract
This paper outlines a logic programming methodology which applies standardized logic program recursion forms afforded by a system of general purpose recursion schemes. The recursion schemes are conceived of as quasi higher-order predicates which accept predicate arguments, thereby representing parameterized program modules. This use of higher-order predicates is analogous to higher-order functionals in functional programming. However, these quasi higher-order predicates are handled by a metalogic programming technique within ordinary logic programming.
Some of the proposed recursion operators are actualizations of mathematical induction principles (e.g. structural induction as generalization of primitive recursion). Others are heuristic schemes for commonly occurring recursive program forms. The intention is to handle all recursions in logic programs through the given repertoire of higher-order predicates.
We carry out a pragmatic feasibility study of the proposed recursion operators with respect to the corpus of common textbook logic programs.
This pragmatic investigation is accompanied with an analysis of the theoretical expressivity. The main theoretical results concerning computability are
-
(1)
Primitive recursive functions can be re-expressed in logic programming by predicates defined solely by non-recursive clauses augmented with afold recursion predicate akin to the fold operators in functional programming.
-
(2)
General recursive functions can be re-expressed likewise sincefold allows re-expression of alinrec recursion predicate facilitating linear, unbounded recursion.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Gegg-Harrison, T. S., “Representing Logic Program Schemata in λProlog,” inProceedings of the Twelfth International Conference on Logic Programming 1995 (Sterling, L., ed.), MIT Press, London, pp. 467–481, 1995.
Marakakis, E. and Gallagher, J. P., “Schema-Based Top-Down Design of Logic Programs Using Abstract Data Types,” inLogic Program Synthesis and Transformation — Meta-Programming in Logic (Fribourg, L. and Turini, F., eds.),LNCS 883, Springer-Verlag, 1994.
Sterling, L. and Kirschenbaum, M., “Applying Techniques to Skeleton,” inConstructing Logic Programs (Jacquet, J.-M., ed.), Wiley, 1993.
Jacquet, J.-M., (ed.),Constructing Logic Programs, Wiley, 1993.
Bird, R. and Wadler, Ph.,Introduction to Functional Programming, Prentice Hall, 1988.
Reade, C.,Elements of Functional Programming, Addison-Wesley, 1989.
Warren, D. H. D., “Higher-Order Extensions to PROLOG: Are They Needed?,” inMachine Intelligence 10 (Michie, D., ed.), Ellis Horwood and Edinburgh University Press, pp. 441–454, 1982.
Nilsson, J. Fischer and Hamfelt, A., “Constructing Logic Programs with Higher Order Predicates,” inProceedings of GULP-PRODE’95, the Joint Conference on Declarative Programming 1995 (Alpuente, M. and Sessa, M. I., eds.), Universitá Degli Studi di Salerno, Salerno, pp. 307–312, 1995.
Sterling, L. and Shapiro, E.,The Art of Prolog, MIT Press, 1986, 1991.
Andrews, P. B.,An Introduction to Mathematical Logic and Type Theory: To Truth through Proof, Academic Press, 1986.
Miller, D. A. and Nadathur, G., “Higher-Order Logic Programming,” inProceedings of the Third International Logic Programming Conference, LNCS 225, Springer-Verlag, 1986.
Chen, W., Kifer, M., and Warren, D. S., “HiLog: A Foundation for Higher-Order Logic Programming,”J. Logic Programming, 15, pp. 187–230, 1993.
Backus, J., “Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs,”Comm. of the ACM, 21, 8, pp. 613–641, 1978.
Bird, R., “Lectures on Constructive Functional Programming,” inConstructive Methods in Computing Science (Broy, M., ed.), Springer-Verlag, pp. 151–216, 1989.
Hamfelt, A. and Nilsson, J. Fischer, “Declarative Logic Programming with Primitive Recursive Relations on Lists,” inProceedings of the Joint International Conference and Symposium on Logic Programming (Maher, P., ed.), MIT Press, 1996. Forthcoming.
Kleene, S. C.,Introduction to Metamathematics, Amsterdam, 1952.
Boolos, G. S. and Jeffrey, J. C.,Computability & Logic, Cambridge University Press, 1974.
Kleene, S. C.,Mathematical Logic, Wiley, 1967.
Tärnlund, S.-Å., “Horn Clause Computability,”BIT 17, pp. 215–226, 1977.
Smith, D. R., “The Design of Divide and Conquer Algorithms,”Science of Computer Programming, 5, pp. 37–58, 1985.
Flener, P.,Logic Program Synthesis from Incomplete Specification, Kluwer, 1995.
Flener, P. and Deville, Y., “Synthesis of Composition and Discrimination Operators for Divide-and-Conquer Programs,” inConstructing Logic Programs (Jacquet, J.-M., ed.), Wiley, 1993.
Nilsson, U. and Maluszyński, J.,Logic, Programming and Prolog, Wiley, 1990.
Meijer, E., Fokkinga, M., and Paterson, R., “Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire,” inProceedings of Fifth ACM Conference on Functional Programming Languages and Computer Architecture, FPCA’91 (Hughes, J., ed.),LNCS 523, Springer-Verlag, pp. 124–144, 1991.
Meertens, L., “Paramorphism,”Formal Aspects of Computing, 4, 5, pp. 413–424, 1992.
Bird, R. and de Moor, O., “Relational Program Derivation and Context-Free Language Recognition,” inA Classical Mind (Roscoe, A. W., ed.), Prentice Hall, pp. 17–35, pp. 151–216, 1994.
Author information
Authors and Affiliations
Corresponding author
Additional information
Andreas Hamfelt, Ph.D.: He currently works as an associate professor at the Computing Science Department, Uppsala University. His interests are in structured programming methodology for relational programming, inductive logic programming, program synthesis, metalogic programming, and knowledge representation of administrative decision making. He obtained an M.Sc. in Computing Science in 1987 from Uppsala University, where he also received his Ph.D. in 1992.
Jørgen Fischer Nilsson, Ph.D.: He is a professor at Department of Information Technology at the Technical University of Denmark (DTU). He received his Ph.D. in computer science from DTU in 1977. In 1976–77 he was visiting researcher at computer science department at IBM Research Laboratories, San José, California. Since 1980 he has been at DTU where he became professor in knowledge based systems 1988. His main research fields are knowledge representation, knowledge based systems, and logic programming methodology and applications.
About this article
Cite this article
Hamfelt, A., Nilsson, J.F. Towards a logic programming methodology based on higher-order predicates. NGCO 15, 421–447 (1997). https://doi.org/10.1007/BF03037300
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF03037300