st 1 order Predicate Logic FOL Now a

  • Slides: 23
Download presentation
st 1 -order Predicate Logic (FOL) Now a “real logic”; Think and concentrate !

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

Simple arguments, where propositional logic does not suffice n n n All monkeys like

Simple arguments, where propositional logic does not suffice n n n 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. n n n 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 2

Logical form (scheme) of an argument The schemata of the arguments above remind valid

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: 1. Every individual, if it is a Monkey, then it likes Bananas 2. Judy is an individual with the property of being a Monkey 3. 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 3

Formal language of FOL (firstorder predicate logic) Alphabet o Logical symbols n individual variables:

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

Formal language of FOL Grammar o terms: each symbol for a variable x, y,

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

Formal language of FOL Grammar o atomic formulas: n If P is an n-ary

Formal language of FOL Grammar o atomic formulas: n If P is an n-ary predicate symbol and if t 1, …, tn are terms, then P(t 1, …, tn) is an atomic formula o (composed) formulas: n each atomic formula is a formula n if A is a formula, then A is a formula n if A and B are formulas, then (A B), (A B) are formulas n if x is a variable and A a formula, then x A and x A are formulas First-Order Predicate Logic 6

Formal language of FOL 1 st-order o We can quantify only over individual variables

Formal language of FOL 1 st-order o We can quantify only over individual variables o We cannot quantify over properties or functions Example: Leibniz’s definition of identity: n n 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 2 nd-order language, because we quantify over properties First-Order Predicate Logic 7

Example: the language of arithmetic n We need special functional symbols: o 0 -ary

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

Transforming natural language into the language of FOL “all”, “every”, “none”, “nobody”, “any”, .

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

Transforming natural language into the language of FOL o An auxiliary rule: + ,

Transforming natural language into the language of FOL o An auxiliary rule: + , + (almost always) o x [P(x) Q(x)] It is not true that all P’s are Q’s Some P’s are not Q’s o 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 10

Transforming natural language into the language of FOL o The lift is used only

Transforming natural language into the language of FOL o The lift is used only by employees x [L(x) E(x)] o All employees use the lift x [E(x) L(x)] o Mary likes only the winners: o 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 11

Transforming natural language into the language of FOL o Everybody loves somebody sometimes o

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

Free, bound variables o x y P(x, y, t) x Q(y, x) bound, free,

Free, bound variables o x y P(x, y, t) x Q(y, x) bound, 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: o x y P(x, y, t) z Q(u, z) First-Order Predicate Logic 13

Substitution of terms for variables o A x/t arises from A by a correct

Substitution of terms for variables o A x/t arises from A by a correct (i. e. , collisionless) substitution of a term t for the variable x. n There are two rules for a correct substitution: o 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. o 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 14

Substitution, example o A(x): P(x) y Q(x, y), term t = f(y) o After

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

Semantics of FOL !!! P(x) y Q(x, y) – is this formula true? A

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) – is this formula true? YES, it is; and it is always so, in all the circumstances. It is necessarily true. First-Order Predicate Logic 16

Semantics of FOL !!! x P(x, f(x)) we have to specify first, x P(x

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

Semantics of FOL !!! A: x P(x, f(x)) we have to specify B: x

Semantics of FOL !!! A: x P(x, f(x)) we have to specify B: x P(x , f(x)) how to understand these formulas: 1) Let U = N (the set of natural numbers) 2) 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 , …}) 3) Let f denote the function second power x 2, 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 18

Semantics of FOL !!! A: x P(x, f(x)) B: x P(x , f(x)) We

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) = x 2 = 0. Let e(x) = 1, then f(x) = x 2 = 1, Let e(x) = 2, then f(x) = x 2 = 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 19

Semantics of FOL !!! A: x P(x, f(x)) B: x P(x , f(x)) The

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 20

Model of a formula, interpretation A: x P(x, f(x)) B: x P(x , f(x))

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, <, x 2 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}, <, x 2 , N, , x 2 , … 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 21

Model of a formula, interpretation C: x P(x, f(y)) what are the models of

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 1. choose a Universe U = N 2. to the symbol P assign a relation: 3. to the symbol f assign a function: x 2 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 22

Model of a formula, interpretation C: x P(x, f(y)) what are the models of

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, , x 2 is not a model of formula C. A (trivial) model is, e. g. , N, N N, x 2. 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 23