Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clausal Form? 1

Status
Not open for further replies.

Whimsical

Programmer
Oct 24, 2012
4
US
Does anyone know how to convert prolog databases to clausal form? I have an assignment where I need to do an SLDNF proof, but before I can do that I need to convert some facts and rules from a prolog program into clausal form. My teacher gave us a 4 step process to do it but in the example he gives he doesn't use a statement from prolog.

So for example:

How would you convert "sibling(X, Y) :- parent(P, X), parent(P, Y), X \== Y" to clausal form?
 
This rule sibling(X, Y) :- parent(P, X), parent(P, Y), X \== Y. means that you have sibling(X, Y) if you have parent(P, X), parent(P, Y), X \== Y.
So
sibling(X, Y) :- parent(P, X), parent(P, Y), X \== Y is like
(parent(P, X), parent(P, Y), X \== Y) => sibling(X, Y)
which is translated as
(parent(P, X)/\ parent(P, Y) /\ not(X == Y)) => sibling(X, Y)
and knowing (a => b) is like (not(a) \/ b)
not((parent(P, X)/\ parent(P, Y) /\ not(X == Y))) \/ sibling(X, Y)
and
not(parent(P, X)) \/ not(parent(P, Y)) \/ (X == Y) \/ sibling(X, Y)

 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top