Chapter 6 Logical Reasoning Xiu-jun GONG (Ph. D) School of Computer Science and Technology, Tianjin University

Slides:



Advertisements
Similar presentations
Resolution Proof System for First Order Logic
Advertisements

Biointelligence Lab School of Computer Sci. & Eng.
Inference Rules Universal Instantiation Existential Generalization
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.
Standard Logical Equivalences
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.
Artificial Intelligence
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.
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Logic.
Logic Concepts Lecture Module 11.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Prolog IV Logic, condensed. 2 Propositional logic Propositional logic consists of: The logical values true and false ( T and F ) Propositions: “Sentences,”
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
Inference and Resolution for Problem Solving
Artificial Intelligence
03 -1 Lecture 03 First-Order Predicate Logic Topics –Syntax –Formal Semantics –Denotational Semantics –Formal Inference –Resolution.
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
I NTRO TO L OGIC Dr Shlomo Hershkop March
Intro to Discrete Structures
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
UNIVERSITI TENAGA NASIONAL 1 CSNB234 ARTIFICIAL INTELLIGENCE Chapter 3 Propositional Logic & Predicate Logic Chapter 3 Propositional Logic & Predicate.
UIUC CS 497: Section EA Lecture #3 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
1 Chapter 8 Inference and Resolution for Problem Solving.
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.
First Order Predicate Logic
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Logical Representations and Resolution. Boolean Logic Conjunctive normal form Resolution.
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
Unification Algorithm Input: a finite set Σ of simple expressions Output: a mgu for Σ (if Σ is unifiable) 1. Set k = 0 and  0 = . 2. If Σ  k is a singleton,
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Resolution Strategies One common strategy for applying resolution is called level saturation. Here you try to resolve every pair of clauses from the original.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
CS6133 Software Specification and Verification
第 1 6 章 谓词演算中的归结. 2 Outline Unification Predicate-Calculus Resolution Completeness and Soundness Converting Arbitrary wffs to Clause Form Using Resolution.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Knowledge Repn. & Reasoning Lec. #5: First-Order Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Introduction to Logic for Artificial Intelligence Lecture 2
Resolution in the Propositional Calculus
Proposition & Predicates
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Biointelligence Lab School of Computer Sci. & Eng.
Horn Clauses and Unification
Horn Clauses and Unification
Biointelligence Lab School of Computer Sci. & Eng.
Horn Clauses and Unification
CSNB234 ARTIFICIAL INTELLIGENCE
RESOLUTION.
Resolution Proof System for First Order Logic
Presentation transcript:

Chapter 6 Logical Reasoning Xiu-jun GONG (Ph. D) School of Computer Science and Technology, Tianjin University

Outline  Intro to logic reasoning  Preparation for resolution Stand form clauses (9 steps) Substitution and unify Control strategies  Resolution reasoning In propositional logic In Predicate logic In particular interrogative sentence  Summary Logic is the Calculus of Computer Science The central role of logic in computer science is comparable to the role of differential equations in the natural sciences

Intro to logic  Logic is the study of the principles of valid demonstration and inference.  Consistency, which means that none of the theorems of the system contradict one another.  Soundness, which means that the system's rules of proof will never allow a false inference from a true premise. If a system is sound and its axioms are true then its theorems are also guaranteed to be true.  Completeness, which means that there are no true sentences in the system that cannot, at least in principle, be proved in the system.

Classifications of logic  Informal logic is the study of natural language arguments.  Formal logic is the study of inference with purely formal content  Symbolic logic is the study of symbolic abstractions that capture the formal features of logical inference  Mathematical logic is an extension of symbolic logic into other areas(model theory, proof theory, set theory, and recursion theory)

Symbolic logic  Two languages Propositional logic Predicate logic  Components Syntax Rules Semantic

