Knowledge Representation and Expert Systems

This chapter covers how AI systems represent what they know — logic, semantic networks, frames, rules, scripts, conceptual dependency and ontologies — and how that representation is put to work in expert systems, including how they handle uncertainty.

Semantic Networks, Frames and Scripts

Four named knowledge-representation schemes
SchemeStructure and what it is good at
Semantic networkA graph of nodes (concepts) linked by labelled edges (relations, e.g. IS-A, HAS-A) — naturally supports INHERITANCE, where a property attached to a general node (Bird → CanFly) is inherited by more specific nodes (Sparrow) unless explicitly overridden lower in the hierarchy (Penguin → cannot fly).
FrameA structured record for a concept with named SLOTS holding values or pointers to other frames (much like an object-oriented class) — a slot can carry a DEFAULT value used unless a specific instance overrides it, which is how a frame system also supports inheritance-with-exceptions.
ScriptA stereotyped sequence of events for a recurring, standard situation (e.g. the 'restaurant script': enter, be seated, order, eat, pay, leave) — lets a system fill in expected but UNSTATED details of a narrative, since a script encodes what normally happens even when a specific telling of the story skips steps.
Conceptual dependency (CD)Represents the MEANING of a sentence using a small, fixed set of primitive actions (e.g. PTRANS for a physical transfer of location, ATRANS for a transfer of an abstract relationship like ownership) rather than the sentence's own words — the goal is that two sentences with the same meaning in different words ('X gave Y to Z' and 'Z received Y from X') produce the SAME CD representation, unlike a purely syntactic parse.

Ontologies and Logic-Based Representation

An ontology is an explicit, formal specification of a domain's concepts and the relationships between them, shared and agreed upon so that different systems (or different people) mean the SAME thing by the same term — this shared-vocabulary role is precisely what the course's Discrete Mathematics chapter's propositional/first-order LOGIC gives a syntax and semantics for, and what this chapter's Web Programming/Semantic Web connection (covered again in this unit's own multi-agent-systems chapter) actually deploys ontologies for at scale. Logic-based representation states knowledge as formulas that can be manipulated by sound inference rules (modus ponens, resolution) to derive new facts — its strength is precision and provable correctness of what follows from what; its weakness is that many everyday facts ('birds typically fly') are not cleanly true-or-false in the way pure logic assumes, which is exactly the gap fuzzy sets (covered later in this unit) exist to fill.

Expert Systems

An expert system captures a human specialist's domain knowledge and reasoning process so a program can answer questions or make decisions at (approximately) expert level within that narrow domain. Its architecture has two DELIBERATELY SEPARATED parts: the KNOWLEDGE BASE (the domain facts and rules, e.g. 'IF fever AND rash THEN consider measles') and the INFERENCE ENGINE (the general reasoning machinery that applies those rules to a specific case) — this separation is what lets the same inference engine be reused across entirely different domains simply by swapping in a different knowledge base, and lets a domain expert update the rules without needing to understand or rewrite the reasoning machinery itself.

  • Forward chaining starts from known facts and repeatedly fires rules whose conditions are satisfied, deriving new facts, until the goal is reached or nothing new can be derived — a DATA-DRIVEN strategy, natural when there is a fixed set of facts and the question is 'what can we conclude'.
  • Backward chaining starts from a HYPOTHESIS (a goal to prove) and works backward, checking whether each rule's conditions can themselves be established (recursively, as sub-goals) — a GOAL-DRIVEN strategy, natural for diagnosis-style questions ('is it measles?') where checking one specific hypothesis is cheaper than deriving everything derivable from the facts.
ℹ️ Handling uncertainty: certainty factors versus formal probability
Classical expert systems (e.g. MYCIN) attached a CERTAINTY FACTOR (a heuristic number, typically in [−1, 1], NOT a formal probability) to each rule and combined them with ad hoc combination rules — computationally cheap, but without the rigorous guarantees Bayesian probability provides, since certainty factors were not derived from an underlying probability model and can behave inconsistently under some combinations. This is exactly why fuzzy logic (membership degrees with well-defined operations) and Bayesian networks (probabilities with formally justified update rules) are presented as more principled alternatives elsewhere in this unit and course, respectively.

Sources of Uncertainty in Knowledge

  • Incompleteness: not all relevant facts about a case may be known or knowable at decision time.
  • Imprecision: the facts that ARE known may themselves be vague or approximate rather than exact ('the patient has a high fever' rather than an exact temperature).
  • Unreliability: a source of evidence (a test, a sensor, a witness) may itself be imperfectly reliable, so even a definite-sounding fact carries some residual doubt.
  • These three sources are conceptually distinct, and different formal tools target different ones: probability theory is well suited to unreliability/incompleteness (given enough data about how often a source is right); fuzzy logic (this unit's own dedicated chapter) is specifically built for imprecision — vague linguistic categories that are not fundamentally about randomness at all.

Key takeaways

  • Semantic networks give natural inheritance via IS-A links; frames give inheritance-with-exceptions via slots and defaults; scripts fill in unstated but expected details of a stereotyped situation.
  • Conceptual dependency represents meaning via primitive actions (PTRANS, ATRANS) so differently-worded sentences with the same meaning get the same representation.
  • An expert system separates a domain-specific knowledge base from a reusable, general inference engine; forward chaining is data-driven, backward chaining goal-driven.
  • Classical certainty factors are heuristic, not formal probability, and can behave inconsistently — Bayesian probability and fuzzy logic are more principled alternatives.
  • Incompleteness, imprecision and unreliability are distinct sources of uncertainty targeted by different formal tools — probability for the first and third, fuzzy logic for imprecision.

Practice questions (8)

Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.

  1. In a semantic network, a property attached to a general node being available to more specific nodes below it, unless explicitly overridden, is called:

    1. Inheritance
    2. Forward chaining
    3. A certainty factor
    4. A conceptual dependency primitive
    Show answer

    Answer: A — Inheritance

    Inheritance via IS-A links is exactly what lets a semantic network state a fact once at a general level (Bird can fly) and have it apply automatically to specific instances (Sparrow), with exceptions (Penguin) stated explicitly lower down.
  2. A script (as a knowledge-representation scheme) is best suited to:

    1. Filling in unstated but expected details of a recurring, stereotyped situation
    2. Storing exact mathematical formulas only
    3. Representing a graph with no edges
    4. Replacing logic entirely in every AI system
    Show answer

    Answer: A — Filling in unstated but expected details of a recurring, stereotyped situation

    A script encodes what normally happens in a standard situation (like a restaurant visit), letting a system infer steps a specific narrative left unstated because they are the expected default.
  3. In conceptual dependency (CD), the goal of using a small set of primitive actions like PTRANS and ATRANS is:

    1. Sentences with the same meaning in different words produce the same representation
    2. Every sentence must use exactly the same words
    3. Grammar becomes irrelevant to all languages
    4. Only single-word sentences can be represented
    Show answer

    Answer: A — Sentences with the same meaning in different words produce the same representation

    CD deliberately abstracts away from surface wording to a small set of meaning primitives, so 'X gave Y to Z' and 'Z received Y from X' — different words, same underlying event — map to the same representation.
  4. Separating an expert system's knowledge base from its inference engine chiefly allows:

    1. The same inference engine to be reused across different domains by swapping the knowledge base
    2. The system to work without any rules at all
    3. Only one domain to ever be modelled by any expert system
    4. The domain expert to have to rewrite the reasoning machinery for every update
    Show answer

    Answer: A — The same inference engine to be reused across different domains by swapping the knowledge base

    The clean separation is exactly why the same general-purpose reasoning machinery can serve completely different domains (medical diagnosis, financial advice) just by loading a different set of domain rules and facts.
  5. Backward chaining, compared to forward chaining, is best described as:

    1. Goal-driven, starting from a hypothesis and checking whether its supporting conditions can be established
    2. Data-driven, starting from known facts and deriving everything possible
    3. Identical to forward chaining in every respect
    4. Usable only when no rules exist
    Show answer

    Answer: A — Goal-driven, starting from a hypothesis and checking whether its supporting conditions can be established

    Backward chaining works backward from a specific hypothesis to prove, which is exactly why it suits diagnosis-style questions where testing one specific guess is cheaper than deriving everything derivable from the facts (forward chaining's own approach).
  6. Which of the following are among the three named sources of uncertainty in knowledge? (More than one option may be correct.)

    1. Incompleteness
    2. Imprecision
    3. Unreliability
    4. Compilation speed
    Show answer

    Answer: A — Incompleteness; B — Imprecision; C — Unreliability

    Incompleteness, imprecision and unreliability are the three named sources, each targeted by different formal tools; compilation speed is a compiler-design concern, unrelated to knowledge uncertainty.
  7. Name the two structurally separate components of a classical expert system's architecture (the domain facts/rules, and the general reasoning machinery that applies them).

    Numerical answer — type the value.

    Show answer

    Answer: knowledge base and inference engine

    The knowledge base holds domain-specific facts and rules; the inference engine is the reusable, general reasoning machinery applied to them — the separation is what enables reuse of the engine across domains.
  8. Certainty factors, as used in classical expert systems like MYCIN, are best described as:

    1. Heuristic numbers, not formally derived probabilities, combined with ad hoc rules
    2. Exact Bayesian probabilities derived from a rigorous underlying model
    3. Guaranteed to behave consistently under every possible combination
    4. Identical to fuzzy set membership degrees
    Show answer

    Answer: A — Heuristic numbers, not formally derived probabilities, combined with ad hoc rules

    Certainty factors are a pragmatic heuristic, not formally derived from a probability model, and are combined with ad hoc rules that can behave inconsistently — which is exactly why more principled alternatives (Bayesian probability, fuzzy logic) are used elsewhere.