Logic and Planning/Reasoning Systems and Default Logic

Lesson 3.122,423 words

Reasoning Systems and Default Logic

Having represented the world, this part is about reasoning with it at scale. Semantic networks give a graphical notation with fast inheritance; description logics keep subsumption and classification tractable by design.

╌╌╌╌

This builds on Knowledge Representation, which built the content of a knowledge base: an upper ontology, categories and composed objects, events reified through the event calculus, and belief modeled in modal logic. Here we turn to the machinery that makes such a base practical.

Reasoning systems for categories

Categories are the primary building blocks of large-scale knowledge bases, and two families of systems are built specifically to organize and reason with them. Semantic networks give a graphical notation and fast inheritance algorithms; description logics give a formal language for defining and combining categories, with efficient tests for subset and superset relations.

Semantic networks

A semantic network displays objects and categories as nodes and relations as labeled links. A link from to encodes ; a link between and encodes ; links chain categories upward. Despite an old rivalry between logic and semantic networks, a semantic net with well-defined semantics simply is a form of logic — a more convenient human interface over the same objects, relations, and quantification.

A semantic network with four objects (John, Mary, 1, 2) and four categories. A single-boxed Legs link asserts a property of every member; the double-boxed HasMother link asserts a relation that holds for each member individually. John's own Legs link (value 1) overrides the inherited default 2.

Inheritance runs by following up to a category, then links upward until a boxed property link is found. Mary has two legs because has a link with value 2 and . The simplicity and transparency of this inference — you can see exactly which links the procedure will traverse — is the main attraction over general theorem proving.

Two complications matter. Links are binary, so an -ary assertion like cannot be drawn directly; the fix is to reify the proposition as an event object with , , , and links — the same reification move from earlier, now forced by the notation. And multiple inheritance, where an object belongs to two categories offering conflicting values, can make the inheritance algorithm find two answers; some object-oriented languages ban it outright, but semantic networks usually allow it and defer the conflict to default reasoning.

Description logics

Description logics formalize what a semantic network means while keeping taxonomic structure central. They are notations designed to make it easy to describe and combine category definitions. The two principal inference tasks are:

A description-logic language such as CLASSIC builds concepts from an algebra of operators on predicates — something first-order logic cannot do. Bachelors are unmarried adult males:

Concepts combine with constructors like (every filler of a role is in a concept), and (cardinality bounds, the clean version of the exactly two legs problem), and . Men with at least three unemployed, married sons who all married doctors, and at most two daughters who are all physics-or-math professors:

The point of description logics is tractability. A problem is posed by describing it and asking which of several solution categories subsumes it, and the design goal is that subsumption testing run in time polynomial in the size of the descriptions. The cost is that keeping subsumption tractable usually means giving up general negation and disjunction, which force a first-order system into exponential case analysis. So either hard problems cannot be stated, or they need exponentially large descriptions — but the tractability results at least tell a designer which constructs are expensive.

The subsumption relation over concepts forms a lattice, and classification finds where a new concept fits into it.

A subsumption lattice. Each upward edge means the lower concept is subsumed by (is a subset of) the upper; classifying a new concept means inserting it at the right place, below everything that subsumes it and above everything it subsumes.

The edge from up to in the lattice is not drawn by hand — a classifier derives it by comparing definitions. Take

Subsumption between conjunctions has a syntactic test: is subsumed by exactly when every conjunct on the right is subsumed by some conjunct on the left. To ask whether is subsumed by , check each conjunct of against the conjuncts of . The right side's matches 's ; the right side's matches 's . Both conjuncts on the right are covered, so — every bachelor is an adult male. The reverse fails: 's definition has no conjunct subsumed by 's , so a married adult male is an adult male but not a bachelor, and . The subsumption is strict, which is why the lattice draws strictly below .

Classification runs the same test to place an individual. Suppose the knowledge base holds , where has already been reduced. Flattening the conjunction gives , which by the same conjunct-matching test is subsumed by . The classifier therefore concludes without any rule mentioning George — the membership falls out of the definitions. Adding the fact later makes unsatisfiable, and a consistency check flags the contradiction rather than silently deriving a false membership.

Description logics matured into OWL, the Web Ontology Language of the Semantic Web, where machine-readable ontologies annotate Web resources and a reasoner classifies and checks them. That is the industrial descendant of the taxonomic tradition running back through semantic networks.

Reasoning with default information

