Advertisement
madmaxhasan

Untitled

May 20th, 2019
3,094
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/I 0.83 KB | None | 0 0
  1. male(jahir).
  2. male(joual).
  3. male(joy).
  4. male(roni).
  5. male(zayan).
  6. female(rahela).
  7. female(ruma).
  8. female(monni).
  9. female(faiza).
  10. female(kashpia).
  11. female(takia).
  12.  
  13. parent(jahir, joual).
  14. parent(jahir, joy).
  15. parent(jahir, monni).
  16. parent(rahela, joual).
  17. parent(rahela, joy).
  18. parent(rahela, monni).
  19. parent(roni, kashpia).
  20. parent(roni, takia).
  21. parent(monni, kashpia).
  22. parent(monni, takia).
  23. parent(ruma, faiza).
  24. parent(ruma, zayan).
  25. parent(joual, faiza).
  26. parent(joual, zayan).
  27.  
  28. father_of(X, Y) :- parent(X, Y), male(X).
  29. mother_of(X, Y) :- parent(X, Y), female(X).
  30. brother_of(X, Y) :- father_of(A, X), father_of(A, Y), male(X), X \= Y.
  31. sister_of(X, Y) :- father_of(A, X), father_of(A, Y), female(X), X \= Y.
  32. grandfather_of(X, Y) :- parent(X, Z), parent(Z, Y), male(X).
  33. grandmother_of(X, Y) :- parent(X, Z), parent(Z, Y), female(X).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement