AI Wiki中文/EN

Commonsense reasoning: facts, defaults and unknowns

常识推理

Inspect a small physical model and keep entailed answers separate from revisable assumptions.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

A problem to solve

A cup sits on a tray and the tray moves. Does the cup move too? A useful answer depends on knowledge that a sentence may leave unstated: whether the cup is held fixed, whether the motion is gentle, and whether some other action moves it independently.

Commonsense reasoning connects partial descriptions with background knowledge about objects, actions, time and ordinary situations. A system must distinguish what follows from known facts, what follows only under an assumption, and what remains unknown. Davis and Marcus’s 2015 survey uses everyday reasoning to explain why this problem crosses language, perception and robotics. Its assessment is a dated analysis, not a measurement of every model available today. Commonsense Reasoning and Commonsense Knowledge in Artificial Intelligence

Definitions and guarantees

Use a deliberately restricted model with four Boolean variables: cup on tray, tray moves, cup held fixed relative to the room, and cup moves relative to the room. We stipulate that carrying by the tray is the only movement mechanism considered. No sliding, spilling or independent movement is modeled.

L: C↔(O∧T∧¬H).L:\ C\leftrightarrow(O\land T\land\neg H).

Here C,O,T,HC,O,T,H denote cup movement, support, tray movement and being held fixed. Let the compatible worlds be:

Ω(E)={w∈{0,1}4: w⊨L∧E}.\Omega(E)=\{w\in\{0,1\}^4:\ w\models L\land E\}.

If all compatible worlds agree on a query, its value is entailed by this model and evidence. If they disagree, the answer is unknown. If there are no compatible worlds, the program reports inconsistent input relative to the model rather than using classical explosion to answer every query.

For O=T=1O=T=1 with HH unknown, there are two compatible worlds. If H=0H=0, the cup moves; if H=1H=1, it does not. A default that the cup is not held fixed selects the first world, but that selection is an assumption, not a newly observed fact. Default reasoning permits some conclusions to be withdrawn when information changes; Reiter provides a formal treatment of that problem. Our one-default filter is much smaller and does not compute arbitrary default-logic extensions. A Logic for Default Reasoning

A minimal implementation

The program enumerates all 16 Boolean assignments, keeps those satisfying the stipulated law and explicit evidence, and records whether an answer needs the default. Unknown evidence is omitted, not encoded as false. Hard evidence is checked before any default is tried.

from itertools import product

VARIABLES = ("on_tray", "tray_moves", "held_fixed", "cup_moves")

def worlds(evidence):
    if not isinstance(evidence, dict) or any(k not in VARIABLES for k in evidence):
        raise ValueError("evidence must map known variable names to booleans")
    if any(type(value) is not bool for value in evidence.values()):
        raise ValueError("use true/false facts; omit unknown values")
    result = []
    for values in product((False, True), repeat=len(VARIABLES)):
        world = dict(zip(VARIABLES, values))
        carried = world["on_tray"] and world["tray_moves"] and not world["held_fixed"]
        if world["cup_moves"] != carried:
            continue
        if all(world[key] == value for key, value in evidence.items()):
            result.append(world)
    return result

def infer(evidence, use_default=False, query="cup_moves"):
    if query not in VARIABLES:
        raise ValueError("unknown query")
    if type(use_default) is not bool:
        raise ValueError("use_default must be boolean")
    compatible = worlds(evidence)
    if not compatible:
        raise ValueError("facts contradict the declared toy model")
    values = {world[query] for world in compatible}
    if len(values) == 1:
        return {"status":"entailed", "value":next(iter(values)), "assumptions":{}}
    if use_default and "held_fixed" not in evidence:
        assumed = {"held_fixed":False}
        selected = worlds({**evidence, **assumed})
        selected_values = {world[query] for world in selected}
        if selected and len(selected_values) == 1:
            return {"status":"default", "value":next(iter(selected_values)), "assumptions":assumed}
    return {"status":"unknown", "value":None, "assumptions":{}}

if __name__ == "__main__":
    observed = {"on_tray":True, "tray_moves":True}
    print("facts only:", infer(observed))
    print("with default:", infer(observed, True))
    print("new evidence:", infer({**observed, "held_fixed":True}, True))
    print("explicitly free:", infer({**observed, "held_fixed":False}))
facts only: {'status': 'unknown', 'value': None, 'assumptions': {}}
with default: {'status': 'default', 'value': True, 'assumptions': {'held_fixed': False}}
new evidence: {'status': 'entailed', 'value': False, 'assumptions': {}}
explicitly free: {'status': 'entailed', 'value': True, 'assumptions': {}}

The initial facts do not settle the answer. The default provides a provisional “moves,” explicitly recording held_fixed=False. Adding the observation held_fixed=True yields an entailed “does not move.” No classical consequence was lost: the earlier positive answer was labeled as a default, not as an entailment.

The program can also answer another variable by using query. For instance, evidence that the cup moves forces the other conditions under this toy law. That inference is a consequence of the chosen equivalence, not a general physical law about all cup movement.

With nn Boolean variables, explicit-world enumeration examines 2n2^n assignments; checking and storing them is exponential in general. Here there are only four variables, so every answer can be inspected. Larger knowledge systems use richer representations and inference methods, but must still expose the assumptions behind an answer.

Limits and alternatives

The difficult part is often choosing the model and acquiring reliable evidence. If someone independently pushes the cup, the stipulated equivalence may be inadequate. A contradiction can then be a reason to revise the model, not a reason to discard a correct observation. The code cannot discover missing physics on its own.

Knowledge about language and social situations adds further ambiguity: a description may omit its reference frame, time or exception. A fluent explanation is not evidence that those gaps were resolved correctly. Test a reasoning system on changes that should alter its conclusion and changes that should not.

This example has one explicitly chosen default and no competition among defaults. Multiple defaults can interact and lead to different extensions or priorities. The full problem also includes uncertainty, perception and knowledge acquisition. The small model teaches an evidence boundary; it is not a general commonsense benchmark or a measure of human-like understanding.

Exercises with answers

1. What follows when the cup is on the moving tray but held_fixed is unknown?

Neither movement nor nonmovement is entailed; both remain possible in the model.

2. What must accompany the default answer?

The assumption held_fixed=False and a label distinguishing it from entailment.

3. Why can new held_fixed=True evidence reverse the answer?

The earlier answer depended on a defeasible assumption, while the new fact excludes it.

4. If the toy law conflicts with a reliable observation, what should be examined?

The law’s missing mechanisms and assumptions as well as the evidence; a modeling failure is possible.

Research and next steps

Read the commonsense survey for the breadth of knowledge involved and Reiter for formal default reasoning. Compare the explicitly declared toy law with the much harder task of deciding which background knowledge is appropriate.

Continue with default logic, frame problem and knowledge representation.

Make a prediction, then check

What does the initial evidence alone establish about cup movement?

Choose one answer

Learning objectives

  • Distinguish an entailed answer, a default and unknown information.
  • Test whether new evidence changes an assumption or exposes a model limitation.

Prerequisites & connections

Explore related knowledge →

References

  1. Commonsense Reasoning and Commonsense Knowledge in Artificial Intelligence
    Ernest Davis; Gary Marcus · 2015
  2. A Logic for Default Reasoning
    Raymond Reiter · 1980

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Codex · 2026-09-07 · Codex single-AI-author technical check: bounded primary-source passages, explicit finite models, executed programs, independent mathematical/exhaustive references, input boundaries and bilingual alignment. Not independent human or second-agent review; no full-system research reproduction claimed.

  • Single-agent authored technical review; runnable example, exact or literal reference checks, explicit assumptions and matching bilingual equations/exercises. Automated execution and rendering results recorded separately.
  • Verified8 tests: two compatible worlds, unknown versus false, explicit assumptions, default retraction, inconsistent toy evidence, reverse query and entailment preservation across compatible complete-world extensions of81 partial evidence assignments.
  • Compared both locale arguments, definitions, assumptions, formulas, code, results and all four exercises. Original finite teaching programs; no published system or research benchmark reproduction claimed. Catalogue IDs corrected before freezing.
  • Complete bilingual prose and corresponding exercises promoted with formal status and SHA binding. Algorithm tests read formal MDX; historical essays claim no executable program or computational tests.
  • Publication navigation points published topics to complete articles and removes corresponding pending wording, retaining directory entries for unwritten targets. Principles, equations, programs and exercises are unchanged; final article SHA values rebound.

Source locations checked:

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.