The semantic-net example already leaked a non-classical idea: the assertion all persons have two legs had only default status, overridden for John. In a strictly logical knowledge base that would be a flat contradiction. Handling it properly means giving up monotonicity — the property, from propositional logic, that adding sentences never retracts a conclusion. Commonsense reasoning is routinely nonmonotonic: seeing a parked car you believe it has four wheels though only three are visible, and you retract that only if new evidence (the owner carrying a wheel, the car jacked up) arrives.

Two ideas are the setting for this. The closed-world assumption takes any proposition not entailed by the knowledge base to be false — useful, but crude. Later we prefer the graded alternative of probability, where a belief has a degree rather than a bare default; this section is the logical route to the same problem.

Circumscription and default logic

Circumscription is a sharper closed-world assumption: name particular predicates that are assumed as false as possible — false for every object except those known to make them true. To encode birds fly by default, introduce an abnormality predicate and write:

Circumscribing lets a reasoner assume unless told otherwise, so follows from — but is withdrawn the moment is asserted. Circumscription is a model preference logic: a sentence is entailed with default status if it holds in all preferred models (here, those with the fewest abnormal objects), rather than in all models.

The classic example is the Nixon diamond: Nixon is a Quaker (so a pacifist by default) and a Republican (so not a pacifist by default).

The Nixon diamond. Nixon inherits pacifism from Quaker and non-pacifism from Republican; the two default paths conflict, and a plain circumscriptive reasoner has two preferred models, staying agnostic about Pacifist(Nixon).

A plain reasoner has two preferred models and stays agnostic about whether Nixon is a pacifist. Prioritized circumscription breaks the tie by minimizing one abnormality predicate ahead of another, letting religious defaults, say, take precedence over political ones.

Default logic takes a different route, with default rules of the form : given prerequisite , and if each justification is consistent with the knowledge base, conclude . Birds fly is . The Nixon diamond becomes two default rules, one concluding and one . The meaning of a set of default rules is given by its extensions — maximal consistent sets of conclusions, each a coherent way of applying the defaults. The Nixon diamond has two extensions, one where he is a pacifist and one where he is not.

Open problems remain. If cars have four wheels is a default, what exactly does it mean to hold it in a knowledge base, and what is a good set of default rules — if we cannot decide rule by rule whether one belongs, we have a nonmodularity problem. And using default beliefs to make decisions, weighing the strength of a belief against the cost of a wrong action, is the hardest issue, pushing toward embedding default reasoning inside probability or utility theory.

Truth maintenance systems

Many conclusions in a knowledge base have only default status and will sometimes turn out wrong, so they must be retractable. Retracting is not as simple as deleting. Suppose the base contains , and was used to add . Naively retracting everything inferred from removes — but may have other justifications ( and ), so it should survive. A truth maintenance system (TMS) manages exactly these dependencies. This is belief revision: revising the base to reflect new information about a fixed world.

The naive approach numbers sentences by insertion order; to retract , undo everything back to just before it and reassert the rest. Correct, but retracting costs reassertions and re-derivations — impractical when facts pour in.

A JTMS (justification-based TMS) is smarter: annotate each sentence with a justification, the set of sentences it was inferred from. If is present and fires, is added with justification . On , the JTMS deletes exactly those sentences for which is in every justification. If also had justification , it survives. Rather than deleting a sentence that loses all justifications, the JTMS marks it out (and in when a justification is restored), so inference chains are kept and need not be rederived.

A JTMS dependency network. has two independent justifications, so retracting (which removes the left one) leaves in via the right one; a node goes out only when it loses every justification.

A concrete trace shows what in every justification means. Put five sentences in the base and let the JTMS record the justification set of each derived one:

SentenceJustification setStatus
(premise)in
(premise)in
(premise)in
(premise)in
in

Firing adds a second justification for the same node, so now carries two:

Now call . The JTMS deletes only sentences with in every justification. fails that test: but , so still supports it and stays in, its label narrowed to . Retract as well and dies too; with no justification left, is marked out rather than erased, so if either premise returns the node flips back in with no re-derivation of the implication chains. Compare the naive insertion-order scheme, which on would blindly undo and every later sentence and then reassert them one by one.

TMSs also speed up analysis of multiple hypothetical situations. Choosing Olympic sites, a great deal of reasoning follows from ; to consider instead, retract the first, assert the second, and the TMS revises only what depends on the change — inference chains not touching the choice are reused.

