Algorithm Search⌘K

Definitionadvanced

Well-founded semantics

Also called Van Gelder-Ross-Schlipf semantics, WFS.

The well-founded semantics gives every normal program one three-valued model. Atoms are true when forced by the rules, false when only unfounded support exists, and undefined otherwise.

The well-founded semantics assigns to every normal logic program a single three-valued model, the well-founded model. An atom is true if the rules force it, false if every way to derive it depends on atoms that are false or on itself, and undefined if neither holds. Van Gelder, Ross and Schlipf (1991) defined it with unfounded sets. It extends the standard model of stratified programs to all programs, and it is more cautious than the stable model semantics: it never picks between alternatives. This page gives the definition and its properties. The two ways to compute it are on their own pages: the bottom-up alternating fixpoint and the goal-directed SLG resolution.

Definition

Let PP be a ground normal program over the atoms AA. A partial interpretation is a pair (T,F)(T, F) of disjoint sets of atoms, the true and the false ones; the other atoms are undefined. A positive literal bb is true in (T,F)(T, F) if b∈Tb \in T and false if b∈Fb \in F; a literal not c\mathit{not}\ c is true if c∈Fc \in F and false if c∈Tc \in T. Pairs are ordered by (T,F)≤(T′,F′)(T, F) \le (T', F') if T⊆T′T \subseteq T' and F⊆F′F \subseteq F'.

A set X⊆AX \subseteq A is unfounded with respect to (T,F)(T, F) if each rule with its head in XX has

  1. a body literal that is false in (T,F)(T, F), or
  2. a positive body atom in XX.

The union of unfounded sets is unfounded, so there is a greatest unfounded set UP(T,F)U_P(T, F). Let TP(T,F)T_P(T, F) be the set of heads of the rules whose body is true in (T,F)(T, F). The operator

WP(T,F)=(TP(T,F), UP(T,F))W_P(T, F) = \big(T_P(T, F),\ U_P(T, F)\big)

is monotone, and the well-founded model is its least fixed point, reached by iterating from (∅,∅)(\emptyset, \emptyset). The model is total if every atom is true or false. For programs with variables, PP is the ground instance and the iteration can be transfinite.

Van Gelder (1993) gave an equivalent form with the reduct. Let Γ(M)=lm(PM)\Gamma(M) = \mathrm{lm}(P^M). Since Γ\Gamma is antimonotone, Γ2\Gamma^2 is monotone. If KK is the least fixed point of Γ2\Gamma^2 and U=Γ(K)U = \Gamma(K), then the true atoms are KK and the false atoms are A∖UA \setminus U.

Examples and non-examples

Take the program

a ← not b.     b ← not a.
c ← not c.
d ← not e.     e ← e.
f ← d, not c.
g ← a.

The iteration of WPW_P from (∅,∅)(\emptyset, \emptyset) is

step true false
0 ∅\emptyset ∅\emptyset
1 ∅\emptyset {e}\{e\}
2 {d}\{d\} {e}\{e\}
3 {d}\{d\} {e}\{e\}

In step 1, {e}\{e\} is unfounded because its only rule needs ee itself. In step 2, dd is true since not e\mathit{not}\ e is true. The atoms a,b,c,f,ga, b, c, f, g stay undefined: aa and bb block each other, cc blocks itself, and ff and gg depend on them. This program has no stable model, because of c←not cc \leftarrow \mathit{not}\ c, while its well-founded model exists and says something about dd and ee.

  • Stratified program. For p←not qp \leftarrow \mathit{not}\ q, the model is total: pp true, qq false. This is the standard model.
  • Positive loop. p←pp \leftarrow p makes pp false, since {p}\{p\} is unfounded. The completion allows pp to be true.
  • Win game. With win(x)←move(x,y),not win(y)\mathit{win}(x) \leftarrow \mathit{move}(x, y), \mathit{not}\ \mathit{win}(y), a position is true if it is won, false if it is lost, and undefined if the play can be drawn by moving around a cycle.
  • Not the intersection of stable models. For a←not ba \leftarrow \mathit{not}\ b, b←not ab \leftarrow \mathit{not}\ a, c←ac \leftarrow a, c←bc \leftarrow b, the atom cc is in both stable models but undefined in the well-founded model.
  • Stable models. Every atom true in the well-founded model is in every stable model, and every false atom is in none. If the well-founded model is total, it is the unique stable model (Van Gelder, Ross and Schlipf 1991). The converse fails: {p←not p, p←not q, q←not p}\{p \leftarrow \mathit{not}\ p,\ p \leftarrow \mathit{not}\ q,\ q \leftarrow \mathit{not}\ p\} has the unique stable model {p}\{p\}, but in its well-founded model pp and qq are undefined.
  • Three-valued stable models. Przymusinski showed that the well-founded model is the least three-valued stable model, which links the two semantics in one framework.
  • Complexity. The well-founded model of a finite ground program can be computed in polynomial time, in O(n⋅s)O(n \cdot s) steps for nn atoms and program size ss by the alternating fixpoint. For Datalog with negation under this semantics, the data complexity is P-complete, by a reduction from the circuit value problem.
  • Systems. XSB Prolog computes the well-founded model goal by goal with SLG resolution, and answer set solvers use it to simplify a program before search.

References

  1. 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 definitions of unfounded sets, the greatest unfounded set and the operator W_P, and the relation to stratified programs and stable models
  2. Allen Van Gelder, The alternating fixpoint of logic programs with negation, Journal of Computer and System Sciences 47(1), 185 to 221 (1993), the characterization of the well-founded model by the alternating fixpoint
  3. Weidong Chen and David S. Warren, Tabled evaluation with delaying for general logic programs, Journal of the ACM 43(1), 20 to 74 (1996), the goal-directed computation of the well-founded model by SLG resolution
  4. Krzysztof R. Apt and Roland N. Bol, Logic programming and negation: a survey, Journal of Logic Programming 19/20, 9 to 71 (1994), the section on the well-founded semantics
  5. Evgeny Dantsin, Thomas Eiter, Georg Gottlob and Andrei Voronkov, Complexity and expressive power of logic programming, ACM Computing Surveys 33(3), 374 to 425 (2001), the complexity results for the well-founded semantics

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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/9NTS8A/text.yaml