I'm new to Prolog and have some doubts.
I need to write a function form_equiv(A,B) that tells us if if B is equivalent to A where A and B are supposed to be propositions.
I know that two propositions are equivalent if
tautology (A iff B) = TRUE
But how could I make a function that checks when a formula is a tautology.
By the way, I cannot use built-in function just AND, OR and NOT.
Right now this what I have so far:
and(P,Q) :- P, Q, !.
or(P,Q) :- (P; Q), !.
impl(P,Q) :- or(not(P),Q).
syss(P,Q) :- and(impl(P,Q),impl(Q,P)).
t.
f :- fail.
t(_).
f(_) :- fail.
:- op(400,xf,not).
:- op(500,xfx,and).
:- op(500,xfx,or).
:- op(600,xfx,impl).
:- op(700,xfx,syss).
I've done a program similar in Haskell but I'm really new to Prolog.
Can anyone help me write a function to check if a formula is a tautology?
Thanks in advance...