0

我想使用 Aleph 来获得 SWI-Prolog 的理论。我的操作系统是 MacOS 10.15。

这是我的输入文件:

% Aleph initialization
    :- aleph.

% Mode declarations
% mode(RecallNumber,PredicateMode).
% - output
:- 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).
:-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.

我的步骤是:

?- use_module(library(aleph)).
true.

?- consult(['/Users/scfang6/Desktop/test1.pl']).
true.

我怎样才能得到输出理论?

4

0 回答 0