Stratifiability
-
A predicate
Pdepends on a predicate Q if some atom A in a rule of P refers to Q.If that atom is negated,
Pnegatively depends on Q, otherwise it positively depends on Q. -
A stratification assigns a natural number LP (the level of P) to every predicate P such that
- No P depends on a Q at a higher level, i.e., LP < LQ
- No P negatively depends on a Q at the same level, i.e., LP = LQ
If a program has (at least) one stratification (“stratifiable”), it has a least fixed point.
-
Datamog checks whether there is a stratification:
- If there is, it applies naive evaluation to each group of predicates with the same level, starting from the lowest
- If there is not, the program is rejected