1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.

Slides:



Advertisements
Similar presentations
Completeness and Expressiveness
Advertisements

Biointelligence Lab School of Computer Sci. & Eng.
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.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
March 10: Quantificational Notions Interpretations: Every interpretation interprets every individual constant, predicate, and sentence letter of PL. Our.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Let remember from the previous lesson what is Knowledge representation
Formal Logic Mathematical Structures for Computer Science Chapter 1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
Predicates and Quantifiers
1 CS 1502 Formal Methods in Computer Science Lecture Notes 12 Variables and Quantifiers.
Chapter 1: The Foundations: Logic and Proofs
Logical Equivalence & Predicate Logic
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Fall 2010 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
Formal Logic Mathematical Structures for Computer Science Chapter Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
MATH 224 – Discrete Mathematics
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.
1 Section 1.1 A Proof Primer A proof is a demonstration that some statement is true. We normally demonstrate proofs by writing English sentences mixed.
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Slides for CISC 2315: Discrete Structures Chapters CISC 2315 Discrete Structures Professor William G. Tanner, Jr. SPRING 2010 Slides created by James.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
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:
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Spring 2011 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
Copyright © Cengage Learning. All rights reserved. CHAPTER 3 THE LOGIC OF QUANTIFIED STATEMENTS THE LOGIC OF QUANTIFIED STATEMENTS.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Key Concepts Representation Inference Semantics Discourse Pragmatics Computation.
Lecture 4: Predicates and Quantifiers; Sets.
Bertram Ludäscher Department of Computer Science & Engineering University of California, San Diego CSE-291: Ontologies in Data Integration.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
CS6133 Software Specification and Verification
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
No new reading for Wednesday. Keep working on chapter 5, section 3. Exam #3 is next Monday.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
1 Section 9.1 Automatic Reasoning Recall that a wff W is valid iff ¬ W is unsatisfiable. Resolution is an inference rule used to prove unsatisfiability.
Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication.
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
Fundamental Concepts of Algebra
1 CMSC 250 Chapter 2, Predicate Logic. 2 CMSC 250 Definitions l Subject / predicate John / went to the store. The sky / is blue. l Propositional logic-
Semantics of Predicate Calculus For the propositional calculus, an interpretation was simply an assignment of truth values to the proposition letters of.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
1 Section 8.3 Higher-Order Logic A logic is higher-order if it allows predicate names or function names to be quantified or to be arguments of a predicate.
Albert Gatt LIN3021 Formal Semantics Lecture 3. Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Section 1.5 and 1.6 Predicates and Quantifiers. Vocabulary Predicate Domain Universal Quantifier Existential Quantifier Counterexample Free variable Bound.
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.
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
1 Section 7.3 Formal Proofs in Predicate Calculus All proof rules for propositional calculus extend to predicate calculus. Example. … k.  x p(x) P k+1.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Chapter 1 Logic and proofs
Chapter 1 Logic and Proof.
Chapter 7. Propositional and Predicate Logic
CS201: Data Structures and Discrete Mathematics I
CS 1502 Formal Methods in Computer Science
MA/CSSE 474 More Math Review Theory of Computation
Predicates and Quantifiers
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially or universally. A predicate describes a property of the subject or subjects of a sentence. If p is a predicate that describes a property of x, then we write p(x). Example. If p is the “is prime” predicate and x is prime, then we write p(x) for “x is prime”. Example. If q is the “is a parent of” predicate, and x is a parent of y, then we write q(x, y) for “x is a parent of y.” Existential Quantifier. The phrase, “there exists an x such that p(x)” is denoted by  x p(x). The symbol  x is an existential quantifier and it indicates disjunction. Example. If x  {1, 2, 3}, then  x p(x) = p(1)  p(2)  p(3). Quiz (1 minute). p(y, a)  p(y, b)  p(y, c) = ? Answer:  x p(y, x), where x  {a, b, c}. Universal Quantifier. The phrase, “for every x, p(x)” is denoted by  x p(x). The symbol  x is a universal quantifier and it indicates conjunction. Example. If x  {1, 2, 3}, then  x p(x) = p(1)  p(2)  p(3). Quiz (1 minute). p(a, x)  p(b, x)  p(c, x) = ? Answer:  y p(y, x) where y  {a, b, c}. Quiz (2 minutes). If x, y  {0, 1}, then  x  y p(x, y, z) = ? Answer 1:  y p(0, y, z)   y p(1, y, z) = (p(0, 0, z)  p(0, 1, z))  (p(1, 0, z)  p(1, 1, z)). Answer 2:  x (p(x, 0, z)  p(x, 1, z)) = (p(0, 0, z)  p(0, 1, z))  (p(1, 0, z)  p(1, 1, z)).

