Theoremadvanced
Lin-Zhao loop formula theorem
Also called loop formulas.
The stable models of a finite normal program are exactly the models of its completion that satisfy one loop formula for each loop of the positive dependency graph.
The Lin-Zhao theorem gives a classical description of the stable models of any finite normal program. The Clark completion admits extra models in which atoms on a positive cycle support each other, and Fages' theorem says this is the only problem. Lin and Zhao (2004) found the formulas that remove exactly these extra models: one loop formula for each loop of the program. With them, a SAT solver can compute stable models of programs that are not tight, which their system ASSAT did, and the same formulas, as loop nogoods, are part of modern answer set solvers.
Statement
Let be a finite ground normal program over the atoms , with rules . The positive dependency graph has the vertices and an edge for each rule and each positive body atom .
- A loop is a nonempty set such that for all there is a path of length at least one from to in that stays inside . A single atom is a loop only if it has a self edge.
- The external support is the set of rules whose head is in and which have no positive body atom in .
- The loop formula of is
where and the empty disjunction is .
Theorem (Lin and Zhao 2004). A set is a stable model of if and only if is a model of and of for every loop of .
A loop formula says: if some atom of the loop is true, the loop must get support from outside itself.
In plain words
Two facts can hold each other up with nothing else under them: "the door is locked because the alarm is on, and the alarm is on because the door is locked". The plain reading of a program as "true when a rule applies" accepts such a pair. The stable model reading does not, because nothing starts the chain. The theorem finds every group of atoms that can lean on each other in this way, and adds one condition per group: if any member of the group is true, then some rule must make it true without using the group. With these extra conditions, the plain reading gives exactly the stable models, and a general solver for logic formulas can find them.
Proof
The theorem is from Lin and Zhao (2004). The short proof below goes through the least model of the reduct, , and uses Steps 1 and 2 of the proof of Fages' theorem: the models of are the supported models (), and every stable model is supported.
Stable implies the loop formulas. Let . It is a model of the completion by Step 2. Let be a loop with . Compute by forward chaining, adding one atom at a time, and let be the first atom of that is added. It is added by a rule of whose were added before , so they are in and not in . This rule comes from a rule of with no . So , its body is true in , and holds.
The loop formulas imply stable. Let be a model of and of all loop formulas. Then is supported, and as in Step 3 of Fages' proof. Suppose that is not empty. For each , take any rule with head and body true in ; one exists because is supported. If all positive atoms of were in , the rule of would put in . So has a positive body atom in . Hence every vertex of the subgraph of induced by has an edge inside . Take a strongly connected component of this subgraph that is a sink: no edge leaves to the rest of . Each vertex of has an edge inside , so inside , and is a loop. Since , gives a rule whose body is true in . Its head is in , so by the argument above it has a positive body atom , and because is external. The edge from the head to leaves inside , which contradicts the choice of . So and .
A check by hand. Take
p ← q. q ← p. p ← not r. r.
The completion is , , . Its models are and . The only loop is , with external support , so . It is false in and true in , which is the only stable model: the reduct by is , whose least model is .
Consequences
- ASSAT. Lin and Zhao compute stable models with a SAT solver: solve the clauses of the completion; if the model is not stable, the proof above finds a violated loop in in linear time with Tarjan's algorithm; add its loop formula and solve again. Each round removes , and the loop formulas are added only when they are needed.
- Fages' theorem. A tight program has no loops, so the theorem reduces to the completion alone.
- Conflict-driven solvers. In conflict-driven answer set solving, the solver clasp treats the completion as nogoods for unit propagation and adds loop nogoods when an unfounded set is found during the search (Gebser et al. 2012).
- Many loops. The number of loops can be exponential. If has the rules for all among atoms, every set of at least two atoms is a loop, which gives loops. Lifschitz and Razborov (2006) proved that this cannot be avoided by a cleverer formula in the same atoms: if , there is no translation of programs into propositional formulas over the same atoms that preserves the models and has polynomial size. Translations with new atoms of polynomial size exist, so the bound is about the vocabulary.
Tightness
- All loops are needed, not only the maximal ones. Take , and . The loops are , from the self edge, and . The completion , has the models and , and the only stable model is . The maximal loop has the fact as external support, so its formula is always true. The loop has no external support, and removes .
- The completion is needed. For there are no loops, so the loop formulas alone allow every set of atoms. The completion makes the only model.
- Finiteness is needed. The infinite program for has no loops, as its graph has no cycle, yet its completion has the model in which every is true, which is not stable.
History
Lin and Zhao presented loop formulas and ASSAT at AAAI 2002 and published the full version in 2004. The home page of ASSAT gives a correction to the definition of loops in the published paper. Later work extended loop formulas to disjunctive programs and to arbitrary propositional formulas. Lifschitz and Razborov (2006) explained why the number of loop formulas has to be large, and solvers such as clasp turned loop formulas into learned nogoods (Gebser et al. 2012).
References
- Fangzhen Lin and Yuting Zhao, ASSAT: computing answer sets of a logic program by SAT solvers, Artificial Intelligence 157(1-2), 115 to 137 (2004), the definitions of loops and loop formulas, the main theorem and the ASSAT procedure
- Vladimir Lifschitz and Alexander Razborov, Why are there so many loop formulas?, ACM Transactions on Computational Logic 7(2), 261 to 268 (2006), the lower bound on the size of translations without new atoms
- François Fages, Consistency of Clark's completion and existence of stable models, Methods of Logic in Computer Science 1(1), 51 to 60 (1994), the case of programs without positive cycles
- Martin Gebser, Roland Kaminski, Benjamin Kaufmann and Torsten Schaub, Answer Set Solving in Practice, Morgan and Claypool (2012), the chapter on the characterization of stable models by completion and loop nogoods, and their use in clasp
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 CK4JH0 Edit this page History Report an error Markdown