I have gotten this program to work so far in GNU prolog
not(X) :- \+ X.
and(X, Y):- X , Y.
or(X, Y):- X ; Y.
implies(X, Y):- \+ X ; Y.
p.
q.
:- initialization(main).
main :-
write('Program start'), nl.
You can type in and(p,q), and get yes, as well as and(p,not(q)) and get no. Now i'd like to do something like this:
I sett p to true, (by initializing it with p.) , and (and(p,q)) to true (but without initializing q), and i want prolog to say: One solution exists: "q" must be true
If i set p and (or(p,q)) to true i want prolog to say: Two solutions exists, "q" can be true or false. Which is the best way to do it?