【问题标题】:How to get more complex theory in Aleph with SWI-Prolog?如何使用 SWI-Prolog 在 Aleph 中获得更复杂的理论?
【发布时间】:2020-07-10 20:58:13
【问题描述】:

我厌倦了用 Aleph 来获得一个理论,但我只有一个头和一个身体,实际上我想要更多的身体。

我的输入文件是:

:- use_module(library(aleph)).
:- if(current_predicate(use_rendering/1)).
:- use_rendering(prolog).
:- endif.
:- aleph.
:- modeh(*,attr2col(+attribute)).
:- modeb(*,type(+attribute,-class)).
:- modeb(*,attrs(+class,+attribute)).

:-determination(attr2col/1, type/2).
:-determination(attr2col/1, attrs/2).


:-begin_bg.
class(clerk).
class(manager).
attribute(boss).
attribute(notype).
attribute(noattrs).
attrs(manager,boss).
attrs(manager,notype).
type(notype,manager).
type(boss,manager).
:-end_bg.

:-begin_in_pos.
attr2col(boss).
attr2col(notype).
:-end_in_pos.

:-begin_in_neg.
attr2col(clerk).
attr2col(manager).
:-end_in_neg.

:-aleph_read_all.

我的输出是:

attr2col(A) :-
   type(A,B).

我想要的是:

attr2col(A) :- attribute(A), attrs(B,A), type(A,C).

现在只有一具尸体,但我想要三具。 而且有'attribute(A)'作为一个body,怎么能只用一个变量来添加这样的东西呢?

【问题讨论】:

    标签: prolog logic swi-prolog induction aleph-ilp


    【解决方案1】:

    您可以尝试以下几种方法:

    1. 为您的谓词 attribute 添加模式声明和确定。

    2. 在模式声明中尝试不同的 + 和 - 组合

    3. 检查所需子句正文中的所有文字是否确实需要正确预测结果。

    干杯/JCR

    【讨论】:

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