By permitting function and predicate symbols to be variables and by replacing first-order terms by simply typed $lambda$-terms, a higher-order extension to first-order Horn clauses can be described. To be complete in principle, a logic programming language based on this extension must incorporate higher-order unification. Although this is a more complex operation than first-order unification, its availability as a primitive makes certain kinds of programming tasks easier. We illustrate this aspect in the paper by presenting some programs in a higher-order version of Prolog called $\lambda$Prolog that manipulate objects, such as formulas and programs, whose representation requires structures containing abstractions or bound variables. Specifically, we show (a) how a simple natural deduction theorem prover may be implemented in $\lambda$Prolog, and (b) how some simple program transformers for a functional programming language may be written in this language. These programs exploit the availability of $\lambda$-conversion and higher-order unification in $\lambda$Prolog to provide elegant solutions to several awkward problems inherent in these tasks. We contend that programs which perform similar tasks but which are written in languages without these features would, at least, be much less perspicuous.
[1]
Robin Milner,et al.
Edinburgh LCF
,
1979,
Lecture Notes in Computer Science.
[2]
William F. Clocksin,et al.
Programming in Prolog
,
1987,
Springer Berlin Heidelberg.
[3]
Dov M. Gabbay,et al.
N-Prolog: An Extension of Prolog with Hypothetical Implications I
,
1984,
J. Log. Program..
[4]
Lawrence C. Paulson,et al.
Natural Deduction as Higher-Order Resolution
,
1986,
J. Log. Program..
[5]
Gopalan Nadathur,et al.
Some Uses of Higher-Order Logic in Computational Linguistics
,
1986,
ACL.
[6]
Gerhard Gentzen,et al.
Investigations into Logical Deduction
,
1970
.
[7]
Dale Miller,et al.
A Theory of Modules for Logic Programming
,
1986,
SLP.
[8]
John Darlington,et al.
A system which automatically improves programs
,
1973,
Acta Informatica.
[9]
G. Nadathur.
A higher-order logic as the basis for logic programming
,
1987
.