The closed-world assumption (CWA) is the reasoning convention that any statement not known to be true is false. In symbolic AI & reasoning, it lets a system draw negative conclusions from the absence of information: if a flight table lists no flight from Prague to Lima, a system under the CWA concludes that no such flight exists rather than that the answer is unknown.
The assumption underlies relational databases, Datalog, Prolog and most production rule systems, and it stands in deliberate contrast to the open-world assumption used by description logics and the Web Ontology Language. Choosing between the two conventions decides whether silence in the data means “no” or “not known”, which changes query answers, consistency checks and the cost of reasoning.
How the closed-world assumption derives negative facts
The CWA works by treating the knowledge base as a complete description of the domain for the predicates it covers. Formally, Raymond Reiter defined it in 1978 as adding the negation of every ground atom that cannot be derived: if a fact P(a) is not entailed by the theory, then not-P(a) is assumed. The result is a single intended model in which only provable atoms are true.
In practice, the mechanism appears as negation as failure. A Prolog or Datalog engine answers a negated goal by attempting to prove the positive goal and succeeding only when that attempt fails finitely. Relational databases apply the same idea implicitly: a SQL query with NOT EXISTS returns rows for which no matching tuple is stored, because the table is assumed to hold every true instance of the relation.
The following table shows how the same query is answered under the closed-world and open-world conventions.
| Query | Stored facts | Answer under CWA | Answer under OWA |
|---|---|---|---|
| Is Anna an employee? | employee(anna) | Yes | Yes |
| Is Boris an employee? | No fact about Boris | No | Unknown |
| Does Anna have no manager? | No manager fact for Anna | True | Unknown |
| How many employees exist? | Three employee facts | Exactly three | At least three |
Formal variants and refinements
Reiter’s original CWA becomes inconsistent with disjunctive knowledge. If a theory states only that Anna or Boris is the manager, neither atom is provable, so the naive CWA asserts both negations and contradicts the disjunction. Several refinements were developed to repair this and related problems, each trading expressiveness against computational cost.
| Variant | Core idea | Typical use |
|---|---|---|
| Naive CWA | Negate every unprovable ground atom | Definite programs and plain databases |
| Generalized CWA | Negate only atoms false in all minimal models | Disjunctive databases |
| Negation as failure | Fail to prove, then assume false | Prolog and Datalog engines |
| Predicate completion | Read rules as if-and-only-if definitions | Clark completion semantics |
| Stable model semantics | Accept models that justify themselves | Answer set programming |
| Local CWA | Close only selected predicates | Hybrid ontology and rule systems |
Circumscription, introduced by John McCarthy, is a related approach that minimizes the extension of chosen predicates in second-order logic. It generalizes the CWA and belongs to the broader family of non-monotonic reasoning, because adding a new fact can retract a conclusion that was previously drawn from missing information.
Closed-world versus open-world reasoning
The CWA and the open-world assumption (OWA) are complementary conventions, and neither is correct in general. The CWA suits domains where the system controls or fully records the data, such as a bank’s own account ledger. The OWA suits domains where knowledge is inherently partial, such as the Semantic Web, where no single source can claim to list every fact.
| Aspect | Closed-world assumption | Open-world assumption |
|---|---|---|
| Meaning of missing data | False | Unknown |
| Monotonicity | Non-monotonic | Monotonic |
| Typical formalisms | SQL, Datalog, Prolog | OWL, description logic, first-order logic |
| Constraint checking | Natural and direct | Requires extra machinery |
| Unique name assumption | Usually adopted | Usually not adopted |
| Reasoning cost | Often polynomial for Datalog | Often exponential for expressive logics |
A common source of confusion is integrity constraints. Under the CWA, a rule stating that every employee must have a manager is checked directly: an employee without a stored manager violates the constraint. Under the OWA, a semantic reasoner instead infers that some unnamed manager exists, so the same rule never reports a violation. This is why validation languages such as SHACL apply closed-world semantics on top of OWL data.
When to apply the closed-world assumption
The decision rests on one question: is the data complete for the predicate being queried? Engineers often close some predicates and leave others open, an approach known as local closed-world reasoning. The table below summarizes typical situations.
| Situation | Recommended convention | Reason |
|---|---|---|
| Airline seat inventory | Closed world | The system is the authoritative record |
| Medical diagnosis from symptoms | Open world | Unreported symptoms may still exist |
| Access control list | Closed world | Deny anything not explicitly granted |
| Merged linked data from many sites | Open world | No source is complete |
| Data validation before import | Closed world | Missing fields must be reported |
In planning systems such as STRIPS, the CWA is built into the state representation: any proposition not listed in the current state is false. This keeps state descriptions compact and makes action effects easy to compute, which is one reason classical planners rely on it.
Limitations and common mistakes
The main risk of the CWA is silent incorrect negation. When a knowledge base is incomplete but treated as complete, the system returns confident negative answers that are simply wrong, and nothing in the output signals the gap. Practitioners repeatedly encounter the following failure modes.
- Applying the CWA to merged or crawled data, where completeness cannot be guaranteed.
- Ignoring null values in SQL, which introduce a third truth value and break pure closed-world semantics.
- Using negation with unsafe variables in Datalog, which makes answers depend on an unbounded domain.
- Mixing OWL ontologies and rules without stating which predicates are closed, which produces contradictory results.
- Forgetting non-monotonicity, so cached conclusions are not revised when new facts arrive.
A truth maintenance system or careful cache invalidation is needed whenever conclusions drawn from missing facts must be withdrawn later. Documenting which relations are declared complete is the simplest safeguard against misuse.
The short version
The closed-world assumption means if it is not on the list, it is not true. Think of a train timetable. If no train leaves at 3:15, you conclude that no train leaves then. You do not wonder whether a secret train exists.
Computers use this rule when they trust their data to be complete. It makes answers fast and clear. The danger is simple. If the list is missing something, the computer will still say no, and it will sound just as sure.
Where it makes a difference
A regional hospital runs a rule-based drug interaction checker written in Datalog. A rule raises an alert when a patient is prescribed a drug and has a recorded allergy to its ingredient class. Allergy records come from the hospital’s own admission form, and the system treats the allergy table as complete under the CWA.
During an audit, the pharmacy team found that patients transferred from other clinics often arrived without imported allergy data. For those patients, the checker concluded “no allergy” instead of “unknown” and raised no alerts. The fix was to close the allergy predicate only for patients whose intake interview was marked finished and to flag all others as allergy status unknown, which forced a manual review. Over the following quarter, the number of unchecked prescriptions for transferred patients dropped to zero.