Back to Logical Agents Topics

Advanced Propositional Logic Reasoning

Three Progressively Challenging Exercises for Exam Preparation

Exercise Set Overview

Advanced Propositional Logic Reasoning

Purpose: These exercises are designed to test your ability to synthesize multiple concepts in propositional logic reasoning - not just apply formulaic steps.

Skills Tested:

  • Multi-step inference using Modus Ponens and Resolution
  • CNF conversion and resolution-based theorem proving
  • Consistency and satisfiability checking
  • Knowledge-based agent reasoning in practical scenarios
  • Soundness and completeness analysis

Recommended For:

  • Midterm/Final exam preparation (Section B: Analytical Questions)
  • Take-home analytical assignments
  • Advanced practice after completing conceptual questions
Important: Show all steps and reasoning in your answers. Partial credit is given for correct methodology!

Exercise Questions

Instructions: Each exercise builds on the previous one. Work through them in order and click "Show Answer" to see detailed solutions with step-by-step reasoning.

Complete Exercise List

  1. Multi-Step Inference Using Modus Ponens and Resolution Intermediate 10 points
    Apply Modus Ponens and Resolution to derive conclusions from a knowledge base.
  2. Consistency and Satisfiability Challenge Advanced 10 points
    Determine if a knowledge base is consistent or find the contradiction.
  3. Knowledge-Based Agent Reasoning (Advanced Scenario) Expert 15 points
    Analyze a home security agent's reasoning using resolution and CNF.
Exercise Information
Total Questions: 3 | Total Points: 35 | Estimated Time: 90-120 minutes | Difficulty: Intermediate to Expert

Question 1: Multi-Step Inference Using Modus Ponens and Resolution

Difficulty: Intermediate | Points: 10

Question & Tasks

Knowledge Base (KB):

1. P → Q
2. Q → R
3. (R ∧ S) → T
4. P
5. S

Tasks:

  1. Part (a): Use Modus Ponens step-by-step to infer whether T can be derived. (3 points)
  2. Part (b): Convert the KB into Conjunctive Normal Form (CNF) and show how resolution can also be used to infer T. (4 points)
  3. Part (c): Explain why your inference process is sound and complete. (3 points)
Guidelines for Your Answer:
  • Part (a): Apply Modus Ponens systematically, showing each inference step
  • Part (b): Eliminate implications (→), convert to CNF, then apply resolution
  • Part (c): Relate soundness to correctness and completeness to finding all derivations
  • Show all intermediate steps clearly
Hint: Remember to eliminate implications and distribute OR over AND when converting to CNF.
Your Answer: ✓ Saved
Reasoning & Approach:
How to Approach This Problem:

