Definitioncore
Clark's completion
Also called program completion, predicate completion.
The completion of a logic program reads the rules for each predicate as an "if and only if" definition, so an atom holds exactly when the body of one of its rules holds.
Clark's completion turns a logic program into a classical theory by reading the rules for each predicate as its full definition: an atom holds if and only if the body of one of its rules holds. Clark (1978) gave it as the declarative meaning of negation as failure, and proved that a finite failure of in SLDNF resolution is sound for in the completion. The soundness and completeness results for the procedure are on the SLDNF page; this page gives the definition, the ground case that answer set solvers use, and how the completion relates to stable models.
Definition
Propositional case. Let be a finite ground normal program over a set of atoms. A rule has the body formula , and an empty body is . The completion is the set of formulas
where the empty disjunction is , so an atom with no rules gets . The models of are called the supported models of . A set is a model of exactly when , where is the set of heads of the rules whose body is true in : the direction "" says , and the direction "" says that each true atom has a rule with a true body.
First-order case. For a predicate of arity , each rule with variables is rewritten as
with fresh variables and read as . If are these formulas for all rules of , the completed definition of is , and if has no rules. The completion is the set of completed definitions together with Clark's equality theory, which says that distinct function symbols give distinct terms, that function symbols are injective, and that no term equals a proper subterm of itself. Lloyd's book states these axioms in full.
Examples and non-examples
- . Then , with the single model . This is also the only stable model.
- . The completion has the models and , the same as the stable models.
- . The completion is inconsistent. The program has no stable model either.
- Non-example of agreement. has the completion , with models and . The only stable model is , because nothing derives . The completion accepts support through a positive cycle, which the stable model semantics rejects. Fages' theorem says that without positive cycles the two agree, and loop formulas are the clauses that must be added to the completion to make them agree in general.
- First order. For and , the completed definition is . With the equality axioms it entails , which SLDNF resolution derives by finite failure.
Related definitions
- Supported model. A model of in which each true atom is the head of a rule whose body is true in ; the same as a model of the completion.
- Stable model. Every stable model is supported, so it is a model of the completion. The converse holds for tight programs (Fages' theorem).
- Tight program. A program whose positive dependency graph has no cycle. For a tight program, the completion and the stable models coincide.
- Closed-world assumption. For a definite program, the closed-world assumption makes false every ground atom that is not a consequence. The completion is weaker: it makes false only what follows from the "only if" halves, so on it leaves open, while the closed-world assumption makes false.
- Clausal form. For a finite ground program, the completion becomes a set of clauses of size linear in the program after one new atom is introduced for each rule body. Answer set solvers such as ASSAT and clasp give these clauses to a SAT solver or use them in unit propagation.
References
- Keith L. Clark, Negation as failure, in Hervé Gallaire and Jack Minker (eds.), Logic and Data Bases, Plenum Press, New York, 293 to 322 (1978), the definition of the completed database and the soundness of negation as failure for it
- John W. Lloyd, Foundations of Logic Programming, 2nd edition, Springer (1987), the chapter on normal programs, the completion and its equality axioms
- 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 completion semantics
- 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 completion of a finite propositional program as a set of clauses
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 JRMWPA Edit this page History Report an error Markdown