KNOWLEDGE REASONING & INFERENCE KNOWLEDGE REASONING & INFERENCE 1 Dr. Abbas Fadhil M. A. AL-Juboori Computer Science Dept. – Kerbala University

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Rules of Inference Rosen 1.5.
1 Section 1.5 Rules of Inference. 2 Definitions Theorem: a statement that can be shown to be true Proof: demonstration of truth of theorem –consists of.
Inference Rules Universal Instantiation Existential Generalization
The Foundations: Logic and Proofs
1 A formula in predicate logic An atom is a formula. If F is a formula then (~F) is a formula. If F and G are Formulae then (F /\ G), (F \/ G), (F → G),
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Introduction to Theorem Proving
Automated Reasoning Systems For first order Predicate Logic.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
First Order Logic Resolution
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
Logic Use mathematical deduction to derive new knowledge.
Resolution in Propositional and First-Order Logic.
Logic Concepts Lecture Module 11.
Automated reasoning and theorem proving Introduction: logic in AI Automated reasoning: ResolutionUnificationNormalization.
Propositional Calculus A propositional calculus formula is composed of atomic propositions, which area simply statements that are either true or false.
CS128 – Discrete Mathematics for Computer Science
Logic 3 Tautological Implications and Tautological Equivalences
CSE (c) S. Tanimoto, 2008 Propositional Logic
Knoweldge Representation & Reasoning
Artificial Intelligence
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Artificial Intelligence Reasoning. Reasoning is the process of deriving logical conclusions from given facts. Durkin defines reasoning as ‘the process.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
I NTRO TO L OGIC Dr Shlomo Hershkop March
Methods of Proof & Proof Strategies
Copyright © Curt Hill Rules of Inference What is a valid argument?
CSNB234 ARTIFICIAL INTELLIGENCE
MATH 224 – Discrete Mathematics
Propositional Calculus Composed of symbols –P – some true statement P might represent something like “It is Monday” or “the car is red” And sentences –a.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems or solving problems, creativity and insight.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Ch 1.4: Basic Proof Methods I A theorem is a proposition, often of special interest. A proof is a logically valid deduction of a theorem, using axioms,
CS6133 Software Specification and Verification
Propositional Logic Predicate Logic
Chapter 4: Inference Techniques
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
1 Example: The following knowledge is given :The following knowledge is given : 1. Marcus was a man. 2. Marcus was a Pompeian. 3. All Pompeians were Romans.
CIT 856 – Artificial Intelligence
CSci 2011 Discrete Mathematics Lecture 4 CSci 2011.
CS104:Discrete Structures Chapter 2: Proof Techniques.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
1 Propositional Proofs 1. Problem 2 Deduction In deduction, the conclusion is true whenever the premises are true.  Premise: p Conclusion: (p ∨ q) 
Chapter 1 Logic and proofs
March 23 rd. Four Additional Rules of Inference  Constructive Dilemma (CD): (p  q) (r  s) p v r q v s.
Propositional Calculus
Chapter 7. Propositional and Predicate Logic
Discrete Mathematics Logic.
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
Proof Techniques.
7.1 Rules of Implication I Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.
CS201: Data Structures and Discrete Mathematics I
Logic Use mathematical deduction to derive new knowledge.
The Method of Deduction
Discrete Mathematics Logic.
Chapter 7. Propositional and Predicate Logic
CSNB234 ARTIFICIAL INTELLIGENCE
Foundations of Discrete Mathematics
CSNB234 ARTIFICIAL INTELLIGENCE
CS201: Data Structures and Discrete Mathematics I
The Foundations: Logic and Proofs
Presentation transcript:

KNOWLEDGE REASONING & INFERENCE KNOWLEDGE REASONING & INFERENCE 1 Dr. Abbas Fadhil M. A. AL-Juboori Computer Science Dept. – Kerbala University

perceive object interpretation action REASONING

 Definition  A process of applying knowledge to arrive at solution  Requires the ability to infer conclusions from the available facts  To reason is to think clearly and logically, to draw reasonable inference or conclusion from known or assumed facts  It works through interaction of rules and data

