The Wikipedia article for Prolog states:
Higher-order programming style in Prolog was pioneered in HiLog and λProlog.
The motivation for HiLog includes its ability to implement higher-order predicates like maplist
:
maplist(F)([],[]).
maplist(F)([X|Xs],[Y|Ys]) <- F(X,Y), maplist(F)(Xs,Ys).
The paper that describes HiLog assumes that Prolog only has call/1
, not call/3
.
However, since Prolog (now) has call/3
, maplist
can be easily implemented in it:
maplist(_, [], []).
maplist(P, [X|Xs], [Y|Ys]) :- call(P, X, Y), maplist(P, Xs, Ys).
Is HiLog mostly of historical interest, or is its "higher-order" logic more general that what's available in Prolog now?
From wiki
Although syntactically HiLog strictly extends first order logic, HiLog can be embedded into this logic.
Any HiLog term can be translated into a Prolog term (HiLog: A foundation for higher-order logic programming - Weidong Chen, Michael Kifer, David S.Warren - 1993). So in a sense yes, it is not more general than Prolog.
Let me quote a few conclusions from the paper
Firstly, programming in HiLog makes more logic programs logical. We all admonish Prolog programmers to make their programs as pure as possible and to eschew the evils of Prolog’s nonlogical constructs. In Prolog, the intermixing of predicate and function symbols, in particular in the predicate, call/ 1, is nonlogical, whereas in HiLog, it is completely logical and is a first-class citizen. So in HiLog, programmers need not avoid using call/l, and thus have more flexibility in their task of writing pure logic programs.
Secondly, even though one might say that HiLog is simply a syntactic variant of Prolog, syntax is important when one is doing meta-programming. Since in meta-programming the syntax determines the data structures to be manipulated, a simpler syntax means that meta-programs can be much simpler.