Chapter 4: Inference Techniques Reasoning Inference Forward Chaining Backward Chaining
How does the inference engine work? Introduction How does the inference engine work?
Modus Ponens => (implies) (X => Y) ______X____ :. Y Review: If it rains, then the streets will be wet. It is raining. Infer the conclusion: The streets will be wet.
The Conditional and Its Variants Review: The Conditional and Its Variants مخالف معكوس قلب معكوس
Modus tollens Review: (X => Y) ____ ~Y _____ :. ~ X If it rains, then the streets will be wet. The streets are not wet. Infer the conclusion: It is not raining. NOTE: Avoid mistakes cannot conclude that it is raining.
Syllogism chain implications to deduce a conclusion (X => Y) Review: chain implications to deduce a conclusion (X => Y) __ (Y => Z)__ :. (X => Z) 6
Resolution (X v Y) (~Y v Z) :. (X v Z) Review: (X v Y) (~Y v Z) :. (X v Z) basis for the inference mechanism in the Prolog language and some theorem provers
Reasoning(استدلال) The process of working with knowledge, facts, and problem solving strategies to draw conclusions Deduction – reasoning where conclusions must follow from premises (general to specific) Induction – inference is from the specific case to the general Intuition – no proven theory-Recognizing a pattern(unconsciously) ANN Heuristics – rules of thumb based on experience Generate and test – trial and error – often used to reach efficiency. Abduction – reasoning back from a true condition to the premises that may have caused the condition Default – absence of specific knowledge Autoepistemic – self-knowledge…The color of the sky as it appears to you. Nonmonotonic – New evidence may invalidate previous knowledge Analogy – inferring conclusions based on similarities with other situations ANN Commonsense knowledge – A combination of all based on our experience
Reasoning Methods Deductive Reasoning (استدلال استنباطي) Inductive Reasoning (استدلال استقرايي) Abductive Reasoning (استدلال انتزاعي) Analogical Reasoning (استدلال قياسي) Common-Sense Reasoning (استدلال عقل سليم) Non-monotonic Reasoning (استدلال غيريكنواخت)
Deductive Reasoning (استدلال استنباطي) Reasoning where conclusions must follow from premises General to specific Application: Generating conclusions Implication: if every body standing in the rain, then he will get wet. Axiom: I am standing in the rain Conclusion: I will get wet
Inductive Reasoning (استدلال استقرايي) inference is from the specific case to the general Application: Generating rules Premise: Monkeys in the pittsburgh zoo eat bananas Premise: Monkeys in the cleveland zoo eat bananas Conclusion: In general , all monkeys eat banana
Abductive Reasoning (استدلال انتزاعي) Reasoning back from a true conclusion to the premises that may have caused the condition Implication: Ground is wet if it is raining Axiom: Ground is wet Conclusion: It is raining (?) A plausible reasoning might be “it’s raining”
Analogical Reasoning (استدلال قياسي) inferring conclusions based on similarities with other situations ANN Tiger Frame : Specialization of : Animals Number of legs : 4 Eats : meat Lives : India and Southeast Asia Color : tawny with stripes If we state that a lion is like a tiger, we would naturally assume that they share many of the features
Common-Sense Reasoning (استدلال عقل سليم) A combination of all based on our experience it’s complicated Also named Heuristic reasoning It’s valuable in applications that required quick solution A loose fan belt usually causes a strong noise A mechanic might have found this common-sense knowledge from his experience
Non-monotonic Reasoning (استدلال غير يكنواخت) New evidence may invalidate previous knowledge Truth maintenance System Keep a record of what cause a fact to be asserted If the wind blows, then the cradle will rock If it’s windy, then the cradle is rock; but, after the wind is gone, we would expect the cradle to stop rocking.
Reasoning Methods (summary) deduction sound conclusions must follow from their premises induction unsound inference from specific cases (examples) to the general abduction unsound reasoning from a true conclusion to premises that may have caused the conclusion analogy unsound a conclusion is drawn based on similarities to another situation common-sense (heuristics) unsound rules of thumb, based on experience non-monotonic unsound new evidence may invalidate previous knowledge
Inference(استنتاج) The process used in an expert system of deriving new information from known information. Reasoning has a general meaning, even it is used for the human case; but inference is used for machine, i.e. AI & ES.
Some Rules of Inference (Modus Ponens)
Some Rules of Inference (continued)
Features of Propositional Logic Review: Features of Propositional Logic Artificial Intelligence: A modern approach, Norving & russel
Quiz با استفاده از قوانين منطق گزاره ای نشان دهيد، روابط زير صحيح هستند: (A^B=>C)معادل با ((A=>C)V(B=>C)) ((𝒂⇒𝒃)∧𝒂)⇒𝒂
Inference with Rules Firing a rule: When all of the rule's hypotheses (the “if parts”) are satisfied Can check every rule in the knowledge base in a forward or backward direction Continues until no more rules can fire, or until a goal is achieved
Forward and Backward Chaining Chain: a group of multiple inferences that connect a problem with its solution Search process: Forward chaining: if the premise matches the situation, then the process attempts to assert the conclusion Backward chaining: if the current goal is to determine the correct conclusion, then the process attempts to determine whether the premise clauses (facts) match the situation
Froward Chaining Inference process
Forward Chaining modus ponens: Unification (pattern matching): given a set of basic facts, we try to derive a conclusion from these facts example: What can we conclude about Clyde? IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant (Clyde) modus ponens: IF p THEN q p q Unification (pattern matching): find compatible values for variables
Forward Chaining Example IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) unification: find compatible values for variables modus ponens: IF p THEN q p q IF elephant( x ) THEN mammal( x ) elephant (Clyde)
Forward Chaining Example IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) unification: find compatible values for variables modus ponens: IF p THEN q p q IF elephant(Clyde) THEN mammal(Clyde) elephant (Clyde)
Forward Chaining Example IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) unification: find compatible values for variables modus ponens: IF p THEN q p q IF mammal( x ) THEN animal( x ) IF elephant(Clyde) THEN mammal(Clyde) elephant (Clyde)
Forward Chaining Example IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) unification: find compatible values for variables modus ponens: IF p THEN q p q IF mammal(Clyde) THEN animal(Clyde) IF elephant(Clyde) THEN mammal(Clyde) elephant (Clyde)
Forward Chaining Example IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) unification: find compatible values for variables modus ponens: IF p THEN q p q animal(Clyde) IF mammal(Clyde) THEN animal(Clyde) IF elephant(Clyde) THEN mammal(Clyde) elephant (Clyde)
Forward Chaining
Conflict Resolution Strategy used for choosing a rule-firing sequence when more than one rule can fire Steps of the conflict resolution strategies: Recognize. Find the rules that can fire (making the conflict set) Resolve, If more than one rule can fire, choose one rule to fire according to some strategy. Act. Fire the rule and add its conclusion to the working memory.
Conflict Resolution Strategies First rule that matches contents of working memory. Highest priority rule. Most specific rule, (more # of premises) Rule that refers to the element most recently added to the working memory. Don't fire a rule that has already fired (preventing loop, used in the most strategies). Fire all rules with separate line of reasoning (parallel).
Backward Chaining modus ponens: Unification (pattern matching): try to find supportive evidence (i.e. facts) for a hypothesis example: Is there evidence that Clyde is an animal? IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant (Clyde) modus ponens: IF p THEN q p q Unification (pattern matching): find compatible values for variables
Backward Chaining Example IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) unification: find compatible values for variables modus ponens: IF p THEN q p q ? animal(Clyde) IF mammal( x ) THEN animal( x )
Backward Chaining Example IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) unification: find compatible values for variables modus ponens: IF p THEN q p q ? animal(Clyde) IF mammal(Clyde) THEN animal(Clyde)
Backward Chaining Example IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) unification: find compatible values for variables modus ponens: IF p THEN q p q ? animal(Clyde) IF mammal(Clyde) THEN animal(Clyde) ? IF elephant( x ) THEN mammal( x )
Backward Chaining Example IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) unification: find compatible values for variables modus ponens: IF p THEN q p q ? animal(Clyde) IF mammal(Clyde) THEN animal(Clyde) ? IF elephant(Clyde) THEN mammal(Clyde)
Backward Chaining Example IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) unification: find compatible values for variables modus ponens: IF p THEN q p q animal(Clyde) IF mammal(Clyde) THEN animal(Clyde) IF elephant(Clyde) THEN mammal(Clyde) elephant (Clyde)
Backward Chaining
Forward-Chaining
Backward-Chaining
Forward Chaining v.s. Backward Chaining planning, monitoring, control diagnosis data-driven goal-driven (hypothesis) bottom-up processing top-down processing find possible conclusions supported by given facts find facts that support a given hypothesis similar to breadth-first search similar to depth-first search CLIPS PROLOG
Advantages and Disadvantages of Forward Chaining
Advantages and Disadvantages of Backward Chaining Many Expert Systems use a combination of backward and forward chaining
Family Example: Facts
Family Example: Rules
PROLOG Sample Inference
PROLOG Sample Inference
Mini Projects 1 Chapter 4 (Inference Engine) Due date: 94/1/20