Process of working with knowledge, facts and problem solving strategies to draw conclusions

Reasoning mechanisms that are used to relate between facts and rules to derive new conclusion or facts

 5 types:  Deductive  Inductive  Abductive  Analogical  Common-Sense

 Deductive reasoning  A process in which general premises are used to obtain specific inference.  E.g. 1: (1). rainy_day  wet_grass (2). wet_grass rainy_day  E.g. 2: (1). mother(X)  female(X) (2). mother(lily) female(lily)

 Inductive Reasoning  Human use to arrive new conclusion from a limited set of facts by the process of generalization.  E.g: P1: Monkeys in the National Zoo eats bananas P2: Monkeys in Taiping Zoo eats bananas All monkeys eat bananas

 Abductive reasoning  A form of deduction that allows for plausible inference, meaning that, the conclusion might follow from available information, but it might be wrong.  Given B is true, if A  B is true, then the conclusion A is true might be deduced, but it can be false.  E.g.: P1: rainy_day  wet_grass P2: wet_grass rainy_day? … or maybe someone watered the grass.

 Analogical Reasoning  Mapping of a mental model (developed from experience) to situation or objects.  E.g.: Q: “What are the working hours of engineers in the company” ▪ Mental model : Engineers are white-collar employees White collar employees work from 8am-5p Working hours for the engineers is from 8am-5pm.

 Common-Sense Reasoning  Based on heuristic knowledge gained through experience.  Relies more on good judgment than on exact logic.  E.g.: ▪ A loose fan usually causes strange noises.  Valuable for quick solutions.

CConcept 1 : Pattern matching AA process of matching between symbols, and between predicates, to determine whether they are identical and therefore, match to each other. CConcept 2 : Instantiation AA process of substituting or replacing a variable with another variable or a constant. OOnly applicable when dealing with FOPL statements. CConcept 3 : Unification AA process of matching identical predicates and instantiating the variables (if any) with another variables or constants. CCombine pattern matching with instantiation. OOnly applicable when dealing with FOPL statements.

 Two symbols/predicates are matched if they are identical  E.g.  tweety  tweety (match)  tweety  tweaty (doesn’t match)  fly  flies (doesn’t match)  man  men (doesn’t match)  teach(X, math)  teach(she, math) ▪ identical predicate name/functor ▪ identical # of arguments Pattern 1 Pattern 2 Pattern 4 Mismatch because unequal with Pattern 1 Pattern 3

 A variable can be instantiated with  Another variable (normally represent object) ▪ E.g.: X/Y; X/Z  Constant ▪ E.g.: X/math; Y/adam  E.g.: man(X), man(Y)..... X/Y or Y/X man(X), man(adam)..... X/adam teach(X, math), teach(joe,Y)..... X/joe; Y/math

IInstantiation involving rules TThe same variable in the same rule must be instantiated with the same value (can be either another variable or constant). EE.g.: R1 : have(X, wings)  flies(X)  isa(X, Y) flies(tweety) X/tweety R1 : have(tweety,wings)  flies(tweety)  isa(tweety,Y)

TTwo predicates unify when they pass pattern matching and instantiation test. EE.g.: 1.isa(X,mammal) and isa(whale,mammal )..... X/whale; mammal  mammal 2.isa(X,mammal) and isa(Y,Z)..... X/Y or Y/X; Z/mammal 3.isa(X,Y) and isa(whale,mammal)..... X/whale; Y/mammal 4.isa(X,Y) and isa(whale,fish)..... X/whale; Y/fish 5.isa(X,Y) and isa(P,Q)..... X/P or P/X; Y/Q or Q/Y 6.isa(X,Mammal) and isa(Whale,mammal)..... X/Whale or Whale/X; Mammal/mammal 7.isa(X,Y) and isa(whale,X)..... X/whale; Y/whale

 Two predicates cannot unify if they failed pattern matching and/or instantiation test.  E.g.: 1.isa(X,mammal) and isa(whale,fish )..... mammal  fish 2.isa(X,mammal) and is(Y,Z)..... isa  is 3.isa(X,Y) and isa(whale,mammal,animal)..... different # of arguments 4.isa(X,X) and isa(whale,mammal)..... whale  mammal 5.isa(X,mammal) and isa(whale,X)..... X/whale; X/mammal

 4 techniques:  Besides, there are also 2 control strategies:  Forward chaining  Backward chaining … will be discussed further in ES topic. Modus Ponens Modus Tollens Hypothetical Syllogism Resolution

 Definition: Rule of logic that asserts IF A and (A  B) are known to be true, then one can infer that B is true.  E.g. 1.It is sunny day (A) 2.If it is sunny (A), then we will go to the beach (B) 3.We will go to the beach (B) or (in PL) 1.A 2.A  B 3. B

