Hi Stassa,
Thanks for the careful reading of the draft paper that definitely would benefit from a few clarifications.
As TL;DR, the code is now fully deployed at https://deepllm.streamlit.app and playing with it will show clearly the generated Prolog program and its unique minimal model (i.e., Least Herbrand Model) as outputs for an initiator goal of your choice.
Let me just focus here and zooming into the SLD-inspiration claim in the paper.
The analogy with SLD-resolution becomes more obvious if you see it expressed (equivalently!) via repeated unfoldings as in:
a0:-a1,a2,...,an. +
b0:-b1,...,bm.
-----------------------
a0:-b1,...,bm,a2,...,an.
assuming a1 and b0 unifies, which in the propositional case is simply a1==b0 with no substitutions to be applied.
When running a propositional definite Horn Clause program, the clause
b0:-b1,...,bm.
is fetched from the Prolog database.
On the other hand, when talking to the LLM, the clause is synthesized in 2 steps:
OR-step: Given a1, build several alternative clause heads, among which, let’s look now at b0.
AND-step: Given b0, build a body of the clause made of b1,…,bm supporting b0
The trace (now switched off by default) is just the traversal of the OR and AND nodes. At the end, a result is returned as a (propositional) Horn clause program, together with its minimal model.
If you take a look at the synthesized Prolog program (e.g.,
)
you will see a combination of rules and facts, that under SLD-resolution will show the initiator goal as being solvable.
The limitation to propositional logic could be fairly easily lifted first to SVO triplets (LLMs are really good at that!) and then to be fed into an ILP system to synthesize a logic program with predicates derived from verbs and subject/object components as their arguments, to be eventually generalized to more compact rules involving variables.
But that’s the next step, and maybe someone familiar with the latest ILP tools can take it over
Paul