Download presentation
Presentation is loading. Please wait.
1
EA C461 Artificial Intelligence
Logical Agent S.P.Vimal BITS-Pilani EA C461 Artificial Intelligence
2
EA C461 Artificial Intelligence
To discuss Reasoning Patterns Modus Ponens, AND Elimination Inference Based on Resolution Forward Chaining, Backward Chaining EA C461 Artificial Intelligence
3
EA C461 Artificial Intelligence
Reasoning Patterns Modus Ponens Given α β, α the sentence β can be inferred And Elimination Given α Λ β, α the sentence β can be inferred Sound inferences can be generated EA C461 Artificial Intelligence
4
EA C461 Artificial Intelligence
Reasoning Patterns R1: P1,1 R2: B1,1 R3: B2,1 R4: B1,1 (P1,2 P2,1) R5: B2,1 (P1,1 P2,2 P3,1) The KB is now R1Λ R2Λ R3Λ R4Λ R5 How do you infer there is no pit in (1,2) . That is ( P1,2).. Sequence of derivations (proof) will help us conclude ( P1,2) Finding proof is similar to searching Trying to find a proof Vs Truth Table Enumeration EA C461 Artificial Intelligence
5
Resolution Conjunctive Normal Form (CNF)
conjunction of disjunctions of literals clauses E.g., (A B) (B C D) Resolution inference rule (for CNF): li … lk, m1 … mn li … li-1 li+1 … lk m1 … mj-1 mj+1 ... mn where li and mj are complementary literals. E.g., P1,3 P2,2, P2,2 P1,3 Resolution is sound and complete for propositional logic EA C461 Artificial Intelligence
6
EA C461 Artificial Intelligence
Resolution algorithm Inference based on resolution Proof by contradiction, i.e., show KBα unsatisfiable EA C461 Artificial Intelligence
7
EA C461 Artificial Intelligence
Resolution example KB = (B1,1 (P1,2 P2,1)) B1,1 α = P1,2 EA C461 Artificial Intelligence
8
Resolution Closure--RC(S)
Set of all clauses derivable by repeated application of the resolution rule to clauses in S and their derivables Ground Resolution Theorem If a set of clauses are unsatisfiable, then their RC will contain an empty clause Any complete search algorithm , applying only resolution rule can derive any conclusions entailed by any knowledge base in propositional logic Refutation Completeness Resolution can always be used to confirm or refute a sentence. EA C461 Artificial Intelligence
9
Forward and backward chaining
Horn Form (restricted) KB = conjunction of Horn clauses Horn clause = proposition symbol; or (conjunction of symbols) symbol E.g., C (B A) (C D B) Modus Ponens (for Horn Form): complete for Horn KBs α1, … ,αn, α1 … αn β β Can be used with forward chaining or backward chaining. These algorithms are very natural and run in linear time EA C461 Artificial Intelligence
10
EA C461 Artificial Intelligence
Forward chaining Idea: fire any rule whose premises are satisfied in the KB, add its conclusion to the KB, until query is found EA C461 Artificial Intelligence
11
Forward chaining algorithm
Forward chaining is sound and complete for Horn KB EA C461 Artificial Intelligence
12
Forward chaining example
EA C461 Artificial Intelligence
13
Forward chaining example
EA C461 Artificial Intelligence
14
Forward chaining example
EA C461 Artificial Intelligence
15
Forward chaining example
EA C461 Artificial Intelligence
16
Forward chaining example
EA C461 Artificial Intelligence
17
Forward chaining example
EA C461 Artificial Intelligence
18
Forward chaining example
EA C461 Artificial Intelligence
19
Forward chaining example
EA C461 Artificial Intelligence
20
EA C461 Artificial Intelligence
Proof of completeness FC derives every atomic sentence that is entailed by KB FC reaches a fixed point where no new atomic sentences are derived Consider the final state as a model m, assigning true/false to symbols Every clause in the original KB is true in m a1 … ak b Hence m is a model of KB If KB╞ q, q is true in every model of KB, including m EA C461 Artificial Intelligence
21
EA C461 Artificial Intelligence
Backward chaining Idea: work backwards from the query q: to prove q by BC, check if q is known already, or prove by BC all premises of some rule concluding q Avoid loops: check if new subgoal is already on the goal stack Avoid repeated work: check if new subgoal has already been proved true, or has already failed EA C461 Artificial Intelligence
22
Backward chaining example
EA C461 Artificial Intelligence
23
Backward chaining example
EA C461 Artificial Intelligence
24
Backward chaining example
EA C461 Artificial Intelligence
25
Backward chaining example
EA C461 Artificial Intelligence
26
Backward chaining example
EA C461 Artificial Intelligence
27
Backward chaining example
EA C461 Artificial Intelligence
28
Backward chaining example
EA C461 Artificial Intelligence
29
Backward chaining example
EA C461 Artificial Intelligence
30
Backward chaining example
EA C461 Artificial Intelligence
31
Backward chaining example
EA C461 Artificial Intelligence
32
Forward vs. backward chaining
FC is data-driven, automatic, unconscious processing, e.g., object recognition, routine decisions May do lots of work that is irrelevant to the goal BC is goal-driven, appropriate for problem-solving, e.g., Where are my keys? How do I get into a PhD program? Complexity of BC can be much less than linear in size of KB EA C461 Artificial Intelligence
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.