Predicate Logic 1
Introduction There are certain arguments that seem to be perfectly logical, yet they cannot be specified by using propositional logic. All cats have tails. Tom is a cat. From these two sentences, one should be able to conclude that Tom has a tail. 2
Introduction Generally, predicates are used to describe certain properties or relationships between individuals or objects. In addition to predicates one uses terms and quantifiers. Mary and Anne are sisters. All cats have tails. Predicate calculus is a generalization of propositional calculus. 3
Syntax: Symbols. constants: a, b, c,... variables: x, y, z,... function symbols: f, g, h,... predicate symbols: p, q, r,... logical connectives:,,, quantifiers: (for all), (there exists) parenthesis and comas 4
Predicates Generally, predicates make statements about individuals. In predicate calculus, each predicate is given a name, which is followed by the list of arguments. The list of arguments is enclosed in parentheses. To express Jane is the mother of Mary, one would choose an identifier, say mother, to express the predicate is mother of and one would write mother(jane, Mary) Note that the order of the arguments is important. The number of elements in the predicate list is called the arity of the predicate. The arity of a predicate is fixed. 5
Predicates A predicate name, followed by an argument list in parentheses, is called an atomic formula. The atomic formulas are statements, and they can be combined by logical connectives. For instance, to express the fact that Jane is the mother of Mary, one can use the atomic formula mother(jane, Mary), and this statement can be part of some compound statement, such as mother(jane, Mary) mother(mary, Jane) 6
Variables Often, one does not want to associate the arguments of an atomic formula with a particular individual. To avoid this, variables are used. cat(x) hastail(x) Syntactically, one can use variables in any place where one is allowed to use constants. The word term is used to refer to anything that can be used in place of an individual. 7
Syntax for terms The set T of all terms is defined as follows: Every constant is a term. Every variable is a term. If f is a function symbol with arity n and s 1, s 2,..., s n are terms, then f(s 1, s 2,..., s n ) is also a term. 8
Well formed formulas Every atomic expression p(s 1,..., s n ) where p is a predicate symbol of arity n and s 1... s n are terms, is a wff. If P and Q are wffs so are P, P Q, P Q, P Q. If P is a wff and x is a variable, x P and x P are wffs. No other expression is a wff. 9
Quantifiers All cats have tails Some people like going to the cinema These statements indicate how frequently certain things are true. In predicate calculus, one uses quantifiers in this context. The universal quantifier indicates that something is true for all individuals. The existential quantifier indicates that a statement is true for some individuals. 10
Universal quantifier Let P be an expression, and let x represent a variable. If we want to indicate that P is true for all possible values of x, we write x P. Here x is called the universal quantifier and P the scope of the quantifier. The variable x is said to be bound by the quantifier. The symbol is pronounced for all Example: Everyone gets a break once in a while x getsbreak(x) 11
Existential quantifier Let P be an expression, and let x represent a variable. If we want to indicate that P is true for at least one value of x, we write x P. This statement is pronounced there exists an x such that P. Here x is called the existential quantifier, and P is called the scope of the existential quantifier. The variable x is said to be bound by the quantifier. Example: Some objects are blue x blue(x) 12
Free variables Any variable that is not bound is said to be free. In the formula, z (p(z) q(x)) y q(y) only the variable x is free. All occurrences of z are bound, and so are all occurrences of the variable y. 13
Precedence rules Same rules as in propositional logic but the quantifiers are given a higher precedence than all the rest of the connectives. Consider the predicates p(x) = x is living and q(x) = x is dead, then x (p(x) q(x)) indicates that everything is either living or dead. x p(x) q(x) indicates that everything is living, or x is dead. 14
Semantic 1. Jane is Paul s mother. 2. Jane is Mary s mother. 3. Any two persons having the same mother are siblings. 4. Paul and Mary are siblings. There are many people named Jane and Paul, and without further information the statement Jane is Paul s mother can refer to many different people. To remove such ambiguities, we introduce the concept of domain (collection of all individuals that affect the logical argument under consideration) 15
Semantic: Interpretation An interpretation t is a mapping that to each constant a and each variable x assigns a value t(a), t(x) D (The set D is called the domain of the interpretation) to each function symbol of arity n, assigns a function f t : D n D to each predicate symbol of arity n, assigns a function p t : D n {T, F } 16
Interpretation The interpretation of a formula is defined inductively by: t(f(s 1,..., s n )) = f t (t(s 1 ),..., t(s n )) for the term f(s 1,..., s n ). t(p(s 1,..., s n )) = p t (t(s 1 ),..., t(s n )) for all atomic formula p(s 1,..., s n ). For all formula P, Q t(p Q) = t(p ) t(q) t(p Q) = t(p ) t(q) t( )P = t(p ) t(p Q) = t(p ) t(q) 17
Interpretation For all formula P t( x P ) = T if t x=d (P ) = T for all d D (otherwise is F ) t( x P ) = T if t x=d (P ) = T for a particular d D (otherwise is F ) A formula P is valid is t(p ) = T for all interpretation t. 18
Gödel s Theorems Gödel s completeness theorem There exists a sound and complete proof system for predicate logic. Gödel s incompleteness theorem For number theory (N, >, +,, 0, 1) is not possible to find a sound proof system that is complete. 19
Examples Domain= {animals} How can we express All dog are mammals? One rephrases the statement as If x is a dog, then x is a mammal. x (dog(x) mammal(x)) Generally, the sentence x (P (x) Q(x)) can be translated as All individuals with property P also have property Q 20
Examples How can we express Some dogs are brown? This statement means that there are some animals that are dogs and that are brown. The statement x is a dog and x is brown can be translated as dog(x) brown(x) There are some brown dogs can now be translated as x (dog(x) brown(x)) In general, the statement x (P (x) Q(x)) can be interpreted as Some individuals with property P also have property Q. 21
Examples Only dogs bark To convert this into predicate calculus, this must be reworded as It barks only if it is a dog or, equivalently, If it barks, then it is a dog. One has therefore x (barks(x) dog(x)) 22