Lecture 6
Logical conditionals
Johannes Korbmacher Lecture slides
Logical methods for AI
Logical conditionals
Lecture 6
What you’ll be able to do
Read chapter 6 first; exercise sheet 6 comes after the lecture.
Conditionals
- Rules, applied to facts, tell us what our knowledge entails.
- An expert system: a KB of rules and facts, an inference engine.
- Rain and a low sun: a rainbow.
The material conditional
| RAIN | WIND | RAIN → WIND |
|---|---|---|
| 1 | 1 | 1 |
| 1 | 0 | 0 |
| 0 | 1 | 1 |
| 0 | 0 | 1 |
False iff (glossary, opens in a new tab) the antecedent (glossary, opens in a new tab) is true and the consequent (glossary, opens in a new tab) is false.
Default-true
|
|
On Tuesday, the rule says nothing: assigning 1 or 2 both satisfy it.
The default truth-value is 1; only a counterexample changes it to 0.
With two truth-values, there is no third option.
Conditional rewriting
Text tree
Modus ponens
By refutation:
resolves to WIND, then to ⊥.
Not every if is material: “if you’d throw the ball at the window, then it would break.”
Knowledge bases
TELL: MORNING, CLEAR, RAIN
ASK: RAINBOW?
Every part of the antecedent first, then the consequent.
Forward chaining
Forward chaining, step by step
Try “Rainbow”, then “Missing fact”: the same KB without CLEAR.
The example is loading.
Derivations found
Backward chaining
| Rule used backward | Remaining queries |
|---|---|
| Start | RAINBOW |
| (RAIN ∧ LOW_SUN) → RAINBOW | LOW_SUN; RAIN is known |
| (MORNING ∧ SUN) → LOW_SUN | SUN; MORNING is known |
| (CLEAR ∧ DAY) → SUN | DAY; CLEAR is known |
| MORNING → DAY | None; MORNING is known |
Backward chaining, step by step
Try the same query without CLEAR. Where does the search get stuck?
The example is loading.
Derivations found
Search order
Forward and backward describe the direction of reasoning; depth first and breadth first, the order of search.
Depth first
- A
- B
- D
- E
- C
- F
- G
- B
Breadth first
- A
- B
- D
- E
- C
- F
- G
- B
Horn clauses
| Disjunctive form | Conditional form | Use |
|---|---|---|
| ¬CLEAR ∨ ¬DAY ∨ SUN | (CLEAR ∧ DAY) → SUN | Derive a fact |
| SUN | ⊤ → SUN | Initial fact |
| ¬SUN ∨ ¬RAIN | (SUN ∧ RAIN) → ⊥ | Forbid a combination |
Horn SAT
Chain from the facts. A constraint reached: ⊥, unsatisfiable. Otherwise the derived atoms are the least model (glossary, opens in a new tab) .
Truth-tables: 2ⁿ rows. Will our planning formulas be Horn?
Counters and an agenda
A counter of unmet premises for each rule; an agenda (glossary, opens in a new tab) of facts to process.
The example is loading.
Derivations found
Planning problem
Green on red ⟶ red on green. Two action steps.
Formalization and SATPLAN
States
Initial and goal:
Preconditions and effects
Frame conditions and miracles
The example is loading.
Derivations found
Frame problem
How do we represent what stays unchanged?
Two positive literals: this frame clause is non-Horn. The O(m+1) guarantee no longer applies.
The example is loading.
Derivations found
Use ← / →, Page Up / Page Down, or Space to navigate. While you work in an app, only Page Up / Page Down change the slide. Press F for full screen and Esc to exit. Each slide has a shareable URL.
What is on the slidesText of every slide
The text of every slide, in order. Drawings are described in words, and interactive apps are named; the textbook chapter has each of them in full.