rtificial Intelligence Knowledge Representation I Lecture 6 Issues in Knowledge Representation 1. How to represent knowledge 2. How to manipulate/process knowledge (2) Can be rephrased as: how to make decisions based on some knowledge. 2
Why logic in knowledge representation? Logical notation can be used to express info/knowledge. Logical notation is useful in reasoning about knowledge. 3 Why logic in knowledge representation? 1. Logical notation for expressing info/knowledge ltavista search: Mary ND lamb the output is: {p WebPages contain(p,mary) & contain(p,lamb)} = {p WebPages contain(p,mary))} {p WebPages contain(p,lamp)} 4
Why logic in knowledge representation? 2. Logical notation is useful in reasoning (about knowledge. eg1. John is a human if John is a human then John is mortal therefore John is mortal. in logic: P P P Q P Q P P Q therefore Q Q Q. 5 Why logic in knowledge representation? 2. Logical notation is useful in reasoning (about knowledge) eg1. John is a human every human are mortals therefore John is mortal. In logic: human(john) h(human(h) mortal(h)) therefore: human(john) mortal(john) by elim. rule therefore: mortal(john) by elim. rule 6
Logical Symbols and Quantifiers Logical Symbols ~ NOT ND OR IMPLIES Quantifers FOR LL THERE EXISTS 7 Objective of this lecture Learn about logical symbols (and their formal meaning). Learn about the rules in using the symbols. Learn about expressing real life problems in terms of logical symbols. and probably more. 8
How to use logical notation for representing knowledge particular logic, called: Propositional Calculus. Studying a logic --- studying a language Defn: language of PC, call it L PC is defined by the following rules: 1. Variables p, q, r,p 2,q 2,r 2,... are in L PC. We call the above variables: undeterminate statements. 2. If a statement is in L PC and a statement B is in L PC, then the statement (&B) is in L PC.Similarly for the symbols:,. 3. If a statement is in L PC, then the statement ~ is in L PC. Note: L PC is a set. It is a set of statements which can be generated from the above rules. 9 Propositional Logic Propositions make declarations. Propositions can be denoted by atoms: symbols as, B, C, etc. Formulae can be built with atoms, parentheses, and logical operators. Interpretation of formulae - assignment of a truth value to every atom occurring in the formula. 10
11 Truth tables for the five operators 12
Formulae interpretation 13 Tautology and inconsistency formula is tautology if and only if it is true under all its interpretations. formula is inconsistency if and only if it is false under all its interpretations. formula is consistent if and only if it is not inconsistent - true under at least one interpretation. Tautology is known as a valid formula; inconsistency as unsatisfiable formula; consistency as satisfiable formula. 14
15 16
Rules of inference 17 Ways of reasoning in L PC 1. Natural deduction 2. Resolution deduction 3. Truth table (model theory) 18
Ways of reasoning in L PC (1) Natural Deduction Elimination Rules Introduction Rules B B B [] [B] : : B C C C : : : : C ~C B B. B : :. ~ Β B [] : B. B B B : : ~. 19 Ways of reasoning in L PC (2) Resolution deduction Idea: Similar to Natural Deduction Based on Proof by Contradiction ~ : :. 20
Rules in Resolution Deduction B B B ~ B ~( B) ~ Β ~( B) ~ Β Closed Branch / B / / ~B B ~ B ------------- ~ B B ------------- B ~( B) ~ Β ------------- ~ ~B ~( B) ~ Β Α Β 21 22
23 Example of resolution deduction 24
Ways of reasoning in L PC (3) Truth Tables sentence is valid means: 1 occurs in all the rows of s Truth Table equivalently means ll possible interpretation of the sentence gives out 1. Given an interpretation I and a sentence S, how do we interpret S with respect to I? ns: n interpretation: function from undeterminate variables to {0, 1} eg. { p 0, q 0, r 1} 25 Example - prove that ~( V B) eqv. (~ & ~B) 26
Relationships between (1) Natural Deduction, (2) Resolution Deduction, and (3) Truth Table (Model Theory) Methods They have the same power, ie. iff iff S provable in Natural Deduction S provable in Resolution Deduction S is valid Provable sound complete Valid 27 End of Lecture 6 Good Day.