Encoding Knowledge with First Order Predicate Logic

Slides:



Advertisements
Similar presentations
Standard Logical Equivalences
Advertisements

Knowledge Representation Methods
AI - Week 13 Knowledge Representation, Logic, Semantic Web Lee McCluskey, room 2/07
CSE (c) S. Tanimoto, 2008 Propositional Logic
Inference and Resolution for Problem Solving
Modelling Conceptual Knowledge using Logic - Week 6 Lee McCluskey Department of Computing and Mathematical Sciences University of Huddersfield.
CSE (c) S. Tanimoto, 2008 Predicate Calculus I 1 Predicate Calculus 1 Motivation Basics Encoding.
CIA2326 Week4: Predicate Logic : introduction Lee McCluskey, room 2/07
Introduction to Logic for Artificial Intelligence Lecture 2 Erik Sandewall 2010.
Predicates and Quantifiers
1st-order Predicate Logic (FOL)
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.
CSCE 4613 Artificial Inteligence
1 Section 7.2 Equivalent Formulas Two wffs A and B are equivalent, written A  B, if they have the same truth value for every interpretation. Property:
First Order Predicate Logic
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
CS344: Introduction to Artificial Intelligence Lecture: Herbrand’s Theorem Proving satisfiability of logic formulae using semantic trees (from Symbolic.
Lecture Propositional Equivalences. Compound Propositions Compound propositions are made by combining existing propositions using logical operators.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Natural Deduction for Predicate Logic Bound Variable: A variable within the scope of a quantifier. – (x) Px – (  y) (Zy · Uy) – (z) (Mz  ~Nz) Free Variable:
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
1 Outline Quantifiers and predicates Translation of English sentences Predicate formulas with single variable Predicate formulas involving multiple variables.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Predicate Calculus CS 270 Math Foundations of Computer Science Jeremy Johnson Presentation uses material from Huth and Ryan, Logic in Computer Science:
March 8, 2016Introduction to Artificial Intelligence Lecture 13: Knowledge Representation & Reasoning II 1Resolution And yet Another Example: Resolving.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 1 Predicates and Quantifiers 1.4.
Chapter 7. Propositional and Predicate Logic
Introduction to Logic for Artificial Intelligence Lecture 2
CSE15 Discrete Mathematics 01/23/17
Formal Modeling Concepts
Knowledge Representation and Reasoning
CSE 341, S. Tanimoto Logic Programming -
Proposition & Predicates
Horn Clauses and Unification
Chapter 1 The Foundations: Logic and Proofs
Semantics In propositional logic, we associate atoms with propositions about the world. We specify the semantics of our logic, giving it a “meaning”. Such.
CS201: Data Structures and Discrete Mathematics I
CS 1502 Formal Methods in Computer Science
Logics for Data and Knowledge Representation
CSE 311 Foundations of Computing I
Quantified Propositions
Logical Inferences: A set of premises accompanied by a suggested conclusion regardless of whether or not the conclusion is a logical consequence of the.
Mathematical Structures for Computer Science Chapter 1
Resolution And yet Another Example:
1st-order Predicate Logic (FOL)
Horn Clauses and Unification
Horn Clauses and Unification
Back to “Serious” Topics…
MA/CSSE 474 More Math Review Theory of Computation
Horn Clauses and Unification
Computer Security: Art and Science, 2nd Edition
Reasoning with the Propositional Calculus
Discrete Mathematics CMP-200 Propositional Equivalences, Predicates & Quantifiers, Negating Quantified Statements Abdul Hameed
Reasoning with the Propositional Calculus
Chapter 7. Propositional and Predicate Logic
Horn Clauses and Unification
Predicates and Quantifiers
CS621 : Artificial Intelligence
Reasoning with the Propositional Calculus
Reasoning with the Propositional Calculus
Encoding Knowledge with First Order Predicate Logic
CS201: Data Structures and Discrete Mathematics I
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
RESOLUTION.
1.3 Propositional Equivalences
Encoding Knowledge with First Order Predicate Logic
1st-order Predicate Logic (FOL)
Presentation transcript:

Encoding Knowledge with First Order Predicate Logic Outline: Motivation Predicate calculus terminology Expressing knowledge in logic An example proof by resolution Formal interpretations and satisfiability CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

Motivation: More Accurate and General Representations of Knowledge “If Willy is a bird, then Willie can fly.” Propositional calculus: P: Willy is a bird Q: Willy can fly P -> Q “Any bird can fly.” Predicate calculus Forall x (Bird(x) -> CanFly(x) ) CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic Another Example “John’s grandfather was a blacksmith, and his mother was a seamstress.” Propositional calculus: P1: John’s grandfather was a blacksmith. P2: John’s grandmother was a seamstress. P & Q Predicate calculus: Q1(x): x is a blacksmith. Q2(x): x is a seamstress. f(x): grandfather of x. Q1(f(x)) & Q2(m(x)) CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

Terminology of the Predicate Calculus Predicate symbols: P, Q, R, P1, P2, ... , Q1, Q2, ..., R1, R2, ... If P takes n arguments, we call P an n-ary predicate P( term1, term2, . . . , termn) n >= 0 Function symbols: f, g, h, f1, f2, . . . , g1, g2, . . . , h1, h2, . . . A term is either: a constant: e.g., a, b, c, a1, a2, . . . , b1, b2, . . . , c1, c2, . . . a variable: e.g., x, y, z, x1, x2, . . . , y1, y2, . . . , z1, z2, . . . an n-ary function symbol, followed by n terms in parentheses. Examples of terms: x, a, f(x), g1(a, y), h(f(x), g(y, b)) CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic Well-Formed Formulas Atomic formula: an n-ary predicate symbol followed by n terms in parentheses: e.g., P(x, f(x, a, y)) If F is an atomic formula, then it is a well-formed formula (WFF). Compound formula: a statement formed from one or more WFFs using logical connectives. If F is a compound formula, then it is a WFF. e.g., P(x, f(x, a, y)) v (Q -> R(x)) Quantified formula: a statement formed from a WFFs by prefixing it with a quantifier and a variable. e.g., (Forall x) (P(x, f(x, a, y)) v (Q -> R(x))) (Exists y) Q(y) If F is a quantified formula, then it is a WFF. CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

A Syllogism for Predicate Logic Coloured flowers are always scented. I dislike flowers that are not grown in the open air. No flowers grown in the open air are colourless. Therefore, I dislike all flowers that are not scented. Lewis Carroll CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

Encoding the Syllogism Predicate symbols: C(x) = x is coloured. S(x) = x is scented. D(x) = I dislike x. A(x) = x is grown in the open air. CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

Encoding the Syllogism Coloured flowers are always scented. (forall x) ( C(x) -> S(x) ) I dislike flowers that are not grown in the open air. (forall x) ( ~A(x) -> D(x) ) No flowers grown in the open air are colourless. (forall x) ( A(x) -> ~~C(x) ) Therefore, I dislike all flowers that are not scented. (forall x) (~S(x) -> D(x) ) CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

Proof by Resolution: (1) Negate the conclusion Coloured flowers are always scented. (forall x) ( C(x) -> S(x) ) I dislike flowers that are not grown in the open air. (forall x) ( ~A(x) -> D(x) ) No flowers grown in the open air are colourless. (forall x) ( A(x) -> ~~C(x) ) It is not the case that I dislike all flowers that are not scented. ~(forall x) (~S(x) -> D(x) ) CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

Proof by Resolution: (2) Obtain Clause Form Coloured flowers are always scented. (forall x) ( C(x) -> S(x) ) (forall x) (~C(x) v S(x) ) Rewrite -> using ~ and v. ~C(x) v S(x) Drop leading universal quantifier. The other clauses are: A(x) v D(x) ~A(x) v C(x) (exists x) ~(~S(x) -> D(x) ) Move negation inward (exists x) (~S(x) & ~D(x) ) DeMorgan’s law ~S(a) & ~D(a) Introduce Skolem constant ~S(a), ~D(a) Break into 2 clauses. CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

Proof by Resolution: (3) Resolve P1: ~C(x) v S(x) P2: A(y) v D(y) variables are standardized apart. P3: ~A(z) v C(z) P4: ~S(a) P5: ~D(a) P6: A(a) P2, P5 { a/y } P7: C(a) P3, P6 { a/z } P8: S(a) P1, P7 { a/x } P9: [] P4, P8 { } CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

Formal Interpretations An interpretation for a given formula W consists of the following: A domain D of elements that can be referred to by terms. E.g., D = (0, 1, 2, . . . } An assignment that maps each constant symbol of W to an element of D. For each n-ary function symbol of W a mapping from n-tuples of elements of D to single elements of D. For each n-ary predicate symbol of W a mapping from n-tuples of elements of D to {T, F}. CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

Example of Interpretation Let W = (forall x) (P(a) & Q(x, a) ) An interpretation for W: D = { apple, peach } { a = apple } mapping for constants { } mappings for functions { P(apple) = T, P(peach) = T; mappings for predicates Q(apple,apple) = T, Q(apple, peach) = T, Q(peach,apple) = T, Q(peach, peach) = T } CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic Satisfiability A formula W is satisfiable iff there exists some interpretation of W that make W true. A formula W is unsatisfiable iff there does NOT exist any interpretation of W that make W true. Then W is inconsistent. W is a contradiction. If every interpretation of W satisfies W (makes W true), then W is a tautology. If I is an interpretation for W that satisfies W , then I is a model for W. CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

Another Interpretation Let W = (forall x) (P(a) & Q(x, a) ) An interpretation for W: D = { 0, 1, 2, . . . } { a = 0 } mapping for constants { } mappings for functions { P(n) iff n = 0; mappings for predicates Q(m,n) iff n > m. } Note that ~Q(x, x). This interpretation fails to satisfy W. It’s not a model for W. CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic

The Basis of Proof by Resolution Resolution is used to prove that a given set of clauses is inconsistent. (i.e., it cannot have a model). Each time a resolvent is formed, it is added to the set of clauses. This does not change the consistency of the set. However, if the null clause is ever added to the set, then it becomes very obvious that the set is inconsistent. CSE 415 -- (c) S. Tanimoto, 2002 Predicate Logic