
Extensional Higher Order Prolog - rutenspitz
https://billwadge.wordpress.com/2016/01/18/extensional-higher-order-prolog/
======
rntz
I've just published a draft paper on an entirely different approach to the
same problem: instead of creating a higher-order Prolog, we've discovered a
functional (and so higher-order) analogue of Datalog, a more limited language
([http://www.rntz.net/files/datafun.pdf](http://www.rntz.net/files/datafun.pdf),
on github at
[https://www.github.com/rntz/datafun](https://www.github.com/rntz/datafun))

This idea of a higher-order Prolog is very interesting! But it's not clear to
me how it can be truly extensional without further limiting the language. For
there is another reason why Prolog is not extensional: non-termination. As a
simple example, consider this program:

    
    
        q(X) :- q(X).
        q(adam).
        p(adam).
    

`p` and `q` are logically equivalent (the line `q(X) :- q(X).` is a no-op; _of
course_ a predicate implies itself). But in Prolog, `q` is a useless,
nonterminating predicate. This problem is not a simple quirk: provability in
even _first-order_ Horn logic is undecidable if you augment it with compound
terms & unification (as Prolog does), so there _is_ no general algorithm for
deciding Prolog queries.

It _looks_ like extensional higher-order prolog should have the same problem.
The article doesn't address it, so I'll go read the papers.

EDIT: The relevant research papers on Higher-Order Prolog, if anybody is
interested: [http://arxiv.org/abs/1106.3457](http://arxiv.org/abs/1106.3457)
"Extensional Higher-Order Logic Programming";
[http://arxiv.org/abs/1405.3792](http://arxiv.org/abs/1405.3792) in which they
extend it to negation;
[https://github.com/acharal/hopes](https://github.com/acharal/hopes) the
implementation's github repo

~~~
sevensor
I'm interested, thanks for posting! I have no background in logic programming,
but I have a problem at work that seems to be screaming for it. I tried Prolog
but ran into some limitations. I couldn't tell whether they were with the
language or whether I was just holding it wrong.

------
infradig
Good to see Prolog getting a mention!