Basic form: ABAB A B ((A  B)  A)  B..... a tautology

Example with rules with >1 propositions: A  B  C A B C ((((A  B)  C)  A)  B)  C

DDefinition: Rule of logic that asserts IF (a  b), and b is known to be not true, then one can infer that a is not true. BBasic form: A  B  B  A ((A  B)   B)   A

 Definition: Rule of logic that asserts IF (a  b) and (b  c) are true, (a  c) is also true.  Antecedent of the 1 st rule (b) is a premise of the 2 nd rule. The 3 rd rule concluded consists of:  the antecedent of the first rule (a) and  the consequent of the second rule (c).

 Basic form: ABAB BCBC A  C ((A  B)  (B  C))  (A  C)

 Definition  An inference strategy that is used to determine the truth of an insertion (new fact)  Structure:  (A v B)  (  B v C) = (A v C) * since B   B can be resolved.

 New insertion should contradict with original insertion.  A contradiction is simply two axioms that are logically contradictory (Eg: B and  B). ▪ If B is true, saying that B is false is definitely contradict.  Known as “proof by refutation”  Resolvent ▪ New expression from the resolution of existing axioms.

 Algorithm 1. Assume  P is TRUE 2.Show that the axioms and  P lead to a contradiction 3.Conclude that  P is FALSE since it leads to a contradiction. 4.Conclude that P is TRUE since  P is FALSE This process continues until a contradiction is produced.

 Steps: 1.Negate the goal (proof by refutation) 2.Transform rules into clausal forms 3.Produce a resolvent from contradict axioms P PP  A  BA  B  A  B  B  C  A  C resolvent

 Steps (c0ntinued): 4.Repeat Step 3 until P is obtained 5.Cancel both P and  P to procude [] to establish the goal. P PP [] ::::

 Equivalence rules 1. P  (Q  R)  (P  Q)  R 2. P  Q  Q  P 3. P  Q  Q  P 4.  (P  Q)  P   Q De Morgan 5.  (P  Q)  P   Q De Morgan 6. P  Q  Q   P 7.  P  P Double negation elimination 8. P  Q  P  Q Implication elimination 9. P  Q  (P  Q)  (Q  P) 10. P  Q  (P  Q)  (  P   Q) 11. P   P  False

1. IF temperature > 100 (A) THEN patient has high temperature (B). 2. IF patient has high temperature (B) THEN advise two aspirin (C). 3. temperature > 100 (A). STATE 1 1.A  B 2.B  C 3.A

STATE 2 1.A  B 2.B  C 3.A 4.B STATE 3 1.A  B 2.B  C 3.A 4.B 5.C Perform a resolution to prove C. Step 1: Proof by refutation... obtain  C (by negating the goal C)

Step 2: Convert rules into clausal forms 1.  A  B 2.  B  C 3.A..... The existing axiom 4.  C.... The new insertion, contradict with the goal Step 3: Produce resolvents  A  B  B  C  A  C Rules are converted using equivalence rules P  Q   P  Q 1.  A  B 2.  B  C 3.A 4.  C 5.  A  C

Step 4: Repeat Step 3 to produce another resolvents A  A  C C C is obtained. 1.  A  B 2.  B  C 3.A 4.  C 5.  A  C 6.C

Step 5: Cancel C and  C to establish []. C  C [] [] is established. 1.  A  B 2.  B  C 3.A 4.  C 5.  A  C 6.C 7.[]

A complete resolution process is shown as below:  A  B  B  C C A  A  C CC []

