Advertisement
Guest User

Untitled

a guest
Feb 11th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.77 KB | None | 0 0
  1. child(zdravko, nikola).
  2. child(zdravko, filip).
  3. child(aleksandra, nikola).
  4. child(aleksandra, filip).
  5. parents(X, Y) :-
  6.     child(Y, X).
  7. children(X, Y, C) :-
  8.     child(X, C),
  9.     child(Y, C).
  10. siblings(X, Y) :-
  11.     parents(X, P1),
  12.     parents(Y, P2),
  13.     P1 == P2,
  14.     X @> Y.
  15.    
  16. /*
  17. teacher(hamna, intro_to_ai).
  18. teacher(nikita, intro_to_ai).
  19. teacher(dr_succi, networks).
  20. teacher(nikita, networks).
  21. likes(nikita, cofee).
  22. likes(dr_succi, cofee).
  23. likes(hamna, tea).
  24. drives(dr_succi, car).
  25. drives(hamna, car).
  26. drives(nikita, bicycle).
  27. pair(TA1, TA2) :-
  28.     teacher(TA1, Course),
  29.     teacher(TA2, Course),
  30.     TA1 @> TA2.
  31. pair(TA1, TA2) :-
  32.     likes(TA1, X),
  33.     likes(TA2, X),
  34.     TA1 @> TA2.
  35. pair(TA1, TA2) :-
  36.     drives(TA1, X),
  37.     drives(TA2, X),
  38.     TA1 @> TA2.
  39. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement