outline logical agents - university of waterlookhoury/ece457/lecture6.pdf · logical agents ece457...

12
1 Logical Agents ECE457 Applied Artificial Intelligence Spring 2008 Lecture #6 ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 2 Outline Logical reasoning Propositional Logic Wumpus World Inference Russell & Norvig, chapter 7 ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 3 Logical Reasoning Recall: Game-playing with imperfect information Partially-observable environment Need to infer about hidden information Two new challenges How to represent the information we have (knowledge representation) How to use the information we have to infer new information and make decisions (knowledge reasoning) ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 4 Knowledge Representation Represent facts about the environment Many ways: ontologies, mathematical functions, … Statements that are either true or false Language To write the statements Syntax: symbols (words) and rules to combine them (grammar) Semantics: meaning of the statements Expressiveness vs. efficiency Knowledge base (KB) Contains all the statements Agent can TELL it new statements (update) Agent can ASK it for information (query)

Upload: hamien

Post on 10-May-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

1

Logical Agents

ECE457 Applied Artificial IntelligenceSpring 2008Lecture #6

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 2

OutlineLogical reasoningPropositional LogicWumpus WorldInference

Russell & Norvig, chapter 7

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 3

Logical ReasoningRecall: Game-playing with imperfect information

Partially-observable environmentNeed to infer about hidden information

Two new challengesHow to represent the information we have (knowledge representation)How to use the information we have to infer new information and make decisions (knowledge reasoning)

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 4

Knowledge RepresentationRepresent facts about the environment

Many ways: ontologies, mathematical functions, …Statements that are either true or false

LanguageTo write the statementsSyntax: symbols (words) and rules to combine them (grammar)Semantics: meaning of the statementsExpressiveness vs. efficiency

Knowledge base (KB)Contains all the statementsAgent can TELL it new statements (update)Agent can ASK it for information (query)

2

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 5

Knowledge RepresentationExample: Language of arithmeticSyntax describes well-formed formulas (WFF)

X + Y > 7 (WFF)X 7 @ Y + (not a WFF)

Semantics describes meanings of formulas

“X + Y > 7” is true if and only if the value of X and the value of Y summed together is greater than 7

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 6

Knowledge ReasoningInference

Discovering new facts and drawing conclusions based on existing informationDuring ASK or TELL“All humans are mortal”“Socrates is human”

EntailmentA sentence β is inferred from sentences αβ is true given that the α are trueα entails βα £ β

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 7

Propositional LogicSometimes called “Boolean Logic”

Sentences are true (T) or false (F)Words of the syntax include propositional symbols…

P, Q, R, …P = “I’m hungry”, Q = “I have money”, R = “I’m going to a restaurant”

… and logical connectives¬ negation NOT∧ conjunction AND∨ disjunction OR⇒ implication IF-THEN⇔ biconditional IF AND ONLY IF

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 8

Propositional LogicAtomic sentences

Propositional symbolsTrue or false

Complex sentences Groups of propositional symbols joined with connectives, and parenthesis if needed(P ∧ Q) ⇒ RWell-formed formulas following grammar rules of the syntax

3

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 9

Propositional LogicComplex sentences evaluate to true or false Using truth tables

Semantics

TFFFFTFFFTTFFTFFTFTTTFTFFTFTFTTFTTFTTTTT

(P ∧ Q) ⇒ RP ∧ QRQP

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 10

Propositional Logic Semantics

FFFT

P ∧ Q

FTTT

P ∨ Q

TFTT

P ⇒ Q

TTFFFFFTFTTFTFTT

P ⇔ Q¬PQP

Truth tables for all connectivesGiven each possible truth value of each propositional symbol, we can get the possible truth values of the expression

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 11

Propositional Logic ExamplePropositional symbols:

A = “The car has gas”B = “I can go to the store”C = “I have money”D = “I can buy food”E = “The sun is shining”F = “I have an umbrella”G = “I can go on a picnic”

If the car has gas, then I can go to the store

A ⇒ BI can buy food if I can go to the store and I have money

(B ∧ C) ⇒ DIf I can buy food and either the sun is not shining or I have an umbrella, I can go on a picnic

(D ∧ (¬E ∨ F)) ⇒ G

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 12TFTTFFFF

FTTTFFFTTFFFFFTF

TFFFFFTT

TFTTFTFFFTTTFTFT

TFTFFTTFFTTFFTTT

TFTTTFFFTTTTTFFT

TFFFTFTF

TFFFTFTTTFTTTTFF

TTTTTTFTTFTFTTTF

TTTFTTTT

D ∧ (¬E ∨ F) ⇒ GD ∧ (¬E ∨ F)¬E ∨ F¬EGFED

