0
我試圖讓Aleph工作,並誘發一個簡單的理論:祖父母(X,Z): - 父親(X,Y),父親(Y,Z)。然而,我回到原子(例如祖父母(約翰,約翰朱尼爾朱尼爾))。希望有人能幫助。請注意,SWI的Aleph使用單個文件作爲輸入。 乾杯/ JC沒有得到一個關於SWI的Aleph理論Prolog
我的程序:
:- use_module(library(aleph)).
:- aleph.
:- modeh(*,grandparent(+person,-person)).
:- modeb(*,father(+person,-person)).
:-begin_bg.
person(john).
person(johnJunior).
person(johnJuniorJunior).
person(jack).
person(jackJunior).
person(jackJuniorJunior).
father(johnJunior, john).
father(johnJuniorJunior, johnJunior).
father(jackJunior, jack).
father(jackJuniorJunior, jackJunior).
:-determination(grandparent/2,father/2).
:-end_bg.
:-begin_in_pos.
grandparent(john, johnJuniorJunior).
grandparent(jack, jackJuniorJunior).
:-end_in_pos.
:-begin_in_neg.
grandparent(jack, john).
:-end_in_neg.
:-aleph_read_all.
我的輸出:
[theory]
[Rule 1] [Pos cover = 1 Neg cover = 0]
grandparent(john,johnJuniorJunior).
[Rule 2] [Pos cover = 1 Neg cover = 0]
grandparent(jack,jackJuniorJunior).
[time taken] [0.0]
[total clauses constructed] [2]
true.