1st-order Predicate Logic (FOL)

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Predicate Logic Colin Campbell. A Formal Language Predicate Logic provides a way to formalize natural language so that ambiguity is removed. Mathematical.
Predicates and Quantifiers
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
Computability and Complexity 8-1 Computability and Complexity Andrei Bulatov Logic Reminder.
Discrete Mathematics Lecture 2 Alexander Bukharovich New York University.
Review Test 5 You need to know: How to symbolize sentences that include quantifiers of overlapping scope Definitions: Quantificational truth, falsity and.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
Formal Logic Mathematical Structures for Computer Science Chapter 1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
CIA2326 Week4: Predicate Logic : introduction Lee McCluskey, room 2/07
1 Propositional calculus versions. 2 3-value (Lukasziewicz) logic Truth values T,F,N(unknown)
1 First order theories. 2 Satisfiability The classic SAT problem: given a propositional formula , is  satisfiable ? Example:  Let x 1,x 2 be propositional.
Predicates and Quantifiers
Relation, function 1 Mathematical logic Lesson 5 Relations, mappings, countable and uncountable sets.
The Foundations: Logic and Proofs
Logical Equivalence & Predicate Logic
Theoretical basis of GUHA Definition 1. A (simplified) observational predicate language L n consists of (i) (unary) predicates P 1,…,P n, and an infinite.
1st-order Predicate Logic (FOL)
LDK R Logics for Data and Knowledge Representation First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
First Order Predicate Logic
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
LDK R Logics for Data and Knowledge Representation First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Semantics of Predicate Calculus For the propositional calculus, an interpretation was simply an assignment of truth values to the proposition letters of.
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.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Lecture 1-3: Quantifiers and Predicates. Variables –A variable is a symbol that stands for an individual in a collection or set. –Example, a variable.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 1 Predicates and Quantifiers 1.4.
Chapter 8 : Fuzzy Logic.
3. The Logic of Quantified Statements Summary
Introduction to Logic for Artificial Intelligence Lecture 2
Advanced Algorithms Analysis and Design
ece 627 intelligent web: ontology and beyond
Chapter 3 The Logic of Quantified Statements
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
Predicate Calculus Discussion #14 Chapter 2, Section 1 1/20.
Discussion #14 Predicate Calculus
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.
The Foundations: Logic and Proofs
CS201: Data Structures and Discrete Mathematics I
CS 1502 Formal Methods in Computer Science
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Lesson 5 Relations, mappings, countable and uncountable sets
Predicate Calculus Discussion #14 Chapter 2, Section 1.
Principles of proof calculi Natural deduction
Lesson 5 Relations, mappings, countable and uncountable sets
MA/CSSE 474 More Math Review Theory of Computation
Computer Security: Art and Science, 2nd Edition
Negations of quantifiers
Logics for Data and Knowledge Representation
Foundations of TIL; method of analysis
Predicates and Quantifiers
Discrete Mathematics Lecture 4 Logic of Quantified Statements
Chapter 1: Propositional and First-Order Logic
The Foundations: Logic and Proofs
CPSC 121: Models of Computation
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Logics for Data and Knowledge Representation
CS201: Data Structures and Discrete Mathematics I
Predicate Calculus. Predicate Calculus Topics Predicates Variables and instantiation Quantifiers Logical expressions Bound and free variables.
Introduction to Computational Linguistics
1st-order Predicate Logic (FOL)
Presentation transcript:

1st-order Predicate Logic (FOL) Now a “real logic”; Think and concentrate ! First-Order Predicate Logic

Simple arguments, where propositional logic does not suffice All monkeys like bananas. Judy is a monkey.  Judy likes bananas. From the viewpoint of Propositional Logic (PL) the above are simple (atomic) sentences: p, q, r, and p, q does not entail r. All students are clever Charles is not clever  Charles is not a student What are the valid schemata of these arguments? First-Order Predicate Logic

Logical form (scheme) of an argument The schemata of the arguments above remind valid schemata of PL: p  q, p |= q (modus ponens) or p  q, q |= p (modus tollens) But, in PL we cannot refine the analyses of simple sentences. Let us reformulate them: Every individual, if it is a Monkey, then it likes Bananas Judy is an individual with the property of being a Monkey  Judy is an individual that likes Bananas x [M(x)  B(x)], M(J) |= B(J), where x is an individual variable, M, B are predicate symbols, J is a functional symbol It is again a schema: For M, B, J we can substitute other properties and individual, respectively. For instance, man for M, mortal for B and Charles for J. M, B, J are here only symbols which stand for properties and individuals First-Order Predicate Logic

