I am doing an exercise to write some logic code in a few different idioms... Prolog, miniKanren, ASP etc... to get a feel for each.
I have a question about something really basic:
In Prolog you can define:
human(bob).
then in the REPL you can check the truth of this fact and a non-fact:
?- human(bob).
true.
?- human(e_t).
false.
In the python miniKanren, LogPy, you can similarly define the fact:
from kanren import fact
fact(human, 'bob')
I cannot find a recipe for simply checking the truth of "bob is human".
The run
function seems to require a variable as the second arg, but I am an not trying to find the value of a variable.
All the kanren examples I found start by showing how to query a relation, like:
from kanren import Relation, fact, run, var
human = Relation()
fact(human, 'bob')
fact(human, 'jim')
x = var('x')
run(0, x, human(x))
# output:
('jim', 'bob')
That's more useful, but what I want to do is even simpler than that (just for the sake of comparing the same baby steps in Prolog).