Syntax  Elements Atoms: {A,B, …, T,F} Literal: atoms and a  sign in front of them Connectives: , , , and  Sentences: Syntax of well-formed formula (wff),  Any atom is a wff.  If w 1 and w 2 are wffs, so are w 1  w 2, w 1  w 2, w 1  w 2,  w 1.  There are no other wffs. Universal sign: x Quantifier sign: x

Inference  Reasoning is the cognitive process of looking for reasons for beliefs, conclusions, actions or feelings.  Inference is the act or process of deriving a conclusion based solely on what one knows.  Logic reasoning Deduction: determining the conclusion Induction: determining the rule. Abduction: determining the precondition.

Semantics  Semantics associating elements of a logical language with elements of a domain of discourse  Interpretation the proposition associated with an atom (value)  Propositional Truth Table Given the values of atoms under some interpretation, use a truth table to compute a value for any wff under that same interpretation.

Standard Form Clauses (1)  Clause: a disjunction of literals.  Conjunctive Normal Form: CNF  Disjunctive Normal Form: DNF  CNF  DNF

Standard Form Clauses (2)  Prenex Normal Form: A wff of predicate logic is in prenex normal form, iff all its quantifiers are clustered at the left no quantifier is negated the scope of each quantifier extends to the end of the wff no two quantifiers quantify the same variable every quantified variable occurs in the matrix of the wff

Standard Form Clauses (3)  Skolem Standard Form: A formula is in SSF if it is in conjunctive prenex normal form with only universal first- order quantifiers Removing existential quantifiers from formal logic statements  Standard Form Clauses: Clauses in SSF P(c)

Convert WFF to SFCs (1) 1. Eliminate implication signs,   > 2. Reduce the scopes of ~ 3. Rename variables

Convert WFF to SFC (2) 4. Forward quantifiers 5. Skolem transfer Eliminate existential quantifiers

Convert WFF to SFC (3) 6. Get CNF with Skolem standard form 7. Eliminate universal quantifiers

Convert WFF to SFC (4) 8. Get clauses 9. Rename variables again

An example

Resolution reasoning of propositional logic  Resolution is a rule of inference leading to a refutation theorem-proving technique for sentences in propositional logic and first-order logic.  Procedure Choose two clauses that have exactly one pair of literals that are complementary Produce a new clause by deleting the complementary literals and combining the remaining literals

General form of resolution Proof: Show that if C 1 and C 2 are true for explanation I, then R is true for I. 1. Under I, if P=false, then C 1 ’ =true, so R=C 1 ’VC 2 ’=true 2. Under I, if P=true, then C 2 ’ =true, so R=C 1 ’VC 2 ’=true

Resolution on propositional logic  Convert all the expressions (facts, rules and the negation of conclusion) into standard form clauses  Resolve on all the clauses until reaches contradict (nil) resolution refutation

Example Conditions: Conclusion: (6) (2) (7) (1) (8) (4) (9) (5) (6) (2) (1) (4) (5)

Example cont. Lucky enough

Substitution and Unify  Preparing for predicate logic resolution Universal quantifications for all variables.  If two clauses have matching but complementary literals, it is possible to resolve them literal Clause

Substitution  Any substitution can be represented by a set of ordered pairs

Example

Unify  F 1 and F 2 are predicate formula,θ is a substitution. if F 1 θ=F 2 θ,then θ is the Unifier of F 1 and F 2 P(c,y,b)and P(x,a,b), θ={c/x,a/y} P(x,y,b)and P(z,u,b) θ={z/x,u/y} other else? P(f(y),a)and P(x,a) θ={f(y)/x}  Three types of unifier Constant/variable —— 变量实例化 Variable/variable —— 变量一致化 Function/variable —— 变量函数化

Most General Unifier: MGU  σ is a MGU between F1 and F2 if for any θ be one of unifiers between F1 and F2, there exists a λ such that θ=σ · λ  i.e. F 1 =P(x), F 2 =P(f(y)) θ 1 ={f(a)/x,a/y},θ 2 ={f(b)/x,b/y} θ 1,θ 2 are unifiers, but not MGUs σ = {f(y)/x} is a MGU, where  θ 1 =σ · {a/y}, λ= {a/y}  θ 2 =σ · {b/y}, λ= {b/y}

