Negation as failure is related to the closed world assumption, as it amounts to believe false every predicate that cannot be proved to be true.
In the knowledge management arena, the closed world assumption is used in at least two situations: 1) when the knowledge base is known to be complete (e.g., a corporate database containing records for every employee), and 2) when the knowledge base is known to be incomplete but a "best" definite answer must be derived from incomplete information. For example, if a database contains the following table reporting editors who have worked on a given article, a query on the people not having edited the article on Formal Logic is usually expected to return “Sarah Johnson”.
| Edit | |
|---|---|
| Editor | Article |
| John Doe | Formal Logic |
| John Doe | Closed World Assumption |
| Joshua A. Norton | Formal Logic |
| Sarah Johnson | Introduction to Spatial Databases |
| Charles Ponzi | Formal Logic |
| Emma Lee-Choon | Formal Logic |
In the closed world assumption, the table is assumed to be complete (it lists all editor-article relationships), and Sarah Johnson is the only editor who has not edited the article on Formal Logic. In contrast, with the open world assumption the table is not assumed to contain all editor-article tuples, and the answer to who has not edited the Formal Logic article is unknown. There is an unknown number of editors not listed in the table, and an unknown number of articles edited by Sarah Johnson that are also not listed in the table.
The first formalization of the closed world assumption in formal logic consists in adding to the knowledge base the negation of the literals that are not currently entailed by it. The result of this addition is always consistent if the knowledge base is in Horn form, but is not guaranteed to be consistent otherwise. For example, the knowledge base
Adding the negation of these two literals to the knowledge base leads to
Alternative formalizations not suffering from this problem have been proposed. In the following description, the considered knowledge base is assumed to be propositional. In all cases, the formalization of the closed world assumption is based on adding to the negation of the formulae that are “free for negation” for , i.e., the formulae that can be assumed to be false. In other words, the closed world assumption applied to a propositional formula generates the formula:
The ECWA and the formalism of circumscription coincide on propositional theories. The complexity of query answering (checking whether a formula is entailed by another one under the closed world assumption) is typically in the second level of the polynomial hierarchy for general formulae, and ranges from P to coNP for Horn formulae. Checking whether the original closed world assumption introduces an inconsistency requires at most a logarithmic number of calls to an NP oracle; however, the exact complexity of this problem is not currently known.