A Logic Programming Language with Lambda-Abstraction, Function Variables, and Simple Unification

It has been argued elsewhere that a logic programming language with function variables and λ-abstractions within terms makes a very good meta-programming language, especially when an object language contains notions of bound variables and scope. The λProlog logic programming language and the closely related Elf and Isabelle systems provide meta-programs with both function variables and λ-abstractions by containing implementations of higher-order unification. In this paper, we present a logic programming language, called Lλ, that also contains both function variables and λ-abstractions, but certain restriction are placed on occurrences of function variables. As a result, an implementation of Lλ does not need to implement full higher-order unification. Instead, an extension to first-order unification that respects bound variable names and scopes is all that is required. Such unification problems are shown to be decidable and to possess most general unifiers when unifiers exist. A unification algorithm and logic programming interpreter are described and proved correct. Several examples of using Lλ as a meta-programming language are presented.

[1]  Dale Miller,et al.  Uses of Higher-Order Unification for Implementing Program Transformers , 1988, ICLP/SLP.

[2]  Wayne Snyder,et al.  Higher-Order Unification Revisited: Complete Sets of Transformations , 1989, J. Symb. Comput..

[3]  Alonzo Church,et al.  A formulation of the simple theory of types , 1940, Journal of Symbolic Logic.

[4]  Frank Pfenning,et al.  A Semi-Functional Implementation of a Higher-Order Logic Programming Language , 1990 .

[5]  Dale Miller,et al.  Lexical Scoping as Universal Quantification , 1989, ICLP.

[6]  Frank Pfenning,et al.  Unification and anti-unification in the calculus of constructions , 1991, [1991] Proceedings Sixth Annual IEEE Symposium on Logic in Computer Science.

[7]  Conal Elliott,et al.  Higher-order Unification with Dependent Function Types , 1989, RTA.

[8]  Tomasz Pietrzykowski,et al.  Mechanizing omega-Order Type Theory Through Unification , 1976, Theor. Comput. Sci..

[9]  Gopalan Nadathur,et al.  Uniform Proofs as a Foundation for Logic Programming , 1991, Ann. Pure Appl. Log..

[10]  Dale Miller,et al.  Unification of Simply Typed Lamda-Terms as Logic Programming , 1991, ICLP.

[11]  Richard Statman,et al.  Intuitionistic Propositional Logic is Polynomial-Space Complete , 1979, Theor. Comput. Sci..

[12]  Lawrence C. Paulson,et al.  Natural Deduction as Higher-Order Resolution , 1986, J. Log. Program..

[13]  Gopalan Nadathur,et al.  Higher-order Horn clauses , 1990, JACM.

[14]  Warren D. Goldfarb,et al.  The Undecidability of the Second-Order Unification Problem , 1981, Theor. Comput. Sci..

[15]  J. Roger Hindley,et al.  Introduction to combinators and λ-calculus , 1986, Acta Applicandae Mathematicae.

[16]  Dale Miller,et al.  A Logic Programming Language with Lambda-Abstraction, Function Variables, and Simple Unification , 1991, J. Log. Comput..

[17]  Frank Pfenning,et al.  Higher-order abstract syntax , 1988, PLDI '88.

[18]  Amy P. Felty,et al.  Specifying Theorem Provers in a Higher-Order Logic Programming Language , 1988, CADE.

[19]  Dale Miller,et al.  A Logical Analysis of Modules in Logic Programming , 1989, J. Log. Program..

[20]  de Ng Dick Bruijn Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem , 1972 .

[21]  Gopalan Nadathur,et al.  A Logic Programming Approach to Manipulating Formulas and Programs , 1987, SLP.

[22]  Gérard P. Huet,et al.  A Unification Algorithm for Typed lambda-Calculus , 1975, Theor. Comput. Sci..

[23]  Dale Miller,et al.  Abstractions in Logic Programs , 1989 .

[24]  Frank Pfenning,et al.  Elf: a language for logic definition and verified metaprogramming , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[25]  Gopalan Nadathur,et al.  Towards a WAM model for ?Prolog , 1989 .

[26]  Gopalan Nadathur,et al.  A representation of Lambda terms suitable for operations on their intensions , 1990, LISP and Functional Programming.

[27]  Tobias Nipkow,et al.  Higher-order critical pairs , 1991, [1991] Proceedings Sixth Annual IEEE Symposium on Logic in Computer Science.