DeAL TutorialStratification

Stratification (.deal)

We cannot use negation in a recursive definition. We say that such a program is non-stratified.

Example: A non-stratified program

even(0).
even(Y) <- ~even(X), Y = X + 1.

The correct way to specify this program is:

int(1).
int(Y) <- int(X), Y = X + 1, X < 99.
odd(X) <- int(X), X mod 2 ~= 0.
even(X) <- int(X), ~odd(X).

Now the negation is out of the recursion.


Last Updated 2014