CS24307 • Module 3
Module 3: Knowledge Representation & Logic
Topics 14 to 22 • Wumpus World, Propositional CNF, First-Order Logic & Resolution
Module 3 Table of Contents (Topics 14 to 22)
• Topic 14: Knowledge-Based Agents & Wumpus World
• Topic 15: Propositional Logic Syntax & Semantics
• Topic 16: Entailment ($\models$) vs. Inference ($\vdash$)
• Topic 17: Forward & Backward Chaining (Horn Clauses)
• Topic 18: Propositional Resolution & CNF Conversion
• Topic 19: First-Order Logic (FOL) Syntax & Quantifiers
• Topic 20: Universal & Existential Instantiation
• Topic 21: Unification & Most General Unifier (MGU)
• Topic 22: FOL Resolution Refutation Proofs
Topic 14 & 15: Knowledge-Based Agents & The Wumpus World
A Knowledge-Based Agent maintains an internal Knowledge Base (KB) consisting of sentences in a formal representation language. It interacts with the KB via two fundamental operations:
$$\mathbf{\text{TELL}(KB, \alpha) \quad \text{and} \quad \text{ASK}(KB, \alpha)}$$
🏛️ The Wumpus World Formal Specification
- Grid: $4 \times 4$ grid of rooms with Start at $[1,1]$.
- Hazards: Bottomless Pits ($P$) with probability 0.2 in each room; One deadly Wumpus ($W$).
- Reward: Gold glitter ($G$) at random location.
- Percepts: `[Stench, Breeze, Glitter, Bump, Scream]`.
- In rooms adjacent to Wumpus $\implies$ Stench: $S_{x,y} \iff (W_{x-1,y} \lor W_{x+1,y} \lor W_{x,y-1} \lor W_{x,y+1})$.
- In rooms adjacent to Pits $\implies$ Breeze: $B_{x,y} \iff (P_{x-1,y} \lor P_{x+1,y} \lor P_{x,y-1} \lor P_{x,y+1})$.
Topic 16 to 18: Propositional Entailment, CNF & Resolution
Entailment vs. Logical Equivalence:
- Entailment ($\alpha \models \beta$): Sentence $\beta$ follows logically from $\alpha$ if and only if in every model where $\alpha$ is true, $\beta$ is also true ($M(\alpha) \subseteq M(\beta)$).
- Proof by Contradiction (Refutation):
$$\mathbf{KB \models \alpha \iff (KB \land \neg \alpha) \text{ is UNSATISFIABLE (generates empty clause } \Box)}$$
🏛️ The 6-Step Algorithm to Convert Any Propositional Sentence into Conjunctive Normal Form (CNF)
- Eliminate Equivalence ($\leftrightarrow$): Replace $\alpha \leftrightarrow \beta$ with $(\alpha \rightarrow \beta) \land (\beta \rightarrow \alpha)$.
- Eliminate Implication ($\rightarrow$): Replace $\alpha \rightarrow \beta$ with $\neg \alpha \lor \beta$.
- Move Negation Inward (De Morgan's Laws): $\neg (\alpha \land \beta) \equiv \neg \alpha \lor \neg \beta$, $\neg (\alpha \lor \beta) \equiv \neg \alpha \land \neg \beta$, $\neg \neg \alpha \equiv \alpha$.
- Distribute $\lor$ over $\land$: Replace $\alpha \lor (\beta \land \gamma)$ with $(\alpha \lor \beta) \land (\alpha \lor \gamma)$.
- Flatten Nested Conjunctions/Disjunctions: $(A \lor B) \lor C \equiv (A \lor B \lor C)$.
- Split into Clauses: Each conjunct becomes a separate clause in the set.
Topic 19 to 22: First-Order Logic (FOL), Unification & Resolution Refutation
First-Order Logic adds Objects, Relations (Predicates), Functions, and Quantifiers ($\forall, \exists$).
| English Statement |
First-Order Logic Translation |
Quantifier Rule |
| "Every student loves AI." | $\forall x (\text{Student}(x) \rightarrow \text{Loves}(x, \text{AI}))$ | $\forall$ typically pairs with $\rightarrow$. |
| "Some student loves AI." | $\exists x (\text{Student}(x) \land \text{Loves}(x, \text{AI}))$ | $\exists$ typically pairs with $\land$. |
| "No person likes snakes." | $\forall x (\text{Person}(x) \rightarrow \neg \text{Likes}(x, \text{Snakes}))$ | $\neg \exists x \dots \equiv \forall x \neg \dots$ |
🏛️ Step-by-Step Unification Algorithm & Most General Unifier (MGU)
Find $\text{UNIFY}(P_1, P_2)$ for:
- $P_1 = \text{Knows}(\text{John}, x)$ and $P_2 = \text{Knows}(y, \text{Bill}) \implies \mathbf{\theta = \{ y/\text{John}, x/\text{Bill} \}}$.
- $P_1 = \text{Knows}(\text{John}, x)$ and $P_2 = \text{Knows}(x, \text{Bill}) \implies \mathbf{\text{Fail (Standardize variables apart first!)}}$.
- $P_1 = \text{Likes}(x, \text{Father}(x))$ and $P_2 = \text{Likes}(y, y) \implies \mathbf{\text{Occur Check Failure!}} \ (y \text{ cannot unify with } \text{Father}(y))$.
🏛️ Complete Step-by-Step FOL Resolution Refutation Proof
Given Axioms:
- "Marcus was a man." $\implies \text{Man}(\text{Marcus})$
- "Marcus was a Pompeian." $\implies \text{Pompeian}(\text{Marcus})$
- "All Pompeians were Romans." $\implies \forall x (\text{Pompeian}(x) \rightarrow \text{Roman}(x)) \implies \neg \text{Pompeian}(x) \lor \text{Roman}(x)$
- "Caesar was a ruler." $\implies \text{Ruler}(\text{Caesar})$
- "All Romans were either loyal to Caesar or hated him." $\implies \forall x (\text{Roman}(x) \rightarrow \text{Loyal}(x, \text{Caesar}) \lor \text{Hate}(x, \text{Caesar})) \implies \neg \text{Roman}(x) \lor \text{Loyal}(x, \text{Caesar}) \lor \text{Hate}(x, \text{Caesar})$
- "Everyone is loyal to someone." $\implies \forall x \exists y \text{Loyal}(x, y) \implies \text{Loyal}(x, f(x))$ (Skolem function)
- "Men only try to assassinate rulers they aren't loyal to." $\implies \forall x \forall y (\text{Man}(x) \land \text{Ruler}(y) \land \text{TryAssassinate}(x, y) \rightarrow \neg \text{Loyal}(x, y)) \implies \neg \text{Man}(x) \lor \neg \text{Ruler}(y) \lor \neg \text{TryAssassinate}(x, y) \lor \neg \text{Loyal}(x, y)$
- "Marcus tried to assassinate Caesar." $\implies \text{TryAssassinate}(\text{Marcus}, \text{Caesar})$
Query to Prove: "Did Marcus hate Caesar?" ($\text{Hate}(\text{Marcus}, \text{Caesar})$)
Proof by Refutation: Add negated query $\neg \text{Hate}(\text{Marcus}, \text{Caesar})$:
- Resolve $\neg \text{Hate}(\text{Marcus}, \text{Caesar})$ with Clause 5 $\{ x/\text{Marcus} \} \implies \mathbf{C_9: \neg \text{Roman}(\text{Marcus}) \lor \text{Loyal}(\text{Marcus}, \text{Caesar})}$.
- Resolve $C_9$ with Clause 3 $\{ x/\text{Marcus} \} \implies \mathbf{C_{10}: \neg \text{Pompeian}(\text{Marcus}) \lor \text{Loyal}(\text{Marcus}, \text{Caesar})}$.
- Resolve $C_{10}$ with Clause 2 $\implies \mathbf{C_{11}: \text{Loyal}(\text{Marcus}, \text{Caesar})}$.
- Resolve $C_{11}$ with Clause 7 $\{ x/\text{Marcus}, y/\text{Caesar} \} \implies \mathbf{C_{12}: \neg \text{Man}(\text{Marcus}) \lor \neg \text{Ruler}(\text{Caesar}) \lor \neg \text{TryAssassinate}(\text{Marcus}, \text{Caesar})}$.
- Resolve $C_{12}$ with Clause 1 $\implies \mathbf{C_{13}: \neg \text{Ruler}(\text{Caesar}) \lor \neg \text{TryAssassinate}(\text{Marcus}, \text{Caesar})}$.
- Resolve $C_{13}$ with Clause 4 $\implies \mathbf{C_{14}: \neg \text{TryAssassinate}(\text{Marcus}, \text{Caesar})}$.
- Resolve $C_{14}$ with Clause 8 $\implies \mathbf{\Box \text{ (EMPTY CLAUSE - CONTRADICTION!)}}$.
$$\mathbf{\text{Q.E.D. Marcus hated Caesar is strictly proven!}}$$
Topic 22.2: Master University Examination Solved Question Bank (10 Solved Questions)
Q1. Prove that Modus Ponens is sound. (6 Marks)
Modus Ponens states: From $\alpha$ and $\alpha \rightarrow \beta$, infer $\beta$. In truth table semantics: Whenever $\alpha$ is True and $\alpha \rightarrow \beta$ is True, $\beta$ must be True (since if $\beta$ were False, $\alpha \rightarrow \beta$ would be False, contradicting the premise). Thus, Modus Ponens preserves truth in all possible models.
Q2. Convert the sentence $\neg \forall x (\text{Dog}(x) \rightarrow \exists y (\text{Cat}(y) \land \text{Chases}(x, y)))$ into Skolemized CNF. (10 Marks)
1. Move negation inward: $\exists x \neg (\neg \text{Dog}(x) \lor \exists y (\text{Cat}(y) \land \text{Chases}(x, y))) \implies \exists x (\text{Dog}(x) \land \forall y (\neg \text{Cat}(y) \lor \neg \text{Chases}(x, y)))$.
2. Skolemize existential variable $x$ with Skolem constant $D$: $\mathbf{\text{Clause 1: } \text{Dog}(D)}$, $\mathbf{\text{Clause 2: } \neg \text{Cat}(y) \lor \neg \text{Chases}(D, y)}$.
Q3. Explain Forward Chaining and Backward Chaining for Horn Clauses. Compare their computational efficiencies. (8 Marks)
• Forward Chaining (Data-Driven): Starts from known facts in the KB and iteratively fires rules whose premises are satisfied, adding new conclusions until the query is reached. Complete and runs in $O(\text{size of KB})$ time for definite clauses.
• Backward Chaining (Goal-Driven): Starts from the goal query and recursively searches backwards for rules whose conclusions match the goal, resolving sub-goals against facts. Avoids generating facts irrelevant to the goal.
Q4. What is the Occur Check in the Unification Algorithm? Why is it crucial? (8 Marks)
The Occur Check verifies whether a variable $v$ appears inside the term $t$ before binding $v/t$. Example: Unifying $x$ with $f(x)$. If permitted, it produces an infinite recursive term $x = f(f(f(\dots)))$, which leads to non-terminating loops and logical unsoundness in automated theorem provers! (Standard Prolog omits occur-check for speed, leading to occasional unsound derivations).
Q5. Explain the Frame Problem, Qualification Problem, and Ramification Problem in Knowledge Representation. (8 Marks)
1. Frame Problem: Representing what remains unchanged in the world when an action is executed without explicitly listing millions of non-effects.
2. Qualification Problem: The impossibility of listing all infinite preconditions required for an action to succeed (e.g. car starting requires battery, gas, no potato in tailpipe, no asteroid strike).
3. Ramification Problem: Handling implicit side-effects (indirect consequences) of actions without writing separate explicit rules for each.
Q6. Convert the proposition $(A \land B) \rightarrow (C \lor D)$ into Conjunctive Normal Form (CNF). (6 Marks)
1. Eliminate implication: $\neg (A \land B) \lor (C \lor D)$.
2. De Morgan's: $(\neg A \lor \neg B) \lor (C \lor D)$.
3. Flatten disjunction: $\mathbf{(\neg A \lor \neg B \lor C \lor D)}$ (Single valid CNF clause!).
Q7. Explain Semantic Networks and Frames as Knowledge Representation schemes. (8 Marks)
• Semantic Networks: Represent knowledge as directed graphs where nodes represent concepts/objects and edges represent binary relations (e.g., `is-a`, `has-a`, `part-of`). Enables taxonomic property inheritance.
• Frames (Minsky): Structured data structures containing named slots and associated fillers (values, default values, or procedural attachment methods/demons).
Q8. What is Non-Monotonic Logic? Explain Default Reasoning and Circumscription. (8 Marks)
In classical monotonic logic, adding new axioms can never invalidate previously derived theorems. In Non-Monotonic Logic, conclusions can be retracted when new evidence arrives (e.g. "Tweety is a bird $\implies$ Tweety flies"; Learning "Tweety is a penguin" retracts "Tweety flies"). Default Logic introduces default inference rules $\frac{\alpha : \beta}{\gamma}$. Circumscription formalizes the assumption that things are normal unless explicitly stated otherwise.
Q9. Explain the DPLL (Davis-Putnam-Logemann-Loveland) Satisfiability Algorithm. (8 Marks)
DPLL is a recursive backtracking search for checking SAT over CNF clauses:
1. Early Termination (SAT if all clauses true; Backtrack if any clause empty).
2. Pure Literal Rule: Literals appearing with only one polarity across all clauses are assigned that polarity immediately.
3. Unit Propagation: Unit clauses force immediate deterministic variable assignments.
4. Splitting: Branch recursively on $X=\text{True}$ and $X=\text{False}$.
Q10. Explain Ontology Engineering and the Role of Description Logics (OWL). (8 Marks)
An Ontology formally defines the concepts, entities, categories, and relationships within a domain. Description Logics (DLs) (like $\mathcal{SHIQ}, \mathcal{SROIQ}$) are decidable fragments of First-Order Logic providing the theoretical foundation for Semantic Web standards (OWL / RDF). DL systems provide automated subsumption checking ($C \sqsubseteq D$) and consistency checking.
Topic 22.5: Advanced Automated Theorem Proving, Semantic Tableaux & Ontologies
🏛️ Step-by-Step Solved Proof: Complete Forward Chaining Trace on Definite Horn Clauses
Given Knowledge Base of Horn Clauses:
- $A \land B \rightarrow C$
- $C \land D \rightarrow E$
- $B \land E \rightarrow F$
- $G \land A \rightarrow D$
- Known Facts: $\mathbf{A, \ B, \ G}$
Query: Prove if goal $F$ is entailed ($\text{KB} \models F$).
Forward Chaining Execution Table:
| Iteration | Rule Fired | Satisfied Premises | New Fact Inferred | Known Facts Pool |
| 0 | Initial Facts | — | $A, B, G$ | $\{A, B, G\}$ |
| 1 | Rule 4 ($G \land A \rightarrow D$) | $G \in KB, A \in KB$ | $D$ | $\{A, B, G, D\}$ |
| 2 | Rule 1 ($A \land B \rightarrow C$) | $A \in KB, B \in KB$ | $C$ | $\{A, B, G, D, C\}$ |
| 3 | Rule 2 ($C \land D \rightarrow E$) | $C \in KB, D \in KB$ | $E$ | $\{A, B, G, D, C, E\}$ |
| 4 | Rule 3 ($B \land E \rightarrow F$) | $B \in KB, E \in KB$ | $F$ | $\mathbf{\{A, B, G, D, C, E, F\}}$ |
$$\mathbf{\text{Conclusion: Goal } F \text{ is derived in linear time } O(N)!}$$
🏛️ The Method of Analytic Semantic Tableaux for First-Order Logic
An alternative to Resolution is the Semantic Tableaux (Tree Proof) Method, which builds a tree of signed formulas to prove that $\text{KB} \land \neg \text{Query}$ is closed (every branch contains a contradiction $P$ and $\neg P$):
- $\alpha$-Rules (Conjunctive): Add both conjuncts to the current branch without splitting ($A \land B \implies A, B$).
- $\beta$-Rules (Disjunctive): Split the current branch into two child branches ($A \lor B \implies \text{Left: } A, \ \text{Right: } B$).
- $\gamma$-Rules (Universal): Instantiate $\forall x P(x)$ with any arbitrary ground term $t$ ($P(t)$).
- $\delta$-Rules (Existential): Instantiate $\exists x P(x)$ with a fresh Skolem constant $c$ ($P(c)$).
Q11. Explain Description Logics (DL) Concepts, Roles, and TBox vs. ABox. (8 Marks)
Description Logics (DLs) form the formal logical foundation for the Semantic Web (OWL-DL) and modern knowledge graphs:
• Concepts (Unary Predicates): Sets of individuals (e.g., $\text{Student}, \text{Course}$).
• Roles (Binary Relations): Relationships between individuals (e.g., $\text{enrolledIn}, \text{teaches}$).
• TBox (Terminological Box): The schema containing conceptual definitions, axioms, and subsumption hierarchies ($\text{CSEStudent} \equiv \text{Student} \sqcap \exists \text{enrolledIn}.\text{CSECourse}$).
• ABox (Assertional Box): Concrete assertions about specific named individuals ($\text{Student}(\text{Shaswat}), \text{enrolledIn}(\text{Shaswat}, \text{CS24307})$).
Q12. What is Default Reasoning and Reiter's Default Logic? (8 Marks)
Default logic allows an agent to draw plausible inferences in the absence of contrary evidence using default rules:
$$\mathbf{\frac{\alpha : \beta}{\gamma}}$$
Where $\alpha$ is the prerequisite, $\beta$ is the justification (must be consistent with the KB, $\neg \beta \notin KB$), and $\gamma$ is the conclusion.
Example (Bird Flight): $\frac{\text{Bird}(x) : \text{Flies}(x)}{\text{Flies}(x)}$. If $\text{Bird}(\text{Tweety})$ is known and $\neg \text{Flies}(\text{Tweety})$ is NOT in the KB, the agent infers $\text{Flies}(\text{Tweety})$. If it later learns $\text{Penguin}(\text{Tweety}) \land (\text{Penguin}(x) \rightarrow \neg \text{Flies}(x))$, the justification fails and the conclusion is retracted automatically!
Topic 22.6: Advanced Resolution Strategies & Knowledge Compilation
| Resolution Strategy |
Algorithmic Restriction |
Completeness & Efficiency |
| Unit Resolution |
At least one of the two parent clauses must be a unit clause (containing exactly one literal). |
Incomplete in general; complete and runs in $O(N)$ time for Horn KBs. |
| Input Resolution |
At least one parent clause must come from the original input KB or negated query (never two derived clauses). |
Incomplete in general; equivalent in power to Unit Resolution. |
| Linear Resolution |
Each step resolves the most recently derived clause with either an input clause or a previous ancestor clause. |
Refutation Complete; basis for Prolog's SLD resolution. |
| Set of Support (SOS) |
Every resolution step must involve at least one clause derived from the negated query (the set of support). |
Refutation Complete; prevents wasteful resolution among mutually consistent background KB axioms. |
🏛️ Step-by-Step Solved Proof: The "Customs Official" Full Refutation Proof Tree
Axioms:
- $C_1: \neg \text{Official}(x) \lor \neg \text{Enters}(y) \lor \text{VIP}(y) \lor \text{Searches}(x, y)$
- $C_2: \text{Smuggler}(A)$ (Skolem constant $A$)
- $C_3: \text{Enters}(A)$
- $C_4: \neg \text{Searches}(z, A) \lor \text{Smuggler}(z)$
- $C_5: \neg \text{Smuggler}(x) \lor \neg \text{VIP}(x)$
- $C_6: \text{Official}(B)$ (Official $B$ exists)
Query: Prove $\exists w (\text{Official}(w) \land \text{Smuggler}(w))$. Negated Query: $C_7: \neg \text{Official}(w) \lor \neg \text{Smuggler}(w)$.
Resolution Proof Steps:
- Resolve $C_2$ ($\text{Smuggler}(A)$) with $C_5$ $\{x/A\} \implies \mathbf{C_8: \neg \text{VIP}(A)}$.
- Resolve $C_1$ with $C_3$ $\{y/A\} \implies \mathbf{C_9: \neg \text{Official}(x) \lor \text{VIP}(A) \lor \text{Searches}(x, A)}$.
- Resolve $C_9$ with $C_8 \implies \mathbf{C_{10}: \neg \text{Official}(x) \lor \text{Searches}(x, A)}$.
- Resolve $C_{10}$ with $C_4$ $\{z/x\} \implies \mathbf{C_{11}: \neg \text{Official}(x) \lor \text{Smuggler}(x)}$.
- Resolve $C_{11}$ with $C_6$ $\{x/B\} \implies \mathbf{C_{12}: \text{Smuggler}(B)}$.
- Resolve $C_{12}$ with $C_7$ $\{w/B\} \implies \mathbf{C_{13}: \neg \text{Official}(B)}$.
- Resolve $C_{13}$ with $C_6$ ($\text{Official}(B)$) $\implies \mathbf{\Box \text{ (EMPTY CLAUSE - CONTRADICTION!)}}$.
$$\mathbf{\text{Q.E.D. Strictly proven that some official must be a smuggler!}}$$
Topic 22.7: Advanced Knowledge Graphs & Description Logic Semantics
Description Logic ($\mathcal{ALC}$) Syntax & Semantics:
- Top (Universal Concept): $\top \implies \Delta^\mathcal{I}$ (All domain elements)
- Bottom (Empty Concept): $\bot \implies \emptyset$
- Conjunction: $(C \sqcap D)^\mathcal{I} = C^\mathcal{I} \cap D^\mathcal{I}$
- Disjunction: $(C \sqcup D)^\mathcal{I} = C^\mathcal{I} \cup D^\mathcal{I}$
- Negation: $(\neg C)^\mathcal{I} = \Delta^\mathcal{I} \setminus C^\mathcal{I}$
- Universal Role Restriction: $(\forall R.C)^\mathcal{I} = \{ x \in \Delta^\mathcal{I} \mid \forall y ((x, y) \in R^\mathcal{I} \rightarrow y \in C^\mathcal{I}) \}$
- Existential Role Restriction: $(\exists R.C)^\mathcal{I} = \{ x \in \Delta^\mathcal{I} \mid \exists y ((x, y) \in R^\mathcal{I} \land y \in C^\mathcal{I}) \}$
🏛️ Step-by-Step Solved Problem: Description Logic Subsumption Proof
Prove that $\text{Mother} \sqsubseteq \text{Parent}$ given the TBox axioms:
- $\text{Parent} \equiv \text{Human} \sqcap \exists \text{hasChild}.\text{Human}$
- $\text{Mother} \equiv \text{Woman} \sqcap \exists \text{hasChild}.\text{Human}$
- $\text{Woman} \sqsubseteq \text{Human}$
Proof Trace:
- Let $x \in \text{Mother}^\mathcal{I} \implies x \in \text{Woman}^\mathcal{I} \land x \in (\exists \text{hasChild}.\text{Human})^\mathcal{I}$.
- Since $\text{Woman}^\mathcal{I} \subseteq \text{Human}^\mathcal{I}$ (Axiom 3), we have $x \in \text{Human}^\mathcal{I}$.
- Therefore, $x \in \text{Human}^\mathcal{I} \land x \in (\exists \text{hasChild}.\text{Human})^\mathcal{I} \implies x \in \text{Parent}^\mathcal{I}$.
- $\mathbf{\text{Q.E.D. Subsumption } \text{Mother} \sqsubseteq \text{Parent} \text{ holds in all models!}}$
Topic 22.8: Complete Step-by-Step Solved Proof Bank (Part III)
🏛️ Step-by-Step Solved Proof: The "Customs and Smuggler" Full Resolution Refutation Tree
Axioms:
- $\neg \text{Official}(x) \lor \neg \text{Enters}(y) \lor \text{VIP}(y) \lor \text{Searches}(x, y)$
- $\text{Smuggler}(A) \land \text{Enters}(A) \land (\neg \text{Searches}(z, A) \lor \text{Smuggler}(z))$ (Skolem constant $A$)
- $\neg \text{Smuggler}(x) \lor \neg \text{VIP}(x)$
- $\text{Official}(O_1)$
Refutation Steps:
- Resolve $\text{Smuggler}(A)$ with Clause 3 $\{x/A\} \implies \mathbf{\neg \text{VIP}(A)}$.
- Resolve Clause 1 with $\text{Enters}(A)$ $\{y/A\} \implies \neg \text{Official}(x) \lor \text{VIP}(A) \lor \text{Searches}(x, A)$.
- Resolve with $\neg \text{VIP}(A) \implies \neg \text{Official}(x) \lor \text{Searches}(x, A)$.
- Resolve with Clause 2 ($\neg \text{Searches}(z, A) \lor \text{Smuggler}(z)$) $\{z/x\} \implies \mathbf{\neg \text{Official}(x) \lor \text{Smuggler}(x)}$.
- Resolve with $\text{Official}(O_1) \implies \mathbf{\text{Smuggler}(O_1)}$.
- Resolve with Negated Query clause $(\neg \text{Official}(O_1) \lor \neg \text{Smuggler}(O_1)) \implies \mathbf{\Box \text{ (EMPTY CLAUSE)}}$.
$$\mathbf{\text{Q.E.D. Proof complete!}}$$
🏛️ Step-by-Step Solved Problem: Situation Calculus Axiomatization
In Situation Calculus, actions take an agent from situation $s$ to situation $do(a, s)$:
- Possibility Axiom (Preconditions for Pickup):
$$\mathbf{\text{Poss}(\text{PickUp}(x), s) \iff \text{Clear}(x, s) \land \text{At}(\text{Robot}, x, s) \land \text{ArmEmpty}(s)}$$
- Successor-State Axiom (Effect on Holding):
$$\mathbf{\text{Holding}(x, do(a, s)) \iff (a = \text{PickUp}(x)) \lor (\text{Holding}(x, s) \land a \neq \text{Release}(x))}$$
Q16. Explain Knowledge Base Consistency and Model Checking using Truth Tables. (8 Marks)
A Knowledge Base $KB$ is consistent (satisfiable) if there exists at least one truth assignment (model) under which all sentences in $KB$ evaluate to True. Model Checking enumerates all $2^n$ interpretations of the $n$ proposition symbols in a truth table. For each row where $KB = \text{True}$, it verifies if the query sentence $\alpha = \text{True}$. If $\alpha$ is True in every model where $KB$ is True, then $KB \models \alpha$ (sound and complete, but exponential time $O(2^n)$).
Topic 22.9: Modal Logic, Epistemic Reasoning & Dempster-Shafer Theory
| Formal Logic System |
Modal Operators & Axioms |
AI Multi-Agent Application |
| Epistemic Logic ($S5$) |
Knowledge operator $K_i \phi$ ("Agent $i$ knows $\phi$"). Axioms: $K_i \phi \rightarrow \phi$ (Truth), $K_i \phi \rightarrow K_i K_i \phi$ (Positive Introspection), $\neg K_i \phi \rightarrow K_i \neg K_i \phi$ (Negative Introspection). |
Distributed systems consensus, multi-agent common knowledge ($C \phi$), Muddy Children puzzle. |
| Temporal Logic (LTL / CTL) |
LTL operators: $\mathbf{G}\phi$ (Always), $\mathbf{F}\phi$ (Eventually), $\mathbf{X}\phi$ (Next), $\phi \mathbf{U} \psi$ (Until). CTL adds path quantifiers $\mathbf{A}$ (All paths), $\mathbf{E}$ (Exists path). |
Model checking automated safety verification of autonomous flight control and medical robotics software. |
| Dempster-Shafer Theory of Evidence |
Mass function $m(A) \in [0, 1]$ over power set $2^\Theta$. Belief function $\text{Bel}(A) = \sum_{B \subseteq A} m(B)$, Plausibility $\text{Pl}(A) = 1 - \text{Bel}(\neg A)$. Dempster's Rule of Combination: $m_1 \oplus m_2(A) = \frac{\sum_{B \cap C = A} m_1(B) m_2(C)}{1 - K}$. |
Sensor fusion with epistemic ignorance (distinguishes total ignorance from equal probability!). |
🏛️ Step-by-Step Solved Problem: Dempster's Rule of Combination in Sensor Fusion
Two medical sensors diagnose a patient for three mutually exclusive conditions $\Theta = \{\text{Flu } (F), \text{Cold } (C), \text{Pneumonia } (P)\}$:
- Sensor 1: $m_1(\{F\}) = 0.6, \ m_1(\Theta) = 0.4$.
- Sensor 2: $m_2(\{F, C\}) = 0.7, \ m_2(\Theta) = 0.3$.
Dempster Combination Matrix:
| $m_1 \backslash m_2$ | $m_2(\{F, C\}) = 0.7$ | $m_2(\Theta) = 0.3$ |
| $m_1(\{F\}) = 0.6$ | $\{F\} \cap \{F, C\} = \{F\} \implies 0.42$ | $\{F\} \cap \Theta = \{F\} \implies 0.18$ |
| $m_1(\Theta) = 0.4$ | $\Theta \cap \{F, C\} = \{F, C\} \implies 0.28$ | $\Theta \cap \Theta = \Theta \implies 0.12$ |
No empty set intersections ($K = 0$). Combined masses:
$$\mathbf{m_{1,2}(\{F\}) = 0.42 + 0.18 = \mathbf{0.60} \qquad m_{1,2}(\{F, C\}) = \mathbf{0.28} \qquad m_{1,2}(\Theta) = \mathbf{0.12}}$$
$$\mathbf{\text{Belief in Flu: } \text{Bel}(\{F\}) = m_{1,2}(\{F\}) = \mathbf{0.60} \qquad \text{Plausibility of Flu: } \text{Pl}(\{F\}) = 0.60 + 0.28 + 0.12 = \mathbf{1.00}}}$$
Q17. Explain the Resolution Refutation Proof with Equality (Paramodulation and Demodulation). (8 Marks)
Standard resolution handles predicate symbols but cannot natively reason about equality axioms ($x = x, x = y \rightarrow y = x, x = y \land y = z \rightarrow x = z$).
• Paramodulation: A specialized inference rule that incorporates equality: From clause $(l = r \lor C)$ and clause $(P(t) \lor D)$, where a subterm of $t$ unifies with $l$ under $\theta = \text{UNIFY}(t|_p, l)$, infer $(P(t[r\theta]_p) \lor C\theta \lor D\theta)$.
• Demodulation: A deterministic rewriting rule that uses unit equality clauses $l = r$ to simplify terms in other clauses to a canonical normal form, preventing exponential branching in equational theorem provers like Otter and Vampire!
Topic 22.10: Master University Exam Proof Bank (Part IV)
🏛️ Step-by-Step Solved Proof: First-Order Unification with Multiple Variable Bindings
Find the Most General Unifier (MGU) $\theta$ for the following predicate expressions or show why unification fails:
- $P(x, g(x), y)$ and $P(f(z), g(f(z)), h(w)) \implies \mathbf{\theta = \{ x / f(z), y / h(w) \}}$.
- $Q(a, x, f(g(y)))$ and $Q(z, f(z), f(u)) \implies z/a, x/f(a), u/g(y) \implies \mathbf{\theta = \{ z/a, x/f(a), u/g(y) \}}$.
- $R(x, x)$ and $R(y, f(y)) \implies \mathbf{\text{Occur-check failure: } y \text{ cannot unify with } f(y)}$!
Q18. Explain Automated Theorem Proving with Binary Decision Diagrams (BDDs) and Reduced Ordered BDDs (ROBDDs). (8 Marks)
A Binary Decision Diagram (BDD) is a rooted, directed acyclic graph representing a Boolean function $f(x_1, \dots, x_n)$ where non-terminal nodes represent variables and outgoing dashed/solid edges represent $0$ and $1$ assignments.
ROBDD Canonical Property (Bryant 1986): For a fixed variable ordering, every Boolean function has a strictly unique, canonical ROBDD representation. Checking whether a formula is a tautology ($f \equiv 1$) or unsatisfiable ($f \equiv 0$) takes $O(1)$ time! Equivalence checking between two logic circuits $f \equiv g$ reduces to graph isomorphism!