M ETHODS OF INFERENCE Hasan Zafari. M ETHODS OF INFERENCE What is reasoning? Inferences with rules...

40
METHODS OF INFERENCE Hasan Zafari

Transcript of M ETHODS OF INFERENCE Hasan Zafari. M ETHODS OF INFERENCE What is reasoning? Inferences with rules...

  • Slide 1
  • M ETHODS OF INFERENCE Hasan Zafari
  • Slide 2
  • M ETHODS OF INFERENCE What is reasoning? Inferences with rules trees The inference tree Inference by Inheritance Inference with frames Reasoning with semantic networks Reasoning with logic
  • Slide 3
  • KR L ANGUAGES AND N ATURAL L ANGUAGE how is a knowledge representation language different from natural language e.g. English, Spanish, German, natural languages are expressive, but have evolved to meet the needs of communication, rather than representation the meaning of a sentence depends on the sentence itself and on the context in which the sentence was spoken e.g. Look! sharing of knowledge is done without explicit representation of the knowledge itself and they are ambiguous (e.g. small dogs and cats)
  • Slide 4
  • G OOD K NOWLEDGE R EPRESENTATION L ANGUAGES combines the best of natural and formal languages: expressive concise unambiguous independent of context what you say today will still be interpretable tomorrow formal the knowledge can be represented in a format that is suitable for computers effective there is an inference procedure which can act on it to make new sentences
  • Slide 5
  • R EASONING process of constructing new sentences from old ones proper reasoning ensures that the new sentences represent facts that actually follow from the facts that the old sentences represent this relationship is called entailment and can be expressed as KB |= alpha knowledge base KB entails the sentence alpha
  • Slide 6
  • W HAT I NFERENCE M ETHODS DO ? an inference procedure can do one of two things: given a knowledge base KB, it can derive new sentences that are (supposedly) entailed by KB KB |-- ==> KB |= given a knowledge base KB and another sentence alpha, it can report whether or not alpha is entailed by KB KB ==> KB |= an inference procedure that generates only entailed sentences is called sound or truth-preserving the record of operation of a sound inference procedure is called a proof an inference procedure is complete if it can find a proof for any sentence that is entailed
  • Slide 7
  • T REES : M AKING D ECISIONS Trees / lattices are useful for classifying objects in a hierarchical nature. Trees / lattices are useful for making decisions. We refer to trees / lattices as structures. Decision trees are useful for representing and reasoning about knowledge. 7
  • Slide 8
  • D ECISION T REE E XAMPLE 8
  • Slide 9
  • http://en.akinator.com/ 9
  • Slide 10
  • AND-OR T REES AND G OALS 1990s, PROLOG was used for commercial applications in business and industry. PROLOG uses backward chaining to divide problems into smaller problems and then solves them. AND-OR trees also use backward chaining. AND-OR-NOT lattices use logic gates to describe problems. 10
  • Slide 11
  • 11
  • Slide 12
  • 12
  • Slide 13
  • I NHERITANCE Inheritance is one of the main kind of reasoning done in semantic nets The ISA (is a) relation is often used to link a class and its superclass. Some links (e.g. haspart ) are inherited along ISA paths The semantics of a semantic net can be relatively informal or very formal Often defined at the implementation level Bird Robin Rusty isa Red isa Animal isa Wings hasPart
  • Slide 14
  • I NFERENCE BY I NHERITANCE One of the main types of reasoning done in a semantic net is the inheritance of values (properties) along the subclass and instance links. Semantic networks differ in how they handle the case of inheriting multiple different values. All possible values are inherited, or Only the lowest value or values are inherited 14
  • Slide 15
  • 15
  • Slide 16
  • M ULTIPLE I NHERITANCE A node can have any number of superclasses that contain it, enabling a node to inherit properties from multiple parent nodes and their ancestors in the network. It can cause conflicting inheritance. Nixon Diamond (two contradictory inferences from the same data) Person subclass non-pacifist Nixon RepublicanQuaker pacifist subclass instance R Q N P ? !P
  • Slide 17
  • C ONFLICT RESOLUTION double arrows signify deductive or strict (i.e., non-defeasible) inferences single arrows signify defeasible inferences, and strikethrough single arrows signify that the negation of the pointed formula is defeasibly implied Penguins are birds (no exceptions); Birds usually fly; and Penguins usually don't fly. conflict Penguin Bird flies Penguin not-flies According to the Specificity Principle an inference with a more specific antecedent overrides a conflicting defeasible inference with a less specific antecedent.
  • Slide 18
  • F RAMES Frames semantic net with properties A frame represents an entity as a set of slots (attributes) and associated values A frame can represent a specific entry, or a general concept Frames are implicitly associated with one another because the value of a slot can be another frame Book Frame Slot Filler Title AI. A modern Approach Author Russell & Norvig Year 2003 3 components of a frame frame name attributes (slots) values (fillers: list of values, range, string, etc.)
  • Slide 19
  • F EATURES OF F RAME R EPRESENTATION More natural support of values than semantic nets (each slots has constraints describing legal values that a slot can take) Can be easily implemented using object-oriented programming techniques Inheritance is easily controlled
  • Slide 20
  • I NHERITANCE Similar to Object-Oriented programming paradigm Hotel Room what room where hotel contains hotel chair hotel phone hotel bed Hotel Chair what chair height 20-40cm legs 4 Hotel Phone what phone billing guest Hotel Bed what bed size king part mattress Mattress price 100$
  • Slide 21
  • : FrameNet 21
  • Slide 22
  • I NFERENCE WITH FRAMES 22
  • Slide 23
  • Reasoning with semantic networks - Knowledge explicitly represented in a semantic network can be used to infer additional facts which are NOT explicitly represented (1) Inferences may rely on rules of common sense e.g.,For all objects X, Y, and Z if X is on Y and Y is left of Z then X is left of Z in the example network cup-1 is on saucer-1 and saucer-1 is left of teapot-1 it follows the above general rule, then: cup-1 is left of teapot-1
  • Slide 24
  • Inferences based on transitivity - Relationship is a is transitive if X is a Y and Y is a Z then X is a Z holds for all distinct objects X, Y and Z - Relationship part of is transitive
  • Slide 25
  • - Relationship supported by is transitive, allowing the inference shown by the dotted line in the following semantic network fragment - However, the relationship is on (i.e., resting directly on) is not transitive cup-1 is on saucer-1 and saucer-1 is on table-1 but cup-1 is not on table-1 - Relationships among people brother of is transitive but not father of
  • Slide 26
  • Inference based on inheritance - A node inherits information from its related more general node - Add a general object node, other nodes inherit its properties - Eases the task of coding knowledge - Automatically infer information about related objects in hierarchy Example: attribute purpose is inherited
  • Slide 27
  • Inferences based on transitivity and inheritance Two steps involved in the inference shown by the dotted line: Step 1. inference based on transitivity Step 2. inference based on inheritance
  • Slide 28
  • Dealing with exceptions - Inheritance is a default mechanism and exceptions do occur Canary Bird Wings Fly IS-A HAS TRAVEL Tweety IS-A Penguin IS-A Animal Air BREATHE From the above semantic network, it can be inferred that: Canary is a animal, Tweety is a bird, Tweety is a animal, Penguin is a bird, Penguin is a animal, Penguin travel fly ... IS-A
  • Slide 29
  • - If an attributes value is explicitly represented in a semantic net, it takes priority over the value that would otherwise by inherited Step 1. Account for exceptions on local basis Step 2. Link new node with information that over-ride the incorrectly inherited information CanaryBird Wings Fly IS-A HAS TRAVEL Tweety IS-A Penguin IS-A Animal Air BREATHE IS-A Walk TRAVEL
  • Slide 30
  • S EMANTIC N ET O PERATION Bird Fly How do you travel? Fly TRAVEL User How do you travel? Tweety How do you travel? Canary How do you travel? Bird Fly TRAVEL Fly User
  • Slide 31
  • A DVANTAGES & D ISADVANTAGES Advantages Explicit and succinct Reduced search time Inheritance Has correspondence with human memory Disadvantages No interpretation standards Invalid inferences Combinatorial explosion: if a relation is false many or all of the relations in the network must be examined.
  • Slide 32
  • Expert Systems: Principles and Programming, Fourth Edition32 Rules of Inference
  • Slide 33
  • R EASONING WITH L OGIC
  • Slide 34
  • Expert Systems: Principles and Programming, Fourth Edition34 Truth Table Modus Ponens
  • Slide 35
  • Expert Systems: Principles and Programming, Fourth Edition35 Types of Logic Deduction reasoning where conclusions must follow from premises Induction inference is from the specific case to the general Analogy inferring conclusions based on similarities with other situations Abduction reasoning back from a true condition to the premises that may have caused the condition
  • Slide 36
  • Expert Systems: Principles and Programming, Fourth Edition36 Deductive Logic Argument group of statements where the last is justified on the basis of the previous ones Deductive logic can determine the validity of an argument. Syllogism has two premises and one conclusion Deductive argument conclusions reached by following true premises must themselves be true
  • Slide 37
  • Expert Systems: Principles and Programming, Fourth Edition37 Syllogisms vs. Rules Syllogism: All basketball players are tall. Jason is a basketball player. Jason is tall. IF-THEN rule: IF All basketball players are tall and Jason is a basketball player THEN Jason is tall.
  • Slide 38
  • Expert Systems: Principles and Programming, Fourth Edition38 Figure 3.21 Causal Forward Chaining
  • Slide 39
  • Slide 40
  • Comparing abduction, deduction, and induction Deduction: major premise: All balls in the box are black minor premise: These balls are from the box conclusion: These balls are black Abduction: rule: All balls in the box are black observation: These balls are black explanation: These balls are from the box Induction: case: These balls are from the box observation: These balls are black hypothesized rule: All ball in the box are black 40 A => B A --------- B A => B B ------------- Possibly A Whenever A then B ------------- Possibly A => B Deduction reasons from causes to effects Abduction reasons from effects to causes Induction reasons from specific cases to general rules