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),

Slides:



Advertisements
Similar presentations
Artificial Intelligence 8. The Resolution Method
Advertisements

Predicate Logic Colin Campbell. A Formal Language Predicate Logic provides a way to formalize natural language so that ambiguity is removed. Mathematical.
Completeness and Expressiveness
Resolution Proof System for First Order Logic
First-Order Logic.
Biointelligence Lab School of Computer Sci. & Eng.
Inference Rules Universal Instantiation Existential Generalization
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Introduction to Theorem Proving
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.
Standard Logical Equivalences
Resolution.
CPSC 121: Models of Computation Unit 6 Rewriting Predicate Logic Statements Based on slides by Patrice Belleville and Steve Wolfman.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
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.
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.
Resolution
Resolution in Propositional and First-Order Logic.
Logic Concepts Lecture Module 11.
Inference Methods Propositional and Predicate Calculus.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Using Predicate Logic Chapter 5.
Prolog IV Logic, condensed. 2 Propositional logic Propositional logic consists of: The logical values true and false ( T and F ) Propositions: “Sentences,”
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
CSE (c) S. Tanimoto, 2008 Propositional Logic
Knoweldge Representation & Reasoning
Let remember from the previous lesson what is Knowledge representation
Chapter 3 Propositional Logic
Artificial Intelligence
Propositional logic It represents real-world facts as logical propositions in well formed formulas. It presented as an atomic propositions, and complex.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
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.
INFERENCE IN FIRST-ORDER LOGIC IES 503 ARTIFICIAL INTELLIGENCE İPEK SÜĞÜT.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
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 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
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.
CS344: Introduction to Artificial Intelligence Lecture: Herbrand’s Theorem Proving satisfiability of logic formulae using semantic trees (from Symbolic.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Propositional calculus
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.
CS6133 Software Specification and Verification
Automated reasoning with propositional and predicate logics Spring 2007, Juris Vīksna.
Propositional Logic Predicate Logic
Propositional & Predicate Calculus _I
1-1 An Introduction to Logical Programming Sept
1 Chapter 2.1 Chapter 2.2 Chapter 2.3 Chapter 2.4 All images are copyrighted to their respective copyright holders and reproduced here for academic purposes.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Introduction to Logic for Artificial Intelligence Lecture 2
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
Predicate Logic Lecture 7.
Lecture 2 Propositional Logic
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
CS201: Data Structures and Discrete Mathematics I
CS201: Data Structures and Discrete Mathematics I
RESOLUTION.
Presentation transcript:

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), and (F ↔G) are formulae. If F is a formula such that x is a free variable in it then  x F and  x F are formulae. There are no other formulae. Quantifiers have precedance over the logical operators. So, (  u(GT(u, v)) /\  v (ODD(v))) Can be written as  u GT(u, v) /\  v ODD(v) This predicate logic is called first order prediacte logic where only variables can be quantified.

2 Interpretations An interpretation consists of 1. Specifying a domain 2. Defining the mapping of every function f(c 1,c 2,…,c n ) 3. Assigning truth values to every predicate P(c 1,c 2,…,c n ) A formula with free variables can not be evaluated. So, we assume that they are all bound. Formulae that have the same truth values under all interpretations are equivalent. Constants

3 Evaluate the truth value of the formula  x  y(P(x) /\ Q(x,f(y))) Under the following two interpretations. 1.Given: Domain={a,b}, f(a) = b and f(b) = a, and the following truth values of atoms. P(a)P(b)Q(a,a)Q(a,b)Q(b,a)Q(b,b) falsetrue falsetrue Evaluation: For x=a, P(x) is false. So, the formula is not true for all values of x in the domain. Hence,  x  y(P(x) /\ Q(x,f(y))) is false.

4 2. Given: Domain={1, 2}, f(1) = 2 and f(2) = 1, and the following truth values for atoms. P(1)P(2)Q(1, 1)Q(1, 2)Q(2, 1)Q(2, 2) true falsetrue Evaluation: For x=1, P(x) is true. Q(x,f(y)) is true for both y = 1 and y = 2. For x=2, P(x) is true. Q(x,f(y)) is true for y = 1. So, for all values of x in the domain, there is a value of y in the domain that makes the formula true. Hence,  x  y(P(x) /\ Q(x,f(y))) is true.  x  y(P(x) /\ Q(x,f(y)))

5 Rules of inference Just as in propositional logic, rules of inference can be used in predicate logic. Besides the rules used in propositional logic, we have other rules in predicate logic. Universal specialization (Universal instantiation) From  x F(x) we can deduce F(a) where a is a constant. Example: Suppose the following premisses are given: 1.Every father argues with his son. 2.John is a father. Prove the goal: John argues with his son.

6 Using predicate logic we can represent the above statements as:  x (FATHER(x) → ARGUES (x,son(x))) 2.FATHER(John) Applying the rule of universal specialization to 1, we get, 3. FATHER(John) → ARGUES(John, son(John)) Applying the modus ponens to 2 and 3 we get, 4.ARGUES(John, son(John)) And the goal is proved to be a theorem.

