Reasoning changes as new information arrives. A truth maintenance system keeps track of why each belief is held so that it can be revised.

The Need

An inference engine adds conclusions to the KB; but if an assumption later turns out false, the conclusions that depended on it must be withdrawn. Rebuilding everything from scratch is costly, and simple logic does not do this because it is monotonic: adding premises never removes conclusions. A truth maintenance system (TMS), also called a reason maintenance system, records the justification for each belief, and handles belief revision, the updating of beliefs when new facts contradict old ones.

Definition: Truth maintenance system. A component that records the justifications of an inference engine's beliefs and, when a belief or assumption is withdrawn, retracts every belief that depended on it.

Justification-Based TMS

In a justification-based TMS (JTMS) each node is a belief that is IN (currently believed) or OUT (not believed). A node has one or more justifications: a rule listing the nodes that must be IN and the nodes that must be OUT. A node is IN if it has a valid justification. An assumption is a node believed without proof unless a contradiction arises. For example: "Tweety flies" is justified by "Tweety is a bird" (IN) together with "Tweety is a penguin" being OUT. When we learn that Tweety is a penguin, the node becomes IN, the justification of "Tweety flies" becomes invalid, and the belief is withdrawn automatically, together with everything derived from it.

Contradictions and Dependency-Directed Backtracking

A contradiction node is reached when the KB derives an inconsistency. The TMS traces the assumptions that support the contradiction and retracts at least one of them: this is dependency-directed backtracking, which is smarter than chronological backtracking because it undoes only responsible assumptions. The TMS can also record the nogood sets of assumptions known to be inconsistent.

Assumption-Based TMS

An assumption-based TMS (ATMS) keeps, for each node, the sets of assumptions (environments) under which it holds, so many contexts are explored at once without retracting, ideal for diagnosis and design when alternative hypotheses are compared. It uses more memory but avoids repeated work when switching between contexts.

Uses

TMSs are used in planning, diagnosis, scheduling, design systems and in constraint solvers, wherever the reasoning is non-monotonic and defaults are used.

Table 3.6: JTMS and ATMS

Basis JTMS ATMS
Records One current context, IN/OUT labels All contexts (assumption sets)
On contradiction Retract an assumption Mark environment nogood
Switching context Requires relabelling Immediate
Memory Smaller Larger

Example 3.6: Belief revision with a TMS

Problem: Beliefs: Bird(Tweety) is a fact; "Flies(Tweety)" is justified by Bird(Tweety) IN and Penguin(Tweety) OUT. Then we learn Penguin(Tweety). Show the labels before and after.

Solution:

  1. Initially Bird = IN, Penguin = OUT, so Flies has a valid justification: Flies = IN.
  2. New fact: Penguin(Tweety) becomes IN.
  3. The justification of Flies requires Penguin OUT, which is now false, so it is invalid.
  4. Flies has no other justification, so it becomes OUT, and any belief resting on it (such as "Tweety can reach the roof") also becomes OUT.

Result: Flies(Tweety) is withdrawn when Penguin(Tweety) is learned; the TMS keeps the KB consistent.

facts = {"Bird"}
def believes(f):
    if f == "Flies":
        return "Bird" in facts and "Penguin" not in facts
    return f in facts
print("Flies before:", believes("Flies"))
facts.add("Penguin")
print("Flies after learning Penguin:", believes("Flies"))

Output

Flies before: True
Flies after learning Penguin: False

Common mistakes

  • Treating all derived beliefs as permanent after new evidence arrives.
  • Deleting only the contradicted belief and not the conclusions that depended on it.
  • Confusing IN/OUT labels with true/false; OUT means "not currently believed", not "false".
  • Backtracking chronologically when dependency-directed backtracking is available.

Key takeaways

  • Classical logic is monotonic; real reasoning is often non-monotonic.
  • A TMS stores justifications and labels beliefs IN or OUT.
  • JTMS keeps one context; ATMS keeps all contexts as assumption sets.
  • Dependency-directed backtracking retracts only the culpable assumptions.

Practice questions

  1. What is the role of a TMS?
  2. What does IN mean in a JTMS?
  3. What is dependency-directed backtracking?

Answers to the practice questions

  1. To record justifications for beliefs and retract dependent beliefs when an assumption fails.
  2. The node has a valid justification and is currently believed.
  3. Backtracking that undoes only the assumptions responsible for a contradiction.

Sources

  • Official BCA syllabus Artificial Intelligence, course code 26BCA404DS04, Unit III