representing knowledge automated reasoning
play

Representing Knowledge Automated Reasoning We are faced with - PowerPoint PPT Presentation

Representing Knowledge Automated Reasoning We are faced with several choices: which type of logic to use? e.g. First Order Logic Representing Knowledge Higher Order Logic axioms (to capture basic facts of domain) definitions:


  1. Representing Knowledge Automated Reasoning We are faced with several choices: � which type of logic to use? e.g. � First Order Logic Representing Knowledge � Higher Order Logic � axioms (to capture basic facts of domain) � definitions: introduce other concepts in terms of basic facts Jacques Fleuriot double x ≡ 2 × x square x ≡ x × x s x ≡ x � 1 Lecture III Other types of definitions e.g. Recursive: Base case factorial 0 = 1 0 � x = x s x � y = s x � y factorial s x = s x × factorial x Step case Introduction Example Axioms: Equality Aim: to express knowledge in a computer tractable form 3 = 3, 4 = 4 Knowledge representation language, such as 1 st order logic, defined by 4 = 3 � 1, 3 � 1 = 4 Finite set of axioms if a = b, b = c then a = c � syntax: what constitutes a legal sentence (formula) in language replace equals with equals � semantics: facts in the world to which sentences refer. Without reflexivity x = x semantics, a sentence is just an arrangement of symbols. symmetry x = y → y = x entails sentences sentence transitivity x = y � y = z → x = z semantics semantics representation replacement x 1 = y 1 � ... � x n = y n → f x 1, ... ,x n = f y 1, ... ,y n world x 1 = y 1 � ... � x n = y n � P x 1, ... ,x n → P y 1, ... ,y n follows fact facts Properties that we Use reflexivity want: Existence: ∃ y. f x = y Key point: Reasoning operates on representations of facts rather Use symmetry Uniqueness: f x = y � f x = z → y = z than on the facts themselves and transitivity

  2. Sets Groups: Examples want to represent individual sets, including empty set need to be able to: 0 � x = x 1 × x = x x � 0 = x x × 1 = x build up sets by adding (adjoining) an element to a set � 1 = 1 x �� x = 0 x × x taking the union of two sets � 1 × x = 1 � x � x = 0 x taking the intersection of two sets x � y � z = x � y � z x × y × z = x × y × z tell whether an element is a member of a set � 1 = y 1 � 1 x 1 = y 1 → � x 1 =� y 1 x 1 = y 1 → x 1 distinguish sets from objects that are not sets x 1 = y 1 � x 2 = y 2 → x 1 � x 2 = y 1 � y 2 x 1 = y 1 � x 2 = y 2 → x 1 × x 2 = y 1 × y 2 Representation needs: Set predicate is true only of sets example domain: real numbers constant: EmptySet � 1 inverse of x = x inv x predicates: Member , Subset , and Set inverse of x = - x identity element: 1 identity element: 0 functions: Intersection , Union , and Adjoin binary function: × binary function: + Example: Axioms of Set Theory Example: Group Theory Axioms 1. The only sets are the empty set and those made by adjoining something a constant to a set. e � x = x e istheidentityelement identity ∀ s. Set s � s = EmptySet � ∃ x s 2 .Set s 2 � s = Adjoin x,s 2 � isabinary function x � e = x 2. The empty set has no elements adjoined to it (i.e. EmptySet cannot xisinverse of x inverse x � x = e be decomposed into a smaller set and an element). x � x = e �∃ x s. Adjoin x,s = EmptySet associativity x � y � z = x � y � z replacement x 1 = y 1 → x 1 = y 1 3. Adjoining an element already in the set has no effect. x 1 = y 1 � x 2 = y 2 → x 1 � x 2 = y 1 � y 2 ∀ x s. Member x,s � s = Adjoin x,s + other equality axioms 4. The only members of a set are the elements that were adjoined to it. ∃ y.x = y It is trivial to prove: ∀ x s. Member x,s � ∃ s 2 y. s = Adjoin y,s 2 � x = y � Member x,s 2

  3. Example: Axioms of Set Theory Example: Natural Numbers Exercise: Axiom of Mathematical Induction 5. A set is a subset of another if and only if all the members of the first set are members of the second set. ∀ x. P x → P s x P 0 Induction Rule ∀ x. P x 6. Two sets are equal if and only if each is a subset of the other. Captures fact that all numbers are generated by a succession operation 7. An object is a member of the intersection of two sets if and only if it is a member of each of the sets. Property P holds if it holds for all numbers defined using successor function Second order axiom: P is a variable predicate 8. An object is a member of the union of two sets if and only if it is a member of either set. Use it to prove many properties Example: Natural Numbers Axioms Issues in representation Peano Arithmetic Understandability of representation: is it natural? - All natural numbers can be generated using successor function Expressiveness 4 = s s s s 0 - propositional, predicate, inductive ... Convenient abbreviation - finite set of axioms? No need for an infinite number of constants: just have 0 and successor function s How easy is it to reason with? ∞ many numbers ¬ 0 = s x - suitability of heuristics s x = s y → x = y - user interaction addition 0 � x = x s x � y = s x � y Granularity of representation multiplication 0 ⋅ x = 0 - choice of primitives s x ⋅ y = x ⋅ y � y e.g. Geometry: take points as primitive (Tarski)? + equality axioms + ???? take points, lines and planes (Hilbert)?

  4. Functions or Relations? Function-free universal fragment Represent some property r holding between two objects x and y � Only use predicates and no existential quantifiers use a function and equality? r x = y � arguments in such theories are essentially boolean use a relation (predicate)? � therefore, only need to test a finite number of variable-free, r x , y quantifier free formulae for tautologyhood Equality axioms give functional representation the � can use techniques of propositional logic following properties: Existence ∃ Y . r X = Y Represent f X 1, ..., X n = Y as p f X 1, ..., X n, Y Uniqueness r X = Y � r X = Z → Y = Z Problem? X � Y = Z as � X,Y, Z Example: functions There may be no such Y, or there may be more than one from group theory X = Y as inv X,Y So, use relational form Example Consider '' daughter of" property: Group theory axioms revisited Can we express it as a function? e.g. daughter_of (marge) = lisa � e,x,x identity But Marge has another daughter called Maggie. � x,e,x uniqueness would mean that lisa = maggie inv x, y → � x, y,e �� y,x,e inverse daughter_of is not a function but a relation: daughter _of (marge , lisa) � � x, y,u �� u,z,w �� y,z,v → � x,v,w associativity � mum_of is a function: So , mum_of (lisa) = marge is okay � y,z,v �� x,v,w �� x, y,u → � u,z,w Another example loves ( bill, monica ) loves ( bill, hilary ), ... loves_em ( bill ) = {hilary, monica, janet ...} + replacement axioms Disadvantages? Not all theorems of group theory can be proved since Represent a relation as a function by introducing sets and using the translation: resulting theory is too weak, e.g. loves_em ( X ) = {Y : loves ( X,Y ) } Bill loves nobody? loves_em ( bill ) = {} cannot be proved ∀ x . ∃ y . inv x,y

  5. Variadic Functions Variadic Function II Representing functions that can take a variable number of parameters (variable arity) � theory of multisets or lists, etc. convenient but is it natural? Common examples: � enables us to represent functions not allowed by predicate logic 2 � 3 � 4 3 ⋅ a ⋅ s i n x � need to define operations on functions in terms of underlying multisets or lists... 4 ≤ X ≤ 8 � can become complicated � Variadic functions not allowed in first order logic � Could represent + as a unary function on multisets (or bags) Alternative � keep theory simple 2 � 3 2, 3 � 2 � 3 � 4 2, 3, 4 � � used proved lemmas 3 � b ⋅ x 2 � c ⋅ x � d 3 , b ⋅ x 2 , c ⋅ x, d a ⋅ x a ⋅ x � X � Y � Z = X � Y � Z For example: can you think of an alternative X � Y � Z = Y � X � Z representation for polynomials? Representing Negation Multisets for variadic functions Multisets Multiplicative inverse � like sets (e.g. order unimportant) but allow repeated inverse function is partial elements � zero has no multiplicative inverse � associativity and commutativity built-in has_inverse (2, 0.5) has_inverse (0, ??) 2, 3, 4 4, 3, 2 = Make inverse function total by introducing special constant? Non-commutative operators: Add: has_inverse (0, none ) append (''auto", append (''mated", ''reasoning")) Problem: 0 ⋅ none = 1 might be represented using a list as ∀ X. . ¬ has_inverse (0, X ) append ([''auto", ''mated", ''reasoning"]) Solution: use quantifiers not constants ¬ ∃ X. . has_inverse (0, X )

  6. Importance of Semantics Want good formalisms with proper semantics Semantics helps us ensure that we are actually representing what we had in mind � e.g. check through use of truth tables Two important properties in AR: � Soundness: a reasoning method is sound if and only if it deduces only the truth. Soundness is crucial: unsound reasoning is rarely useful � Completeness: a reasoning method is complete if and only if it deduces the whole truth. Completeness is desirable, but often unattainable � These properties require a formal definition of truth and this is what a semantics provides. Summary � We have considered axioms for equality, groups, sets, and Peano arithmetic. � more than one axiomatization possible e.g. groups � many other domains axiomatized: geometry, reals ... � read Bundy Section 4.2 � How to represent knowledge � functions vs predicates � use of multisets, lists ... � dealing with negation � importance of semantics - two important properties soundness and Completeness � Bundy Section 4.3 � See also Russell and Norvig (AI- a modern approach) > chapters 6 and 7

Recommend


More recommend