Are Hilog terms (i.e. compounds having as functors arbitrary terms) still regarded as a powerful feature in XSB Prolog (or any other Prolog) ? Are there many XSB projects currently using this feature ? which of them for example ?
I ask since as far as I understand higher order programming is equally possible using the ISO built-in call/N.
Specifically, I would like to understand if XSB is using Hilog terms just for historical reasons or if Hilog terms have considerable advantages in comparison to the current ISO standard.
Within XSB, Hilog terms are very strongly connected to the module system which is unique to XSB. XSB has a functor based module system. That is, within the same scope
length(X)
might belong to one module, whereaslength(L, N)
might belong to another. As a consequence,call(length(L), N)
might refer to one module andcall(length(L, N))
to another:It might be that in such a context there are differences between
call/N
and Hilog terms. I have, however, so far not found one.Historically, Hilog terms have been introduced 1987-1989. At that point in time,
call/N
already existed as built-ins in NU and aslibrary(call)
in Quintus Prolog with only cursory documentation. It has been proposed 1984 by Richard O'Keefe. On the other hand,call/N
was clearly unknown to the authors of Hilog, as is exemplified on p.1101 of Weidong Chen, Michael Kifer, David Scott Warren: HiLog: A First-Order Semantics for Higher-Order Logic Programming Constructs. NACLP 1989. 1090-1114. MIT-Press.Now, this can be done with
call/N
like so:Which is even more general than the
(=..)/2
-version becauseR
is no longer restricted to being an atom. As an aside, I'd rather prefer to write: