First Order Syntax
Total Page:16
File Type:pdf, Size:1020Kb
first-order logic: ingredients There is a domain of interpretation, and I variables: x; y; z;::: ranging over the domain I constant symbols (names): 0 1 π e Albert Einstein I function symbols: + ∗ − = sin(−) exp(−) I predicates: = > 6 male(−) parent(−; −) I propositional connectives: ^ _ q −! ! O "# I quantifiers: 8 9. Tibor Beke first order syntax False. sentences Let the domain of interpretation be the set of real numbers. 8a 8b 8c 9x(ax2 + bx + c = 0) This formula is an example of a sentence from first-order logic. It has no free variables: every one of the variables a, b, c, x is in the scope of a quantifier. A sentence has a well-defined truth value that can be discovered (at least, in principle). The sentence above (interpreted over the real numbers) is Tibor Beke first order syntax sentences Let the domain of interpretation be the set of real numbers. 8a 8b 8c 9x(ax2 + bx + c = 0) This formula is an example of a sentence from first-order logic. It has no free variables: every one of the variables a, b, c, x is in the scope of a quantifier. A sentence has a well-defined truth value that can be discovered (at least, in principle). The sentence above (interpreted over the real numbers) is False. Tibor Beke first order syntax \Every woman has two children " but is, in fact, logically equivalent to every woman having at least one child. That child could play the role of both y and z. sentences Let the domain of discourse be a set of people, let F (x) mean \x is female" and let P(x; y) mean \x is a parent of y". 8x F (x) −! 9y9zP(x; y) ^ P(x; z) This sentence seems to be saying Tibor Beke first order syntax sentences Let the domain of discourse be a set of people, let F (x) mean \x is female" and let P(x; y) mean \x is a parent of y". 8x F (x) −! 9y9zP(x; y) ^ P(x; z) This sentence seems to be saying \Every woman has two children " but is, in fact, logically equivalent to every woman having at least one child. That child could play the role of both y and z. Tibor Beke first order syntax Suppose the domain of discourse is the natural numbers 0; 1; 2; 3;::: . What is the meaning of the following formula? 8p8q pq = n −! (p = 1 O q = 1) \n is a prime number" open formulas A first-order formula that contains free variables is said to be open. You cannot associate a truth value to it unless the free variables are specialized to some element of the domain: 8x f (x) 6 f (x0) An open formula can be thought of as defining a property (\predicate") of its free variable(s). Tibor Beke first order syntax \n is a prime number" open formulas A first-order formula that contains free variables is said to be open. You cannot associate a truth value to it unless the free variables are specialized to some element of the domain: 8x f (x) 6 f (x0) An open formula can be thought of as defining a property (\predicate") of its free variable(s). Suppose the domain of discourse is the natural numbers 0; 1; 2; 3;::: . What is the meaning of the following formula? 8p8q pq = n −! (p = 1 O q = 1) Tibor Beke first order syntax open formulas A first-order formula that contains free variables is said to be open. You cannot associate a truth value to it unless the free variables are specialized to some element of the domain: 8x f (x) 6 f (x0) An open formula can be thought of as defining a property (\predicate") of its free variable(s). Suppose the domain of discourse is the natural numbers 0; 1; 2; 3;::: . What is the meaning of the following formula? 8p8q pq = n −! (p = 1 O q = 1) \n is a prime number" Tibor Beke first order syntax \ x is a grandparent of y " 9w9z9uP(w; z) ^ P(z; x) ^ P(w; u) ^ P(u; y) \ x and y are cousins (or siblings, or the same people!) " open formulas F (x): x is female M(x): x is male P(x; y): x is a parent of y 9zP(x; z) ^ P(z; y) Tibor Beke first order syntax 9w9z9uP(w; z) ^ P(z; x) ^ P(w; u) ^ P(u; y) \ x and y are cousins (or siblings, or the same people!) " open formulas F (x): x is female M(x): x is male P(x; y): x is a parent of y 9zP(x; z) ^ P(z; y) \ x is a grandparent of y " Tibor Beke first order syntax \ x and y are cousins (or siblings, or the same people!) " open formulas F (x): x is female M(x): x is male P(x; y): x is a parent of y 9zP(x; z) ^ P(z; y) \ x is a grandparent of y " 9w9z9uP(w; z) ^ P(z; x) ^ P(w; u) ^ P(u; y) Tibor Beke first order syntax open formulas F (x): x is female M(x): x is male P(x; y): x is a parent of y 9zP(x; z) ^ P(z; y) \ x is a grandparent of y " 9w9z9uP(w; z) ^ P(z; x) ^ P(w; u) ^ P(u; y) \ x and y are cousins (or siblings, or the same people!) " Tibor Beke first order syntax first-order logic: syntax We will define the notion of well-formed formula. The definition will be \step-by-step" (inductive). • A term is a composite of function symbols, variables and constants. Terms denote elements of the domain | specific or unspecified elements. Examples of terms x π Pope Francis 23 · 24 sin2(kx) + 23 a · x2 + b · x + c Tibor Beke first order syntax first-order logic: atomic formulas • Suppose t1; t2;:::; tn are terms, and R(−; −;:::; −) is an n-ary relation symbol. The expression R(t1; t2;:::; tn) is called an atomic formula. Atomic formulas contain neither propositional connectives nor quantifiers. They are the simplest types of expressions that can be evaluated to True or False | if their free variables are specialized to some element of the domain, that is. They are the same, essentially, as the \atomic propositions" of propositional logic. Tibor Beke first order syntax examples of atomic formulas π > e x = y friends(Big Bird; Cookie Monster) spouse(Pope Francis; x) collinear(p; q; r) x2 + 1 > sin(z) + 23 Tibor Beke first order syntax first-order logic: well-formed formulas We will define well-formed formulas the following way: I Any atomic formula is well-formed. I If α and β are well-formed and ? is any binary propositional connective, then (α ? β) is well-formed. (`?' could be any of ^ _ −! O ! " # .) I If α is well-formed, so is qα. I If α is well-formed and x is any variable then the expressions 8xα 9xα are both well-formed. Tibor Beke first order syntax not well-formed (if we're sticklers!) wff not wff not wff wff wff wff (strange but true!) which of the following is a well-formed formula? P(x) ^ Q(y) ^ R(z) 9x P(x; y) ^ Q(x) _ R(y) 9x ^ 9y P(x)OQ(y) q q8x9yR(x) q 8xQ(x; y) −!q9yqqQ(z; z) q 8yq 9x P(z) ! 9xQ(x) q 8zq 8z9zQ(x; y) Tibor Beke first order syntax wff not wff not wff wff wff wff (strange but true!) which of the following is a well-formed formula? P(x) ^ Q(y) ^ R(z) not well-formed (if we're sticklers!) 9x P(x; y) ^ Q(x) _ R(y) 9x ^ 9y P(x)OQ(y) q q8x9yR(x) q 8xQ(x; y) −!q9yqqQ(z; z) q 8yq 9x P(z) ! 9xQ(x) q 8zq 8z9zQ(x; y) Tibor Beke first order syntax not wff not wff wff wff wff (strange but true!) which of the following is a well-formed formula? P(x) ^ Q(y) ^ R(z) not well-formed (if we're sticklers!) 9x P(x; y) ^ Q(x) _ R(y) wff 9x ^ 9y P(x)OQ(y) q q8x9yR(x) q 8xQ(x; y) −!q9yqqQ(z; z) q 8yq 9x P(z) ! 9xQ(x) q 8zq 8z9zQ(x; y) Tibor Beke first order syntax not wff wff wff wff (strange but true!) which of the following is a well-formed formula? P(x) ^ Q(y) ^ R(z) not well-formed (if we're sticklers!) 9x P(x; y) ^ Q(x) _ R(y) wff 9x ^ 9y P(x)OQ(y) not wff q q8x9yR(x) q 8xQ(x; y) −!q9yqqQ(z; z) q 8yq 9x P(z) ! 9xQ(x) q 8zq 8z9zQ(x; y) Tibor Beke first order syntax wff wff wff (strange but true!) which of the following is a well-formed formula? P(x) ^ Q(y) ^ R(z) not well-formed (if we're sticklers!) 9x P(x; y) ^ Q(x) _ R(y) wff 9x ^ 9y P(x)OQ(y) not wff q q8x9yR(x) not wff q 8xQ(x; y) −!q9yqqQ(z; z) q 8yq 9x P(z) ! 9xQ(x) q 8zq 8z9zQ(x; y) Tibor Beke first order syntax wff wff (strange but true!) which of the following is a well-formed formula? P(x) ^ Q(y) ^ R(z) not well-formed (if we're sticklers!) 9x P(x; y) ^ Q(x) _ R(y) wff 9x ^ 9y P(x)OQ(y) not wff q q8x9yR(x) not wff q 8xQ(x; y) −!q9yqqQ(z; z) wff q 8yq 9x P(z) ! 9xQ(x) q 8zq 8z9zQ(x; y) Tibor Beke first order syntax wff (strange but true!) which of the following is a well-formed formula? P(x) ^ Q(y) ^ R(z) not well-formed (if we're sticklers!) 9x P(x; y) ^ Q(x) _ R(y) wff 9x ^ 9y P(x)OQ(y) not wff q q8x9yR(x) not wff q 8xQ(x; y) −!q9yqqQ(z; z) wff q 8yq 9x P(z) ! 9xQ(x) wff q 8zq 8z9zQ(x; y) Tibor Beke first order syntax which of the following is a well-formed formula? P(x) ^ Q(y) ^ R(z) not well-formed (if we're sticklers!) 9x P(x; y) ^ Q(x) _ R(y) wff 9x ^ 9y P(x)OQ(y) not wff q q8x9yR(x) not wff q 8xQ(x; y) −!q9yqqQ(z; z) wff q 8yq 9x P(z) ! 9xQ(x) wff q 8zq 8z9zQ(x; y) wff (strange but true!) Tibor Beke first order syntax unique parsing If α is a wff but not atomic then it must arise from smaller wff (\subformulas") using one of the three rules of formation: (1) If α and β are well-formed and ? is any propositional connective, then (α ? β) is well-formed.