CV Courseversity

Knowledge Representation

Surveys how AI systems formally represent objects, categories, properties, events, actions, time, space, and other agents' beliefs — the ontological building blocks beneath any reasoning system.

“An office assistant AI is told that the printer is out of toner, and that Priya believes someone already ordered more, even though nobody has. To act sensibly, the system must represent not just objects (the printer, the cartridge) and categories (printers are office equipment) but also an event (an order being placed), a time (before now), and — crucially — a belief that is false: what a person thinks is true, independent of what actually is true. Representing "Priya believes X" turns out to be a fundamentally different problem from representing X itself, and getting that distinction wrong is a classic reason knowledge-based systems fail at real-world reasoning.”

Objects, Categories, and Properties · 14 min

A category like Car can be represented in two different ways. The simplest is as a unary predicate, Car(x), true of exactly those objects that are cars. A more powerful alternative is to reify the category itself — to treat Car as an object in its own right, related to its individual members by a MemberOf relation and to more general categories by a SubclassOf relation. Reification matters because it lets a system make statements about the category itself, not only about its instances: a system can assert that the category Car has many members, or that cars are typically four-wheeled, without those statements being claims about any one specific car. This is the same move made throughout knowledge representation — treating something that could be left implicit in the logic (a category, an event, a time) as an explicit object that relations can be stated about — and it recurs across every subtopic in this module.

Subclass hierarchies built from SubclassOf relations support inheritance: a property asserted of a superclass is, by default, inherited by every subclass and every instance beneath it, unless a more specific statement overrides it for a particular subclass or instance — a Sedan inherits "has four wheels" from Car unless some subclass of Sedan is explicitly declared to be an exception. A separate relation, PartOf, captures physical composition rather than category membership: a wheel is PartOf a car, but a wheel is not a kind of car, and a car is not a kind of wheel either, so the two hierarchies encode entirely different facts about the world. PartOf hierarchies and SubclassOf hierarchies are structurally similar in that both form directed hierarchies that a diagram can draw the same way, but they license entirely different inferences — properties inherit down a SubclassOf hierarchy, while nothing about a whole's properties automatically transfers to its parts, or vice versa — and conflating the two relations is a common and consequential representational error.

Precisely defining a category by necessary and sufficient conditions is often harder than it looks: natural categories like "chair" or "bird" resist crisp logical definitions because real members vary along dimensions the definition would need to anticipate in advance, and edge cases — a beanbag chair with no legs, a flightless bird such as a penguin — routinely violate whatever clean rule seemed to capture the category when it was first written down. Trying to patch the definition with more and more conditions to handle each new exception tends to produce an increasingly brittle, ad hoc list rather than a genuinely general definition. In practice, systems often fall back on typical or default properties with explicit exceptions — "birds typically fly, except for penguins, ostriches, and a known list of others" — rather than insisting on strict necessary-and-sufficient definitions for every category. This is a tension that reappears, and is resolved rather differently, when ontology engineering imposes formal, description-logic-based definitions on categories in the module that follows this one.

Events, Actions, and Time · 15 min

John McCarthy and Patrick Hayes's 1969 paper introduced the situation calculus as a formal way to represent actions and their effects within first-order logic. A situation is defined as the complete state of the universe at an instant of time, and a function maps an action performed in a situation to the new situation that results from performing it — so that a sequence of actions corresponds to a chain of situations, and reasoning about whether a plan achieves some goal becomes reasoning about whether the situation reached at the end of the chain satisfies that goal. Properties that can change from situation to situation, such as a door's being open, are represented as fluents, predicates that take a situation as one of their arguments so that their truth can differ across the chain rather than being fixed once and for all. This framework let the authors formalize how actions can be combined into strategies using program-like notation, including loops and knowledge-acquisition steps, and prove things about whether a given strategy is guaranteed to succeed, treating planning itself as a form of logical proof within the same formal system used to represent the facts.

The same paper identified what became known as the frame problem: when reasoning about a sequence of actions, a system must know which facts stay the same across each action as well as which facts change, and naively writing an explicit "this fact did not change" sentence for every fluent and every action produces roughly (number of actions) × (number of fluents) sentences — a combinatorial explosion for any domain with more than a handful of actions and properties, and one that only grows worse as a plan lengthens into a longer chain of situations. McCarthy and Hayes proposed a frame-based shortcut in response: declare which fluents an action changes, and let every fluent not mentioned be presumed to persist unchanged by default, avoiding the need to state persistence explicitly for everything the action does not touch. This shortcut trades a fully explicit, exhaustively stated theory of change for a much smaller one that relies on an implicit default assumption, at the cost of needing extra care whenever that default assumption turns out to be wrong for a particular action.

Later formalisms, including the event calculus and various interval- and point-based temporal representations, extend and in some cases replace situation calculus's discrete before/after structure with explicit representations of time intervals, addressing questions like whether one event happened during, before, entirely after, or overlapping another — distinctions a purely sequential chain of situations does not naturally express. Representing events explicitly, rather than only as the transitions between situations, also makes it easier to talk about an event's duration, about several events happening concurrently, and about reasoning that refers to time itself as an object, such as "the meeting was scheduled for an hour after the previous one ended." This remains an active area of research with multiple competing formalizations rather than one universally agreed solution, particularly once concurrent actions, continuous processes, and events whose exact timing is only partially known are taken into account, and different systems in practice choose different tradeoffs between how much they can expressively represent and how tractable it remains to reason within the chosen formalism.

Space and Belief: Representing What Agents Think · 14 min

Many practical spatial-reasoning tasks depend only on qualitative relationships between regions — containment, adjacency, overlap, connection — rather than on precise numeric coordinates: knowing that the printer is in the same room as the desk, or that the desk is next to the window, is often exactly the information a system needs, without ever computing exact positions in a coordinate system or measuring distances. Representing space qualitatively, as a set of regions and topological relations among them, lets a system reason about location and containment using the same kind of logical inference used elsewhere in the knowledge base — the same style of rule-based deduction covered in the automated reasoning module — rather than requiring numeric geometric computation for every spatial question. This mirrors the choice made for time: just as situation calculus can reason about before-and-after ordering without always needing precise clock times, qualitative spatial representations can reason about containment and adjacency without needing precise coordinates, falling back on numeric geometry only when a task genuinely requires it.

Belief poses a different and subtler challenge. Representing "Priya believes the printer has been fixed" is not the same problem as representing "the printer has been fixed," because the belief report can be true even when the sentence believed is false. Philosophers analyzing propositional attitude reports — sentences describing an agent's cognitive relation to a proposition, such as belief or knowledge — have identified this as a case of referential opacity: inside an ordinary sentence, substituting one term for another term that refers to exactly the same thing never changes the sentence's truth value, but inside a belief context, that substitution can change the truth value, because an agent can believe something true of one name for a thing while not believing the same thing is true of another, equally correct name for it. The classic illustration involves someone who believes Superman can fly without believing that Clark Kent can fly, even though Superman and Clark Kent are, as a matter of fact, the very same person — the belief report is sensitive to which name was used, not only to which individual is actually being referred to.

The practical consequence for knowledge representation is that inference rules safe for ordinary first-order sentences — such as substituting equals for equals, or existentially generalizing from a specific individual to "there exists someone such that..." — become unsafe once they are applied inside a belief context, so systems typically represent beliefs either through a dedicated modal-style operator, Believes(Agent, Sentence), or by treating the believed sentence as quoted content rather than as directly asserted by the system itself. Keeping "what is true" and "what an agent believes is true" as separate, distinctly represented layers is essential for any system that reasons about other agents — other people, other AI systems, or even its own possibly outdated beliefs about the world — since collapsing the two layers into one would force the system to treat every belief it represents as simply true, making it unable to reason correctly about mistaken, outdated, or deliberately false beliefs held by the agents around it.

Practice

Category Hierarchy and Part-Whole Structure

Vehicle Car Truck Sedan MyCar Engine solid = subclassOf dashed = instanceOf dotted = partOf

Vehicle, Car, Truck, and Sedan are related by SubclassOf; MyCar is an instance of Sedan; Engine is PartOf MyCar — three distinct relations that are easy to conflate but support entirely different inferences.

  • Reifying a category as an object in its own right — rather than only as a predicate — lets a system state facts about the category itself, such as its typical properties or how many members it has, not just about individual instances.
  • SubclassOf, MemberOf (instance-of), and PartOf are three different relations that are often visually similar in a diagram but license entirely different inferences, and conflating them is a classic knowledge-representation bug.
  • Representing an agent's belief about the world is not the same as representing the world: a belief report can be true even when the sentence believed is false, which breaks ordinary substitution rules that hold outside belief contexts.

Recall Practice

Categories as objectsClick to reveal
Why might a knowledge engineer represent a category like Car as an object rather than only as a unary predicate?
Representing the category itself as an object lets the system make statements about the category — such as its typical properties or how many members it has — which cannot be expressed if Car exists only as a predicate applied to individuals.
Frame problemClick to reveal
State the frame problem in your own words, as McCarthy and Hayes originally posed it.
It is the problem of specifying which facts stay unchanged after an action without explicitly writing a 'did not change' sentence for every fluent and every action, since doing so naively requires on the order of (number of actions) × (number of fluents) sentences.
Situation calculusClick to reveal
What does the situation-calculus function that maps an action and a situation to a new situation represent?
It represents the new situation that results from performing that action starting in the given situation, allowing sequences of actions to be reasoned about as a sequence of situations.
Belief representationClick to reveal
Why can't a system always substitute one true term for an equal term inside a belief report?
Because belief contexts are referentially opaque: an agent can believe a sentence true of one name for a thing while not believing the same sentence true of another, equally correct name for that thing, so substitution that is always safe outside belief contexts can change the truth value inside one.

Glossary

Category
A class of objects, which can be represented either as a unary predicate or reified as an object with SubclassOf and MemberOf relations.
Inheritance
The default transfer of a property asserted of a category to its subclasses and instances, absent an overriding statement.
PartOf
A relation of physical composition between a component and the whole it belongs to, distinct from the SubclassOf category hierarchy.
Situation calculus
A formalism representing the world as a sequence of situations connected by actions, used to reason about the effects of acting over time.
Frame problem
The challenge of concisely specifying which facts an action leaves unchanged, without enumerating every unaffected fluent explicitly.
Propositional attitude
A mental relation (such as belief or knowledge) that an agent bears toward a proposition, requiring representation distinct from the proposition's own truth.
Practical Activity

Sketching a Semantic Network on Paper

A fully paper-based, simulated exercise: for a small office domain (a printer, a toner cartridge, a person, and a scheduled meeting), draw by hand a category hierarchy with SubclassOf and MemberOf links, add one PartOf relation, represent one event with a time relative to another event, and write one belief statement of the form Believes(Agent, Sentence) that is false of the world but true as a belief. No software or real data of any kind is used.

Ready to test yourself?

5 questions on this module.

Start Quiz