CS 416 Artificial Intelligence Lecture Lecture 11 11 Logical Logical Agents Agents Chapter Chapter 77 Midterm Exam Midterm Midterm will will be be on on Thursday Thursday March March 13 13thth ItIt will will cover cover material material up up until until Feb Feb 27 27thth Reasoning w propositional logic Remember Remember what what we ve we ve developed developed so so far far Logical Logical sentences sentences And And or or not not implies implies entailment entailment iff iff equivalence equivalence Syntax Syntax vs vs semantics semantics Truth Truth tables tables Satisfiability Satisfiability proof proof by by contradiction contradiction Logical Equivalences Know Know these these equivalences equivalences Reasoning w propositional logic Inference Inference Rules Rules Modus Modus Ponens Ponens Whenever Whenever sentences sentences of of form form and and are are given given the the sentence sentence can can be be inferred inferred R R11 Green Green Martian Martian R R22 Green Green Inferred Inferred Martian Martian Reasoning w propositional logic Inference Inference Rules Rules And Elimination And Elimination Any Any of of conjuncts conjuncts can can be be inferred inferred R R11 Martian Martian Green Green Inferred Inferred Martian Martian Inferrred Inferrred Green Green Use Use truth truth tables tables ifif you you want want to to confirm confirm inference inference rules rules Example of a proof P P B P B P P Example of a proof P P B P B P P Constructing a proof Proving Proving is is like like searching searching Find Find sequence sequence of of llogical ogical inference inference rules rules that that lead lead to to desired desired result result Note Note the the explosion explosion of of propositions propositions Good Good proof proof methods methods ignore ignore the the countless countless irrelevant irrelevant propositions propositions Monotonicity of knowledge base Knowledge Knowledge base base can can only only get get larger larger Adding Adding new new sentences sentences to to knowledge knowledge base base can can only only make make itit get get larger larger IfIf KB KB entails entails KB KB entails entails This This is is important important when when constructing constructing proofs proofs A A logical logical conclusion conclusion drawn drawn at at one one point point cannot cannot be be invalidated invalidated by by aa subsequent subsequent entailment entailment How many inferences Previous Previous example example relied relied on on application application of of inference inference rules rules to to generate generate new new sentences sentences When When have have you you drawn drawn enough enough inferences inferences to to prove prove something something Too Too many many make make search search process process take take longer longer Too Too few few halt halt logical logical progression progression and and make make proof proof process process incomplete incomplete Resolution Unit Unit Resolution Resolution Inference Inference Rule Rule IfIf m m and and llii are are complementary complementary literals literals Resolution Inference Rule Also Also works works with with clauses clauses But But make make sure sure each each literal literal appears appears only only once once Resolution and completeness Any Any complete complete search search algorithm algorithm applying applying only only the the resolution resolution rule rule can can derive derive any any conclusion conclusion entailed entailed by by any any knowledge knowledge base base in in propositional propositional logic logic More More specifically specifically refutation refutation completeness completeness Able Able to to confirm confirm or or refute refute any any sentence sentence Unable Unable to to enumerate enumerate all all true true sentences sentences What about and clauses Resolution Resolution only only applies applies to to or or clauses clauses Every Every sentence sentence of of propositional propositional logic logic can can be be transformed transformed to to aa logically logically equivalent equivalent conjunction conjunction of of disjunctions disjunctions of of literals literals Conjunctive Conjunctive Normal Normal Form Form CNF CNF A A sentence sentence expressed expressed as as conjunction conjunction of of disjunction disjunction of of literals literals k CNF k CNF exactly exactly kk literals literals per per clause clause CNF An algorithm for resolution We We wish wish to to prove prove KB KB entails entails Must Must show show KB KB is is unsatisfiable unsatisfiable No No possible possible way way for for KB KB to to entail entail not not Proof Proof by by contradiction contradiction An algorithm for resolution Algorithm Algorithm KB KB is is put put in in CNF CNF Each Each pair pair with with complementary complementary literals literals is is resolved resolved to to produce produce new new clause clause which which is is added added to to KB KB if if novel novel Cease Cease ifif no no new new clauses clauses to to add add is is not not entailed entailed Cease Cease ifif resolution resolution rule rule derives derives empty empty clause clause is is entailed entailed Example of resolution Proof Proof that that there there is is not not aa pit pit in in P P1 2 P1 2 1 2 P 1 2 KB KB PP1 2 leads to to empty empty clause clause 1 2 leads Therefore Therefore P P1 2 is true true 1 2 is Formal Algorithm Horn Clauses Horn Horn Clause Clause Disjunction Disjunction of of literals literals with with at at most most one one is is positive positive a a V V b b V V c c V V d d a a V V bb V V cc V V d d Not Not aa Horn Horn Clause Clause Horn Clauses Can Can be be written written as as aa special special implication implication a a V V b b V V c c a a b b cc a a V V b b V V c c a a b b V V c c de de Morgan Morgan a a b b V V c c a a b b cc implication implication elimination elimination Horn Clauses Permit Permit straightforward straightforward inference inference determination determination Forward Forward chaining chaining Backward Backward chaining chaining Horn Clauses Permit Permit determination determination of of entailment entailment in in linear linear time time in in order order of of knowledge knowledge base base size size Forward Chaining Forward Chaining Properties Properties Sound Sound Complete Complete All All entailed entailed atomic atomic sentence sentence will will be be derived derived Data Data Driven Driven Start Start with with what what we we know know
View Full Document