Download presentation
Presentation is loading. Please wait.
1
ITCS 3153 Artificial Intelligence Lecture 11 Logical Agents Chapter 7 Lecture 11 Logical Agents Chapter 7
2
Reasoning w/ propositional logic Remember what we’ve developed so far Logical sentencesLogical sentences And, or, not, implies (entailment), iff (equivalence)And, or, not, implies (entailment), iff (equivalence) Syntax vs. semanticsSyntax vs. semantics Truth tablesTruth tables Satisfiability, proof by contradictionSatisfiability, proof by contradiction Remember what we’ve developed so far Logical sentencesLogical sentences And, or, not, implies (entailment), iff (equivalence)And, or, not, implies (entailment), iff (equivalence) Syntax vs. semanticsSyntax vs. semantics Truth tablesTruth tables Satisfiability, proof by contradictionSatisfiability, proof by contradiction
3
Logical Equivalences Know these equivalences
4
Reasoning w/ propositional logic Inference Rules Modus Ponens:Modus Ponens: –Whenever sentences of form => and are given the sentence can be inferred R 1 : Green => Martian R 2 : Green Inferred: Martian Inference Rules Modus Ponens:Modus Ponens: –Whenever sentences of form => and are given the sentence can be inferred R 1 : Green => Martian R 2 : Green Inferred: Martian
5
Reasoning w/ propositional logic Inference Rules And-EliminationAnd-Elimination –Any of conjuncts can be inferred R 1 : Martian ^ Green Inferred: Martian Inferrred: Green Use truth tables if you want to confirm inference rules Inference Rules And-EliminationAnd-Elimination –Any of conjuncts can be inferred R 1 : Martian ^ Green Inferred: Martian Inferrred: Green Use truth tables if you want to confirm inference rules
6
Example of a proof ~P ~B B P?
7
Example of a proof ~P ~B B ~P P? ~P
8
Constructing a proof Proving is like searching Find sequence of logical inference rules that lead to desired resultFind sequence of logical inference rules that lead to desired result Note the explosion of propositionsNote the explosion of propositions –Good proof methods ignore the countless irrelevant propositions Proving is like searching Find sequence of logical inference rules that lead to desired resultFind sequence of logical inference rules that lead to desired result Note the explosion of propositionsNote the explosion of propositions –Good proof methods ignore the countless irrelevant propositions
9
Monotonicity of knowledge base Knowledge base can only get larger Adding new sentences to knowledge base can only make it get largerAdding new sentences to knowledge base can only make it get larger –If (KB entails ) ((KB ^ ) entails ) This is important when constructing proofsThis is important when constructing proofs –A logical conclusion drawn at one point cannot be invalidated by a subsequent entailment Knowledge base can only get larger Adding new sentences to knowledge base can only make it get largerAdding new sentences to knowledge base can only make it get larger –If (KB entails ) ((KB ^ ) entails ) This is important when constructing proofsThis is important when constructing proofs –A logical conclusion drawn at one point cannot be invalidated by a subsequent entailment
10
How many inferences? Previous example relied on application of inference rules to generate new sentences When have you drawn enough inferences to prove something?When have you drawn enough inferences to prove something? –Too many make search process take longer –Too few halt logical progression and make proof process incomplete Previous example relied on application of inference rules to generate new sentences When have you drawn enough inferences to prove something?When have you drawn enough inferences to prove something? –Too many make search process take longer –Too few halt logical progression and make proof process incomplete
11
Resolution Unit Resolution Inference Rule If m and l i are complementary literalsIf m and l i are complementary literals Unit Resolution Inference Rule If m and l i are complementary literalsIf m and l i are complementary literals
12
Resolution Inference Rule Also works with clauses But make sure each literal appears only once Also works with clauses But make sure each literal appears only once
13
Resolution and completeness Any complete search algorithm, applying only the resolution rule, can derive any conclusion entailed by any knowledge base in propositional logic More specifically, refutation completenessMore specifically, refutation completeness –Able to confirm or refute any sentence –Unable to enumerate all true sentences Any complete search algorithm, applying only the resolution rule, can derive any conclusion entailed by any knowledge base in propositional logic More specifically, refutation completenessMore specifically, refutation completeness –Able to confirm or refute any sentence –Unable to enumerate all true sentences
14
What about “and” clauses? Resolution only applies to “or” clauses Every sentence of propositional logic can be transformed to a logically equivalent conjunction of disjunctions of literalsEvery sentence of propositional logic can be transformed to a logically equivalent conjunction of disjunctions of literals Conjunctive Normal Form (CNF) A sentence expressed as conjunction of disjunction of literalsA sentence expressed as conjunction of disjunction of literals –k-CNF: exactly k literals per clause Resolution only applies to “or” clauses Every sentence of propositional logic can be transformed to a logically equivalent conjunction of disjunctions of literalsEvery sentence of propositional logic can be transformed to a logically equivalent conjunction of disjunctions of literals Conjunctive Normal Form (CNF) A sentence expressed as conjunction of disjunction of literalsA sentence expressed as conjunction of disjunction of literals –k-CNF: exactly k literals per clause
15
CNF
16
An algorithm for resolution We wish to prove KB entails Must show (KB ^ ~ ) is unsatisfiableMust show (KB ^ ~ ) is unsatisfiable –No possible way for KB to entail (not ) –Proof by contradiction We wish to prove KB entails Must show (KB ^ ~ ) is unsatisfiableMust show (KB ^ ~ ) is unsatisfiable –No possible way for KB to entail (not ) –Proof by contradiction
17
An algorithm for resolution Algorithm KB ^ ~ is put in CNFKB ^ ~ is put in CNF Each pair with complementary literals is resolved to produce new clause which is added to KB (if novel)Each pair with complementary literals is resolved to produce new clause which is added to KB (if novel) –Cease if no new clauses to add (~ is not entailed) –Cease if resolution rule derives empty clause (~ is entailed) Algorithm KB ^ ~ is put in CNFKB ^ ~ is put in CNF Each pair with complementary literals is resolved to produce new clause which is added to KB (if novel)Each pair with complementary literals is resolved to produce new clause which is added to KB (if novel) –Cease if no new clauses to add (~ is not entailed) –Cease if resolution rule derives empty clause (~ is entailed)
18
Example of resolution Proof that there is not a pit in P 1,2 : ~P 1,2 KB ^ P 1,2 leads to empty clauseKB ^ P 1,2 leads to empty clause Therefore ~P 1,2 is trueTherefore ~P 1,2 is true Proof that there is not a pit in P 1,2 : ~P 1,2 KB ^ P 1,2 leads to empty clauseKB ^ P 1,2 leads to empty clause Therefore ~P 1,2 is trueTherefore ~P 1,2 is true
19
Formal Algorithm
20
Horn Clauses Horn Clause Disjunction of literals with at most one is positiveDisjunction of literals with at most one is positive –(~a V ~b V ~c V d) –(~a V b V c V ~d) Not a Horn Clause Horn Clause Disjunction of literals with at most one is positiveDisjunction of literals with at most one is positive –(~a V ~b V ~c V d) –(~a V b V c V ~d) Not a Horn Clause
21
Horn Clauses Can be written as a special implication (~a V ~b V c) (a ^ b) => c(~a V ~b V c) (a ^ b) => c –(~a V ~b V c) == (~(a ^ b) V c) … de Morgan –(~(a ^ b) V c) == ((a ^ b) => c … implication elimination Can be written as a special implication (~a V ~b V c) (a ^ b) => c(~a V ~b V c) (a ^ b) => c –(~a V ~b V c) == (~(a ^ b) V c) … de Morgan –(~(a ^ b) V c) == ((a ^ b) => c … implication elimination
22
Horn Clauses Permit straightforward inference determination Forward chainingForward chaining Backward chainingBackward chaining Permit straightforward inference determination Forward chainingForward chaining Backward chainingBackward chaining
23
Horn Clauses Permit determination of entailment in linear time (in order of knowledge base size)
24
Forward Chaining
25
Properties SoundSound CompleteComplete –All entailed atomic sentence will be derived Data Driven Start with what we knowStart with what we know Derive new info until we discover what we wantDerive new info until we discover what we wantProperties SoundSound CompleteComplete –All entailed atomic sentence will be derived Data Driven Start with what we knowStart with what we know Derive new info until we discover what we wantDerive new info until we discover what we want
26
Backward Chaining Start with what you want to know, a query (q) Look for implications that conclude q Goal-Directed Reasoning Start with what you want to know, a query (q) Look for implications that conclude q Goal-Directed Reasoning
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.