Yes, you can implement a Turing machine without
dif/2. But you cannot even implement intersection or similar predicates.
Suppose we do extend pure Prolog (Horn FOL + CWA + UNA) with call/N, dif/2, and (=)/3, to be used in if_/3, would there still be gaps in its expressiveness, i.e. things that are trivial to define in, say, Scheme, but are much harder to state in such extended (almost pure) Prolog?
In particular, does such a Prolog allow manipulating Prolog lists about as conveniently as Scheme allows manipulating Scheme lists?
Edit: Assume Scheme without mutation, macros, continuations, laziness, streams, numbers, strings, vectors or characters. Just symbols, booleans and lists (trees).
Just
symbol/1anddif/2are sufficient extensions of logically pure Prolog.Proof:
This answer contains an evaluator for Scheme expressions,
evil/2. It understandslambdaandquote, and can be easily extended to handle built-in list procedures likelist,car,cdr, etc. Aside from pure (Horn) Prolog, it uses onlysymbol/1anddif/2. While it is an interpreter and will run slowly, its existence shows that the same list operations done by Scheme can be done in such almost pure Prolog. (I thinksymbol/1wouldn't be needed either, if Scheme symbols were translated intosymb(prolog_atom)instead of directly intoprolog_symbol)Edit
This extends
evil/2to handleif,#tand#f(represented bytrueandfalse):This extends
evil/2to handleequalp. It's even more powerful than Scheme'seq*in that it will equate some closures too: