8.1 Representation Revisited
Good representation makes important distinctions explicit while keeping inference manageable. First-order logic (FOL) adds individuals and relations to propositional logic's indivisible facts.
AI · Knowledge, reasoning, and planning
Represent objects, their properties, and relations—not just whole statements. Explore how quantifiers turn a compact rule into claims about a domain.
Good representation makes important distinctions explicit while keeping inference manageable. First-order logic (FOL) adds individuals and relations to propositional logic's indivisible facts.
Constants name objects, predicates express properties or relations, and functions map objects to objects. A model supplies a domain and interpretations; quantifiers range over that domain. ∀ means “for every,” ∃ means “for at least one.”
Translate “every learner reads a book” as ∀x (Learner(x) → ∃y (Book(y) ∧ Reads(x,y))). Variables are bound by quantifiers; predicates state what is true of chosen objects.
Choose the task and vocabulary, encode general rules and specific facts, then ask queries and check whether the resulting model captures intended meanings. A formalization is only as sound as its assumptions.
Interactive model
Toggle facts about each object, then evaluate ∀x Kind(x) or ∃x Kind(x) in this finite model.
Model evaluation
For a domain of n objects, the code checks each stored Kind fact: universal is true iff all n facts are true; existential is true iff at least one is true. It also lists all true objects to show witnesses, or reports the first counterexample.
Time: O(n) per evaluation. Auxiliary space: O(n) for the temporary witness list created while evaluating; the facts and rendered labels/checkboxes also occupy O(n) model/UI space. The displayed domain currently has n = 3. This assumes a finite, nonempty domain and one stored Boolean fact per object.