【问题标题】:Not getting a theory in Aleph for SWI Prolog没有在 Aleph 中获得 SWI Prolog 的理论
【发布时间】:2016-11-27 20:20:23
【问题描述】:

我试图让 Aleph 工作并得出一个简单的理论:祖父母(X,Z):-父亲(X,Y),父亲(Y,Z)。但是我得到了一个原子(例如祖父母(john,johnJuniorJunior))。希望有人可以提供帮助。请注意,SWI 的 Aleph 使用单个文件作为输入。 干杯/JC

我的程序:

:- 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.

【问题讨论】:

    标签: prolog swi-prolog aleph-ilp inductive-logic-programming


    【解决方案1】:

    变化

    :- modeh(*,grandparent(+person,-person)).
    :- modeb(*,father(+person,-person)).
    

    :- modeh(*,grandparent(+person,+person)).
    :- modeb(*,father(-person,-person)).
    

    解决了我的问题。谢谢法布里齐奥!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-12-18
      • 2016-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多