set(ur_res).
set(back_demod).
set(dynamic_demod_all).
assign(max_proofs,1).
 
weight_list(pick_and_purge).
weight(Roberta,1).
weight(Thelma,2).
weight(Steve,3).
weight(Pete,4).
end_of_list.
 
list(usable).
FEMALE(x)  |  MALE(x).
-FEMALE(x)  |  -MALE(x).
-HASAJOB(x,nurse)  |  MALE(x).
-HASAJOB(x,actor)  |  MALE(x).
HASAJOB(x,job1(x)).
HASAJOB(x,job2(x)).
HASAJOB(jobholder(y),y).
-HUSBAND(x,jobholder(chef))  |  HASAJOB(x,clerk).
-HASAJOB(x,clerk)  |  HUSBAND(x,jobholder(chef)).
FEMALE(jobholder(chef)).
-HUSBAND(x,y)  |  MALE(x).
-HUSBAND(x,y)  |  FEMALE(y).
-HASAJOB(x,nurse)  |  GREATERTHAN(education(x),9).
-HASAJOB(x,police)  |  GREATERTHAN(education(x),9).
-HASAJOB(x,teacher)  |  GREATERTHAN(education(x),9).
-HASAJOB(x,chef)  |  -HASAJOB(x,police).
-EQUALP(Roberta,Thelma).
-EQUALP(Roberta,Steve).
-EQUALP(Roberta,Pete).
.Pb
-EQUALP(Thelma,Steve).
-EQUALP(Thelma,Pete).
-EQUALP(Pete,Steve).
-EQUALJ(job1(x),job2(x)).
EQUALP(x,x).
EQUALJ(x,x).
EQUAL(x,x).
EQUALJ(y,job2(x))  |  EQUALJ(y,job1(x)).
EQUALP(x,z)  |  -HASAJOB(x,y)  |  -HASAJOB(z,y).
-FEMALE(jobholder(y))  |  HASAJOB(Roberta,y)  |  HASAJOB(Thelma,y).
-MALE(jobholder(y))   |   HASAJOB(Steve,y)  |  HASAJOB(Pete,y).
POSSJOBS(l(pj(Roberta,chef),l(pj(Roberta,guard),
  l(pj(Roberta,nurse),l(pj(Roberta,clerk),
  l(pj(Roberta,police),l(pj(Roberta,teacher),
  l(pj(Roberta,actor),l(pj(Roberta,boxer),end))))))))).
POSSJOBS(l(pj(Thelma,chef),l(pj(Thelma,guard),
  l(pj(Thelma,nurse),l(pj(Thelma,clerk),
  l(pj(Thelma,police),l(pj(Thelma,teacher),
  l(pj(Thelma,actor),l(pj(Thelma,boxer),end))))))))).
POSSJOBS(l(pj(Steve,chef),l(pj(Steve,guard),
  l(pj(Steve,nurse),l(pj(Steve,clerk),
  l(pj(Steve,police),l(pj(Steve,teacher),
  l(pj(Steve,actor),l(pj(Steve,boxer),end))))))))).
POSSJOBS(l(pj(Pete,chef),l(pj(Pete,guard),
  l(pj(Pete,nurse),l(pj(Pete,clerk),
  l(pj(Pete,police),l(pj(Pete,teacher),
  l(pj(Pete,actor),l(pj(Pete,boxer),end))))))))).
POSSPPL(l(pj(Roberta,chef),l(pj(Steve,chef),
  l(pj(Thelma,chef),l(pj(Pete,chef),end))))).
POSSPPL(l(pj(Roberta,guard),l(pj(Steve,guard),
  l(pj(Thelma,guard),l(pj(Pete,guard),end))))).
POSSPPL(l(pj(Roberta,nurse),l(pj(Steve,nurse),
  l(pj(Thelma,nurse),l(pj(Pete,nurse),end))))).
POSSPPL(l(pj(Roberta,clerk),l(pj(Steve,clerk),
  l(pj(Thelma,clerk),l(pj(Pete,clerk),end))))).
POSSPPL(l(pj(Roberta,police),l(pj(Steve,police),
  l(pj(Thelma,police),l(pj(Pete,police),end))))).
POSSPPL(l(pj(Roberta,teacher),l(pj(Steve,teacher),
  l(pj(Thelma,teacher),l(pj(Pete,teacher),end))))).
POSSPPL(l(pj(Roberta,actor),l(pj(Steve,actor),
  l(pj(Thelma,actor),l(pj(Pete,actor),end))))).
POSSPPL(l(pj(Roberta,boxer),l(pj(Steve,boxer),
  l(pj(Thelma,boxer),l(pj(Pete,boxer),end))))).
HASAJOB(x,y)  |  EQUAL(pj(x,y),crossed).
EQUAL(l(crossed,x),x).
-POSSJOBS(l(pj(x,y),l(pj(x,z),end)))  |  EQUALP(x,w)
  |  EQUAL(pj(w,y),crossed).
.Pb
-POSSJOBS(l(pj(x,y),l(pj(x,z),end)))  |  EQUALP(x,w)
  |  EQUAL(pj(w,z),crossed).
-POSSJOBS(l(pj(x,y),l(pj(x,z),end)))  |  HASAJOB(x,y).
-POSSJOBS(l(pj(x,y),l(pj(x,z),end)))  |  HASAJOB(x,z).
-POSSPPL(l(pj(x,y),end))  |  HASAJOB(x,y).
STILLTODO(l(jobsof(Roberta),l(jobsof(Steve),
l(jobsof(Thelma),l(jobsof(Pete),end))))).
-POSSJOBS(l(pj(x,y),l(pj(x,z),end)))  |  EQUAL(jobsof(x),crossed).
-STILLTODO(end).
-HASAJOB(x,y)  |  EQUAL(pj(x,y),j(x,y)).
EQUAL(l(pj(x,y),l(j(x,z),w)),l(j(x,z),l(pj(x,y),w))).
EQUAL(l(j(x,y),l(j(x,z),l(v,w))),l(j(x,y),l(j(x,z),end))).
-POSSJOBS(l(j(x,y),l(j(x,z),end)))  |  EQUAL(jobsof(x),crossed).
-POSSJOBS(l(j(x,y),l(pj(x,z),end)))  |  HASAJOB(x,z).
end_of_list.
 
list(sos).
FEMALE(Roberta).
FEMALE(Thelma).
MALE(Steve).
MALE(Pete).
-HASAJOB(Roberta,boxer).
-GREATERTHAN(education(Pete),9).
-HASAJOB(Roberta,chef).
-HASAJOB(Roberta,police).
end_of_list.
 
list(demodulators).
EQUAL(l(crossed,x),x).
end_of_list.
</pre>