7 Predicate logic is semi-decidable. A domain can contain an infinite number of elements Hence, there can be an infinite number of interpretations for of a formula We can not show that a formula is a tautology or an inconsistency by evaluating it under all interpretations In predicate logic, there exists no general proof procedure that will prove a goal G if G is a theorem and that will disprove G if G is not a theorem. There are procedures that prove G if G is a theorem but will not terminate if it is not (Resolution).

8 Resolution in predicate logic Before we can apply resolution we must: Convert formulae to clause form Clause: disjunction of literals Literal: an atom or the negation of an atom Conjunction exists implicitly between clauses all variables in a clause are universally quantified There is a ten stage procedure for converting a formula to clause form in predicate logic.

9 Resolution in predicate logic is similar to that in propositional logic. In propositional logic, however, it is easy to check if two literals are contradictory. In predicate logic it is more difficult. man(John) ~man(John) Are contradictory but, man(John) ~man(George) are not. And, man(x) ~man(John) are also contradictory. There is an algorithm known as a unification algorithm that does this matching and produces the resolvent clause.

10 1. man(Marcus) 2. ~man(x1) \/ mortal(x1) man(Marcus) unifies with man(x1) with the substitution Marcus/x1 which means that for x1=Marcus, ~man(Marcus) is false. We can not cancel out the literals and generate mortal(x1) Clause 2 says that for a given x1 either ~man(x1) or mortal(x1) Here, we can only conclude mortal(Marcus) is true We can not say mortal(x1) for all x1 because for some x1, ~man(x1) might be true. The resolvent generated will be mortal(Marcus) which is obtained by applying the result of the unification to the resolvent.

11 An algorithm for resolution for predicate logic. F is the set of given statements S is the statement to be proved 1. Convert the statements in F to clause form. 2. Negate S and convert the result to clause form. Add it to the set of clauses obtained in Repeat until either a contradiction is found, no progress is possible, or a predetermined amount of effort has been expended. a. Select two clauses. Call them parent clauses. b. Resolve them together. The resolvent will be the disjunction of all the literals of the parent clauses with appropriate substitutions performed and with the following exceptions. If there is a pair of literals T1 and ~T2 such that one of the parent clauses contains T1 and the other contains T2 and if T1 and T2 are unifiable, then neither T1 nor T2 should appear in the resolvent. We will call T1 and T2 complimentary literals. Use the substitution produced by the unification to create the resolvent. c. If the resolvent is empty then a contradiction has been found.If it is not then add it to the set of clauses available to the procedure.

12 Let’ see how the resolution principle can be used to prove new statements from given ones. Example: Given statements converted to formulae in predicate logic: 1.Marcus was a man. man(Marcus). (Past tense lost which is ok in this case) 2. Marcus was a Pompein. Pompein(Marcus). 3. All Pompeins were Romans.  x Pompein(x) → Roman(x). 4. Caesaer was a ruler. ruler(Caeser). 5. All Romans were either loyal to Caeser or (EOR) hated him  x Roman(x) → loyalto(x, Caeser) \/ hate(x,Caeser). OR  x Roman(x) → ((loyalto(x, Caeser) \/ hate(x,Caeser) /\ ~(loyalto(x, Caeser) /\ hate(x,Caeser))). EOR

13 6. Everyone is loyal to someone.  x  y loyalto(x, y). For every person there is someone…  y  x loyalto(x, y). There is someone who is loyal to all… 7. People only try to assassinate rulers they are not loyal to.  x  y person(x)/\ ruler(y) /\ tryassassinate(x,y) → ~loyalto(x,y). Does this mean that people try to assassinate rulers if they are not loyal to them or the only thing people do is to try to assassinate rulers they are not loyal to (Ambiguous). 8. Marcus tried to assassinate Caeser. tryassassinate(Marcus, Caeser). Converting from English to logic is not easy.

14 We want to prove: hate (Marcus, Caesar) We first have to convert our formulae into clause form. Axioms in clause form: 1. man(Marcus). 2. Pompein(Marcus). 3. Pompein(Marcus) \/ Roman(x1). 4. ruler(Caeser). 5. ~Roman(x2) \/ loyalto(x2, Caeser) \/ hate(x2,Caeser). 6. loyalto(x3, f1(x3)). 7. ~man(x4) \/ ~ruler(y1) \/ ~tryassassinate(x4, y1) \/ ~loyalto(x4,y1). 8. tryassassinate(Marcus, Caeser).

15 prove: hate (Marcus, Caesar) 5 Marcus/x2 3 ~Roman(Marcus) \/ loyalto(Marcus, Caeser) Marcus/x1 ~Pompein(Marcus) \/ loyalto(Marcus, Caeser) 2 7 loyalto (Marcus, Caeser) Marcus/x4, Caesar/y1 1 ~man(Marcus) \/ ~ruler(Caeser) \/ ~tryassassinate(Marcus, Caeser) 4 ~ruler(Caeser) \/ ~tryassassinate(Marcus, Caeser) ~tryassassinate(Marcus, Caeser) 8