Predicate Logic: Sematics Part 1 CS402, Spring 2018 Shin Yoo
Predicate Calculus Propositional logic is also called sentential logic, i.e. a logical system that deals with whole sentences connected with conjunctive words such as and, or, not, if-then, etc. The minimum unit of ideas is a sentence in propositional logic. What if we want something finer-grained?
Domains and Modifiers What can we reason about a sentence itself which deals with its target domain? Jane is taller than Alice (target domain : human being) For natural numbers x and y, x + y (x + y) (target domain: N) What can we reason about a sentence itself which also deal with modifiers like there exists, all, among, and only? Note that these modifiers enable us to reason about an infinite domain because we do not have to enumerate all elements in the domain.
Predicate Calculus Every student is younger than some instructor. The only way to represent this in propositional logic is to capture the whole sentence as a literal, e.g. p. But there is more to it! This statement is about being a student, being an instructor and being younger than somebody else for a set of people in this room.
Predicate Calculus Every student is younger than some instructor. Let us define predicates: S(Suckzoo) for being a student, I (Shin) for being an instructor, Y (Suckzoo, Shin) for one being younger than the other. Also, it is important that we don t have to repeat writing as many formulas as there are pairs of students and instructors in this room: we want variables (again, this is where we leave the sentential form). In other words, we can rewrite the sentence as: Every student x is younger than some instructor y.
Every student x is younger than some instructor y. Finally, we introduce quantifiers to capture actual elements with variables. In other words, we can rewrite the sentence once again as: For every x, if x is a student, then there exists some y who is an instructor such that x is younger than y. x(s(x) ( y(i (y) Y (x, y))))
Relations and predicates The axioms and theorems of mathematics are defined on arbitrary sets (domain) such as the set of integers Z. For example, Fermat s last theorem: If an integer n is greater than 2, then the equation a n + b n = c n has no solutions in non-zero integers a, b, and c. The predicate calculus extends the propositional calculus with predicate letters that are interpreted as relations on a domain. That is, predicates are interpreted upon domain. Definition 1 (7.3) Let R be an n-ary relation on a domain D, that is, R is a subset of D n. The relation R can be represented by the Boolean-valued function P R : D n {T, F } that maps an n-tuple to T if and only if the n-tuple is an element of the relation.
Predicate Formulas Definition 2 (7.15) Let P, A and V be countable sets of symbols called predicate letters, constants, and variables, respectively: P = {p, q, r}, A = {a, b, c}, V = {x, y, z}. Atomic formula Formula argument ::= x for any x V argument ::= a for any a A argument list ::= argument+ atomic formula ::= p(argument list) for any p P formula ::= atomic formula formula ::= formula formula ::= formula formula // similarly for,... formula ::= x formula formula ::= x formula
Free and bound variables Definition 3 (7.7, 7.11) is the universal quantifier and is read for all. is the existential quantifier and is read there exists. In a quantified formula xa, x is the quantified variable and A is its scope: x does not have to appear in A. Definition 4 (7.12) Let A be a formula. An occurrence of a variable x in A is a free variable of A iff x is not within the scope of a quantified variable x. Notation: A(x 1,..., x n ) indicates that the set of free variables of the formula A is a subset of x 1,..., x n. A variable which is not free is bound. If a formula has no free variable it is closed. If {x 1,..., x n } are all the free variables of A, the universal closure of A is x 1 x n A and the existential closure is x 1 x n A.
Example 1 (7.14) In xp(x) q(x), the occurrence of x in p(x) is bound and the occurrence in q(x) is free. The universal closure is x( xp(x) q(x)). Obviously, it would have been better to write the formula as xp(x) q(y), where y is the free variable. The closure then would be y( xp(x) q(y))
Interpretations Definition 5 (5.10) Let A be a formula where {p 1,..., p m } are all the predicates appearing in A and {a 1,..., a k } are all the constants appearing in A. An interpretation I A for A is a triple: (D, {R 1,..., R m }, {d 1,..., d k }), where: D is a non-empty set called the domain, R i is an n i -ary relation on D that is assigned to the n i -ary predicate p i (notation: p I i = R i ) d i is an element of D that is assigned to the constant a i
Interpretations Example 2 (7.17) Given x(p(a, x)), here are three numerical interpretations: I 1 = (N, { }, {0}), I 2 = (N, { }, {1}), I 3 = (Z, { }, {0}) The formula can also be interpreted over strings: I 4 = (S, {substr}, { }) where S is the set of strings on some alphabet.
Interpretations Definition 6 (7.18) Let I A be an interpretation for formula A. An assignment σ IA : V D is a function which maps every free variable v V to an element d D, the domain of I A. σ I [x i d i ] is an assignment that is the same as σ IA except that x i is mapped to d i. Definition 7 (7.19) Let A be a formula, I A an interpretation, and σ IA an assignment. ν σia (A), the truth value of A, is defined by Let A = p k (c 1,..., c n ) be an atomic formula where each c i is either a free variable x i or a constant a i. ν σia (A) = T iff {d 1,..., d n } R k where R k is the relation assigned by I A to p k and d i is the domain element assigned to c i, either by I A if c i is a constant or by σ IA if c i is a variable.
Definition 7 Cont. ν σ ( A) = T iff ν σ (A) = F ν σ (A 1 A 2 ) iff ν σ (A 1 ) = T or ν σ (A 2 ) = T ν σ ( xa) = T iff ν σ[x d] (A) = T for all d D ν σ ( x(a)) = T iff ν σ[x d] (A) = T for some d D Remember: Interpretation (I A ): maps constants in A to domain. Assignment under interpretation (σ IA ): maps free variables in A to domain.
Interpretations Theorem 1 (7.20) Let A be a closed formula. Then ν σia (A) does not depend on σ IA. Theorem 2 (7.22) Let A = A(x 1,..., x n ) be a non-closed formula with free variables x 1,..., x n, and let I be an interpretation. Then: ν σia (A ) = T for some assignment σ IA iff ν I ( x 1... x n A ) = T ν σia (A ) = T for all assignment σ IA iff ν I ( x 1... x n A ) = T
Interpretations Definition 8 (7.23) Let A be a closed first order formula: A is true in I, or I is a model for A, iff ν I (A) = T. Notation: I A. A is valid if for all interpretations I, I A. Notation: A. A is satisfiable if for some interpretation I, I A. A is unsatisfiable if it is not satisfiable. A is falsifiable if it is not valid. Note: we only need I because A is closed.
Interpretations Example 3 (7.24) = ( xp(x)) p(a) Proof. Suppose that it is not. Then there must be an interpretation I = (D, {R}, {d}) such that ν I ( xp(x)) = T and ν I (p(a)) = F. By Theorem 2, from ν I ( xp(x)) = T it follows that ν σi (p(x)) = T for all assignment σ I, in particular for the assignment σ I that assigns d to x. But p(a) is closed, so ν σ I (p(a)) = ν I (p(a)) = F, which is a contradiction.
Semantics Analysis of Predicate Formulas Example 4 (7.25) x y(p(x, y) p(y, x)): this formula is satisfiable in an interpretation where p is assigned with a symmetric relation such as =. x y(p(x, y)): The formula is satisfiable in an interpretation where p is assigned a relation that is a total function, for example, (x, y) R iff y = x + 1 for x, y Z. The formula would be falsified if the domain is changed to the negative numbers because there is no negative number y such that y = 1 + 1. x y(p(x) p(y)): This formula is satisfiable only in a domain with at least two elements.
Semantics Analysis of Predicate Formulas Example 5 (5.20) x(p(a, x)): This expresses the existence of an element with special properties. For example, if p is interpreted by the relation on the domain N, then the formula is true for a = 0. If we change the domain to Z the formula is false for the same assignment of to p. x(p(x) q(x)) ( x(p(x)) x(q(x))): The formula is valid. We prove the forward direction and leave the converse as an exercise. Let I = (D, {R 1, R 2 }, {}) be an arbitrary interpretation. By Theorem 2, ν σi (p(x) q(x)) = T for all assignments σ I, and by the inductive definition of an interpretation, ν σi (p(x)) = T and ν σi (q(x)) = T for all assignments σ I. Again by Theorem 2, ν I ( x(p(x))) = T and ν I ( x(q(x))) = T, and by the definition of an interpretation ν I ( x(p(x)) x(q(x))) = T.
Exercises Show that does not distribute over disjunction by constructing a falsifying interpretation for x(p(x) q(x)) ( xp(x) xq(x)).