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.