Formal language of FOL (first-order predicate logic) Alphabet Logical symbols individual variables: x, y, z, ... Symbols for truth-connectives: , , , ,  Symbols for quantifiers: ,  Special symbols Predicate: Pn, Qn, ... n – arity = number of arguments Functional: fn, gn, hn, ... -- „ -- Auxiliary symbols: (, ), [, ], {, }, ... First-Order Predicate Logic

Formal language of FOL Grammar terms: each symbol for a variable x, y, ... is a term if t1,…,tn (n  0) are terms and if f is an n-ary functional symbol, then the expression f(t1,…,tn) is a term; If n = 0, then we talk about individual constant (denoted a, b, c, …) only expressions due to i. and ii. are terms First-Order Predicate Logic

Formal language of FOL Grammar atomic formulas: If P is an n-ary predicate symbol and if t1,…,tn are terms, then P(t1,…,tn) is an atomic formula (composed) formulas: each atomic formula is a formula if A is a formula, then A is a formula if A and B are formulas, then (A  B), (A  B), (A  B), (A  B) are formulas if x is a variable and A a formula, then x A and x A are formulas First-Order Predicate Logic

Formal language of FOL 1st-order We can quantify only over individual variables We cannot quantify over properties or functions Example: Leibniz’s definition of identity: If two individuals have all the properties identical, then it is one and the same individual P [ P(x) = P(y)]  (x = y) here we need a 2nd-order language, because we quantify over properties First-Order Predicate Logic

Example: the language of arithmetic We need special functional symbols: 0-ary symbol: 0 (the constant zero) – constant is a 0-ary functional symbol unary symbol: s (the successor function) binary symbols: + and  (functions of adding and multiplying) Examples of terms (using infix notation for + and ): 0, s(x), s(s(x)), (x + y)  s(s(0)), etc. Formulas are, e.g.: (= is here a special predicate symbol): s(0) = (0  x) + s(0), x (y = x  z), x [(x = y)  y (x = s(y))] First-Order Predicate Logic

Transforming natural language into the language of FOL “all”, “every”, “none”, “nobody”, “any”, ...   “somebody”, “something”, “some”, “there is”, ...   A sentence often needs to be reformulated (in an equivalent way) No student is retired (For any student it holds that he is not retired): x [S(x)  R(x)] But: Not all students are retired (It is not true that any student is retired): x [S(x)  R(x)]  x [S(x)  R(x)] First-Order Predicate Logic

Transforming natural language into the language of FOL An auxiliary rule:  + ,  +  (almost always) x [P(x)  Q(x)]  x [P(x)  Q(x)] It is not true that all P’s are Q’s  Some P’s are not Q’s x [P(x)  Q(x)]  x [P(x)  Q(x)] It is not true that some P’s are Q’s  No P is a Q de Morgan laws in FOL First-Order Predicate Logic

Transforming natural language into the language of FOL The lift is used only by employees x [L(x)  E(x)] All employees use the lift x [E(x)  L(x)] Mary likes only the winners: Hence, for all individuals it holds that if Mary likes him then he must be a winner: x [L(m, x)  W(x)], “to like” is a binary relation, not a property !!! First-Order Predicate Logic

Transforming natural language into the language of FOL Everybody loves somebody sometimes x y t L(x, y, t) Everybody loves somebody sometimes but Hitler doesn’t like anybody x y t L(x, y, t)  z L’(h, z) Everybody loves nobody – ambiguous Nobody loves anybody – ambiguous; Everybody dislikes anybody: x y L’(x, y)  x y L’(x, y) First-Order Predicate Logic

First-Order Predicate Logic Free, bound variables x y P(x, y, t)  x Q(y, x) bound, free free, bound Formula with clear variables: each variable has only free occurrences, or only bound occurrences; each quantifier “has its own variables”. For instance, the above formula does not have clear variables: x in the second conjunct is another variable than the x in the first conjunct, similarly for y. Clear formula: x y P(x, y, t)  z Q(u, z) First-Order Predicate Logic

Substitution of terms for variables Ax/t  arises from A by a correct (i.e., collisionless) substitution of a term t for the variable x. There are two rules for a correct substitution: We can substitute a term t only for free occurrences of a variable x in a formula A, and we have to substitute for all the free occurrences. No individual variable that occurrs in the term t can become bound in A (in such a case the term t is not substitutable for x in the formula A). First-Order Predicate Logic

