I’m using prolog script to do all queries, the code goes like:
:- initialization(run).
writeln(T) :- write(T), nl.
queryAll :-
forall(query(Q), (Q ->
writeln('yes':Q) ;
writeln('no ':Q))).
run :-
queryAll,
halt.
query( (1,2,3) = (X,Y,Z) ).
the problem is that queryAll will only print “yes” or “no” while I want to see the unification results like:
X = 1
Y = 2
Z = 3
How to do this in prolog?
Thanks in advance.
here a sample of gprolog builtins that could be useful to build a better experience for your customers:
Note that you should change the query/1 content: instead of
should be
and then the loop could be, for instance
I get the hint from this answer.