An ATMS (assumption-based TMS) goes further. A JTMS represents one state at a time; an ATMS keeps all states considered so far, labeling each sentence not simply in or out but with the set of assumption sets under which it holds. This makes context-switching between hypothetical worlds nearly free. ATMSs also generate explanations: an explanation of is a set of sentences that entails , possibly including assumptions — sentences not known true but which would suffice. For car won't start, an ATMS makes assumptions like battery dead or no gas in any order, then reads off from 's label which assumption sets would justify it.

The label is the whole mechanism. Designate a set of assumptions — sentences the reasoner may posit but does not know true. Each derived sentence is labelled with a set of assumption sets, where every member is a minimal collection of assumptions sufficient to derive it. Given the rules , , and , the label of becomes

read as: the car fails to start under any one of these assumptions. A sentence requiring two assumptions at once, say needing both a weak battery and lights left on, would carry a label whose member is the two-element set .

An ATMS label. Each derived sentence carries a set of minimal assumption sets; WontStart holds under any one of three single-assumption sets, so its label has three members, while a conclusion needing two assumptions carries a two-element set. Reading the label off gives every diagnosis at once.

Because the label is computed once and updated incrementally as rules fire, the reasoner never re-solves the diagnosis when it switches from considering to considering ; both contexts are already recorded in the label. That is the trade the ATMS makes against the JTMS: more bookkeeping per sentence, but every hypothetical context available at once instead of one at a time.

Truth maintenance is not free — its complexity is at least that of propositional inference, so it is NP-hard. Used carefully, though, a TMS gives a logical system a real increase in its ability to cope with complex environments and hypotheses.

From description logics to OWL and the Semantic Web

The taxonomic tradition described here — semantic networks, then description logics with subsumption and classification — became a deployed standard. The Web Ontology Language (OWL) was published as a W3C recommendation in 2004 and revised as OWL 2 in 2009, and its expressive dialect OWL 2 DL is grounded in a specific description logic. Horrocks, Kutz, and Sattler, in The Even More Irresistible SROIQ (KR 2006), defined that logic, , by extending an earlier one with complex role-inclusion axioms, qualified number restrictions, and reflexive and irreflexive roles, and gave a tableau reasoning procedure for it; their paper is the logical basis W3C adopted for OWL 2. The constructors are the same , , , and this lesson used, formalized to the point of a decidability proof.

The line from this lesson's machinery to deployed standards. Semantic networks and description logics feed the SROIQ logic behind OWL 2; tableau reasoners such as HermiT decide subsumption and classification over ontologies; knowledge graphs like Wikidata supply the facts at Web scale.

Deciding subsumption over such a logic needs an actual reasoner. HermiT, described by Glimm, Horrocks, Motik, Stoilos, and Wang in the Journal of Automated Reasoning (2014), is an OWL 2 reasoner built on a hypertableau calculus; it performs classification, entailment checking, and consistency testing over OWL ontologies and is compliant with the OWL 2 direct semantics standardized by the W3C. It is the industrial version of the subsumption and consistency tests this lesson stated abstractly.

The other modern current is the large curated store of facts. Wikidata, described by Vrandečić and Krötzsch in Communications of the ACM (2014), is a free, collaboratively edited knowledge base built to hold the structured, multilingual factual data behind Wikipedia; it represents facts as items with property-value statements, a reification of the same object-relation structure this lesson began with. Earlier, Miller's WordNet (Communications of the ACM, 1995) organized English nouns, verbs, adjectives, and adverbs into synonym sets linked by hyponym and other lexical relations — a hand-built taxonomy of word senses that became a standard resource in language processing. Between the reasoners and the fact stores, the two halves of this subject — the machinery here and the content of the previous lesson — each have a deployed descendant.

Where this sits

First-order logic supplies the language; these two lessons cover using it well at scale. An ontology fixes the top-level categories; reification turns categories, propositions, and events into objects you can quantify over and pin facts to; the event calculus threads time and change through the whole thing; modal logic represents agents' beliefs. On top of that content, description logics keep subsumption tractable, and default reasoning with a truth maintenance system lets conclusions be held tentatively and withdrawn cleanly when the beliefs beneath them change.

The recurring problem across all of it is exceptions — most useful rules hold only by default. The logical treatments here (circumscription, default logic, TMSs) buy retractability but not degree: they cannot say a car has four wheels with probability . That graded account is the alternative developed under uncertainty, where the same commonsense inferences reappear as conditioning on evidence rather than overriding a default.

╌╌ END ╌╌