我正在尝试使用Swi-prolog工作Aleph。当我运行我的程序时,我在这里得到了错误。我该怎么做才能导入库(aleph)?顺便说一句,我已经为我的程序下载了Aleph.pl. 这是我的测试程序,我知道库aleph肯定有问题。
:- use_module(library(aleph)).
:- aleph.
我收到了错误:
ERROR: c:/users/mac/desktop/swi-prolog/aleph draft/1.pl:1:
source_sink `library(aleph)' does not exist
警告:c:/ users / mac / desktop / swi-prolog / aleph draft / 1.pl:1: 目标(指令)失败:用户:use_module(library(aleph)) 错误:c:/ users / mac / desktop / swi-prolog / aleph draft / 1.pl:2: catch / 3:未定义的程序:aleph / 0 警告:c:/ users / mac / desktop / swi-prolog / aleph draft / 1.pl:2: 目标(指令)失败:用户:aleph 欢迎来到SWI-Prolog(线程,32位,版本7.6.4) SWI-Prolog绝对不提供任何保修。这是免费软件。 请运行? - 许可证。有关法律细节。
有关在线帮助和背景信息,请访问http://www.swi-prolog.org 对于内置帮助,请使用? - help(主题)。或? - apropos(Word)。
答案 0 :(得分:1)
您应该使用安装程序:
?- pack_install(aleph).
% Contacting server at http://www.swi-prolog.org/pack/query ... ok
Install aleph@5 from GIT at https://github.com/friguzzi/aleph.git Y/n?
% Cloning into '/home/carlo/lib/swipl/pack/aleph'...
% Contacting server at http://www.swi-prolog.org/pack/query ... ok
% "aleph.git" was downloaded 6 times
Package: aleph
Title: Aleph Inductive Logic Prorgramming system
Installed version: 5
Author: Fabrizio Riguzzi <fabrizio.riguzzi@unife.it>
Activate pack "aleph" Y/n?
true.
?- use_module(library(aleph)).
true.
答案 1 :(得分:0)
这是我尝试的示例,但我没有得到归纳理论。
% 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).
:-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.015625]
[total clauses constructed] [2]
true.
我想aleph systeme无法正常工作。