1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% 000401 Slim Abdennadher and Henning Christiansen
5 %% ported to hProlog by Tom Schrijvers
9 :- use_module(library(chr)).
12 % extensional predicates:
13 person/2, father/2, mother/2,
15 % intensional predicates:
22 % Representing the test for failed state, i.e.,
23 % that the 'predefined' are satisfiable
32 parent(P,C) <=> (true | (father(P,C) ; mother(P,C))).
37 parent(P,C1), parent(P,C2).
40 start <=> father(john,mary), father(john,peter),
42 person(john,male), person(peter,male),
43 person(jane,female), person(mary,female),
50 father(X,Y) ==> ( true | ((X=john, Y=mary) ; (X=john, Y=peter))).
53 mother(X,Y) ==> X=jane, Y=mary.
56 person(X,Y) ==> ( true | ( (X=john, Y=male) ;
69 father(F1,C),father(F2,C) ==> F1=F2.
73 mother(M1,C),mother(M2,C) ==> M1=M2.
76 person(P,G1), person(P,G2) ==> G1=G2.
79 father(F,C) ==> person(F,male), person(C,S).
82 mother(M,C) ==> person(M,female), person(C,G).
87 orphan(C) ==> person(C,G).
90 orphan(C), /* person(F,male),*/ father(F,C) ==> false.
93 orphan(C), /* person(M,female),*/ mother(M,C) ==> false.
97 %%%% The following just to simplify output;
100 father(F,C) \ father(F,C)<=> true.
101 mother(M,C) \ mother(M,C)<=> true.
102 person(M,C) \ person(M,C)<=> true.
103 orphan(C) \ orphan(C)<=> true.
106 /*************************************************
109 :- start, sibling(peter,mary).
111 :- start, sibling(paul,mary).
113 :- father(X,Y), mother(X,Y).
115 **************************************************/