E.g.: All cats are animal. By nature, animal will die. Using resolution, prove that if Chico is a cat, then Chico will die. 1.  X cat(X)  animal(X). 2.  Y animal(Y)  will_die(Y). 3.cat(chico). 1.  X cat(X)  animal(X). 2.  Y animal(Y)  will_die(Y). 3.cat(chico).

 X cat(X)  animal(X) cat(chico) animal(chico)  Y animal(Y)  will_die(Y) will_die(chico) 1.  X cat(X)  animal(X). 2.  Y animal(Y)  will_die(Y). 3.cat(chico). 4.animal(chico). 5.  will_die(chico). 1.  X cat(X)  animal(X). 2.  Y animal(Y)  will_die(Y). 3.cat(chico). 4.animal(chico). 5.  will_die(chico). Step 1

Step 2 1.  X cat(X)  animal(X). 2.  Y animal(Y)  will_die(Y). 3.cat(chico). 4.animal(chico). 5.  will_die(chico). 1.  cat(X)  animal(X). 2.  animal(Y)  will_die(Y). 3.cat(chico). 4.animal(chico). 5.  will_die(chico). 1.  cat(X)  animal(X). 2.  animal(Y)  will_die(Y). 3.cat(chico). 4.animal(chico). 5.  will_die(chico). P  Q   P  Q

Proven! Contradiction between the goal will_die(ciko) and ¬wil_die(ciko). X/Y (note: Y/X is also true) Y/chico  cat(X)  animal(X)  animal(Y)  will_die(Y)  cat(Y)  will_die(Y) cat(chico)  will_die(chico) will_die(chico)

Q6: Use Modus Ponens to determine whether a cup supports a book or a book supports a cup. 1.ontopof(X,Y)  supports(X,Y). 2.isabove(X,Y)  (istouching(X,Y)  istouching(Y,X))  ontopof(X,Y). 3.isabove(cup,book). 4.istouching(cup,book).

ontopof(X,Y)  supports(Y,X) isabove(X,Y)  (istouching(X,Y)  istouching(Y,X))  ontopof(X,Y) isabove(cup,book) X/cup; Y/book isabove(cup, book)  (istouching(cup, book)  istouching(book, cup))  ontopof(cup, book) istouching(cup,book) ontopof(cup, book) X/cup; Y/book supports(book,cup) The answer for Q6

Q7: Use Resolution to prove hates(marcus,caesar). 1.man(marcus). 2.pompeians(marcus). 3.  X pompeians(X)  romans(X). 4.ruler(caesar). 5.  X romans(X)  loyalto(X,caesar)  hates(X,caesar). 6.  X loyalto(X,Y). 7.  X  Y man(X)  ruler(Y)  trytoassassinate(X,Y)   loyalto(X,Y). 8.trytoassassinate(marcus,caesar).

Q7: Use Resolution to prove hates(marcus,caesar). 1.man(marcus). 2.pompeians(marcus). 3.  X pompeians(X)  romans(X). 4.ruler(caesar). 5.  X romans(X)  loyalto(X,caesar)  hates(X,caesar). 6.  X loyalto(X,Y). 7.  X  Y man(X)  ruler(Y)  trytoassassinate(X,Y)   loyalto(X,Y). 8.trytoassassinate(marcus,caesar).

X/marcus (3)  pompeians(X)  romans(X) (2) pompeians(marcus) romans(marcus) (5)  romans(X)  loyalto(X,caesar)  hates(X,caesar). (7)  man(X)  ruler(Y)   trytoassassinate(X,Y)   loyalto(X,Y) loyalto(marcus,caesar)  hates(marcus,caesar) X/marcus; Y/caesar  man(marcus)   ruler(caesar)   trytoassassinate(marcus,caesar)  hates(marcus,caesar) hates(marcus,caesar) (4) ruler(caesar) (1) man(marcus)  ruler(caesar)   trytoassassinate(marcus,caesar)  hates(marcus,caesar)  trytoassassinate(marcus,caesar)  hates(marcus,caesar) (8)  trytoassassinate(marcus,caesar) (9)  hates(marcus,caesar) []