Hi,
I find the following program, which has a recursive query, makes the Datalog engine hang.
:- table sxud/1.
kuts(-28).
sxud(A) :- kuts(A).
huvd(B) :- kuts(B).
kuts(B) :- huvd(B).
I run it with the command:
xsb --noprompt --quietload --nobanner --nofeedback -e "example.P, sxud(A), writeln([A]), fail. halt."
But if I query the result of kuts, I can get the result, as follow:
:- table kuts/1.
kuts(-28).
sxud(A) :- kuts(A).
huvd(B) :- kuts(B).
kuts(B) :- huvd(B).
I run it with command:
xsb --noprompt --quietload --nobanner --nofeedback -e "example.P, kuts(A), writeln([A]), fail. halt."
the result is -28.
Did I do something wrong?
you are tabling sxud/1 but the recursive predicate is kuts/1 or huvd/1, not sxud/1.
Hi,
Thank you very much for your quick answer. I still have a very small question, even if I am tabling sxud/1, shouldn't the fix point be reached when the facts of the relation in the recursive query are unchanged?
Without tabling recursive preds it won't.
Nov 28, 2022 20:34:12 chi cztest@users.sourceforge.net:
Related
Bugs: #255
Thank you very much for your patient answer! I got it! We can close this ticket now.