Definitioncore
Stratified logic program
Also called stratified negation.
A logic program is stratified when no predicate depends on its own negation. Such a program has one standard model, computed layer by layer, and every major semantics agrees on it.
A stratified logic program is a normal program whose predicates can be put in layers so that each predicate depends positively on predicates of its own or lower layers and negatively only on predicates of strictly lower layers. Apt, Blair and Walker (1988) showed that such a program has one natural model, the standard (or perfect) model, which does not depend on the choice of layers. The evaluation of stratified Datalog in databases, stratum by stratum with semi-naive evaluation, is on the Datalog pages. This page gives the definition for general logic programs and its place among the semantics of negation as failure: it is the class on which they all agree.
Definition
The dependency graph of a program has a vertex for each predicate and an edge from to for each rule with head predicate and in its body. The edge is positive if occurs in a positive literal and negative if it occurs under ; an edge can be both.
A stratification of is a map from the predicates to the natural numbers such that, for each rule with head predicate ,
- for each predicate in a positive body literal, and
- for each predicate in a negative body literal.
is stratified if it has a stratification. Equivalently, no cycle of the dependency graph contains a negative edge, which can be tested in linear time by computing the strongly connected components and checking that no negative edge joins two vertices of the same component.
Let be the rules whose head predicate has stratum . The standard model is and the least set that contains and is closed under the rules of , with each read as . This reading is fixed while is evaluated, because lies in a lower stratum. For a finite number of strata the last is the standard model.
A program is locally stratified (Przymusinski) if the same condition holds for its ground instance, with ground atoms in place of predicates and an ordinal-valued .
Examples and non-examples
-
Stratified. Reachability in a graph and its complement:
reach(X, Y) ← edge(X, Y). reach(X, Y) ← edge(X, Z), reach(Z, Y). unreach(X, Y) ← node(X), node(Y), not reach(X, Y).The strata are at 0, at 0 or 1, and above . The recursion through is positive.
-
Stratified. with and . The standard model is .
-
Not stratified. : the cycle has negative edges. It has two stable models.
-
Not stratified. : a negative self loop.
-
Locally stratified, not stratified. , . The predicate depends negatively on itself, but each ground atom depends only on .
-
Not locally stratified. The game on a graph with a cycle: the ground atoms on the cycle depend negatively on each other. The well-founded semantics leaves them undefined.
Related definitions
- Agreement of the semantics. For a stratified program, the standard model is the unique stable model (Gelfond and Lifschitz 1988) and the well-founded model, which is then total (Van Gelder, Ross and Schlipf 1991). It is also a model of the completion, but the completion can have other models, as shows.
- Positive and definite programs. A program without negation is stratified with one stratum, and its standard model is the least model.
- Splitting. The strata form a chain of splitting sets, so the splitting set theorem reduces the stable models of a stratified program to one least model per layer.
- Stratified Datalog. Restricted to function-free programs with a finite database, this is the stratified negation of Datalog, evaluated in the order of a topological sort of the components.
References
- Krzysztof R. Apt, Howard A. Blair and Adrian Walker, Towards a theory of declarative knowledge, in Jack Minker (ed.), Foundations of Deductive Databases and Logic Programming, Morgan Kaufmann, 89 to 148 (1988), the definition of stratification and the standard model, and its independence of the stratification
- Michael Gelfond and Vladimir Lifschitz, The stable model semantics for logic programming, in Robert A. Kowalski and Kenneth A. Bowen (eds.), Logic Programming: Proceedings of the Fifth International Conference and Symposium, MIT Press, 1070 to 1080 (1988), the result that a stratified program has exactly one stable model, its standard model
- Allen Van Gelder, Kenneth A. Ross and John S. Schlipf, The well-founded semantics for general logic programs, Journal of the ACM 38(3), 620 to 650 (1991), the result that the well-founded model of a stratified program is total and equals its standard model
- Krzysztof R. Apt and Roland N. Bol, Logic programming and negation: a survey, Journal of Logic Programming 19/20, 9 to 71 (1994), the sections on stratified and locally stratified programs
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 95QH65 Edit this page History Report an error Markdown