Hi all, I'm trying to find a way to put the following first order logic expression into Prolog
This means that it should respond in the following way to queries:
I tried to translate the logical expression:
Using Clarks completion (that states that every definitional theory can be put in a logical program by giving the if-halves), I can obtain:
Unfortunately, this resulting theory is only sound (it will not derive false information), but not complete (for example: p(1) cannot be derived). This is a consequence of Clarks theorem.
Does anybody know if there is a better solution? Thanks!
Code:
(p(0) or p(1)) and not (p(0) and p(1))
This means that it should respond in the following way to queries:
Code:
?- p(0)
Yes.
?- p(1)
Yes.
?- p(0),p(1).
No.
I tried to translate the logical expression:
Code:
(p(0) or p(1)) and not (p(0) and p(1)) <=>
(not p(0) -> p(1)) and (p(0) -> not p(1)) <=>
p(0) <-> p(1)
Using Clarks completion (that states that every definitional theory can be put in a logical program by giving the if-halves), I can obtain:
Code:
p(0) :- p(1).
Unfortunately, this resulting theory is only sound (it will not derive false information), but not complete (for example: p(1) cannot be derived). This is a consequence of Clarks theorem.
Does anybody know if there is a better solution? Thanks!