Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Module loading
- :- use_module(library(aleph)).
- % Aleph initialization
- :- if(current_predicate(use_rendering/1)).
- :- use_rendering(prolog).
- :- endif.
- :- aleph.
- % Mode declarations
- % mode(RecallNumber,PredicateMode).
- % - output
- :- modeh(*,grandparent(+person,-person)).
- :- modeb(*,father(+person,-person)).
- :-determination(grandparent/2,father/2).
- :-begin_bg.
- person(john).
- person(dad(john)).
- person(dad(dad(john))).
- person(jack).
- person(dad(jack)).
- person(dad(dad(jack))).
- father(dad(john), john).
- father(dad(dad(john)), dad(john)).
- father(dad(jack), jack).
- father(dad(dad(jack)), dad(jack)).
- father(dad(X),X):-
- person(X).
- :-dynamic grandparent/2.
- :-end_bg.
- :-begin_in_pos.
- grandparent(john, dad(dad(john))).
- grandparent(jack, dad(dad(jack))).
- :-end_in_pos.
- :-begin_in_neg.
- grandparent(jack, dad(jack)).
- grandparent(jack, john).
- :-end_in_neg.
- :-aleph_read_all.
- [theory]
- [Rule 1] [Pos cover = 1 Neg cover = 0]
- grandparent(john,dad(dad(john))).
- [Rule 2] [Pos cover = 1 Neg cover = 0]
- grandparent(jack,dad(dad(jack))).
- [time taken] [0.0]
- [total clauses constructed] [2]
- true.
Add Comment
Please, Sign In to add comment