First-Order Predicate Logic Substitution, example A(x): P(x)  y Q(x, y), term t = f(y) After executing the substitution A(x/f(y)), we obtain: P(f(y))  y Q(f(y), y). The term f(y) is not substitutable for x in A We’d change the sense of the formula First-Order Predicate Logic

First-Order Predicate Logic Semantics of FOL !!! P(x)  y Q(x, y) – is this formula true? A non-reasonable question; For, we do not know what the symbols P, Q mean, what they stand for. They are only symbols which can stand for any predicate (property). P(x)  P(x) – is this formula true? YES, it is; and it is always so, in all the circumstances. It is necessarily true. First-Order Predicate Logic

First-Order Predicate Logic Semantics of FOL !!! x P(x, f(x)) we have to specify first, x P(x , f(x)) how to understand these formulas: What do they talk about; we have to choose the universe of discourse: any non-empty set U   What does the symbol P denote; it is binary, with two arguments; it has to denote a binary relation R  U  U What does the symbol f denote; it is an unary, one-argument symbol; it has to denote a function F  U  U, denoted F: U  U First-Order Predicate Logic

First-Order Predicate Logic Semantics of FOL !!! A: x P(x, f(x)) we have to specify B: x P(x , f(x)) how to understand these formulas: Let U = N (the set of natural numbers) let P denote the relation < (i.e., the set of pairs, where the first element is strictly less than the second one: {0,1, 0,2, …,1,2, …}) Let f denote the function second power x2, i.e., the set of pairs where the second element is the power of the first one: {0,0, 1,1, 2,4, …,5,25, …} Now we can evaluate the truth values of the formulas A, B First-Order Predicate Logic

First-Order Predicate Logic Semantics of FOL !!! A: x P(x, f(x)) B: x P(x , f(x)) We evaluate “from the inside”: First evaluate the term f(x). Each term denotes an element of the universe. Which one? It depends on the valuation e of the variable x. Let e(x) = 0, then f(x) = x2 = 0. Let e(x) = 1, then f(x) = x2 = 1, Let e(x) = 2, then f(x) = x2 = 4, etc. Now by evaluating P(x , f(x)) we have to obtain a truth value: e(x) = 0, 0 is not < 0 False e(x) = 1, 1 is not < 1 False, e(x) = 2, 2 is < 4 True. First-Order Predicate Logic

First-Order Predicate Logic Semantics of FOL !!! A: x P(x, f(x)) B: x P(x , f(x)) The formula P(x , f(x)) is in the given interpretation True for some valuations of the variable x, and False for other valuations. The meaning of x (x): the formula is true for all (some) valuations of x Formula A: False in our interpretation I: |I A Formula B: True in the interpretation I: |=I B First-Order Predicate Logic

Model of a formula, interpretation A: x P(x, f(x)) B: x P(x , f(x)) We have found an interpretation I in which the formula B is true. The Interpretation structure N, <, x2 satisfies the formula B; it is a model of the formula B. How to adjust the interpretation in order it were a model of the formula A? There are infinitely many possibilities, infinitely many models. For instance: N, <, x+1, {N/{0,1}, <, x2, N, , x2, … All the models of the formula A are also models of the formula B (“what holds for all, it holds also for some”) First-Order Predicate Logic

Model of a formula, interpretation C: x P(x, f(y)) what are the models of this formula (with a free variable y)? Let us again choose a Universe U = N to the symbol P assign a relation:  to the symbol f assign a function: x2 Is the structure IS = N, , power a model of the formula C? In order it were so, the formula C would have to be true in IS for all the valuations of the variable y. Hence the formula P(x, f(y)) would have to be true for all valuations of x and y. But it is not so, for instance, if e(x) = 5, e(y) = 2, then 5 is not  22 First-Order Predicate Logic

Model of a formula, interpretation C: x P(x, f(y)) what are the models of this formula (with a free variable y)? The structure N, , x2 is not a model of formula C. A (trivial) model is, e.g., N, N  N, x2. The whole Cartesian product N  N, i.e. the set of all the pairs of natural numbers, is also a relation over N. Or, the structure N, , F, where F is the function, mapping N  N, such that F associates all the natural numbers with the number 0. First-Order Predicate Logic