Before jumping into the solution, understand the strategy:

  • Part (a) - Modus Ponens: Start with what you KNOW (P and S). Apply Modus Ponens repeatedly: if you have α and α → β, you can conclude β. Chain inferences until you reach T.
  • Part (b) - Resolution: First convert all implications to CNF (eliminate →, apply De Morgan's if needed). Then use proof by refutation: assume ¬T and derive empty clause (contradiction).
  • Part (c) - Soundness/Completeness: Ask yourself: "Does this method only give correct answers?" (soundness) and "Can it find all correct answers?" (completeness).

Key Insight: Modus Ponens is like following a chain of "if-then" statements. Resolution is more powerful - it can prove anything that's true.

Complete Solution:
Part (a): Using Modus Ponens

Modus Ponens Rule: From α → β and α, we can infer β

Initial Knowledge Base (KB₀):
1. P → Q
2. Q → R
3. (R ∧ S) → T
4. P
5. S
1
What we know: P (sentence 4) and P → Q (sentence 1)
Apply Modus Ponens: From P and P → Q, infer Q

Updated KB₁ = KB₀ + {Q}:
• P → Q, Q → R, (R ∧ S) → T, P, S, Q ← NEW
2
What we know: Q (from Step 1) and Q → R (sentence 2)
Apply Modus Ponens: From Q and Q → R, infer R

Updated KB₂ = KB₁ + {R}:
• P → Q, Q → R, (R ∧ S) → T, P, S, Q, R ← NEW
3
What we know: R (from Step 2) and S (sentence 5)
Form conjunction: R ∧ S (both facts are known, so their conjunction is true)

Updated KB₃ = KB₂ + {R ∧ S}:
• P → Q, Q → R, (R ∧ S) → T, P, S, Q, R, R ∧ S ← NEW
4
What we know: R ∧ S (from Step 3) and (R ∧ S) → T (sentence 3)
Apply Modus Ponens: From (R ∧ S) and (R ∧ S) → T, infer T

Final KB₄ = KB₃ + {T}:
• P → Q, Q → R, (R ∧ S) → T, P, S, Q, R, R ∧ S, T ← GOAL REACHED!
Conclusion: Yes, T can be derived using Modus Ponens in 4 steps.
Inference Chain: P → Q → R → (R ∧ S) → T
Part (b): Using Resolution

Step 1: Convert KB to CNF

Original KB:
1. P → Q
2. Q → R
3. (R ∧ S) → T
4. P
5. S

Convert implications (α → β ≡ ¬α ∨ β):

1. ¬P ∨ Q
2. ¬Q ∨ R
3. ¬(R ∧ S) ∨ T ≡ (¬R ∨ ¬S) ∨ T ≡ ¬R ∨ ¬S ∨ T
4. P
5. S

CNF Clauses:

C1: {¬P, Q}
C2: {¬Q, R}
C3: {¬R, ¬S, T}
C4: {P}
C5: {S}

Step 2: Prove T using Resolution

To prove KB ⊨ T, we assume ¬T and derive a contradiction.

C6: {¬T} (negated goal)
1
Resolve C3 and C6:
C3: {¬R, ¬S, T}
C6: {¬T}
Result: C7: {¬R, ¬S}
2
Resolve C7 and C5:
C7: {¬R, ¬S}
C5: {S}
Result: C8: {¬R}
3
Resolve C2 and C8:
C2: {¬Q, R}
C8: {¬R}
Result: C9: {¬Q}
4
Resolve C1 and C9:
C1: {¬P, Q}
C9: {¬Q}
Result: C10: {¬P}
5
Resolve C4 and C10:
C4: {P}
C10: {¬P}
Result: C11: {} (empty clause - CONTRADICTION!)
Conclusion: We derived a contradiction (empty clause) from KB ∪ {¬T}, therefore KB ⊨ T.
Part (c): Soundness and Completeness

Soundness:

  • Definition: An inference procedure is sound if it only derives sentences that are entailed (no false conclusions)
  • Our Process: Both Modus Ponens and Resolution are sound inference rules
    • Modus Ponens: If α → β and α are true, then β MUST be true (logically valid)
    • Resolution: If two clauses resolve, the resolvent is a logical consequence
  • Conclusion: Since we only applied sound rules, T is genuinely entailed by KB

Completeness:

  • Definition: An inference procedure is complete if it can derive any sentence that is entailed
  • Modus Ponens alone: NOT complete (can't derive all entailments)
    • Example: Can't handle disjunctions effectively
    • Limited to forward chaining with implications
  • Resolution: Complete for propositional logic
    • Can derive any entailed sentence (if KB ⊨ α, resolution will prove it)
    • Proof by refutation guarantees finding contradictions when they exist
  • Conclusion: Resolution is both sound AND complete, making it a powerful inference method
Summary:
Soundness: Our inference is correct - T truly follows from KB
Completeness (Resolution): If T were not derivable, resolution would not find a contradiction
Result: We can trust that T is a valid conclusion

Question 2: Consistency and Satisfiability Challenge

Difficulty: Advanced | Points: 10

Question & Tasks

Knowledge Base (KB):

1. A ∨ B
2. ¬A ∨ C
3. ¬C ∨ D
4. ¬D
5. ¬B

Tasks:

  1. Part (a): Determine whether the KB is consistent or inconsistent using resolution. (4 points)
  2. Part (b): If inconsistent, indicate the exact pair(s) of clauses that cause the contradiction. (3 points)
  3. Part (c): If consistent, provide a model (truth assignment) that satisfies all sentences. (3 points)
Guidelines for Your Answer:
  • Part (a): Apply resolution systematically until you derive empty clause or can't proceed
  • Part (b): Trace back through resolution steps to find contradicting clauses
  • Part (c): If consistent, assign truth values that make all sentences true
  • Show your resolution derivation tree
Hint: You may find it helpful to write all clauses in CNF and perform pairwise resolutions systematically.
Your Answer: ✓ Saved
Reasoning & Approach:
How to Approach This Problem:

Think of consistency checking like solving a puzzle - can all pieces fit together?

  • What is consistency? A KB is consistent if there exists at least ONE model (truth assignment) where ALL sentences are true simultaneously.
  • How to check with Resolution: Apply resolution repeatedly. If you derive the empty clause {}, the KB is INCONSISTENT (contradictory). If you can't derive empty clause and no more resolutions are possible, it's CONSISTENT.
  • Finding contradictions: Look for pairs like {P} and {¬P}, or clauses that resolve to create such pairs.
  • Strategy: Start with unit clauses (single literals) - they're easiest to resolve. Work systematically through all possible resolutions.

Key Insight: If sentences force different values for the same variable, you have an inconsistency. Resolution will expose this by deriving {} (empty clause).

Complete Solution:
Part (a): Check Consistency Using Resolution

Initial Clauses (already in CNF):

C1: {A, B}
C2: {¬A, C}
C3: {¬C, D}
C4: {¬D}
C5: {¬B}

Apply Resolution Systematically:

1
Resolve C1 and C5:
C1: {A, B}
C5: {¬B}
Result: C6: {A} (eliminate B)
2
Resolve C2 and C6:
C2: {¬A, C}
C6: {A}
Result: C7: {C} (eliminate A)
3
Resolve C3 and C7:
C3: {¬C, D}
C7: {C}
Result: C8: {D} (eliminate C)
4
Resolve C4 and C8:
C4: {¬D}
C8: {D}
Result: C9: {} (EMPTY CLAUSE - CONTRADICTION!)
Conclusion: The KB is INCONSISTENT. We derived the empty clause, which means there is no possible model that satisfies all sentences simultaneously.
Part (b): Identifying Contradicting Clauses

Contradiction Chain Analysis:

The contradiction arises from the following chain:

1. From C1 (A ∨ B) and C5 (¬B), we get: A must be true
2. From C2 (¬A ∨ C) and A being true, we get: C must be true
3. From C3 (¬C ∨ D) and C being true, we get: D must be true
4. But C4 says: ¬D (D must be false)

This creates the contradiction!

Direct Contradicting Pairs:

  • Primary Contradiction: C8 {D} and C4 {¬D}
    • These directly contradict each other
  • Root Causes: The combination of:
    • C1 {A, B} and C5 {¬B} → forces A to be true
    • C2, C3, C4 → create a chain that makes D both true and false
Key Insight:
The inconsistency stems from the entire set working together:
• C1 and C5 force A = true
• C2 forces C = true (given A = true)
• C3 forces D = true (given C = true)
• C4 asserts D = false

No subset of 4 clauses would be inconsistent - all 5 are needed!
Part (c): Satisfying Model
Result: Since the KB is inconsistent, there is NO model (truth assignment) that satisfies all sentences simultaneously.

Why no model exists:

  • We proved the KB is inconsistent using resolution (derived empty clause)
  • An inconsistent KB is false in every possible model
  • There is no combination of truth values for A, B, C, D that makes all 5 sentences true

Verification by attempting to build a model:

Try: A = ?, B = ?, C = ?, D = ?

From C5: B = False (required)
From C1 and B = False: A = True (required)
From C2 and A = True: C = True (required)
From C3 and C = True: D = True (required)
But C4 says: D = False (required)

CONTRADICTION: D cannot be both True and False!

Question 3: Knowledge-Based Agent Reasoning (Advanced Scenario)

Difficulty: Expert | Points: 15

Question & Tasks

Scenario: Home Security Agent

A simple home security agent uses propositional logic to reason about whether to sound the alarm.

Propositions:

M: Motion detected
D: Door is open
A: Alarm sounds
P: Power supply working

Knowledge Base (KB):

1. If motion is detected and the door is open, the alarm sounds.
   (M ∧ D) → A

2. If the alarm sounds, the power supply must be working.
   A → P

3. Either motion is detected or the door is open (or both).
   M ∨ D

4. The power supply is NOT working.
   ¬P

Tasks:

  1. Part (a): Convert all formulas to CNF. (4 points)
  2. Part (b): Using resolution, determine whether the knowledge base entails A (i.e., KB ⊨ A). (6 points)
  3. Part (c): Explain the result intuitively — what does the contradiction (if any) imply about the agent's belief system? (5 points)
Guidelines for Your Answer:
  • Part (a): Eliminate → using (α → β ≡ ¬α ∨ β), apply De Morgan's laws if needed
  • Part (b): Use proof by refutation (assume ¬A and derive contradiction)
  • Part (c): Think about what the logical contradiction means for the real-world agent
  • Relate findings to soundness of the KB and practical implications
Your Answer: ✓ Saved
Reasoning & Approach:
How to Approach This Problem:

This is a real-world agent reasoning scenario - think logically about what the rules tell us:

  • Understanding the scenario: The agent has rules about when the alarm sounds and what that means about power. But it observes the power is off. What can it conclude?
  • Part (a) - CNF Conversion:
    • Step 1: Replace every → with ¬...∨...
    • Step 2: Apply De Morgan's law if you have ¬(A ∧ B) → becomes (¬A ∨ ¬B)
    • Step 3: Distribute ∨ over ∧ if needed (not needed in this problem)
  • Part (b) - Proving with Resolution: Use proof by refutation. To prove KB ⊨ A, assume ¬A and try to derive a contradiction (empty clause).
  • Part (c) - Intuitive Explanation: Think about what it means in the real world. If we find a contradiction, what does that tell us about the agent's beliefs? Is the KB modeling reality correctly?

Key Insight: Sometimes what seems like a contradiction is actually the KB telling us something important - either the alarm can't sound (because power is off), OR there's an inconsistency in the rules themselves. Think carefully about what the logic reveals!

Complete Solution:
Part (a): Convert to CNF

Original KB:

1. (M ∧ D) → A
2. A → P
3. M ∨ D
4. ¬P

Step 1: Eliminate Implications (α → β ≡ ¬α ∨ β)

1
Sentence 1: (M ∧ D) → A
Eliminate →: ¬(M ∧ D) ∨ A
Apply De Morgan: (¬M ∨ ¬D) ∨ A
Simplify: ¬M ∨ ¬D ∨ A
2
Sentence 2: A → P
Eliminate →: ¬A ∨ P
3
Sentence 3: M ∨ D
Already in CNF!
4
Sentence 4: ¬P
Already in CNF!

Final CNF Clauses:

C1: {¬M, ¬D, A}
C2: {¬A, P}
C3: {M, D}
C4: {¬P}
Part (b): Check if KB ⊨ A Using Resolution

Goal: Determine if KB ⊨ A (does the KB entail that the alarm sounds?)

Method: Proof by refutation - assume ¬A and try to derive a contradiction

Add negated goal:
C5: {¬A}

Apply Resolution:

1
Resolve C2 and C4:
C2: {¬A, P}
C4: {¬P}
Result: C6: {¬A} (eliminate P)
2
Resolve C1 and C5:
C1: {¬M, ¬D, A}
C5: {¬A}
Result: C7: {¬M, ¬D} (eliminate A)
3
Resolve C3 and C7:
C3: {M, D}
C7: {¬M, ¬D}
First resolve on M: {D, ¬D}
Then resolve on D: {} (EMPTY CLAUSE!)
Conclusion: We derived a contradiction from KB ∪ {¬A}.
Therefore: KB ⊨ A
The knowledge base DOES entail that the alarm sounds!

Alternative Path (showing multiple resolution possibilities):

• We could also resolve C1 and C6 (derived {¬A} from C2 and C4) to get {¬M, ¬D}
• This also leads to the same contradiction with C3
• Multiple paths to contradiction confirm the entailment
Part (c): Intuitive Explanation and Implications

What the Result Means:

The Logical Conclusion:
KB ⊨ A means: "Given all the facts in the KB, the alarm MUST sound."

Intuitive Reasoning Chain:

  1. From sentence 3: Either motion is detected OR door is open (or both)
  2. From sentence 1: If BOTH motion detected AND door open → alarm sounds
  3. But wait... What if only ONE of them is true (not both)?
  4. From sentence 2: If alarm sounds → power must be working
  5. From sentence 4: Power is NOT working

The Contradiction Reveals:

  • The KB is INCONSISTENT!
    • It's not just that A is entailed
    • The entire knowledge base contains contradictory beliefs
    • An inconsistent KB entails EVERYTHING (including A)

Detailed Analysis:

Why is the KB inconsistent?

Case 1: If M=T and D=T:
• From (M ∧ D) → A: Alarm sounds (A=T)
• From A → P: Power must be working (P=T)
• But ¬P says: Power NOT working (P=F)
CONTRADICTION!

Case 2: If only M=T (and D=F):
• From M ∨ D: This satisfies sentence 3
• From (M ∧ D) → A: Since M ∧ D is false, alarm doesn't necessarily sound
• Could A=F? Let's check...
• If A=F, then A → P is satisfied (vacuous truth)
• And ¬P is satisfied
This seems consistent!

But wait... let's re-examine sentence 1 more carefully!

Actually, the KB forces this scenario:

1. From ¬P and (A → P), we know: ¬A must be true (by Modus Tollens)
2. From ¬A and ((M ∧ D) → A), we know: ¬(M ∧ D) must be true
   This means: ¬M ∨ ¬D (at least one of M or D is false)
3. But sentence 3 says: M ∨ D (at least one of M or D is true)
4. Combining: (M ∨ D) AND (¬M ∨ ¬D)
   This means: Exactly one is true (XOR)
5. This is actually CONSISTENT with M=T, D=F, A=F, P=F
   OR M=F, D=T, A=F, P=F

Wait, let me recalculate...

Actually, I need to check if KB is consistent or if KB ⊨ A:

Model 1: M=T, D=F, A=F, P=F
• Check (M ∧ D) → A: (T ∧ F) → F = F → F = T ✓
• Check A → P: F → F = T ✓
• Check M ∨ D: T ∨ F = T ✓
• Check ¬P: ¬F = T ✓
All satisfied with A=F!

Model 2: M=F, D=T, A=F, P=F
• Similar analysis shows all satisfied ✓
Important Correction:
Upon careful analysis, KB does NOT actually entail A!
There exist models where A=F and all sentences are satisfied.
The resolution proof error: When resolving C3: {M, D} and C7: {¬M, ¬D},
we cannot directly get empty clause - we need to resolve carefully on one literal at a time.

Correct Resolution:

Resolve C3: {M, D} with C7: {¬M, ¬D}
• Resolve on M: {D, ¬D} (still a tautology, not empty!)
• We CANNOT derive empty clause this way

Correct Conclusion: KB does NOT entail A
The KB is consistent, and there are models where alarm doesn't sound.

Final Intuitive Explanation:

  • The Agent's Belief System is Consistent:
    • The rules don't force the alarm to sound
    • If either M or D alone is true (but not both), alarm doesn't sound
    • Since power is not working, alarm CAN'T sound (would violate sentence 2)
  • Practical Meaning:
    • The agent knows power is down
    • It detects some activity (motion OR door)
    • But it correctly concludes: alarm won't sound (can't sound without power)
    • The rules prevent impossible situations
  • Design Implication:
    • The security system has a built-in "fail-safe" logic
    • It won't claim alarm sounds when power is unavailable
    • This makes the KB realistic and useful for reasoning

Evaluation Rubric

Suggested grading criteria for instructors

Criterion Description Points Weight
Logical Soundness Correct application of inference rules (Modus Ponens, Resolution, etc.) 12 35%
CNF Conversion Proper elimination of → and ↔, correct distribution, valid clause form 8 23%
Resolution Steps Clearly shown resolution derivation or contradiction with proper justification 10 29%
Explanation & Insight Clear justification of reasoning and meaning of results, practical interpretation 5 14%
TOTAL 35 100%
Grading Notes:
  • Partial credit should be awarded for correct methodology even if final answer is incorrect
  • Clear presentation and step-by-step reasoning should be valued
  • Minor notation errors should not heavily penalize if the logic is sound
  • Bonus points can be given for identifying alternative solution paths

Instructor Notes

Alignment with course objectives and resources

Course Alignment

These questions align with:

  • SE444 Lecture 7.2–7.4: Foundations, Inference, Resolution, CNF
  • Russell & Norvig (AIMA, 4th ed.): Chapter 7 - Logical Agents
  • Topics Covered:
    • Propositional logic syntax and semantics
    • Inference rules and proof methods
    • CNF conversion and resolution
    • Knowledge base consistency
    • Knowledge-based agent design
Recommended Usage
  • Midterm Exam: Use Question 1 or 2 (15-20 minutes each)
  • Final Exam: Use Question 3 or all three (30-45 minutes total)
  • Take-Home Assignment: All three questions with detailed write-ups
  • Practice Sessions: Work through in tutorials or study groups
Learning Outcomes

After completing these exercises, students should be able to:

  1. Apply multiple inference methods systematically
  2. Convert complex logical formulas to CNF correctly
  3. Use resolution to prove entailment or detect inconsistency
  4. Analyze knowledge-based agent reasoning
  5. Explain logical results in practical, intuitive terms
  6. Understand soundness and completeness properties
Quality Assurance:
These exercises have been designed to push students to synthesize symbolic reasoning concepts - not just apply formulaic steps. They require critical thinking and deep understanding of propositional logic fundamentals.

Manage Your Answers

Your answers are automatically saved in your browser's local storage. Use the buttons below to manage all your answers at once:

Important Notes:
  • Auto-save: Your answers are saved automatically as you type (after 500ms)
  • Browser Storage: Answers are stored locally in your browser
  • Privacy: Your answers are NOT sent to any server
  • Persistence: Answers persist across browser sessions
  • Limitations: Clearing browser data will delete your answers
  • Export: Download your answers as a text file for backup