Guest User

Untitled

a guest
Jun 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. % Module loading
  2. :- use_module(library(aleph)).
  3.  
  4. % Aleph initialization
  5.  
  6. :- if(current_predicate(use_rendering/1)).
  7. :- use_rendering(prolog).
  8. :- endif.
  9. :- aleph.
  10.  
  11. % Mode declarations
  12. % mode(RecallNumber,PredicateMode).
  13. % - output
  14. :- modeh(*,grandparent(+person,-person)).
  15. :- modeb(*,father(+person,-person)).
  16. :-determination(grandparent/2,father/2).
  17.  
  18. :-begin_bg.
  19. person(john).
  20. person(dad(john)).
  21. person(dad(dad(john))).
  22. person(jack).
  23. person(dad(jack)).
  24. person(dad(dad(jack))).
  25. father(dad(john), john).
  26. father(dad(dad(john)), dad(john)).
  27. father(dad(jack), jack).
  28. father(dad(dad(jack)), dad(jack)).
  29. father(dad(X),X):-
  30. person(X).
  31.  
  32.  
  33. :-dynamic grandparent/2.
  34. :-end_bg.
  35.  
  36. :-begin_in_pos.
  37. grandparent(john, dad(dad(john))).
  38. grandparent(jack, dad(dad(jack))).
  39. :-end_in_pos.
  40.  
  41. :-begin_in_neg.
  42. grandparent(jack, dad(jack)).
  43. grandparent(jack, john).
  44. :-end_in_neg.
  45.  
  46. :-aleph_read_all.
  47.  
  48. [theory]
  49.  
  50. [Rule 1] [Pos cover = 1 Neg cover = 0]
  51. grandparent(john,dad(dad(john))).
  52.  
  53. [Rule 2] [Pos cover = 1 Neg cover = 0]
  54. grandparent(jack,dad(dad(jack))).
  55.  
  56. [time taken] [0.0]
  57. [total clauses constructed] [2]
  58. true.
Add Comment
Please, Sign In to add comment