Advertisement
logicmoo

Logicmoo Example session

Aug 3rd, 2016
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 18.60 KB | None | 0 0
  1.  
  2. :- ensure_loaded(logicmoo(logicmoo_engine)).
  3. :- ensure_loaded(logicmoo_i_compiler).
  4. :- enable_mpred_expansion.
  5.  
  6. are_clauses_entailed(E):-not(compound(E)),!,must(true==E).
  7. are_clauses_entailed([E|List]):-is_list([E|List]),!,maplist(
  8. are_clauses_entailed,[E|List]).
  9. are_clauses_entailed((C,L)):-!,are_clauses_entailed(C),are_clauses_entailed(
  10. L).
  11. are_clauses_entailed(CL):- unnumbervars(CL,UCL),  !, \+ \+ show_call_failure
  12. (is_entailed(UCL)),!.
  13.  
  14. is_entailed(UCL):-clause_asserted(UCL),!.
  15. is_entailed(UCL):-pfc_call(UCL),!.
  16.  
  17. member_ele(E,E):- \+ compound(E),!.
  18. member_ele([L|List],E):- is_list([L|List]),C=..[v,L|List],!,arg(_,C,EL),
  19. member_ele(EL,E).
  20. member_ele((H,T),E):-!, (member_ele(H,E);member_ele(T,E)).
  21. member_ele(E,E).
  22.  
  23. delistify_last_arg(CALL):-CALL=..[F|ARGS],append(Left,[OLD],ARGS),append(
  24. Left,[NEW],NARGS),NEWCALL=..[F|NARGS],!,
  25.   NEWCALL,member_ele(NEW,OLD).
  26.  
  27. % sanity that mpreds (manage prolog prodicate) are abily to transform
  28. :- thlocal:disable_mpred_term_expansions_locally->throw(thlocal:
  29. disable_mpred_term_expansions_locally);true.
  30.  
  31. % cwc "code-wise chaining" is always true in Prolog but will throw programming
  32. error if evalled in LogicMOO Prover.
  33. % Use this to mark code and not axiomatic prolog
  34.  
  35. clif_to_prolog(CLIF,Prolog):-cwc,is_list(CLIF),!,must_maplist(clif_to_prolog
  36. ,CLIF,Prolog).
  37. clif_to_prolog((H,CLIF),(T,Prolog)):-cwc,sanity(must(nonvar(H))),!,trace,
  38. clif_to_prolog(H,T),clif_to_prolog(CLIF,Prolog).
  39. clif_to_prolog((H<=B),(H<=B)):- cwc,!.
  40. clif_to_prolog((H:-B),PrologO):- cwc,!,must((show_call(boxlog_to_pfc((H:-B),
  41. Prolog)),!,=(Prolog,PrologO))),!.
  42. clif_to_prolog(CLIF,PrologO):- cwc,
  43.   % somehow integrate why_to_id(tell,Wff,Why),
  44.      must_det_l((
  45.       kif_to_boxlog(CLIF,HORN),
  46.       boxlog_to_pfc(HORN,Prolog),
  47.       dmsg(pfc:-Prolog),
  48.       =(Prolog,PrologO))),!.
  49.  
  50.  
  51. % Sanity Test for expected side-effect entailments
  52. % why does renumbervars work but not copy_term?
  53. clif_must(CLIF0):- cwc, =(CLIF0,CLIF),sanity((clif_to_prolog(CLIF,Prolog),!,
  54. sanity(( \+ \+ (show_call(are_clauses_entailed(Prolog))))))),!.
  55.  
  56. % Sanity Test for required absence of specific side-effect entailments
  57. clif_must_not(CLIF):- cwc, sanity((clif_to_prolog(CLIF,Prolog),show_call(\+
  58.  are_clauses_entailed(Prolog)))),!.
  59.  
  60.  
  61. :-op(1190,xfx,(:-)).
  62. :-op(1200,fy,(clif_must)).
  63.  
  64. % this defines a recogniser for clif syntax (well stuff that might be safe
  65. to send in thru kif_to_boxlog)
  66. is_clif(all(_,X)):-cwc,compound(X),!,is_clif(X).
  67. is_clif(forall(_,X)):-cwc,compound(X),!.
  68. is_clif(CLIF):-cwc,
  69.   VVs = v(if,iff,clif_forall,all,exists), % implies,equiv,forall
  70.    (var(CLIF)-> (arg(_,VVs,F),functor(CLIF,F,2));
  71.      compound(CLIF),functor(CLIF,F,2),arg(_,VVs,F)).
  72.  
  73. % we ensure we are in "pfc" consultation mode (so the syntax rules will
  74. define correctly)
  75.  
  76. :- wdmsg(pfc_trace).
  77. :- pfc_trace.
  78. :- file_begin(pfc).
  79.  
  80. % make sure op alias for '=>' is not overriden
  81. :- op_alias( (=>),  (=>)).
  82.  
  83. % whenever we know about clif we'll use the prolog forward chainging system
  84. (clif(CLIF) =>
  85.    ({ clif_to_prolog(CLIF,PROLOG)},
  86.       % this consequent asserts the new rules
  87.       PROLOG,{sanity(clif_must(CLIF))})).
  88. % (clif(CLIF),{delistify_last_arg(kif_to_boxlog(CLIF,PROLOG))}) =>
  89. boxlog(PROLOG).
  90. (boxlog(CLIF),{delistify_last_arg(boxlog_to_pfc(CLIF,PROLOG))}) =>
  91. pfclog(PROLOG).
  92. (pfclog(PROLOG)=>(PROLOG,{clif_must(PROLOG)})).
  93.  
  94.  
  95. % we create code syntax listeners for [if,iff,clif_forall,all,exists]/2s
  96. ({is_clif(CLIF)} =>
  97.   (CLIF/is_clif(CLIF) => clif(CLIF))).
  98.  
  99. % fyi: we are still in PFC mode (not KIF)
  100. mother(Ma,Kid),parent(Kid,GrandKid)
  101.       =>grandmother(Ma,GrandKid).
  102.  
  103. :- if(if_defined(pfc_examples,true)).
  104.  
  105. :- wdmsg(pfc_trace).
  106.  
  107. :- pfc_trace.
  108.  
  109. % see logicmoo_i_compiler.pl for more info
  110. :- set_clause_compile(fwc).
  111.  
  112. % if two like each other then they are love compatible
  113. clif(
  114.  forall(a,forall(b,
  115.     if( (likes(a,b)  & likes(b,a)),
  116.      love_compatible(a,b))))).
  117.  
  118.  
  119. % will have the side effects...
  120.  
  121. % if A is not love compatible with B .. yet B likes A.. we must conclude A
  122. must not like B back.
  123. :- clif_must((not(likes(A, B)):-not(love_compatible(A, B)), likes(B, A))).
  124. % if A is not love compatible with B .. yet A likes B.. we must conclude B
  125. must not like A back.
  126. :- clif_must((not(likes(B, A)):-not(love_compatible(A, B)), likes(A, B))).
  127. % if A and B like each other both ways then they are love compatible
  128. :- clif_must((love_compatible(A, B):-likes(A, B), likes(B, A))).
  129.  
  130.  
  131. % if people are love compatible then they must like each other
  132. clif(
  133.   forall(a,forall(b,
  134.    if(love_compatible(a,b),
  135.     (likes(a,b)  & likes(b,a)))))).
  136.  
  137.  
  138. % will have the side effects...
  139.  
  140. % if A and B must not be love compatible since A does not like B
  141. :- clif_must((not(love_compatible(A, B)):-not(likes(A, B)))).
  142. % if A and B must not be love compatible since B does not like A
  143. :- clif_must((not(love_compatible(A, B)):-not(likes(B, A)))).
  144. % obviously A likes B .. since they are love compatible
  145. :- clif_must((likes(A, B):-love_compatible(A, B))).
  146. % obviously B likes A .. after all they are love compatible
  147. :- clif_must((likes(B, A):-love_compatible(A, B))).
  148.  
  149.  
  150. % this uses biconditional implicatature
  151. clif(
  152.  forall(a,forall(b,
  153.   iff(might_altercate(a,b),
  154.     (dislikes(a,b)  & dislikes(b,a)))))).
  155.  
  156. %  canonicalizes to..
  157.  
  158. % A and B will not scrap becasue it takes two to tango and A doesnt dislike
  159. B
  160. :- clif_must((not(might_altercate(A, B)):-not(dislikes(A, B)))).
  161. % A and B will not scrap becasue it takes B doent dislike A (like above)
  162. :- clif_must((not(might_altercate(A, B)):-not(dislikes(B, A)))).
  163. % Since we can prove A and B  dislike each other we can prove they are
  164. scrap compatible
  165. :- clif_must((might_altercate(A, B):-dislikes(A, B), dislikes(B, A))).
  166. %  A dislikes B  when we prove A and B are scrap compatible somehow  (this
  167. was due to the biconditional implicatature)
  168. :- clif_must((dislikes(A, B):-might_altercate(A, B))).
  169. %  B dislikes A  when we prove A and B are scrap compatible
  170. :- clif_must((dislikes(B, A):-might_altercate(A, B))).
  171.  
  172.  
  173. % alice likes bill
  174. clif(likes(alice,bill)).
  175.  
  176. % also she likes ted
  177. clif(likes(alice,ted)).
  178.  
  179. % we take as a given that bill does not like alice (why?)
  180. clif(not(likes(bill,alice))).
  181.  
  182. % we take as a given that bill and ted dislike each other (dont blame the
  183. woman!)
  184. clif((dislikes(bill,ted) & dislikes(ted,bill))).
  185.  
  186. % we support also SUMO language
  187. :- file_begin(kif).
  188. % (yes we are reading and atom.. which contains parens so we read it as
  189. sexprs
  190. % thank you triska for showing off this neat hack for term reading)
  191.  
  192. % treat the (normally PFC) operators as clif
  193. :- op_alias((<=>), iff).
  194. :- op_alias( (=>),  if).
  195.  
  196. % we of course supprt KIF
  197. clif('
  198.  
  199. (<=>
  200.  (dislikes ?A ?B)
  201.  (not
  202.      (likes ?A ?B)))
  203.  
  204. '
  205. ).
  206.  
  207. % we of course supprt CLIF!
  208. clif('
  209.  
  210. (forall (a b)
  211. (iif
  212.  (dislikes a b)
  213.  (not
  214.      (likes a b))))
  215.  
  216. '
  217. ).
  218.  
  219. % we support also CycL language
  220. clif('
  221.  
  222. (equiv
  223.  (dislikes ?A ?B)
  224.  (not
  225.      (likes ?A ?B)))
  226.  
  227. '
  228. ).
  229.  
  230. % interestingly this canonicallizes to ...
  231. % A does not dislike B when A like B
  232. :- clif_must((not(dislikes(A, B)):-likes(A, B))).
  233. % A does not like B when A dislikes B
  234. :- clif_must((not(likes(A, B)):-dislikes(A, B))).
  235. % A does dislikes B when we can somehow prove A not liking B
  236. :- clif_must((dislikes(A, B):-not(likes(A, B)))).
  237. % A does likes B when we can somehow prove A not disliking B
  238. :- clif_must((likes(A,B) :- not(dislikes(A,B)))).
  239.  
  240. % The above assertions forward chain to these side-effects...
  241. :- clif_must((not(love_compatible(bill, alice)))).
  242. :- clif_must((not(love_compatible(alice, bill)))).
  243. :- clif_must((might_altercate(ted, bill))).
  244. :- clif_must((might_altercate(bill, ted))).
  245.  
  246. % get proof
  247. :- sanity(call(pfc_get_support(not(love_compatible(bill, alice))   ,Why))).
  248. % O = (not(likes(bill, alice)), pt(not(likes(bill, alice)),
  249. rhs([not(love_compatible(bill, alice))]))) ;
  250. % TODO fix this error O = (u, u).
  251.  
  252. % logic tests...
  253.  
  254.  
  255. :- file_begin(kif).
  256. % treat the (normally PFC) operators as clif
  257. :- op_alias((<=>), iff).
  258. :- op_alias( (=>),  if).
  259.  
  260.  
  261. % save compiled clauses using forward chaining storage
  262. % we are using forward chaining just so any logical errors, performance and
  263. program bugs manefest
  264. % immediately
  265. :- set_clause_compile(fwc).
  266. :- file_begin(kif).
  267. :- pfc_trace.
  268.  
  269. prologBuiltin(otherGender/2).
  270. otherGender(male,female).
  271. otherGender(female,male).
  272.  
  273. :-trace_pfc.
  274. breeder(X,Y) <=> breeder(Y,X).
  275.  
  276. (breeder(X,Y),gender(X,G1), otherGender(G1,G2))
  277.      => gender(Y,G2).
  278.  
  279.  
  280.  
  281. gender(P,male) <=> male(P).
  282. gender(P,female) <=> female(P).
  283.  
  284. male(P) <=> ~female(P).
  285.  
  286. % human(P) => (female(P) v male(P)).
  287. clif(if(human(P), (female(P) v male(P)))).
  288.  
  289.  
  290.  
  291. ((parent(X,Y) & female(X)) <=> mother(X,Y)).
  292.  
  293. :- clif_must(((parent(X,Y) & female(X)) <=> mother(X,Y))).
  294. :- clif_must(((parent(X,Y) & female(X)) => mother(X,Y))).
  295. :- clif_must((mother(X,Y)=>(parent(X,Y) & female(X)))).
  296. :- clif_must((parent(A,B):-mother(A,B))).
  297. :- clif_must(not(mother(A,B)):-not(parent(A,B))).
  298.  
  299. ((parent(X,Y) & female(X)) => mother(X,Y)).
  300. ((mother(X,Y) => parent(X,Y) & female(X))).
  301.  
  302. :- clif_must((parent(A,B):-mother(A,B))).
  303.  
  304.  
  305.  
  306.  
  307. parent(X,Y),parent(Y,Z) => grandparent(X,Z).
  308. grandparent(X,Y),male(X) <=> grandfather(X,Y).
  309. grandparent(X,Y),female(X) <=> grandmother(X,Y).
  310. mother(Ma,Kid),parent(Kid,GrandKid)
  311.       =>grandmother(Ma,GrandKid).
  312. grandparent(X,Y),female(X) <=> grandmother(X,Y).
  313. parent(X,Y),male(X) <=> father(X,Y).
  314. (parent(Ma,X),parent(Ma,Y),different(X,Y) =>siblings(X,Y)).
  315. parent(P1,P2) => ancestor(P1,P2).
  316. (parent(P1,P2), ancestor(P2,P3)) => ancestor(P1,P3).
  317. (ancestor(P1,P2), ancestor(P2,P3)) => ancestor(P1,P3).
  318.  
  319.  
  320. mother(eileen,douglas).
  321.  
  322.  
  323. human(trudy).
  324.  
  325. clif(forall(p,exists([m,f], if(human(P), (mother(m,p) & father(f,p)))))).
  326.  
  327. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  328. %  % /opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/
  329. logicmoo_i_clif.pl:309
  330. %  kif :-
  331. %          all(M,
  332. %              all(F, all(P, exists([M, F], (human(P)=>mother(M,
  333. P)&father(F, P)))))).
  334. %  %
  335. %  % /opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/
  336. logicmoo_i_clif.pl:309
  337. %  pkif :-
  338. %          all(M,
  339. %              all(F,
  340. %                  all(P,
  341. %                      exists(M, exists(F, (human(P)=>mother(M,
  342. P)&father(F, P))))))).
  343. %  %
  344. %  % /opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/
  345. logicmoo_i_clif.pl:309
  346. %  cnf :-
  347. %          (not(skolem(M, skArg1ofMotherFn(P)))v (not(skolem(F,
  348. skArg1ofFatherFn(P)))v (not(human(P))v mother(M, P))))& (not(skolem(M,
  349. skArg1ofMotherFn(P)))v (not(skolem(F, skArg1ofFatherFn(P)))v
  350. (not(human(P))v father(F, P)))).
  351. %  %
  352. %  % /opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/
  353. logicmoo_i_clif.pl:309
  354. %  horn :-
  355. %
  356. %          [ (not(human(P)):-skolem(M, skArg1ofMotherFn(P)), skolem(F,
  357. skArg1ofFatherFn(P)), not(father(F, P))),
  358. %            (not(human(P)):-skolem(M, skArg1ofMotherFn(P)), skolem(F,
  359. skArg1ofFatherFn(P)), not(mother(M, P))),
  360. %            (not(skolem(F, skArg1ofFatherFn(P))):-skolem(M,
  361. skArg1ofMotherFn(P)), human(P), not(father(F, P))),
  362. %            (not(skolem(F, skArg1ofFatherFn(P))):-skolem(M,
  363. skArg1ofMotherFn(P)), human(P), not(mother(M, P))),
  364. %            (not(skolem(M, skArg1ofMotherFn(P))):-skolem(F,
  365. skArg1ofFatherFn(P)), human(P), not(father(F, P))),
  366. %            (not(skolem(M, skArg1ofMotherFn(P))):-skolem(F,
  367. skArg1ofFatherFn(P)), human(P), not(mother(M, P))),
  368. %            (father(F, P):-skolem(M, skArg1ofMotherFn(P)), skolem(F,
  369. skArg1ofFatherFn(P)), human(P)),
  370. %            (mother(M, P):-skolem(M, skArg1ofMotherFn(P)), skolem(F,
  371. skArg1ofFatherFn(P)), human(P))
  372. %          ].
  373. %  %
  374. %  % /opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/
  375. logicmoo_i_clif.pl:309
  376. %  pfc :-
  377. %
  378. %          [ (neg(human(P))<-neg(father(F, P)), {vg(s(P))}),
  379. %            (neg(human(P))<-neg(mother(M, P)), {vg(s(P))}),
  380. %            true,
  381. %            true,
  382. %            true,
  383. %            true,
  384. %            (if_missing(father(F, P), father(skArg1ofFatherFn(P),
  385. P))<={ignore(M=skArg1ofMotherFn(P))}, human(P), {vg(s(P))}),
  386. %            (if_missing(mother(M, P), mother(skArg1ofMotherFn(P),
  387. P))<={ignore(F=skArg1ofFatherFn(P))}, human(P), {vg(s(P))})
  388. %          ].
  389. %  %
  390. %  % /opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/
  391. logicmoo_i_clif.pl:309
  392. %  %                succeed(user:must(repropagate(arity(if_missing, _)))).
  393. %  %
  394. %
  395. %  % Removing (pfc_rem1(neg(arity(if_missing,2)), (u,u)))
  396. neg(arity(if_missing,2)).
  397. %
  398. %  % /opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/
  399. logicmoo_i_clif.pl:309
  400. %  %     succeed(user:must(repropagate(arity(if_missing, _)))).
  401. %  %
  402. %  % /opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/
  403. logicmoo_i_clif.pl:309
  404. %  %      succeed(user:must(repropagate(argIsa(if_missing, 2,
  405. ftPercent)))).
  406. %  %
  407. %  % /opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/plarkc/
  408. logicmoo_i_clif.pl:309
  409. %  %       succeed(user:must(repropagate(argIsa(if_missing, 2, ftInt)))).
  410. %  %
  411.  
  412.  
  413.  
  414. :-show_call(must(father(_,trudy))).
  415. mother(trudy,eileen).
  416. ((human(P1),ancestor(P1,P2))=>human(P2)).
  417. :- listing([ancestor,human,parent]).
  418. %:- wdmsg("press Ctrl-D to resume.").
  419. %:- prolog.
  420.  
  421. :-clif_must(grandmother(trudy,douglas)).
  422.  
  423. mother(trudy,robby).
  424. mother(trudy,liana).
  425. mother(liana,matt).
  426. mother(liana,liz).
  427. mother(trudy,pam).
  428.  
  429.  
  430. % this fact sets off the anscesteral rule that her decendants are humans to
  431. % human(trudy).
  432.  
  433. % therefore
  434. :-clif_must(human(douglas)).
  435.  
  436. % :- pfc_why(human(douglas)),!.
  437. % Justifications for human(douglas):
  438. %  1.1 ancestor(eileen,douglas)
  439. %  1.2 human(eileen)
  440. %  1.3
  441. human(_G97841)<=human(eileen),ancestor(eileen,_G97841),{vg(s(_G97841))}
  442. %  2.1 ancestor(trudy,douglas)
  443. %  2.2 human(trudy)
  444. %  2.3
  445. human(_G97802)<=human(trudy),ancestor(trudy,_G97802),{vg(s(_G97802))}
  446. %  3.1 ancestor(trudy,douglas)
  447. %  3.2 human(trudy)
  448. %  3.3
  449. human(douglas)<=human(trudy),ancestor(trudy,douglas),{vg(s(douglas))}
  450. %  4.1 ancestor(eileen,douglas)
  451. %  4.2 human(eileen)
  452. %  4.3
  453. human(douglas)<=human(eileen),ancestor(eileen,douglas),{vg(s(douglas))}
  454.  
  455.  
  456. %:- wdmsg("press Ctrl-D to resume.").
  457. %:-prolog.
  458.  
  459. :- style_check(-singleton).
  460.  
  461.  
  462. % so far no males "asserted" in the KB
  463. :-doall(show_call(male(Who ))).
  464. /*
  465. OUTPUT WAS..
  466. male(skArg1ofFatherFn(pam)).
  467. male(skArg1ofFatherFn(liz)).
  468. male(skArg1ofFatherFn(matt)).
  469. male(skArg1ofFatherFn(liana)).
  470. male(skArg1ofFatherFn(robby)).
  471. male(skArg1ofFatherFn(eileen)).
  472. male(skArg1ofFatherFn(douglas)).
  473. male(skArg1ofFatherFn(trudy)).
  474. */
  475.  
  476. % we can report the presence on non male though...
  477. %    the ~/1 is our negation hook into the inference engine
  478. :-doall(show_call(~male(Who ))).
  479. % we expect to see at least there mothers here
  480. %  succeed(user: ~male(liana)).
  481. %  succeed(user: ~male(trudy)).
  482. %            succeed(user: ~male(skArg1ofMotherFn(trudy))).
  483. %  succeed(user: ~male(eileen)).
  484.  
  485. % thus ~/1 is tnot/1 of XSB ?!?
  486.  
  487. % there ar explicly non females
  488. :-doall(show_call(~ female(Who ))).
  489.  
  490. % ensure skolems are made or destroyed
  491.  
  492. father(robert,eileen).
  493. siblings(douglas,cassiopea).
  494. father(douglas,sophiaWebb).
  495. father(douglas,skylar).
  496. father(douglas,sophiaWisdom).
  497. father(douglas,zaltana).
  498.  
  499. :-doall(show_call(mother(Female,Who))).
  500. %  succeed(user:mother(eileen, douglas)).
  501. %  succeed(user:mother(liana, liz)).
  502. %  succeed(user:mother(liana, matt)).
  503. %  succeed(user:mother(skArg1ofMotherFn(skylar), skylar)).
  504. %  succeed(user:mother(skArg1ofMotherFn(sophiaWebb), sophiaWebb)).
  505. %  succeed(user:mother(skArg1ofMotherFn(sophiaWisdom), sophiaWisdom)).
  506. %  succeed(user:mother(skArg1ofMotherFn(trudy), trudy)).
  507. %  succeed(user:mother(skArg1ofMotherFn(zaltana), zaltana)).
  508. %  succeed(user:mother(trudy, eileen)).
  509. %  succeed(user:mother(trudy, liana)).
  510. %  succeed(user:mother(trudy, pam)).
  511. %  succeed(user:mother(trudy, robby)).
  512.  
  513.  
  514. :-doall(show_call(father(Female,Who))).
  515. %  succeed(user:father(douglas, skylar)).
  516. %  succeed(user:father(douglas, sophiaWebb)).
  517. %  succeed(user:father(douglas, sophiaWisdom)).
  518. %  succeed(user:father(douglas, zaltana)).
  519. %  succeed(user:father(robert, eileen)).
  520. %  succeed(user:father(skArg1ofFatherFn(douglas), douglas)).
  521. %  succeed(user:father(skArg1ofFatherFn(eileen), eileen)).
  522. %  succeed(user:father(skArg1ofFatherFn(liana), liana)).
  523. %  succeed(user:father(skArg1ofFatherFn(liz), liz)).
  524. %  succeed(user:father(skArg1ofFatherFn(matt), matt)).
  525. %  succeed(user:father(skArg1ofFatherFn(pam), pam)).
  526. %  succeed(user:father(skArg1ofFatherFn(robby), robby)).
  527. %  succeed(user:father(skArg1ofFatherFn(trudy), trudy)).
  528.  
  529.  
  530. :-doall(show_call(male(Who))).
  531. %  succeed(user:male(douglas)).
  532. %  succeed(user:male(robert)).
  533. %  succeed(user:male(skArg1ofFatherFn(douglas))).
  534. %  succeed(user:male(skArg1ofFatherFn(eileen))).
  535. %  succeed(user:male(skArg1ofFatherFn(liana))).
  536. %  succeed(user:male(skArg1ofFatherFn(liz))).
  537. %  succeed(user:male(skArg1ofFatherFn(matt))).
  538. %  succeed(user:male(skArg1ofFatherFn(pam))).
  539. %  succeed(user:male(skArg1ofFatherFn(robby))).
  540. %  succeed(user:male(skArg1ofFatherFn(trudy))).
  541.  
  542. :-doall(show_call(female(Who))).
  543. %  succeed(user:female(eileen)).
  544. %  succeed(user:female(liana)).
  545. %  succeed(user:female(skArg1ofMotherFn(skylar))).
  546. %  succeed(user:female(skArg1ofMotherFn(sophiaWebb))).
  547. %  succeed(user:female(skArg1ofMotherFn(sophiaWisdom))).
  548. %  succeed(user:female(skArg1ofMotherFn(trudy))).
  549. %  succeed(user:female(skArg1ofMotherFn(zaltana))).
  550. %  succeed(user:female(trudy)).
  551.  
  552. :-doall(show_call(siblings(Who,AndWho))).
  553. %  succeed(user:siblings(douglas, cassiopea)).
  554. %  succeed(user:siblings(eileen, liana)).
  555. %  succeed(user:siblings(eileen, pam)).
  556. %  succeed(user:siblings(eileen, robby)).
  557. %  succeed(user:siblings(liana, eileen)).
  558. %  succeed(user:siblings(liana, pam)).
  559. %  succeed(user:siblings(liana, robby)).
  560. %  succeed(user:siblings(liz, matt)).
  561. %  succeed(user:siblings(matt, liz)).
  562. %  succeed(user:siblings(pam, eileen)).
  563. %  succeed(user:siblings(pam, liana)).
  564. %  succeed(user:siblings(pam, robby)).
  565. %  succeed(user:siblings(robby, eileen)).
  566. %  succeed(user:siblings(robby, liana)).
  567. %  succeed(user:siblings(robby, pam)).
  568. %  succeed(user:siblings(skylar, sophiaWebb)).
  569. %  succeed(user:siblings(skylar, sophiaWisdom)).
  570. %  succeed(user:siblings(skylar, zaltana)).
  571. %  succeed(user:siblings(sophiaWebb, skylar)).
  572. %  succeed(user:siblings(sophiaWebb, sophiaWisdom)).
  573. %  succeed(user:siblings(sophiaWebb, zaltana)).
  574. %  succeed(user:siblings(sophiaWisdom, skylar)).
  575. %  succeed(user:siblings(sophiaWisdom, sophiaWebb)).
  576. %  succeed(user:siblings(sophiaWisdom, zaltana)).
  577. %  succeed(user:siblings(zaltana, skylar)).
  578. %  succeed(user:siblings(zaltana, sophiaWebb)).
  579. %  succeed(user:siblings(zaltana, sophiaWisdom)).
  580.  
  581.  
  582. % unaliasing
  583. :- op_alias( (<=>),  <=>).
  584. :- op_alias(  (=>),   =>).
  585.  
  586.  
  587. % break to the debugger
  588. %:- wdmsg("press Ctrl-D to resume.").
  589. %:- break.
  590.  
  591. :- endif.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement