Skip to content
AL-304 · Artificial Intelligence/Quick Revision Short Notes

Artificial Intelligence (AL-304) - Unit 3 Short Notes

How unit 3 is examined

This unit covers reasoning under uncertainty (Bayes' theorem), structured knowledge representations (semantic networks, scripts, schemas, frames, conceptual dependency) and forward versus backward reasoning; Bayes' theorem, semantic networks and forward/backward reasoning carry the most marks.

Probabilistic reasoning

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. Probabilistic reasoning represents uncertain knowledge with probabilities and updates them as evidence arrives, so an agent can still choose the best action when facts are incomplete or unreliable. <mark>Uncertainty arises when an agent cannot be sure of a fact, and probability theory lets it reason with degrees of belief instead of true or false.</mark>

Key points.

  1. Uncertainty means the agent lacks certain knowledge of the world state, so pure true/false logic cannot decide.
  2. Incomplete information is a cause: the agent cannot observe everything, for example a doctor without test results.
  3. Noisy data, such as a faulty temperature sensor, gives unreliable inputs.
  4. Contradictory data from different sources or experts leaves the agent unsure which to trust.
  5. Vague or fuzzy statements such as "tall" or "hot" have no crisp truth value.
  6. Dynamic environments change while the agent reasons, for example traffic changing mid-route.
  7. Handling methods: Bayes' theorem, Bayesian networks (a directed graph of variables with conditional probability tables) and fuzzy logic (degrees of truth from 0 to 1).

Formula. $P(H|E)=\dfrac{P(E|H)\,P(H)}{P(E)}$ with prior $P(H)$, likelihood $P(E|H)$ and posterior $P(H|E)$.

Spam example. $P(\text{spam})=0.4$, $P(\text{free}|\text{spam})=0.5$, $P(\text{free}|\text{ham})=0.05$. Then $P(\text{free})=0.5(0.4)+0.05(0.6)=0.23$ and $P(\text{spam}|\text{free})=0.2/0.23$, so $P(\text{spam}|\text{free})\approx 0.87$.

Answer frame. Open with the definition of uncertainty; list the five causes as one-line points; then state the Bayes formula with its three components and one AI example such as spam filtering; close by saying probability manages uncertainty by updating belief.

Asked: [6 marks] (Jun 2023) Explain the causes of uncertainty in AI. Asked: [7 marks] (Dec 2025) Explain probabilistic reasoning and Bayes' theorem.

Bayes' theorem

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>

Definition. ==Bayes' theorem gives the probability of a hypothesis A after seeing evidence B as $P(A|B)=\dfrac{P(B|A)\,P(A)}{P(B)}$, combining prior belief with the likelihood of the evidence.==

Derivation. From the definition of conditional probability:

$$P(A|B)=\frac{P(A\cap B)}{P(B)},\qquad P(B|A)=\frac{P(A\cap B)}{P(A)}$$

Hence $P(A\cap B)=P(B|A)P(A)$; substituting into the first gives $P(A|B)=\dfrac{P(B|A)P(A)}{P(B)}$, where $P(B)=\sum_i P(B|A_i)P(A_i)$.

Key points.

  1. $P(A)$ is the prior, the belief in A before the evidence is seen.
  2. $P(B|A)$ is the likelihood, how probable the evidence is if A is true.
  3. $P(B)$ is the evidence or marginal likelihood, and it normalises the result so probabilities sum to 1.
  4. $P(A|B)$ is the posterior, the updated belief after the evidence.
  5. Advantage: beliefs are updated systematically as new evidence arrives, prior to posterior.
  6. Advantage: it handles incomplete and noisy data, and unlike the frequentist view it carries prior knowledge forward.
  7. Advantage: it has a sound mathematical semantics and is the foundation of Bayesian networks.
  8. Advantage (transparency): Bayes treats probability as a subjective degree of belief with explicit, inspectable priors, so its handling of uncertainty is transparent; the frequentist view instead treats probability as long-run frequency and uses no priors.
  9. Applications: medical diagnosis; spam filtering (P(spam | words)); the Naive Bayes classifier (highest-posterior class, words assumed independent); speech recognition (most probable words given the sound); robotics (Bayes filters update position belief from noisy sensors); recommendation systems (probability a user likes an item given past ratings); image recognition and fault diagnosis.
  10. Disadvantages: it needs prior probabilities that are often unknown or guessed, the full joint probability table grows exponentially ($2^n$ entries for $n$ Boolean variables), and practical use needs independence assumptions (as in Naive Bayes) that may not hold.

Comparison with other frameworks.

Basis Bayes Certainty factors (MYCIN) Dempster-Shafer Fuzzy logic
Basis Probability theory Expert-assigned belief minus disbelief, from -1 to +1 Belief functions over sets of hypotheses Degree of membership in vague sets, 0 to 1
Handles Randomness in events Rule-based expert confidence Ignorance and conflicting evidence Vagueness ("tall", "hot")
Semantics Formal and consistent Ad hoc, can give inconsistent results Formal, but combination is costly Formal for vagueness, not for chance
Basis Bayesian Frequentist Fuzzy logic Dempster-Shafer
--- --- --- --- ---
Priors Required None None Mass functions, no single prior
Uncertainty type Degree of belief about chance events Long-run frequency Vagueness Ignorance and conflict
Data needs Prior plus evidence, works with little data Large samples Expert membership functions Evidence from several sources

Example. A disease has $P(D)=0.01$; a test has $P(+|D)=0.9$ and false-positive rate $P(+|\neg D)=0.05$.

Step Working
Evidence $P(+)=0.9(0.01)+0.05(0.99)=0.0585$
Posterior $P(D\mid +)=\dfrac{0.9\times0.01}{0.0585}$

$P(D|+)\approx 0.154$, so a positive test still gives only about 15% chance of disease because the prior is small.

Answer frame. Open with the definition and formula; write the derivation in two lines; define the four terms; then develop advantages (points 5-8) or applications (point 9) depending on the question; for "compared to other frameworks", add the comparison table and point 10; close with the worked example and a line on its role in Bayesian networks.

Pitfall: Confusing $P(A|B)$ with $P(B|A)$; the two are equal only when $P(A)=P(B)$.

Asked: [8 marks] (Jun 2023, Jun 2024, Jun 2025) Define Bayes' theorem. Explain its applications and significance in probabilistic reasoning. Asked: [7 marks] (Nov 2022) Explain Bayes's theorem. Asked: [7 marks] (Dec 2023) What are the key advantages of using Bayes theorem compared to other probability frameworks?

Semantic networks

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>

Definition. <mark>A semantic network is a directed graph in which nodes represent concepts or objects and labelled edges represent the relationships between them.</mark>

Diagram. <figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u3-01" viewBox="0 0 467 381" width="467" height="381" role="img" aria-label="Ani = Animal, Bir = Bird, Can = Canary, Fly = fly, Yel = yellow, Twe = Tweety, Win = wings. Canary inherits "can fly" from Bird; Tweety is an instance of Canary."><style>#dsfig-u3-01 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u3-01 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u3-01 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u3-01 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u3-01 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u3-01 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u3-01 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u3-01 .t{fill:#16181D;font-weight:500}#dsfig-u3-01 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u3-01 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u3-01 .dot{fill:#16181D}#dsfig-u3-01 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u3-01 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u3-01 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u3-01 .ah{fill:#454C5A}#dsfig-u3-01 .ah.hi{fill:#2340B8}#dsfig-u3-01 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u3-01 .wl .t{font-size:12px;font-weight:700}#dsfig-u3-01 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u3-01 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u3-01 .e{stroke:#B1B7C3}html.dark #dsfig-u3-01 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u3-01 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u3-01 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u3-01 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u3-01 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u3-01 .t{fill:#E6E8ED}html.dark #dsfig-u3-01 .t.inv{fill:#0F1115}html.dark #dsfig-u3-01 .kd{stroke:#E6E8ED}html.dark #dsfig-u3-01 .dot{fill:#E6E8ED}html.dark #dsfig-u3-01 .ann{fill:#8FA3FF}html.dark #dsfig-u3-01 .lbl{fill:#858D9C}html.dark #dsfig-u3-01 .ptr{fill:#8FA3FF}html.dark #dsfig-u3-01 .ah{fill:#B1B7C3}html.dark #dsfig-u3-01 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u3-01 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u3-01 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u3-01 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah9" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh9" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M153.2,115.5 L57.5,51.6" marker-end="url(#ah9)"/><path class="e" d="M282.2,201.5 L186.5,137.6" marker-end="url(#ah9)"/><path class="e" d="M186.2,118 L279,74.7" marker-end="url(#ah9)"/><path class="e" d="M317,212 L406,212" marker-end="url(#ah9)"/><path class="e" d="M413.6,327.6 L312.8,226.8" marker-end="url(#ah9)"/><path class="e" d="M153.2,136.5 L57.5,200.4" marker-end="url(#ah9)"/><g class="wl"><rect x="84.1" y="74" width="40.8" height="18" rx="9"/><text class="t" x="104.5" y="83" dy=".35em" text-anchor="middle">is-a</text></g><g class="wl"><rect x="213.1" y="160" width="40.8" height="18" rx="9"/><text class="t" x="233.5" y="169" dy=".35em" text-anchor="middle">is-a</text></g><g class="wl"><rect x="216.7" y="86.9" width="33.6" height="18" rx="9"/><text class="t" x="233.5" y="95.9" dy=".35em" text-anchor="middle">can</text></g><g class="wl"><rect x="335.4" y="203" width="54.3" height="18" rx="9"/><text class="t" x="362.5" y="212" dy=".35em" text-anchor="middle">colour</text></g><g class="wl"><rect x="317.8" y="267.5" width="89.4" height="18" rx="9"/><text class="t" x="362.5" y="276.5" dy=".35em" text-anchor="middle">instance-of</text></g><g class="wl"><rect x="81" y="160" width="47.1" height="18" rx="9"/><text class="t" x="104.5" y="169" dy=".35em" text-anchor="middle">has-a</text></g><circle class="n" cx="40" cy="40" r="18"/><text class="t" x="40" y="40" dy=".35em" text-anchor="middle">Ani</text><circle class="n" cx="169" cy="126" r="18"/><text class="t" x="169" y="126" dy=".35em" text-anchor="middle">Bir</text><circle class="n" cx="298" cy="212" r="18"/><text class="t" x="298" y="212" dy=".35em" text-anchor="middle">Can</text><circle class="n" cx="298" cy="65.8" r="18"/><text class="t" x="298" y="65.8" dy=".35em" text-anchor="middle">Fly</text><circle class="n" cx="427" cy="212" r="18"/><text class="t" x="427" y="212" dy=".35em" text-anchor="middle">Yel</text><circle class="n" cx="427" cy="341" r="18"/><text class="t" x="427" y="341" dy=".35em" text-anchor="middle">Twe</text><circle class="n" cx="40" cy="212" r="18"/><text class="t" x="40" y="212" dy=".35em" text-anchor="middle">Win</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Ani = Animal, Bir = Bird, Can = Canary, Fly = fly, Yel = yellow, Twe = Tweety, Win = wings. Canary inherits "can fly" from Bird; Tweety is an instance of Canary.</figcaption></figure>

Key points.

  1. Nodes stand for concepts (Animal, Bird) or instances (Tweety), and directed labelled arcs stand for relations.
  2. IS-A links a class to its superclass (Bird is-a Animal), and instance-of links an individual to its class.
  3. HAS-A or part-of links attach components (Bird has wings).
  4. Property inheritance lets a node inherit properties of its ancestors, so "can fly" is stored once at Bird and not repeated at Canary.
  5. Knowledge is stored once and found by following links; limitations: no standard meaning for links, poor handling of exceptions (penguin) and quantifiers, and searching large networks is slow.

Design example (weather). <figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u3-02" viewBox="0 0 596 338" width="596" height="338" role="img" aria-label="Wea = Weather, Rin = Rain, Sun = Sunny, Cdy = Cloudy, Pre = Precipitation, Hum = Humidity, HiH = High humidity, Tmp = Temperature, Hi = High, Lo = Low, Cld = Clouds (cloud type), Drk = Dark, Clr = Clear sky, Sea = Season, Smr = Summer."><style>#dsfig-u3-02 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u3-02 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u3-02 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u3-02 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u3-02 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u3-02 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u3-02 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u3-02 .t{fill:#16181D;font-weight:500}#dsfig-u3-02 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u3-02 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u3-02 .dot{fill:#16181D}#dsfig-u3-02 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u3-02 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u3-02 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u3-02 .ah{fill:#454C5A}#dsfig-u3-02 .ah.hi{fill:#2340B8}#dsfig-u3-02 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u3-02 .wl .t{font-size:12px;font-weight:700}#dsfig-u3-02 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u3-02 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u3-02 .e{stroke:#B1B7C3}html.dark #dsfig-u3-02 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u3-02 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u3-02 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u3-02 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u3-02 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u3-02 .t{fill:#E6E8ED}html.dark #dsfig-u3-02 .t.inv{fill:#0F1115}html.dark #dsfig-u3-02 .kd{stroke:#E6E8ED}html.dark #dsfig-u3-02 .dot{fill:#E6E8ED}html.dark #dsfig-u3-02 .ann{fill:#8FA3FF}html.dark #dsfig-u3-02 .lbl{fill:#858D9C}html.dark #dsfig-u3-02 .ptr{fill:#8FA3FF}html.dark #dsfig-u3-02 .ah{fill:#B1B7C3}html.dark #dsfig-u3-02 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u3-02 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u3-02 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u3-02 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah10" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh10" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M427,279 L427,61" marker-end="url(#ah10)"/><path class="e" d="M446,40 L535,40" marker-end="url(#ah10)"/><path class="e" d="M440.4,284.6 L541.2,183.8" marker-end="url(#ah10)"/><path class="e" d="M182.4,155.6 L283.2,54.8" marker-end="url(#ah10)"/><path class="e" d="M298,150 L298,61" marker-end="url(#ah10)"/><path class="e" d="M413.6,155.6 L312.8,54.8" marker-end="url(#ah10)"/><path class="e" d="M155.6,182.4 L54.8,283.2" marker-end="url(#ah10)"/><path class="e" d="M40,59 L40,148" marker-end="url(#ah10)"/><path class="e" d="M40,188 L40,277" marker-end="url(#ah10)"/><path class="e" d="M556,59 L556,148" marker-end="url(#ah10)"/><path class="e" d="M556,59 L556,277" marker-end="url(#ah10)"/><path class="e" d="M169,59 L169,277" marker-end="url(#ah10)"/><path class="e" d="M177.5,57 L288.6,279.2" marker-end="url(#ah10)"/><path class="e" d="M169,279 L169,190" marker-end="url(#ah10)"/><path class="e" d="M298,279 L298,190" marker-end="url(#ah10)"/><g class="wl"><rect x="406.6" y="160" width="40.8" height="18" rx="9"/><text class="t" x="427" y="169" dy=".35em" text-anchor="middle">is-a</text></g><g class="wl"><rect x="439.6" y="31" width="103.8" height="18" rx="9"/><text class="t" x="491.5" y="40" dy=".35em" text-anchor="middle">has-attribute</text></g><g class="wl"><rect x="439.6" y="224.5" width="103.8" height="18" rx="9"/><text class="t" x="491.5" y="233.5" dy=".35em" text-anchor="middle">has-attribute</text></g><g class="wl"><rect x="213.1" y="95.5" width="40.8" height="18" rx="9"/><text class="t" x="233.5" y="104.5" dy=".35em" text-anchor="middle">is-a</text></g><g class="wl"><rect x="277.6" y="95.5" width="40.8" height="18" rx="9"/><text class="t" x="298" y="104.5" dy=".35em" text-anchor="middle">is-a</text></g><g class="wl"><rect x="342.1" y="95.5" width="40.8" height="18" rx="9"/><text class="t" x="362.5" y="104.5" dy=".35em" text-anchor="middle">is-a</text></g><g class="wl"><rect x="84.1" y="224.5" width="40.8" height="18" rx="9"/><text class="t" x="104.5" y="233.5" dy=".35em" text-anchor="middle">is-a</text></g><g class="wl"><rect x="2" y="95.5" width="75.9" height="18" rx="9"/><text class="t" x="40" y="104.5" dy=".35em" text-anchor="middle">has-value</text></g><g class="wl"><rect x="12.8" y="224.5" width="54.3" height="18" rx="9"/><text class="t" x="40" y="233.5" dy=".35em" text-anchor="middle">causes</text></g><g class="wl"><rect x="518.1" y="95.5" width="75.9" height="18" rx="9"/><text class="t" x="556" y="104.5" dy=".35em" text-anchor="middle">has-value</text></g><g class="wl"><rect x="518.1" y="160" width="75.9" height="18" rx="9"/><text class="t" x="556" y="169" dy=".35em" text-anchor="middle">has-value</text></g><g class="wl"><rect x="131.1" y="160" width="75.9" height="18" rx="9"/><text class="t" x="169" y="169" dy=".35em" text-anchor="middle">has-value</text></g><g class="wl"><rect x="195.6" y="160" width="75.9" height="18" rx="9"/><text class="t" x="233.5" y="169" dy=".35em" text-anchor="middle">has-value</text></g><g class="wl"><rect x="131.1" y="224.5" width="75.9" height="18" rx="9"/><text class="t" x="169" y="233.5" dy=".35em" text-anchor="middle">indicates</text></g><g class="wl"><rect x="260.1" y="224.5" width="75.9" height="18" rx="9"/><text class="t" x="298" y="233.5" dy=".35em" text-anchor="middle">indicates</text></g><circle class="n" cx="298" cy="40" r="18"/><text class="t" x="298" y="40" dy=".35em" text-anchor="middle">Wea</text><circle class="n" cx="169" cy="169" r="18"/><text class="t" x="169" y="169" dy=".35em" text-anchor="middle">Rin</text><circle class="n" cx="298" cy="169" r="18"/><text class="t" x="298" y="169" dy=".35em" text-anchor="middle">Sun</text><circle class="n" cx="427" cy="169" r="18"/><text class="t" x="427" y="169" dy=".35em" text-anchor="middle">Cdy</text><circle class="n" cx="40" cy="298" r="18"/><text class="t" x="40" y="298" dy=".35em" text-anchor="middle">Pre</text><circle class="n" cx="40" cy="169" r="18"/><text class="t" x="40" y="169" dy=".35em" text-anchor="middle">HiH</text><circle class="n" cx="40" cy="40" r="18"/><text class="t" x="40" y="40" dy=".35em" text-anchor="middle">Hum</text><circle class="n" cx="556" cy="40" r="18"/><text class="t" x="556" y="40" dy=".35em" text-anchor="middle">Tmp</text><circle class="n" cx="556" cy="169" r="18"/><text class="t" x="556" y="169" dy=".35em" text-anchor="middle">Hi</text><circle class="n" cx="556" cy="298" r="18"/><text class="t" x="556" y="298" dy=".35em" text-anchor="middle">Lo</text><circle class="n" cx="169" cy="40" r="18"/><text class="t" x="169" y="40" dy=".35em" text-anchor="middle">Cld</text><circle class="n" cx="169" cy="298" r="18"/><text class="t" x="169" y="298" dy=".35em" text-anchor="middle">Drk</text><circle class="n" cx="298" cy="298" r="18"/><text class="t" x="298" y="298" dy=".35em" text-anchor="middle">Clr</text><circle class="n" cx="427" cy="40" r="18"/><text class="t" x="427" y="40" dy=".35em" text-anchor="middle">Sea</text><circle class="n" cx="427" cy="298" r="18"/><text class="t" x="427" y="298" dy=".35em" text-anchor="middle">Smr</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Wea = Weather, Rin = Rain, Sun = Sunny, Cdy = Cloudy, Pre = Precipitation, Hum = Humidity, HiH = High humidity, Tmp = Temperature, Hi = High, Lo = Low, Cld = Clouds (cloud type), Drk = Dark, Clr = Clear sky, Sea = Season, Smr = Summer.</figcaption></figure> Rain, Sunny and Cloudy are is-a subclasses of Weather; Temperature, Humidity and Clouds carry has-value links to High/Low and Dark/Clear; High humidity causes Precipitation, and Rain is-a Precipitation. A link cannot stand for absence ("no dark clouds"), so a positive Clear sky node is used, since negation is a weakness of semantic nets. Rules: (1) IF Clouds has-value Dark AND Humidity has-value High THEN Rain; (2) IF Season = Summer (Summer is-a Season) AND Temperature High AND Clouds Clear THEN Sunny; (3) IF Temperature is Low AND Humidity is High THEN Rain is likely. Summer is-a Season, Season has-attribute Temperature (level), and Summer has-attribute High Temperature.

Comparison (semantic net, frame, script).

Basis Semantic network Frame Script
Unit Nodes and labelled links Slots and fillers Scenes, roles, props
Represents Concepts and relations A stereotyped object A stereotyped event sequence
Use in KR Concept hierarchies, taxonomies Objects with attributes and defaults Story and dialogue understanding
Inference Inheritance through is-a links Defaults and demons Filling in missing events
Example Canary is-a Bird Patient frame Restaurant script

Answer frame. Open with the definition; draw the Animal-Bird-Canary network (or the weather network if asked to design); develop points 1-4 in order; close with advantages and limitations. For "describe semantic networks, frames and scripts", give a short paragraph on each and end with the comparison table above.

Asked: [7 marks] (Nov 2022, Dec 2024) Write about semantic networks used in AI; what are they in knowledge representation? Give an example. Asked: [7 marks] (Jun 2025) Design a simple knowledge base using semantic networks for a weather prediction system. Asked: [7 marks] (Dec 2025) Describe semantic networks, frames and scripts.

Scripts

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. <mark>A script is a frame-like structure that describes a stereotypical sequence of events in a familiar situation, such as eating in a restaurant.</mark>

Key points.

  1. Components are entry conditions (customer hungry, has money), roles (customer, waiter), props (table, menu, bill), named scenes (Entering, Ordering, Eating, Paying) and results (customer fed, has less money).
  2. Scripts fill in unstated events (assuming the bill was paid) and give expectations, so a departure signals something unusual.
  3. In chatbots, scripts drive conversation flow (restaurant reservation, flight booking), which improves coherence and reduces repeated questions.
  4. Limitations: they are rigid and cover only routine situations.
Basis Frame Script Schema
Focus An object or concept A sequence of events A general organised pattern of knowledge
Structure Slots and fillers Scenes, roles, props Generalised mental framework
Time ordering None Strict temporal order None required
Example Patient frame Restaurant script "Restaurant" knowledge in memory
Chatbot use Slot filling (destination, date) Dialogue flow Context tracking
Use in KR Objects with attributes and defaults Routine event sequences General pattern for interpreting new data
Inference Inheritance through is-a links, defaults and demons Filling in missing, unstated events Matching new input to expectations

Virtual assistants (Alexa, Siri style). A frame per intent (PlayMusic: artist, song, device) is filled by slot filling and the assistant asks only for empty slots; a script (morning routine, ordering food) keeps the dialogue flow; a schema holds the user profile and current context, so "play more of that" resolves to the last song and defaults such as favourite artist personalise replies. The impact is fewer repeated questions, more coherent dialogue, a higher task completion rate and personalised replies.

Answer frame. For "differentiate", open with three one-line definitions, then draw the table and finish with applications in KR. For the chatbot question, give the definitions, one application each (flow, slot-filling, context tracking) and close on coherence and personalised interaction.

Asked: [7 marks] (Dec 2024) Investigate the role of scripts, schemas and frames in AI chatbots and virtual assistants; assess their potential for improving user interactions. Asked: [7 marks] (Jun 2024) Differentiate between scripts, schemas and frames. How are they applied in knowledge representation?

Schemas

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. A schema is a generalised knowledge structure that organises concepts, their attributes and relationships, so new experience can be interpreted and stored.

Key points.

  1. Schemas come from cognitive psychology and give the mind, or a program, a framework for interpreting new information.
  2. They hold default expectations that are updated by experience.
  3. Frames and scripts are specialised schemas, one for objects and one for event sequences.
  4. In dialogue systems a schema tracks context and expectations.
  5. In KR and reasoning a schema supplies defaults (a "restaurant" schema assumes a menu) and works by assimilation: new input that fits is absorbed into the schema, and a misfit forces the schema to be revised.

Frames

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. <mark>A frame is a data structure that represents a stereotyped object or situation as a collection of slots (attributes), each holding a filler (value), default value or attached procedure.</mark>

Key points.

  1. Slots are attributes such as Age, and fillers are their values, which may be numbers, text or other frames.
  2. Default values are used when no value is known and can be overridden by specific ones.
  3. Frames form an is-a hierarchy, so a child frame inherits slots and defaults from its parent.
  4. Attached procedures (demons) run automatically: if-needed computes a value when asked, and if-added fires when a value is set.
  5. Application (medical diagnosis): a Patient frame has slots Age, Symptoms, History and default Treatment; a Child-Patient frame inherits them and overrides the inherited default Treatment = rest with Treatment = weight-based dosage, and an if-added demon flags high fever.
  6. Limitation (defaults and exceptions): defaults can be overridden or cancelled, so no inherited property is guaranteed. A frame therefore cannot give necessary and sufficient conditions for a class; a three-legged elephant is still an elephant, so "four legs" cannot define Elephant.
  7. Limitation (multiple inheritance): a frame with two parents may inherit conflicting defaults. In the Nixon diamond, Nixon is-a Quaker (default: pacifist) and is-a Republican (default: not pacifist), and the frame system has no principled way to decide which value to inherit.
  8. Limitation (no formal semantics): slot names and links mean whatever the designer intends, so two systems can read the same frame differently and inference cannot be proved correct.
  9. Limitation (rigidity and procedures): a fixed slot structure fits stereotyped cases badly, and demons hide procedural code whose effects are hard to predict or verify.
  10. Fixes: exceptions by overriding rules (the most specific frame wins) or non-monotonic reasoning; multiple-inheritance conflict by priority ordering or skeptical inheritance (accept nothing when parents disagree); rigidity by slot constraints; description logics give frames formal semantics, automatic classification (subsumption) and consistency checking.
  11. Enhancement: OWL ontologies are built on description logics and give a standard, shareable format with off-the-shelf reasoners.
  12. Alternative: object-oriented KR maps frames to classes, attributes and methods, with inheritance and encapsulation giving a practical, implementable form.

Worked run (Patient frame). Slots: Age, Symptoms, Treatment (default: rest). A nurse fills Symptoms = fever, so a value is filled. Child-Patient sets Treatment = weight-based dosage on the same slot, overriding the inherited default Treatment = rest. The instance Patient-101 (instance-of Child-Patient) therefore gets weight-based dosage, not rest. Setting Temperature = 103 F fires the if-added demon, which raises the flag High-fever. A second domain is course registration, where an if-needed demon computes Fees from Credits and an if-added demon rejects Credits above a default Max-credits of 24.

Answer frame. For "explain terms", give two lines each on frames, scripts and conceptual dependency. For the application, open with the definition, draw the Patient frame as a box of slots, show inheritance and a demon, and close on efficiency. For limitations, develop points 6-9 with the elephant and Nixon examples, then enhancements 10-12, and close with description logics and OWL as the modern fix.

Asked: [7 marks] (Nov 2022) Explain these terms: i) Frames ii) Scripts iii) Conceptual dependency. Asked: [7 marks] (Dec 2024) Analyze a real-world problem and suggest how frames can be used to represent the knowledge required to solve it. Asked: [7 marks] (Jun 2024) Evaluate the limitations of frames in knowledge representation and propose enhancements or alternatives.

Conceptual dependency

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. Conceptual dependency (CD) is Schank's theory that represents the meaning of sentences with a small set of primitive acts, independent of the words used.

Key points.

  1. The 11 primitive ACTs are ATRANS (transfer of possession, give), PTRANS (physical transfer of location, go), PROPEL (apply force, push), MOVE (move a body part, kick), GRASP (grasp an object, clutch), INGEST (take into the body, eat), EXPEL (expel from the body, cry), MTRANS (transfer of mental information, tell), MBUILD (build new information, decide), SPEAK (produce sounds, say) and ATTEND (focus a sense organ, listen).
  2. Schank's conceptual categories are PP (picture producer, a physical object or person), ACT (an action), PA (picture aider, an attribute of a PP such as colour), AA (action aider, an attribute of an ACT such as speed), T (time) and LOC (location).
  3. Diagram notation: a double arrow joins actor and ACT, o marks the object, R the recipient case with to/from arrows, D the direction case, I the instrument, and p (past) or f (future) over the double arrow gives the tense.
  4. Worked sentence: "Ram gave Sita a book" is ATRANS with actor Ram, object book, from Ram to Sita, in the past; this is drawn below.
  5. CD supports inference and language understanding, since implied facts follow from the primitives.

Example. "Ram gave Sita a book":

          p        o           R  +--> Sita
   Ram <=====> ATRANS <--- book <-----|
                                      +--< Ram

Forward and backward reasoning

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>

Definition. <mark>Forward reasoning (forward chaining) is data-driven, starting from known facts and applying rules to reach a goal; backward reasoning (backward chaining) is goal-driven, starting from a hypothesis and working back to the facts that support it.</mark>

Basis Forward Backward
Approach Data-driven, bottom-up Goal-driven, top-down
Starting point Known facts Goal or hypothesis
Direction Facts to conclusion Goal to supporting facts
Goal verification Goal checked at the end Goal is known from the start, sub-goals checked
Best when Many facts, unknown goal Few goals, many possible facts
Examples Monitoring, planning, production scheduling Diagnosis, debugging, theorem proving, Prolog

Key points.

  1. Forward chaining fires every rule whose conditions match, adding new facts until the goal appears.
  2. Forward strength: it is thorough and reacts to new data; weakness: it may generate many irrelevant facts.
  3. Backward chaining replaces the goal by sub-goals from rules whose conclusion matches, until facts are reached.
  4. Backward strength: it is focused on the goal and efficient; weakness: it may fail or loop with many unrelated goals.
  5. Backward chaining is used in automated theorem proving, Prolog and diagnostic systems.
  6. Choose forward when the data drives the answer and backward when a specific hypothesis must be proved.
  7. Backward chaining gives a natural explanation facility: the system can answer "why" (why it asks a question, the goal it is proving) and "how" (the rule chain that proved a conclusion), as in MYCIN.
  8. Bidirectional or hybrid chaining runs forward from facts and backward from the goal until they meet, cutting the search; it is faster on large rule bases but harder to implement.
  9. Resolution is another inference method: it proves a goal by refutation, adding its negation to the clauses and deriving the empty clause. It is refutation-complete for first-order logic (if the clauses are unsatisfiable, the empty clause can be derived) but needs clause form and can blow up in search.

Worked example. Facts A, B; rules R1: A AND B -> C, R2: C -> D; goal D.

Step Forward chaining Backward chaining
1 A, B known; R1 fires, add C Goal D; R2 needs C
2 C known; R2 fires, add D C needs R1 with A and B
3 D is the goal, stop A and B are facts, so C, then D, proved

Backward chaining loops on circular rules (P -> Q and Q -> P): the goal P asks for Q, which asks for P again. Prevent it by keeping a list of goals already being tried and failing any repeat, or by limiting depth.

Answer frame. For "differentiate", define both in one line each, draw the table, add one example each and close with when to use which. For the backward short note, define it, state the goal-to-facts working, list uses (point 5) and compare briefly with forward. For strengths and weaknesses, use points 2, 4, 6 and 7, then mention hybrid chaining and resolution (points 8-9).

Asked: [7 marks] (Nov 2022, Dec 2025) Differentiate between forward and backward reasoning. Asked: [7 marks] (Jun 2023) Write a short note on backward reasoning. Asked: [7 marks] (Dec 2024) Evaluate the strengths and weaknesses of forward and backward chaining and give scenarios where each is more appropriate.

Last-minute revision

  • Bayes: $P(A|B)=P(B|A)P(A)/P(B)$; prior, likelihood, evidence, posterior.
  • Causes of uncertainty: incomplete, noisy, contradictory, vague, dynamic.
  • Semantic network: nodes are concepts, labelled edges are is-a, has-a, instance-of; inheritance.
  • Script parts: entry conditions, roles, props, scenes, results.
  • Frame: slots, fillers, defaults, inheritance, demons (if-needed, if-added).
  • Frame limits: exceptions, multiple inheritance, no formal semantics; fixes are description logics and OWL.
  • CD: Schank's primitives ATRANS, PTRANS, MTRANS.
  • Forward is data-driven; backward is goal-driven (Prolog, diagnosis).

Memory hooks

  • PLEP: Prior, Likelihood, Evidence, Posterior.
  • Semantic network = "is-a chain": Canary to Bird to Animal.
  • Frame = form with blanks; script = film with scenes.
  • RPSER for scripts: Roles, Props, Scenes, Entry, Results.
  • Forward = "facts first"; backward = "goal first".

Coverage checklist

  • Probabilistic reasoning: causes of uncertainty (Jun 2023); probabilistic reasoning and Bayes (Dec 2025).
  • Baye's theorem: definition and applications (Jun 2023, Jun 2024, Jun 2025); Explain Bayes (Nov 2022); advantages (Dec 2023).
  • semantic networks: Nov 2022, Dec 2024; weather design (Jun 2025); semantic networks, frames, scripts (Dec 2025).
  • scripts: chatbots (Dec 2024); differentiate scripts, schemas, frames (Jun 2024).
  • schemas: covered with the comparison table and chatbot question.
  • frames: terms (Nov 2022); application (Dec 2024); limitations (Jun 2024).
  • conceptual dependency: terms question (Nov 2022).
  • forward and backward reasoning: differentiate (Nov 2022, Dec 2025); backward note (Jun 2023); strengths and weaknesses (Dec 2024).
Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in