Algorithms looking for a MGU  Steps Find out the difference sets of variables between two clauses Identify the substitutions for each set  Ex1. F 1 = P(x,y,z) F 2 = P(x,f(a),h(b)) Difference set: D 1 ={y,f(a)}, D 2 ={z,h(b)} MGU= {f(a)/ y, h(b)/z}  Ex2. F 1 = P(x), F 2 = P(y) Difference set: D={x,y} MGU={x/y} or {y/x}

Resolution Reasoning of Predicate Logic  F1 and F2 are clauses, P1 in F1 and ~ P2 in F2 are literals such that P1 and P2 have a MGU μ, then These two clauses have a resolvent ρ. The resolvent is obtained by applying the substitution μ to the union of F1 and F2, leaving out the complementary literals. Ρ=[(F1-{P1}) ∨ (F1-{ ~ P2}) ] μ

Example  Problem Marcus is a man Caesar is a ruler A person trying to assassinate its ruler is not loyal Marcus want to assassinate Caesar  Step1 Convert to logic expression man (marcus) ruler (caesar) person(X) ∧ rule(Y) ∧ tryassassinate(X,Y) → ~ loyalto(X,Y) tryassassinate (marcus, caesar) man(X) → person(X) Show that Marcus is not loyal to Caesar ~ loyalto(marcus,caesar)

Example cont.  Step2, build standard form clauses (1) man(m) (2) ruler(c) (3) ~ person(X) ∨~ ruler(Y) ∨~ trya (X,Y) ∨~ loyalto(X,Y) (4) trya (m,c) (5) ~ man (Z) ∨ person(Z) (6) loyalto(m,c)  Step3, resolution reasoning (7) ~ person(m) ∨~ ruler(c) ∨~ trya (m,c) (6) (3) {m/X, c/Y} (8) ~ person(m) ∨~ ruler(c) (7) (4) (9) ~ person(m) (8) (2) (10) ~ man (m) (9) (5) {m/Z} (11) NIL (10)(1)

Example cont.

Control Strategy (1)  Problem How to pick up clauses to resolve? Quick and completeness  Strategies 1. Breadth-first resolution: completeness, time- consuming 2. Unit resolution: with priority with literals 3. Input resolution: each resolvent at lease involves a input clause

Control strategies (2) 4. Linear resolution: Start from an initiate clause, then resolve continue linearly. (1) ~P ∨ S (2) P ∨ Q (3)~P ∨ R (4)~Q ∨ R (5)~R (6)Q ∨ R (2)(3) (7)R (6)(4) (8)NIL (7)(5) The point is how to choose the initiate clause

Control strategies (3) 5. Supported set resolution: for each resolvent, one of clause must be in “supported set” The supported set includes negation of the conclusion and its resolvents (1) ~P ∨ S (2) P ∨ Q (3)~P ∨ R (4)~Q ∨ R (5)~R

Control strategies (4) 6. One occurrence literal deletion (1) ~P ∨ S (2) P ∨ Q (3)~P ∨ R (4)~Q ∨ R (5)~R

Resolution for Particular Interrogative Sentence  Answers for who , what , when , where , how Known as: pompeian(x)->died(x,70) pompeian(marcus) Ask: died(marcus,?) Clause set: (1) ~pompeian(x) ∨ died(x,70) (2) pompeian(marcus) (3) ~died(marcus,t) ∨ died(marus,t) (ever-true expression is added for conclusion)

Example cont. (1) ~pompeian(x) ∨ died(x,70) (2) pompeian(marcus) (3) ~died(marcus,t) ∨ died(marus,t)

Summary  Preparation for resolution Stand form clauses (9 steps) Substitution and unify Control strategies  Resolution reasoning In propositional logic In Predicate logic In particular interrogative sentence