SWI Prolog忽略了不连续的谓词

Vuc*_*rul 4 prolog

我很难理解如何discontiguous/1在(SWI)Prolog中正确使用谓词.

buumi.pl这个伪事实的小文件:

discontiguous(buumi/1).

buumi(eins).
buri(zwei).
buumi(drei).
Run Code Online (Sandbox Code Playgroud)

swipl -s Buumi.pl然而,跑步仍会发出此警告:

% swipl -s Buumi.prolog
Warning: [...]/Buumi.prolog:5:
        Clauses of buumi/1 are not together in the source-file
Run Code Online (Sandbox Code Playgroud)

文档非常含糊,只是陈述

discontiguous :PredicateIndicator, ...

但没有给出如何使用它的具体例子.我发现了一些例子表明我正确使用它; 至少,swipl并没有抱怨,但是再一次,它也不尊重我的要求.我在这做错了什么?

fal*_*lse 8

discontiguous/1是ISO指令.你必须把它作为

:- discontiguous(pred/2).
Run Code Online (Sandbox Code Playgroud)

在Prolog文本的开头.

  • 谢谢。为什么 SWI PRolog 手册不能只是说这让我感到困惑 (3认同)