Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SWI Prolog ignores discontiguous predicate

Tags:

prolog

I'm struggling to understand how to properly use the discontiguous/1 predicate in (SWI) Prolog.

Let buumi.pl be this little file of pseudo-facts:

discontiguous(buumi/1).

buumi(eins).
buri(zwei).
buumi(drei).

Running swipl -s Buumi.pl however still gives this warning:

% swipl -s Buumi.prolog
Warning: [...]/Buumi.prolog:5:
        Clauses of buumi/1 are not together in the source-file

The documentation is quite vague and simply states

discontiguous :PredicateIndicator, ...

but gives no concrete example on how to use it. I've found some examples that suggest that I'm using it correctly; at the very least, swipl doesn't complain, but then again, it doesn't honour my request either. What am I doing wrong here?

like image 579
Vucar Timnärakrul Avatar asked Feb 19 '14 20:02

Vucar Timnärakrul


1 Answers

discontiguous/1 is an ISO directive. You have to put it as

:- discontiguous(pred/2).

at the beginning of the Prolog text.

like image 67
false Avatar answered Oct 19 '22 18:10

false