Theoremadvanced
NP-completeness of stable model existence
Also called Marek-Truszczynski theorem.
Deciding whether a finite propositional normal logic program has a stable model is NP-complete.
This theorem places the main reasoning task of answer set programming exactly in the complexity landscape. A stable model can be checked in linear time, so the existence question is in NP, and the even cycles of negation in a program can encode any 3-SAT instance, so it is NP-hard. The result is due to Marek and Truszczyński (1991), and Bidoit and Froidevaux (1991) proved it in an equivalent setting. It explains why stable model solvers search like SAT solvers, and why programs with disjunction, which reach one level higher, need a different theorem.
Statement
A finite propositional normal program is a finite set of rules , where , the and the are atoms from a finite set and . The program has no variables and no disjunction in the heads. For , the reduct deletes each rule with some and deletes the negative literals of the other rules. is a stable model if is the least model of (Gelfond and Lifschitz 1988). The size of is the number of rules plus the number of literals.
Theorem (Marek and Truszczyński 1991; Bidoit and Froidevaux 1991). The problem "given a finite propositional normal program , does have a stable model?" is NP-complete.
The same holds when constraints are allowed, and NP-hardness holds already for programs in which each rule has at most three positive body atoms and at most one negative body literal.
In plain words
To check a proposed answer, you only have to follow the rules forward once, which is fast. So the question is no harder than the problems where a good guess can be checked quickly. It is also no easier than any of them. A pair of rules that say "this is true unless that is true" and "that is true unless this is true" acts like a free choice between two values, one pair for each variable of a logic formula. One more rule for each clause of the formula rejects every choice that makes the clause false. So the program has an answer exactly when the formula can be satisfied, and a fast method for answers would give a fast method for every problem in NP.
Proof
Membership in NP. A certificate is a set . The reduct is computed in linear time, and its least model in linear time by the counter method of Dowling and Gallier (1984). Comparing it with takes linear time. With constraints, also check that satisfies no constraint body.
NP-hardness. We reduce 3-SAT. Let be a CNF formula over the variables . Use the atoms and for each variable and one more atom . For a literal , let be the atom that says that is false: and . The program has the rules
It has rules and is built in linear time. For an assignment , let .
(a) Every stable model is for some and does not contain . If , the reduct deletes every rule with head , so is not in the least model, a contradiction. If neither nor is in , the reduct keeps the fact , so is in the least model, a contradiction. If both are in , the reduct deletes both rules, and no other rule has as its head, a contradiction.
(b) is a stable model if and only if satisfies . The reduct by keeps exactly the facts with , the facts with , and the rules , since . Its least model is , plus if the body of some clause rule lies in . That body lies in exactly when every literal of the clause is false under . So the least model equals exactly when satisfies every clause.
By (a) and (b), is a bijection between the satisfying assignments of and the stable models of . In particular, has a stable model if and only if is satisfiable. Each clause rule has at most three positive atoms and one negative literal. With constraints, the clause rules can be written without .
Example. For , the constraint version of has the six choice rules and the constraints , and . Its stable models are and , and the satisfying assignments of are and .
Consequences
- Brave and cautious reasoning. Deciding whether an atom is in some stable model is NP-complete: add the constraint . Deciding whether is in every stable model is coNP-complete: it fails exactly when the program with added has a stable model (Dantsin, Eiter, Gottlob and Voronkov 2001).
- Search is needed. Unless P = NP, no polynomial algorithm finds stable models. Solvers such as the smodels search and conflict-driven answer set solving use the methods of SAT solvers for this reason.
- ASP solves exactly NP. Every problem in NP can be written as a program whose stable models are the certificates, by the construction above applied to a SAT encoding obtained from the Cook-Levin theorem. This is the basis of the claim that ASP captures NP search problems.
- Polynomial approximations. The well-founded model is computed in polynomial time and is contained in every stable model, so it can prune the search but cannot decide existence.
Tightness
- Hard even for tight programs. The program has no positive cycle: the atoms and have no positive body, and depends positively only on these atoms. So the problem stays NP-complete on tight programs, where stable models are the models of the completion.
- Polynomial cases. For a program without negation the unique stable model is the least model, found in linear time. For a stratified program the unique stable model is the perfect model, also found in polynomial time. So some negation through a cycle is necessary for hardness, and uses even cycles of length two.
- Disjunction goes higher. For disjunctive programs, existence is -complete (Eiter and Gottlob 1995); for head-cycle-free disjunctive programs it stays in NP.
- Variables go higher. For programs with variables and no function symbols, the problem is NEXPTIME-complete when the program is part of the input, and NP-complete when the program is fixed and only the facts vary (Dantsin, Eiter, Gottlob and Voronkov 2001).
History
Gelfond and Lifschitz defined stable models in 1988. Marek and Truszczyński (1991) studied autoepistemic logic, whose stable expansions correspond to stable models through Gelfond's translation, and proved among other results that the existence of a stable model of a finite propositional program is NP-complete. Bidoit and Froidevaux (1991) obtained the same bound for their default semantics of logic programs, which coincides with the stable model semantics. Marek and Truszczyński (1999) and Niemelä (1999) later used the result to argue that logic programs with stable models are a language for NP search problems, which started answer set programming as a programming method.
References
- Victor W. Marek and Mirosław Truszczyński, Autoepistemic logic, Journal of the ACM 38(3) (1991), the complexity results for stable expansions and for stable models of logic programs, including the NP-completeness of the existence of a stable model
- Nicole Bidoit and Christine Froidevaux, Negation by default and unstratifiable logic programs, Theoretical Computer Science 78(1), 85 to 112 (1991), the complexity of the default semantics of logic programs, which coincides with the stable model semantics
- Victor W. Marek and Mirosław Truszczyński, Stable models and an alternative logic programming paradigm, in Krzysztof R. Apt, Victor W. Marek, Mirosław Truszczyński and David S. Warren (eds.), The Logic Programming Paradigm: a 25-Year Perspective, Springer, 375 to 398 (1999), the section on the complexity of stable model existence
- 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 propositional complexity of normal programs under the stable model semantics, for existence, brave and cautious reasoning
- 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 definition of stable models
- William F. Dowling and Jean H. Gallier, Linear-time algorithms for testing the satisfiability of propositional Horn formulae, Journal of Logic Programming 1(3), 267 to 284 (1984), the linear-time least model computation used in the membership proof
- Ilkka Niemelä, Logic programs with stable model semantics as a constraint programming paradigm, Annals of Mathematics and Artificial Intelligence 25(3-4), 241 to 273 (1999), the discussion of stable models as a language for NP search problems
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 5555AX Edit this page History Report an error Markdown