2 Syntax of wffs in first-order predicate calculus Terms are nonlogical things: constants a, b, c, …, variables x, y, z, …. and function symbols applied to terms ƒ(a), g(x, ƒ(y)), h(c, z), …. Atoms are predicate symbols applied to terms p(x), q(a, ƒ(x)),.... Wffs are either atoms or if U and V are wffs then the following expressions are also wffs: ¬ U, U  V, U  V, U  V,  x U,  x U, and (U). Hierarchy in the absence of parentheses ¬,  x,  x (highest, group rightmost operator with smallest wff to its right)    (lowest, and it is left associative) Example.  x ¬  y p(x, y)   x q(x) = (  x (¬ (  y p(x, y)))  (  x q(x)). Scope, Bound, and Free The scope of  x in  x W is W. The scope of  x in  x W is W. An occurrence of x is bound if it occurs in either  x or  x or in their scope. Otherwise the occurrence of x is free. Example.

3 Interpretations An interpretation for a first-order wff consists of a nonempty set D, called the domain, together with an assignment of the symbols of the wff as follows: 1. Predicate letters are assigned to relations over D. 2. Function letters are assigned to functions over D. 3. Constants are assigned to elements of D. 4. Free occurrences of variables are assigned to elements of D. Notation: If x is free in W and d  D, then W(x/d) denotes the wff obtained from W by replacing all free occurrences of x by d. We also write W(d) = W(x/d). Example. Let W =  y (p(x, y)  q(x)). Then W(x/d) =  y (p(d, y)  q(d)). Truth Value of a Wff The truth value of a wff with respect to an interpretation with domain D is obtained by recursively applying the following rules: 1.An atom has the truth value of the proposition obtained from its interpretation. 2.Truth values for ¬ U, U  V, U  V, U  V are obtained by applying truth tables for ¬, , ,  to the truth values for U and V. 3.  x W is true iff W(x/d) is true for all d  D. 4.  x W is true iff W(x/d) is true for some d  D. If a wff is true with respect to an interpretation I, we say the wff is true for I. Example. Let W = p(x). We can define an interpretation I by letting D = N, p(x) means x is odd, and x = 4. Then W is false for I because W(x/4) = p(x)(x/4) = p(4) = “4 is odd,” which is false. If we let J be the same as I except that we assign x = 3, then W is true for J because W(x/3) = p(x)(x/3) = p(3) = “3 is odd,” which is true.

4 Example. Let W =  x (p(x)  q(x, y)). Here are two interpretations of W: 1. Let I be defined by D = {0, 1}, p(0) = True, p(1) = False, q(0, 1) = True, otherwise q(x, y) is false, and y = 1. Then W is true for I because it becomes  x (p(x)  q(x, 1))= (p(0)  q(0, 1))  (p(1)  q(1, 1)) = (True  True)  (False  False)  True  True  True. 2. If J has any domain D, p is true, q is false, and y any value of D, then W is false for J. Example. Let W =  x (p(x)  q(x)). Here are two interpretations of W: 1. Let I be defined by D = N, p(x) means x is prime, and q(x) means x is odd. Then W is true for I because, for example, p(3)  q(3) = True  True  True. 2. If J consists of D = N, p(x) means x is even, and q(x) means x is odd, then W is false for I because, for example, p(3)  q(3) = False  True  False. Example. Let W =  x (g(x, c)   y (p(y)  d(y, x))). Here are two interpretations of W: 1. Let I be defined by D = {a}, p(a) = False, d(a, a) = True, g(a, a) = True, and c = a. Then W is false for I because W = g(a, a)  p(a)  d(a, a)  True  False  True  False. 2. Let I be defined by D = N, g(x, c) means x > c, p(x) = means x is prime, d(x, y) means x divides y, and c = 1. This gives the sentence, “every natural number greater than 1 has a prime divisor,” which is known to be true. Example. Let W =  x  y (¬ (p(x)  p(y))   z q(z, x, y)). Let I be defined by D = N, p(x) means x = 0 and q(z, x, y) means z = gcd(x, y). Then the meaning of W wrt I is “Every pair of natural numbers that are not both zero has a greatest common divisor,” which is known to be true.

5 Models and Countermodels An interpretation that makes a wff true is called a model. An interpretation that makes a wff false is called a countermodel. See the previous examples. Example. Let W be the following wff.  x (r(x, a)  ¬ p(x)   y (r(x, y)  r(y, a)  d(y, x))). 1. Any interpretation for which r is always false is a model for W. 2. Any interpretation for which r is always true, p is always false, and d is always false is a countermodel for W. Quiz (1 minute). For the preceding example, let I be the interpretation defined by D = N, r(x, y) means x > y, p(x) means x is prime, d(y, x) means y divides x, and a = 1. Is I a model or a countermodel for W? Answer: We get the statement, “every natural number x > 1 that is not a prime has a divisor y between 1 and x,” which is known to be true. So I is a model of W. Validity A wff is valid if every interpretation is a model. Otherwise the wff is invalid. A wff is unsatisfiable if every interpretation is a countermodel. Otherwise the wff is satisfiable. Quiz (1 minute). Every wff has exactly two of these four properties. What are the possible pairs of properties that a wff can have? Answer: {valid, satisfiable}, {unsatisfiable, invalid}, and {satisfiable, invalid}

6 Proofs of Validity or Unsatisfiability We can’t check every interpretation (there are too many). So we need to reason informally with interpretations. Example:  x (p(x)  p(x)) is valid because p(x)  p(x) is true for all interpretations. Example:  x (p(x)  ¬ p(x)) is unsatisfiable because p(x)  ¬ p(x) is always false. The previous two examples were quite simple. Here is a more realistic example. Example. Prove the following wff is valid.  x (A(x)  B(x))   x A(x)   x B(x). Direct Proof: Let I be an interpretation with domain D for the wff and assume that the antecedent is true for I. Then A(d)  B(d) is true for I for some d  D. So both A(d) and B(d) are true for I. Therefore both  x A(x) and  x B(x) are true for I. So the consequent is true for I. Thus I is a model for the wff. Since I was an arbitrary interpretation for the wff, every interpretation for the wff is a model. Therefore, the wff is valid. QED. Indirect Proof: Suppose, BWOC, that the wff is invalid. Then there is a countermodel I with domain D for the wff. So the antecedent is true for I and the consequent is false for I. Since the antecedent is true for I, it follows that A(d)  B(d) is true for I for some d  D. Since the consequent is false for I, either  x A(x) or  x B(x) is false for I. So either A(x) is false for all x  D or B(x) is false for all x  D. These cases contradict the fact that both A(d) and B(d) are true for I for some d  D. So the wff is valid. QED. Quiz (1 minute). Is  x A(x)   x B(x)   x (A(x)  B(x)) valid? Answer: No. e.g., let D = N, A(x) mean x is even, and B(x) mean x is odd.

7 Some Valid Conditionals Whose Converses Are Invalid (a)  x A(x)   x A(x). (b)  x (A(x)  B(x))   x A(x)   x B(x). (c)  x A(x)   x B(x)   x (A(x)  B(x)). (d)  x (A(x)  B(x))  (  x A(x)   x B(x)). (e)  x  y P(x, y)   y  x P(x, y). Quiz (5 minutes). Find a countermodel for each converse of the above wffs. Closures Let W be a wff with free variables x 1, …, x n. Then we have the following definitions:  x 1 …  x n W is the universal closure of W.  x 1 …  x n W is the existential closure of W. Sometimes a wff and one of its closures have the same properties and sometimes they don’t, as we can see in the following examples. Example. The wff p(x)  ¬ p(y) is satisfiable and invalid. The universal closure  x  y (p(x)  ¬ p(y)) is satisfiable and invalid. The existential closure  x  y (p(x)  ¬ p(y)) is valid. Example. The wff p(x)  ¬ p(y) is satisfiable and invalid. The universal closure  x  y (p(x)  ¬ p(y)) is unsatisfiable. The existential closure  x  y (p(x)  ¬ p(y)) is satisfiable and invalid.

8 Closure Properties (proofs in text) 1. A wff is valid if and only if its universal closure is valid. 2. A wff is unsatisfiable if and only if its existential closure is unsatisfiable. Example. The wff p(x)   y p(y) is valid and its universal closure  x (p(x)   y p(y)) is also valid. Example. The wff p(x)   y ¬ p(y) is unsatisfiable and its existential closure  x (p(x)   y ¬ p(y) )) is also unsatisfiable. Decidability (Solvability) A problem in the form of a yes/no question is decidable if there is an algorithm that takes as input any instance of the problem and halts with the answer. Otherwise, the problem is undecidable. A problem is partially decidable if there is an algorithm that takes as input any instance of the problem and halts if the answer is yes, but might not halt if the answer is no. The Validity Problem for Propositional Calculus The problem of determining whether a propositional wff is a tautology is decidable. An algorithm can build a truth table for the wff and then check it. The Validity Problem for First-Order Predicate Calculus The problem of determining whether a first-order wff is valid is undecidable, but it is partially decidable. Two partial decision procedures are natural deduction (due to Gentzen in 1935) and resolution (due to Robinson in 1965). We’ll study natural deduction in Section 7.3 and resolution in Chapter 9.