Predicate Calculus - Syntax

Similar documents
Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Introduction to Sets and Logic (MATH 1190)

Discrete Mathematics and Its Applications

Formal (Natural) Deduction for Predicate Calculus

Propositional Logic Not Enough

Section Summary. Section 1.5 9/9/2014

Predicate Calculus. Lila Kari. University of Waterloo. Predicate Calculus CS245, Logic and Computation 1 / 59

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

PREDICATE LOGIC. Schaum's outline chapter 4 Rosen chapter 1. September 11, ioc.pdf

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

ICS141: Discrete Mathematics for Computer Science I

Proposi'onal Logic Not Enough

AAA615: Formal Methods. Lecture 2 First-Order Logic

Predicate Logic: Sematics Part 1

Predicate Calculus lecture 1

Recall that the expression x > 3 is not a proposition. Why?

2-4: The Use of Quantifiers

Proving Arguments Valid in Predicate Calculus

Mat 243 Exam 1 Review

Thinking of Nested Quantification

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

ECOM Discrete Mathematics

2. Use quantifiers to express the associative law for multiplication of real numbers.

Lecture Predicates and Quantifiers 1.5 Nested Quantifiers

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Introduction to Predicate Logic Part 1. Professor Anita Wasilewska Lecture Notes (1)

Logic as a Tool Chapter 4: Deductive Reasoning in First-Order Logic 4.4 Prenex normal form. Skolemization. Clausal form.

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

Predicate Logic. Andreas Klappenecker

1.1 Language and Logic

MAT2345 Discrete Math

Announcements CompSci 102 Discrete Math for Computer Science

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

Discrete Structures for Computer Science

Introduction to first-order logic:

Logical equivalences 12/8/2015. S T: Two statements S and T involving predicates and quantifiers are logically equivalent

! Predicates! Variables! Quantifiers. ! Universal Quantifier! Existential Quantifier. ! Negating Quantifiers. ! De Morgan s Laws for Quantifiers

software design & management Gachon University Chulyun Kim

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

Department of Computer Science & Software Engineering Comp232 Mathematics for Computer Science

Quantifiers Here is a (true) statement about real numbers: Every real number is either rational or irrational.

1.1 Language and Logic

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

ITS336 Lecture 6 First-Order Logic

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

Predicate Logic: Syntax

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

CSI30. Chapter 1. The Foundations: Logic and Proofs Nested Quantifiers

Predicates and Quantifiers. Nested Quantifiers Discrete Mathematic. Chapter 1: Logic and Proof

Logic Overview, I. and T T T T F F F T F F F F

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Predicates, Quantifiers and Nested Quantifiers

Adequate set of connectives, logic gates and circuits

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

First-Order Logic (FOL)

Computational Logic. Recall of First-Order Logic. Damiano Zanardini

Predicate Logic: Introduction and Translations

Predicate Calculus. Formal Methods in Verification of Computer Systems Jeremy Johnson

Transparencies to accompany Rosen, Discrete Mathematics and Its Applications Section 1.3. Section 1.3 Predicates and Quantifiers

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Today we will probably finish Course Notes 2.3: Predicates and Quantifiers.

1.3 Predicates and Quantifiers

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Proseminar on Semantic Theory Fall 2013 Ling 720 First Order (Predicate) Logic: Syntax and Natural Deduction 1

Logic and Propositional Calculus

Logic: The Big Picture

The predicate calculus is complete

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Exercises 1 - Solutions

COMP 2600: Formal Methods for Software Engineeing

Logic and Propositional Calculus

Chapter 1 Elementary Logic

Math.3336: Discrete Mathematics. Nested Quantifiers

06 From Propositional to Predicate Logic

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:


First Order Logic (FOL) 1 znj/dm2017

First order Logic ( Predicate Logic) and Methods of Proof

A Little Logic. Propositional Logic. Satisfiability Problems. Solving Sudokus. First Order Logic. Logic Programming

Semantics I, Rutgers University Week 3-1 Yimei Xiang September 17, Predicate logic

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

Propositional Language - Semantics

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

III. Elementary Logic

Predicate Logic - Semantic Tableau

Logic and Modelling. Introduction to Predicate Logic. Jörg Endrullis. VU University Amsterdam

Comp487/587 - Boolean Formulas

THE LOGIC OF QUANTIFIED STATEMENTS

Rosen, Discrete Mathematics and Its Applications, 6th edition Extra Examples

Predicate Logic & Quantification

LING 501, Fall 2004: Quantification

Foundations of Mathematics Worksheet 2

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

1 The Foundation: Logic and Proofs

CM10196 Topic 2: Sets, Predicates, Boolean algebras

Transcription:

Predicate Calculus - Syntax Lila Kari University of Waterloo Predicate Calculus - Syntax CS245, Logic and Computation 1 / 26

The language L pred of Predicate Calculus - Syntax L pred, the formal language of predicate calculus, consists of the following basic symbols: individual constant symbols: a, b, c, a 1, a 2... predicate or relation symbols: F, G, H, P, F 1,... function symbols: f, g, h, f 1,... free variable symbols: u, v, w, u 1,... bound variable symbols: x, y, z, x 1,... connectives:,,,, quantifiers:, punctuation symbols: ( ), Predicate Calculus - Syntax CS245, Logic and Computation 2 / 26

Comments There is a special binary relation symbol called the equality symbol, written as. L pred may or may not contain. L pred containing is called the first order language with equality. In order to emphasize the equality symbol, we stipulate that it is denoted by none of F, G, H... The adjective first-order is used to distinguish the language we study from those in which (1) there are predicates having other predicates as arguments, or (2) in which predicate quantifiers or function quantifiers are permitted, or both. Predicate Calculus - Syntax CS245, Logic and Computation 3 / 26

The terms of L pred Definition. Term(L pred ) is the smallest class of expressions of L pred closed under the following formation rules: (1) Every individual constant symbol is a term of L pred. (2) Every free variable symbol is a term of L pred. (3) If f is an n-ary function symbol and t 1, t 2,... t n are terms of L pred, then f (t 1,... t n ) is a term of L pred. Predicate Calculus - Syntax CS245, Logic and Computation 4 / 26

Atoms of L pred Definition. An expression of L pred is an atom in Atom(L pred ) iff it is of one of the following two forms: (1) P(t 1, t 2,..., t n ) where P is an n-ary predicate (relation symbol) and t 1, t 2,..., t n are terms in Term(L pred ). (2) (t 1, t 2 ) where t 1, t 2 are terms in Term(L pred ). Predicate Calculus - Syntax CS245, Logic and Computation 5 / 26

Formulas of L pred Definition. Form(L pred ), the class of (well-formed) formulas of L pred, is the smallest class of expressions of L pred closed under the following formation rules: (1) Every atom in Atom(L pred ) is a formula of L pred. (2) If A is a formula of L pred then ( A) is a formula of L pred. (3) If A, B are formulas of L pred then (A B), (A B), (A B), (A B) are formulas of L pred. (4) If A(u) is a formula of L pred, where u is a free variable occurring in A, and x is a variable not occurring in A(u), then xa(x) and xa(x) are formulas of L pred. Predicate Calculus - Syntax CS245, Logic and Computation 6 / 26

The terms are the nouns and pronouns of the English language: they are the expressions which can be interpreted as naming an object. The terms are defined to be those expressions which can be built up from the individual constant symbols and variables, possibly by prefixing with function symbols. The atoms (atomic formulas) will be those formulas formed by using only terms and predicates, but which have neither connective nor quantifier symbols. The formulas are those expressions which can be built up from the atoms by use of the connective symbols and the quantifier symbols. Predicate Calculus - Syntax CS245, Logic and Computation 7 / 26

Example (1) For every integer x, there is an integer which is greater than x. (2) 500 is an integer. (3) There is an integer which is greater than 500. Translate into predicate calculus if the domain is the set of real numbers: Symbol N(x) G(y, x) x y Meaning x is an integer y is greater than x for all x there exists y Predicate Calculus - Syntax CS245, Logic and Computation 8 / 26