4

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 13

Wumpus World2D cave dividedin roomsGold

GlittersAgent has to pick it up

PitsAgent falls in and diesAgent feels breeze near pit

WumpusAgent gets eaten and dies if Wumpus aliveAgent can kill Wumpus with arrow (will hear scream)Agent smells stench near Wumpus (alive or dead)

4321

1

2

3

4

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 14

Wumpus WorldInitial state:

(1,1)Goal:

Get the gold and get back to (1,1)

Actions:Turn 90°, move forward, shoot arrow, pick up gold

Cost:+1000 for getting gold, -1000 for dying, -1 per action, -10 for shooting the arrow

4321

1

2

3

4

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 15

Exploring the Wumpus World

4321

1

2

3

4

Wumpus?

Pit?

Pit?Wumpus?OK Pit?

Pit?OK

OK

Pit? Pit?

OK

OK

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 16

Wumpus World LogicPropositional symbols

Pi,j = “there is a pit at (i,j)”Bi,j = “there is a breeze at (i,j)”Si,j = “there is a stench at (i,j)”Wi,j = “there is a Wumpus at (i,j)”Ki,j = “(i,j) is ok”

RulesBi,j ⇔ (Pi+1,j ∨ Pi-1,j ∨ Pi,j+1 ∨ Pi,j-1)Si,j ⇔ (Wi+1,j ∨ Wi-1,j ∨ Wi,j+1 ∨ Wi,j-1)Ki,j ⇔ (¬Wi,j ∧ ¬Pi,j)

Have to be written out for every (i,j)

5

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 17

Wumpus World KB

4321

1

2

3

41. K1,1

2. ¬B1,1

3. ¬S1,1

a. B1,1 ⇔ (P2,1 ∨ P1,2)

b. S1,1 ⇔ (W2,1 ∨ W1,2)

c. K2,1⇔(¬W2,1∧¬P2,1)

d. K1,2⇔(¬W1,2∧¬P1,2)

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 18

Wumpus World Inference

FFFFFTFTTTTFFTTTFFFTTFTF

T

FFF

¬B1,1

TFFFF

TTFTTTTTFTTTTTT

B1,1 ⇔ (P1,2∨P2,1)P1,2∨P2,1P2,1P1,2B1,1

1. K1,1 3. ¬S1,12. ¬B1,1

1. K1,1 3. ¬S1,1 5. ¬P2,12. ¬B1,1 4. ¬P1,2

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 19

1. K1,1 3. ¬S1,1 5. ¬P2,1 7. ¬W2,12. ¬B1,1 4. ¬P1,2 6. ¬W1,2

Wumpus World Inference

FFFFFTFTTTTFFTTTFFFTTFTF

T

FFF

¬S1,1

TFFFF

TTFTTTTTFTTTTTT

S1,1 ⇔ (W1,2∨W2,1)W1,2∨W2,1W2,1W1,2S1,1

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 20

1. K1,1 3. ¬S1,1 5. ¬P2,1 7. ¬W2,12. ¬B1,1 4. ¬P1,2 6. ¬W1,2

1. K1,1 3. ¬S1,1 5. ¬P2,1 7. ¬W2,1 9. K2,12. ¬B1,1 4. ¬P1,2 6. ¬W1,2 8. K1,2

Wumpus World Inference

TFFFTFF

F¬W1,2∧¬P1,2

TFTFTFT

F¬P1,2

TTFFTTF

F¬W1,2

FTFTFTF

TP1,2

FFTTFFT

TW1,2

FFFFTTT

TK1,2

TTTTF

FF

FK1,2 ⇔ (¬W1,2∧¬P1,2)

6

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 21

10.B2,1

11.P3,1

12.¬S2,1

13.¬W2,2

14.¬W3,1

15.¬B1,2

16.¬P1,3

17.¬P2,2

18.S1,2

19.W1,3

20.K2,2

Wumpus World KB1. K1,1

2. ¬B1,1

3. ¬S1,1

4. ¬P1,2

5. ¬P2,1

6. ¬W1,2

7. ¬W2,1

8. K1,2

9. K2,1

4321

1

2

3

4

OK

OKPit?

Pit?

Wumpus?

Wumpus?OK

10.B2,1

11.P2,2 ∨ P3,1

12.¬S2,1

13.¬W2,2

14.¬W3,1

15.¬B1,2

16.¬P1,3

17.¬P2,2

18.S1,2

19.W1,3 ∨ W2,2

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 22

Inference with Truth TablesSound

Only infers true conclusions from true premises

CompleteFinds all facts entailed by KB

Time complexity = O(2n)Checks all truth values of all symbols

Space complexity = O(n)

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 23

Inference with RulesSpeed up inference by using inference rulesUse along with logical equivalencesNo need to enumerate and evaluate every truth value

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 24

Rules and EquivalencesLogical equivalences

(α ∧ β) ≡ (β ∧ α)(α ∨ β) ≡ (β ∨ α)((α ∧ β) ∧ γ) ≡ (α ∧ (β ∧ γ))((α ∨ β) ∨ γ) ≡ (α ∨ (β ∨ γ))¬(¬α) ≡ α(α ⇒ β) ≡ (¬β ⇒ ¬α)(α ⇒ β) ≡ (¬α ∨ β)(α ⇔ β) ≡ ((α ⇒ β) ∧ (β ⇒ α))¬(α ∧ β) ≡ (¬α ∨ ¬β)¬(α ∨ β) ≡ (¬α ∧ ¬β)(α ∧ (β ∨ γ)) ≡ ((α ∧ β) ∨ (α ∧ γ))(α ∨ (β ∧ γ)) ≡ ((α ∨ β) ∧ (α ∨ γ))

Inference rules(α ⇒ β), α

β(α ∧ β)

αα, β

(α∧β)(α ∨ β), ¬β

α(α∨β), (¬β∨γ)

(α ∨ γ))

7

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 25

Wumpus World & Inference RulesKB: ¬B1,11. B1,1 ⇔ (P2,1 ∨ P1,2)

Biconditional elimination2. (B1,1 ⇒ (P2,1 ∨ P1,2)) ∧ ((P2,1 ∨ P1,2) ⇒ B1,1)

And elimination3. (P2,1 ∨ P1,2) ⇒ B1,1

Contraposition4. ¬B1,1 ⇒ ¬(P2,1 ∨ P1,2)

Modus Ponens5. ¬(P2,1 ∨ P1,2)

De Morgan’s Rule6. ¬P2,1 ∧ ¬P1,2

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 26

ResolutionInference with rules is sound, but only complete if we have all the rules Resolution rule is both sound and complete

(α∨β), (¬β∨γ)(α ∨ γ))

But it only works on disjunctions!Conjunctive normal form (CNF)

1. Eliminate biconditionals: (α⇔β) ≡ ((α⇒β)∧(β⇒α))

2. Eliminate implications: (α ⇒ β) ≡ (¬α ∨ β)3. Move/Eliminate negations: ¬(¬α) ≡ α,

¬(α ∧ β) ≡ (¬α ∨ ¬β), ¬(α ∨ β) ≡ (¬α ∧ ¬β)4. Distribute ∨ over ∧: (α ∨ (β∧γ)) ≡ ((α∨β) ∧ (α∨γ))

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 27

CNF Example1. B1,1 ⇔ (P2,1 ∨ P1,2)

Eliminate biconditionals

2. (B1,1 ⇒ (P2,1 ∨ P1,2)) ∧ ((P2,1 ∨ P1,2) ⇒ B1,1)Eliminate implications

3. (¬B1,1 ∨ P2,1 ∨ P1,2) ∧ (¬(P2,1 ∨ P1,2) ∨ B1,1)Move/Eliminate negations

4. (¬B1,1 ∨ P2,1 ∨ P1,2) ∧ ((¬P2,1 ∧ ¬P1,2) ∨ B1,1)Distribute ∨ over ∧

5. (¬B1,1 ∨ P2,1 ∨ P1,2) ∧ (¬P2,1 ∨ B1,1) ∧(¬P1,2 ∨ B1,1)

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 28

Resolution AlgorithmGiven a KBNeed to answer a query α

KB £ α ?

Proof by contradictionShow that (KB ∧ ¬α) is unsatisfiable

i.e. leads to a contradiction

If (KB ∧ ¬α) is false, then (KB ∧ α) must be true

8

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 29

Resolution AlgorithmConvert (KB ∧ ¬α) into CNFFor every pair of clauses that contain complementary symbols

Apply resolution to generate a new clauseAdd new clause to KB

End whenResolution gives the empty clause (KB £ α)No new clauses can be added (fail)

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 30

Wumpus World & Resolution(¬B1,1 ∨ P1,2 ∨ P2,1) ∧ (¬P1,2 ∨ B1,1) ∧(¬P2,1 ∨ B1,1)

CNF form of B1,1 ⇔ (P2,1 ∨ P1,2)¬B1,1

Query: ¬P1,2

(¬B1,1 ∨ P1,2 ∨ P2,1) ∧ (¬P2,1 ∨ B1,1) ∧ (¬P1,2 ∨ B1,1) ∧ ¬B1,1 ∧ P1,2

(¬B1,1 ∨ P1,2 ∨ P2,1) ∧ (¬P2,1 ∨ B1,1) ∧ B1,1 ∧ ¬B1,1 ∧ P1,2

(¬B1,1 ∨ P1,2 ∨ P2,1) ∧ (¬P2,1 ∨ B1,1) ∧ Empty clause! ∧ P1,2

KB £ ¬P1,2

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 31

Resolution AlgorithmSoundCompleteNot efficient

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 32

Horn ClausesResolution algorithm can be further improved by using Horn clausesDisjunction clause with at most one positive symbol

¬α ∨ ¬β ∨ γCan be rewritten as implication

(α ∧ β) ⇒ γInference in linear time!

Using Modus PonensForward or backward chaining

9

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 33

Forward ChainingData-driven reasoning

Start with known symbolsInfer new symbols and add to KBUse new symbols to infer more new symbolsRepeat until query proven or no new symbols can be inferred

Work forward from known data, towards proving goal

1. KB: α, β, δ, ε2. (α ∧ β) ⇒ γ3. (δ ∧ ε) ⇒ λ4. (λ ∧ γ) ⇒ q

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 34

Backward ChainingGoal-driven reasoning

Start with query, try to infer itIf there are unknown symbols in the premise of the query, infer them firstIf there are unknown symbols in the premise of these symbols, infer those firstRepeat until query proven or its premise cannot be inferred

Work backwards from goal, to prove needed information

1. KB: α, β, δ, ε2. (λ ∧ γ) ⇒ q3. (δ ∧ ε) ⇒ λ4. (α ∧ β) ⇒ γ

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 35

Forward vs. BackwardForward chaining

Proves everythingGoes to work as soon as new information is availableExpands the KB a lot

Improves understanding of the worldTypically used for proving a world model

Backward chainingProves only what is needed for the goalDoes nothing until a query is askedExpands the KB as little as needed

More efficientTypically used for proofs by contradiction

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 36

AssumptionsUtility-based agentEnvironment

Fully observable / Partially observable (approximation)Deterministic / Strategic / Stochastic SequentialStatic / Semi-dynamicDiscrete / ContinuousSingle agent / Multi-agent

10

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 37

Assumptions UpdatedLearning agentEnvironment

Fully observable / Partially observableDeterministic / Strategic / Stochastic SequentialStatic / Semi-dynamicDiscrete / ContinuousSingle agent / Multi-agent

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 38

ExerciseIf the unicorn is mythical, then it is immortal, but if it is not mythical then it is a mortal mammal. If the unicorn is either immortal or a mammal, then it is horned. The unicorn is magical if it is horned.Is the unicorn

Magical?Horned?Mythical?

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 39

Exercise: CNFPropositional symbols

Mythical = “The unicorn is mythical”Immortal = “The unicorn is immortal”Mammal = “The unicorn is a mammal”Horned = “The unicorn is horned”Magical = “The unicorn is magical”

If the unicorn is mythical, then it is immortal

Mythical ⇒ Immortal¬Mythical ∨ Immortal

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 40

Exercise: CNFPropositional symbols

Mythical = “The unicorn is mythical”Immortal = “The unicorn is immortal”Mammal = “The unicorn is a mammal”Horned = “The unicorn is horned”Magical = “The unicorn is magical”

If it is not mythical then it is a mortal mammal

¬Mythical ⇒ (¬Immortal ∧ Mammal)Mythical ∨ (¬Immortal ∧ Mammal)(Mythical ∨ ¬Immortal) ∧ (Mythical ∨ Mammal)

11

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 41

Exercise: CNFPropositional symbols

Mythical = “The unicorn is mythical”Immortal = “The unicorn is immortal”Mammal = “The unicorn is a mammal”Horned = “The unicorn is horned”Magical = “The unicorn is magical”

If the unicorn is either immortal or a mammal, then it is horned

(Immortal ∨ Mammal) ⇒ Horned ¬(Immortal ∨ Mammal) ∨ Horned(¬Immortal ∧ ¬Mammal) ∨ Horned(¬Immortal ∨ Horned) ∧ (¬Mammal ∨ Horned)

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 42

Exercise: CNFPropositional symbols

Mythical = “The unicorn is mythical”Immortal = “The unicorn is immortal”Mammal = “The unicorn is a mammal”Horned = “The unicorn is horned”Magical = “The unicorn is magical”

The unicorn is magical if it is hornedHorned ⇒ Magical¬Horned ∨ Magical

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 43

Exercise: KB, QueriesKB

(¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧ (Mythical ∨ Mammal) ∧ (¬Immortal ∨ Horned) ∧ (¬Mammal ∨ Horned) ∧ (¬Horned ∨ Magical)

Negation of queries¬Magical¬Horned¬Mythical

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 44

Exercise: Resolution, ¬Magical (¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧(Mythical ∨ Mammal) ∧ (¬Immortal ∨ Horned) ∧(¬Mammal ∨ Horned) ∧ (¬Horned ∨ Magical) ∧¬Magical(¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧(Mythical ∨ Mammal) ∧ (¬Immortal ∨ Horned) ∧(¬Mammal ∨ Horned) ∧ (¬Horned ∨ Magical) ∧¬Magical(¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧(Mythical ∨ Mammal) ∧ (¬Immortal ∨ Horned) ∧(¬Mammal ∨ Horned) ∧ ¬Horned ∧ ¬Magical(¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧(Mythical ∨ Mammal) ∧ ¬Immortal ∧ ¬Mammal ∧¬Horned ∧ ¬Magical¬Mythical ∧ (Mythical ∨ ¬Immortal) ∧ Mythical ∧¬Immortal ∧ ¬Mammal ∧ ¬Horned ∧ ¬Magical

12

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 45

Exercise: Resolution, ¬Horned (¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧(Mythical ∨ Mammal) ∧ (¬Immortal ∨ Horned) ∧(¬Mammal ∨ Horned) ∧ (¬Horned ∨ Magical) ∧¬Horned (¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧(Mythical ∨ Mammal) ∧ (¬Immortal ∨ Horned) ∧(¬Mammal ∨ Horned) ∧ (¬Horned ∨ Magical) ∧¬Horned(¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧(Mythical ∨ Mammal) ∧ ¬Immortal ∧ ¬Mammal ∧(¬Horned ∨ Magical) ∧ ¬Horned¬Mythical ∧ (Mythical ∨ ¬Immortal) ∧ Mythical ∧¬Immortal ∧ ¬Mammal ∧ (¬Horned ∨ Magical) ∧¬Horned

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 46

Exercise: Resolution, ¬Mythical(¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧(Mythical ∨ Mammal) ∧ (¬Immortal ∨ Horned) ∧(¬Mammal ∨ Horned) ∧ (¬Horned ∨ Magical) ∧¬Mythical(¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧(Mythical ∨ Mammal) ∧ (¬Immortal ∨ Horned) ∧(¬Mammal ∨ Horned) ∧ (¬Horned ∨ Magical) ∧¬Mythical(¬Mythical ∨ Immortal) ∧ ¬Immortal ∧ Mammal ∧(¬Immortal ∨ Horned) ∧ (¬Mammal ∨ Horned) ∧(¬Horned ∨ Magical) ∧ ¬Mythical¬Mythical ∧ ¬Immortal ∧ Mammal ∧ (¬Immortal ∨Horned) ∧ Horned ∧ (¬Horned ∨ Magical) ∧¬Mythical¬Mythical ∧ ¬Immortal ∧ Mammal ∧ (¬Immortal ∨Horned) ∧ Horned ∧ Magical ∧ ¬Mythical

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 47

Exercise: Resolution, Mythical(¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧(Mythical ∨ Mammal) ∧ (¬Immortal ∨ Horned) ∧(¬Mammal ∨ Horned) ∧ (¬Horned ∨ Magical) ∧Mythical(¬Mythical ∨ Immortal) ∧ (Mythical ∨ ¬Immortal) ∧(Mythical ∨ Mammal) ∧ (¬Immortal ∨ Horned) ∧(¬Mammal ∨ Horned) ∧ (¬Horned ∨ Magical) ∧MythicalImmortal ∧ (Mythical ∨ ¬Immortal) ∧ (Mythical ∨Mammal) ∧ (¬Immortal ∨ Horned) ∧ (¬Mammal ∨Horned) ∧ (¬Horned ∨ Magical) ∧ MythicalImmortal ∧ Mythical ∧ (Mythical ∨ Mammal) ∧Horned ∧ (¬Mammal ∨ Horned) ∧ (¬Horned ∨Magical) ∧ MythicalImmortal ∧ Mythical ∧ (Mythical ∨ Mammal) ∧Horned ∧ (¬Mammal ∨ Horned) ∧ Magical ∧ Mythical

ECE457 Applied Artificial Intelligence R. Khoury (2008) Page 48

Exercise: NotePrevious two examples

(KB ∧ ¬Mythical) £ (Horned ∧ Magical)(KB ∧ Mythical) £ (Horned ∧ Magical)

ThereforeKB £ (Horned ∧ Magical)