First order logic. Example The deduction of statements: This reasoning is intuitively correct. Every man is mortal. Since Ade is a man, he is mortal.

Similar documents
2-4: The Use of Quantifiers

First-Order Predicate Logic. Basics

Proposi'onal Logic Not Enough

Section Summary. Section 1.5 9/9/2014

Predicate Logic: Sematics Part 1

Propositional Logic Not Enough

Introduction to Sets and Logic (MATH 1190)

Discrete Mathematics

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

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

Denote John by j and Smith by s, is a bachelor by predicate letter B. The statements (1) and (2) may be written as B(j) and B(s).

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

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

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

Thinking of Nested Quantification

Part I: Propositional Calculus

Section Summary. Predicates Variables Quantifiers. Negating Quantifiers. Translating English to Logic Logic Programming (optional)

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

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Logic: The Big Picture

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

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

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

Advanced DB CHAPTER 5 DATALOG

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

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

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

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/26)

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

Logic and Propositional Calculus

Propositional Functions. Quantifiers. Assignment of values. Existential Quantification of P(x) Universal Quantification of P(x)

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:

Discrete Mathematics and Its Applications

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

Predicate Logic. Andreas Klappenecker

Introduction to first-order logic:

First Order Logic (FOL) 1 znj/dm2017

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

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

06 From Propositional to Predicate Logic

Lecture 3 : Predicates and Sets DRAFT

Predicate Calculus - Syntax

Chapter 1, Part II: Predicate Logic

Predicate Calculus lecture 1

I thank the author of the examination paper on which sample paper is based. VH

First order Logic ( Predicate Logic) and Methods of Proof


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

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

University of Aberdeen, Computing Science CS2013 Predicate Logic 4 Kees van Deemter

LIN1032 Formal Foundations for Linguistics

Section 2.1: Introduction to the Logic of Quantified Statements

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

First-Order Logic (FOL)

Propositional Logic. Premises: If Jack knows Jill, then Jill knows Jack. Jack knows Jill. Conclusion: Is it the case that Jill knows Jack?

Formal (Natural) Deduction for Predicate Calculus

CSE 311: Foundations of Computing. Lecture 6: More Predicate Logic

Predicate Logic Thursday, January 17, 2013 Chittu Tripathy Lecture 04

Introduction to Metalogic

Overview. CS389L: Automated Logical Reasoning. Lecture 7: Validity Proofs and Properties of FOL. Motivation for semantic argument method

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

Logic and Propositional Calculus

Topic #3 Predicate Logic. Predicate Logic

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

Logic. Propositional Logic: Syntax. Wffs

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

Predicate Calculus - Semantics 1/4

Philosophy 240 Symbolic Logic Russell Marcus Hamilton College Fall 2014

CHAPTER 2. FIRST ORDER LOGIC

Predicate Logic - Deductive Systems

Introduction. Predicates and Quantifiers. Discrete Mathematics Andrei Bulatov

Discrete Structures for Computer Science

THE LOGIC OF QUANTIFIED STATEMENTS

First-Order Logic. Chapter Overview Syntax

Announcements CompSci 102 Discrete Math for Computer Science

Propositional Logic: Syntax

Completeness for FOL

1.1 Language and Logic

AAA615: Formal Methods. Lecture 2 First-Order Logic

EXERCISES BOOKLET. for the Logic Manual. Volker Halbach. Oxford. There are no changes to the exercises from last year s edition

ICS141: Discrete Mathematics for Computer Science I

CS156: The Calculus of Computation Zohar Manna Winter 2010

Notes on Satisfiability-Based Problem Solving. First Order Logic. David Mitchell October 23, 2013

Ling 130 Notes: Predicate Logic and Natural Deduction

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

Predicates, Quantifiers and Nested Quantifiers

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

Chapter 1 Elementary Logic

Notation for Logical Operators:

First Order Logic Semantics (3A) Young W. Lim 9/17/17

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

Class 29 - November 3 Semantics for Predicate Logic

Automated Reasoning Lecture 5: First-Order Logic

Logic Part I: Classical Logic and Its Semantics

Mat 243 Exam 1 Review

1.3 Predicates and Quantifiers

ICS141: Discrete Mathematics for Computer Science I

First-order logic Syntax and semantics

Some Rewriting Systems as a Background of Proving Methods

Mathematical Logic. Reasoning in First Order Logic. Chiara Ghidini. FBK-IRST, Trento, Italy

Transcription:

First Order Logic

In the propositional logic, the most basic elements are atoms. Through atoms we build up formulas. We then use formulas to express various complex ideas. In this simple logic, an atom represents a declarative sentence that can be either true or false. An atom is created as a single unit. Its structure and composition are suppressed. However, there are many ideas that cannot be treated in this simple way.

Example The deduction of statements: Every man is mortal. Since Ade is a man, he is mortal. This reasoning is intuitively correct.

Example (cont.) If we denote P: Every man is mortal, Q: Ade is a man, R: Ade is mortal, then R is not a logical consequence of P and Q within the framework of the propositional logic. This is because the structures of P, Q, and R are not used in the propositional logic.

The first order logic has three more logical notions (called terms, predicates, and quantifiers) than does the propositional logic. Much of everyday and mathematical language can be symbolized by the first order logic.

Just as in the propositional logic, we first have to define atoms in the first-order logic. Example We want to represent x is greater than 3. We first define a predicate GREATER(x,y) to mean x is greater than y. A predicate is a relation. Then the sentence x is greater than 3 is represented by GREATER(x,3).

Example: Similarly, we can represent x loves y by the predicate LOVE(x,y). Then John loves Mary can be represented by LOVE(John, Mary).

We can also use function symbols in the first order logic. Example We can use plus(x,y) to denote x+y and father(x) to mean the father of x. The sentences x+1 is greater than x and John s father laves John can be symbolized as GREATER(plus(x,1),x) LOVE(father(John),John).

Atoms: GREATER(x,3) LOVE(John,Mary) GREATER(plus(x,1),x) LOVE(father(John),John). Predicate symbols: GREATER LOVE.

In general, we are allowed to use the following four types of symbols to construct an atom: i. Individual symbols or constants: These are usually names of objects, such as John, Mary, and 3. ii. Variable symbols: These are customarily lowercase unsubscripted or subscripted letters, x, y, z,... iii. Function symbols: These are customarily lowercase letters f, g, h,... or expressive strings of lowercase letters such as father and plus. iv. Predicate symbols: These are customarily uppercase letters P, Q, R,... or expressive strings of uppercase letters such as GREATER and LOVE.

Any function or predicate symbol takes a specified number of arguments. If a function symbol f takes n arguments, f is called an n-place function symbol. An individual symbol or a constant may be considered a function symbol that takes no argument. If a predicate symbol P takes n arguments, P is called an n-place predicate symbol.

Example father is a one-place function symbol, GREATER and LOVE are two-place predicate symbols. A function is a mapping that maps a list of constants to a constant. Example father is a function that maps a person named John to a person who is John s father.

father(john) represents a person, even though his name is unknown. We call father(john) a term in the first order logic.

Definition. Terms are defined recursively as follows: i. A constant is a term. ii. A variable is a term. iii. If f is an n-place function symbol, and t 1,..., t n are terms, then f(t 1,..., t n ) is a term. iv. All terms are generated by applying the above rules.

Example Since x and 1 are both terms and plus is a twoplace function symbol, plus(x,1) is a term according to the definition. Furthermore, plus(plus(x,1),x) and father(father(john)) are also terms; the former denotes (x+1)+x, and the latter denotes the grandfather of John.

A predicate is a mapping that maps a list of constants to T or F. For example, GREATER is a predicate. GREATER(5,3) is T, but GREATER(1,3) is F.

Definition If P is an n-place predicate symbol, and t 1,..., t n are terms, then P(t 1,..., t n ) is an atom. Once atoms are defined, we can use the same five logical connectives as in the propositional logic to build up formulas. Furthermore, since we have introduced variables, we use two special symbols and to characterize variables. The symbols and are called, respectively, the universal and existential quantifiers.

If x is a variable, then ( x) is read as for all x, for each x or for every x, while ( x) is read as there exists an x for some x or for at least one x Example Symbolize the following statements: (a) Every rational number is a real number. (b) There exists a number that is a prime. (c) For every number x, there exists a number y such that x<y.

Denote x is a prime number by P(x), x is a rational number by Q(x), x is a real number by R(x), and x is less than y by LESS(x,y). Then statements can he denoted, respectively, as (a ) ( x)(q(x) R(x)) (b ) ( x)p(x) (c ) ( x)( y)less(x,y). Each of the expressions (a ), (b ), and (c ) is called a formula.

The scope of a quantifier occurring in a formula - the formula to which the quantifier applies. Example The scope of both the universal the existential quantifiers in the formula ( x)( y)less(x,y) is LESS(x,y). The scope of the universal quantifier in the formula ( x)(q(x) R(x)) is (Q(x) R(x)).

An occurrence of a variable in a formula is bound if and only if the occurrence is within the scope of a quantifier employing the variable, or is the occurrence in that quantifier. An occurrence of a variable in a formula is free if and only if this occurrence of the variable is not bound.

A variable is free in a formula if at least one occurrence of it is free in the formula. A variable is bound in a formula if at least one occurrence of it is bound. Example In the formula ( x)p(x,y), since both the occurrences of x are bound, the variable x is bound. The variable y is free since the only occurrence of it is free.

A variable can be both free and bound in a formula. Example y is both free and bound in the formula ( x)p(x,y) ( y)q(y).

Definition First order logic Well formed formulas, or formulas for short, in the first-order logic are defined recursively as follows: An atom is a formula. (Actually, atom is an abbreviation for an atomic formula.) If F and G are formulas, then ~(F), (F G), (F G), (F G) and (F G) are formulas. If F is a formula and x is a free variable in F, then ( x)f and ( x)f are formulas. Formulas are generated only by a finite number of applications of the three rules given above.

Parentheses may be omitted by the same conventions that hold in the propositional logic. The quantifiers have the least rank. Example ( x)a B stands for ((( x)a) (B)).

Example First order logic Translate the statement Every man is mortal. Ade is a man. Therefore, Ade is mortal. into a formula. Denote x is a man by MAN(x), and x is mortal by MORTAL(x). Then every man is mortal can be represented by ( x)(man(x) MORTAL(x)), Ade is a man by MAN(Ade), and Ade is mortal by MORTAL(Ade).

Example (cont.) First order logic The, whole statement can now be represented by ( x)(man(x) MORTAL(x)) MAN(Ade) MORTAL(Ade).

In the propositional logic, an interpretation is an assignment of truth values to atoms. In the first-order logic, since there are variables involved, we have to do more than that. To define an interpretation for a formula in the firstorder logic, we have to specify: the domain an assignment to constants, function symbols, and predicate symbols occurring in the formula.

For every interpretation of a formula over a domain D, the formula can be evaluated to T or F according to the following rules: If the truth values of formulas G and H are evaluated, then the truth values of the formulas ~G, (G H), (G H), (G H), and (G H) are evaluated by using the rules that hold in the propositional logic. ( x)g is evaluated to T if the truth value of G is evaluated to T for every x in D; otherwise, it is evaluated to F. ( x)g is evaluated to T if the truth value of G is T for at least one x in D; otherwise, it is evaluated to F.

Any formula containing free variables cannot be evaluated. It should be assumed either that formulas do not contain free variables, or that free variables are treated as constants.

Example First order logic Let us consider the formulas ( x)p(x) and ( x)~p(x). Let an interpretation be as follows: Domain: D={1,2}. Assignment for P: P(1)=T, P(2)=F. ( x)p(x) is F in this interpretation because P(x) is not T for both x=1 and x=2. Since ~P(2) is T in this interpretation, ( x)~p(x) is T in this interpretation

Example The formula ( x)( y)p(x,y) The interpretation P(1,1)=T, P(1, 2)=F, P(2,1)=F, P(2,2)=T, If x=1, there is a y, 1, such that P(1,y) is T. If x=2, there is also a y, 2, such that P(2,y) is T. Therefore, in this interpretation, for every x in D, there is a y such that P(x,y) is T. That means that ( x)( y)p(x,y) is T in this interpretation.

The formula First order logic G: ( x)(p(x) Q(f(x),a)). There are one constant a, one one-place function symbol f, one one-place predicate symbol P, and one two-place predicate symbol Q in G.

The interpretation I of G Domain: D={1,2}. Assignment for a: a=1. Assignment for f: f(1)=2, f(2)=1. Assignment for P and Q: P(1)=F, P(2)=T, Q(1,1)=T, Q(1,2)=T, Q(2,l)=F, Q(2,2)=T.

If x=1, then First order logic P(x) Q(f(x),a)=P(1) Q(f(1),a) =P(1) Q(2,1) =F F=T. If x=2, then P(x) Q(f(x),a)=P(2) Q(f(2),a) =P(2) Q(1,1) =T T=T.

Since P(x) Q(f(x),a) is true for all elements x in the domain D, the formula ( x)(p(x) Q(f(x),a)) is true under the interpretation I.

Exercise First order logic Evaluate the truth values of the following formulas under the interpretation given in the previous example. (a) ( x)(p(f(x)) Q(x,f(a)) (b) ( x)(p(x) Q(x,a)) (c) ( x)( y)(p(x) Q(x,y))

Once interpretations are defined, all the concepts, such as validity, inconsistency, and logical consequence, defined in propositional logic can be defined analogously for formulas of the first-order logic.

Definition First order logic A formula G is consistent (satisfiable) if and only if there exists an interpretation I such that G is evaluated to T in I. If a formula G is T in an interpretation I, we say that I is a model of G and I satisfies G.

Definition A formula G is inconsistent (unsatisfiable) if and only if there exists no interpretation that satisfies G. Definition A formula G is valid if and only if every interpretation of G satisfies G. Definition A formula G is a logical consequence of formulas F 1, F 2,..., F n, if and only if for every interpretation I, if F 1 F 2... F n is true in I, G is also true in I.

The relations between validity (incon-sistency) and logical consequence that hold in propositional logic also hold for the first-order logic. In fact, the first-order logic can be considered as an extension of the propositional logic. When a formula in the first-order logic contains no variables and quantifiers, it can be treated just as a formula in the propositional logic.

In the first-order logic, since there are an infinite number of domains, in general, there are an infinite number of inter-pretations of a formula. Therefore, unlike in the propositional logic, it is not possible to verify a valid or an inconsistent formula by evaluating the formula under all the possible inter-pretations.

Exercise The formulas First order logic F 1 : ( x)(p(x) Q(x)) F 2 : P(a) Prove that formula Q(a) is a logical consequence of F 1 and F 2.