Example contd. Now the preceding reasoning can be formalized as follows: (1) x(n(x) y(n(y) G(y, x))). (2) N(500) (3) y(n(y) G(y, 500)) Predicate Calculus - Syntax CS245, Logic and Computation 9 / 26

Example - comments To get the first formula from the preceding example x(n(x) y(n(y) G(y, x))) according to the definition of a formula in L pred, we proceed as follows: terms atoms formulas To get N(500) one proceeds as follows: u, v G(u, v), N(u), N(v) (N(u) G(u, v)) y(n(y) G(y, v)) (N(v) y(n(y) G(y, v))) x(n(x) y(n(y) G(y, x))) term 500 atom N(500) Predicate Calculus - Syntax CS245, Logic and Computation 10 / 26

The eight types of formulas in Form(L pred ) Theorem. Any term is of exactly one of three forms: an individual constant symbol, a free variable symbol, or f (t 1,..., t n ) where f is an n-ary function symbol; and in each case it is of that form in exactly one way. Theorem. Any formula of Form(L pred ) is of exactly one of eight forms: an atom (uses only terms and predicates), ( A), (A B), (A B), (A B), (A B), xa(x) or xa(x); and in each case it is of that form in exactly one way. Predicate Calculus - Syntax CS245, Logic and Computation 11 / 26

Generating formulas in L pred The formula x(f (b) y( zg(y, z) H(u, x, y))) is generated as follows: Predicate Calculus - Syntax CS245, Logic and Computation 12 / 26

Sentences (closed formulas) and precedence rules Definition A sentence or a closed formula of L pred is a formula of L pred in which no free variable symbols occurs. The set of sentences of L pred is denoted by Sent(L pred ). As before, we omit brackets to simplify the appearance of a formula using the precedence rules for connectives and quantifiers. Thus the formula can be written as x((a(x) B(x)) C(x)) x(a(x) B(x) C(x)). Predicate Calculus - Syntax CS245, Logic and Computation 13 / 26

Quantification of two variables Let Q(x, y) denote x + y = 0. If the domain is the set of real numbers, what are the truth values of y xq(x, y) and x yq(x, y)? Solution: The formula y xq(x, y) denotes the statement It is true that there is a real number y such that for every real number x, Q(x, y). Since there is no real number y such that x + y = 0 for all real numbers x, this statement, and thus the formula, is false. The formula x yq(x, y) denotes the statement It is true that for every real number x, there is a real number y such that Q(x, y). Given a real number x there is a real number y such that x + y = 0; namely y = x. Hence, this statement, and thus the formula, is true. Conclusion: The order in which quantifiers appear matters! Predicate Calculus - Syntax CS245, Logic and Computation 14 / 26

Quantification of two variables In working with quantifications of more than one variable, it is sometimes helpful to think of them in terms of nested loops. For example, to see whether x yp(x, y) is true, we loop through the values for x and, for each x, we loop through the values for y. If we find that P(x, y) is true for all values of x and y we have determined that x yp(x, y) is true. If we find that we ever hit a value x for which we hit a value y for which P(x, y) is false, then we have shown that x yp(x, y) is false. Predicate Calculus - Syntax CS245, Logic and Computation 15 / 26

Summary: quantification of 2 variables Statement When true? 1. x yp(x, y) P(x, y) is true for every y xp(x, y) pair x, y 2. x yp(x, y) For every x there is a y for which P(x, y) is true 3. x yp(x, y) There is an x for which P(x, y) is true for every y 4. x yp(x, y) There is a pair x, y for which y xp(x, y) P(x, y) is true Predicate Calculus - Syntax CS245, Logic and Computation 16 / 26

Summary: quantification of 2 variables - contd. Statement When false? 1. x yp(x, y) There is a pair x, y for y xp(x, y) which P(x, y) is false 2. x yp(x, y) There is an x such that P(x, y) is false for every y 3. x yp(x, y) For every x there is a y for which P(x, y) is false 4. x yp(x, y) P(x, y) is false for every y xp(x, y) pair x, y Predicate Calculus - Syntax CS245, Logic and Computation 17 / 26

Exercise Let Q(x, y, z) be the statement x + y = z. If the domain is the set of real numbers, what are the truth values of the statements and x y zq(x, y, z) z x yq(x, y, z)? Predicate Calculus - Syntax CS245, Logic and Computation 18 / 26

Negating quantifiers We will often want to consider the negation of a quantified expression. Consider the negation of the statement: Every student in the class has taken a course in calculus. If the domain is the set of all students in this class, this statement can be translated as xp(x) where P(x) is the statement x has taken a course in calculus. The negation of this statement is It is not the case that every student in this class has taken a course in calculus. This is equivalent to There is a student in the class who has not taken a course in calculus., that is x P(x). Predicate Calculus - Syntax CS245, Logic and Computation 19 / 26

Negating quantifiers Consider the proposition There is a student in this class who has taken a course in calculus. which, if the domain is the set of all students in this class, can be translated as xp(x) where P(x) is the statement x has taken a course in calculus. The negation of this statement is It is not the case that there is a student in this class who has taken a course in calculus. This is equivalent to Every student in this class has not taken calculus, that is, x P(x) Predicate Calculus - Syntax CS245, Logic and Computation 20 / 26

Negation of quantifiers summarized Negation Equivalent statement 1. xp(x) x P(x) 2. xp(x) x P(x) When true? When false? 1. xp(x) P(x) is false for every x There is an x for which P(x) is true 2. xp(x) There is an x for which P(x) is true for every x P(x) is false Predicate Calculus - Syntax CS245, Logic and Computation 21 / 26

Assume the domain D is finite, D = {α 1,..., α n } The universal quantifier can be interpreted as a generalization of conjunction: xr(x) = 1 iff R(α 1 ) R(α 2 )... R(α n ) = 1 The existential quantifier can be interpreted as a generalization of disjunction: xr(x) = 1 iff R(α 1 ) R(α 2 )... R(α n ) = 1 Thus, the rules of negating quantifiers can be viewed as generalizations of De Morgan s Laws Predicate Calculus - Syntax CS245, Logic and Computation 22 / 26

First-order languages When associated with a structure, L pred consist of the same classes of symbols as defined before, but the three classes of individual constant symbols, relation symbols, and function symbols should be in one-to-one correspondence with designated individual constants, relations and functions of the structure. We have: non-logical symbols (parameters): individual constants, relations (predicates), and functions. logical symbols: free and bound variable symbols, connectives, quantifier symbols, punctuation, and. Predicate Calculus - Syntax CS245, Logic and Computation 23 / 26

Examples of first-order languages Language of ordered abelian groups Equality: Yes. Predicate symbols: One 2-place predicate. Individual constant symbol: 0 (neutral element for +). Function symbols: a unary function symbol (inverse), a binary function symbol + (addition). Language of set theory Equality: Yes. Predicate symbols: One 2-place predicate symbol. Individual constant symbols:. Function symbols: None. Predicate Calculus - Syntax CS245, Logic and Computation 24 / 26

Examples of first-order languages Language of elementary number theory: Equality: Yes. Predicate symbols: One 2-place predicate symbol <. Individual constant symbols: The symbol 0. One place function symbols: S (for successor) Two-place function symbols: + (for addition), and (for multiplication). Predicate Calculus - Syntax CS245, Logic and Computation 25 / 26

Language of elementary number theory The expressions +(u, v) and +(u, +(v, w)) are terms. They are usually written as u + v and u + v + w. The expressions (+(u, v), 0) and < (+(u, +(v, w)), +(u, v)) are atoms, usually written as u + v = 0 and u + v + w < u + v. The expression < (u, v) < (+(u, u), +(v, v)) is a formula usually written as (u < v) (u + u < v + v) The expression x y(< (x, S(y)) z(< (x, z) < (z, y))) is a formula usually written as x y((x < y + 1) z((x < z) (z < y))). Predicate Calculus - Syntax CS245, Logic and Computation 26 / 26