Predicate Logic
Predicate Logic
Lecture 4
Cant draw any conclusions about similarities between P, Q and R. Better to represent these facts as
MAN(peter), MAN(paul) and MAN(john).
Cont
Even more difficult to represent sentences like All men are mortal in propositional logic.
Such sentences really need quantification.
In Predicate Logic, these limitations are removed to great extent. Predicate Logic is logical extension of propositional logic. First Order Predicate Logic is one where the quantification is over simple variables.
Predicate Calculus
It has three more logical notions as compared to propositional calculus.
Terms Predicates Quantifiers (universal or existential quantifiers i.e. for all' and there exists)
Term is
a constant (single individual or concept i.e.,5,john etc.),a variable that stands for different individuals, a function: a mapping that maps n terms to a term i.e., if f is nplace function symbol and t1, , tn are terms, then f(t1, , tn) is a term.
Prof Saroj Kaushik, CSE, IIT Delhi
Cont
Predicate : a relation that maps n terms to a truth value true (T) or false (F).
LOVE (john , mary) LOVE(father(john), john) LOVE is a predicate. father is a function.
Examples
A statement x is greater than y is represented in predicate calculus as GREATER(x, y). It is defined as follows:
GREATER( x, y) = = T , if x > y F , otherwise
The predicate names GREATER takes two terms and map to T or F depending upon the values of their terms
Examples Cont
A statement represented as john loves everyone is
(x) LOVE(john , x) which maps it to true when x gets instantiated to actual values.
The predicate name LOVE takes two terms and map to T or F depending upon the values of their terms.
Prof Saroj Kaushik, CSE, IIT Delhi
Well-formed Formula
Well-formed formula in FOPC is defined recursively as follows:
Atomic formula P(t1, , tn ) is a well-formed formula, where P is a predicate symbol and t1,...,tn are the terms. It is also called atom. If and are well-formed formulae, then ~ () , ( V ), ( ), ( ) and ( ) are well-formed formulae. If is a well-formed formula and x is a free variable in , then (x) and (x) are well-formed formulae. Well-formed formulae are generated by a finite number of applications of above rules.
Example
Example:
Translate the text "Every man is mortal. John is a man. Therefore, John is mortal" into a FOPC formula. Solution:Let MAN(x), MORTAL(x) represent that x is a man and x is mortal respectively.
Every man is mortal : (x) (MAN(x) MORTAL(x)) John is a man : MAN(john) John is mortal : MORTAL(john)
The whole text can be represented by the following formula. (x) ((MAN(x) MORTAL(x)) MAN(john)) MORTAL(john)
Prof Saroj Kaushik, CSE, IIT Delhi
Interpretation
An interpretation of a formula in FOL consists of
a non empty domain D and an assignment of values to each constant, function symbol and predicate symbol occurring in .
Interpretation Cont
The quantifiers (x) and (x) are interpreted as follows:
(x) will be interpreted as for all elements x such that x D (x) as there exist x such that x D.
We use notation I[] to represents that is evaluated under interpretation I over a domain D.
I[] under interpretation I over a domain D cab be evaluated to be true or false.
Interpretation Cont
Let and are formulae and I is an interpretation over any domain D. The following holds true.
I[ ] I[ V ] I[ ] I[~] = = = = I[] I[] I[] V I[] I[] I[] ~ I[]
For any interpretation I and a formula using (x) & ( x), the following results holds true.
I[(x)P(x)] I[(x) P(x)] =T = F, =T = F, iff I[P(x)] = T, x D otherwise iff cD such that I[P(c)] = T otherwise
Example - Interpretation
Let : (x) ( y) P(x, y) be a formula. Evaluate under the following interpretation I.
I
D = {1, 2}; I[P(1, 1)] = F; I[P(1, 2)] = T; I[P(2, 1)] = T; I[P(2, 2)] = F
Example - Cont
Solution: Consider the following cases:
If x = 1, then 2 D such that I[P(1, 2)] = T If x = 2, then 1 D such that I[P(2, 1)] = T
Therefore, I[] = I[(x) ( y) P(x, y)] = T i.e., is true under above interpretation.
Exercise
Consider a formula : (x) (P(x) Q( f(x),c)) and the following interpretation
I D = {1, 2}; c = 1; f (1) = 2, f (2) = 1 I[P(1)] = F, I[P(2)] = T I[Q(1, 1)] = T, I[Q(1, 2)] = T, I[Q(2, 1)] = F, I[Q(2, 2)] = T
Find the truth value of : (x) ( P(x) Q( f(x), c) ) under I - (Ans: true)
Prof Saroj Kaushik, CSE, IIT Delhi
Definitions
A formula is said to be consistent (satisfiable)
if and only if there exists an interpretation I such that I[] = T. Alternatively, we say that I is a model of or I satisfies .
A formula is valid if and only if for every interpretation I, I[] = T. A formula is a logical consequence of a set of formulae {1, 2, ..., n } if and only if
for every interpretation I, if I[1 n ] = T, then I[] = T.
Example
Show that is a logical consequence of and
: : : (x) ( P(x) ~Q(x) ) (x) ( Q(x) R(x) ) (x) ( R(x) ~ P(x) )
Solution: Let I be any interpretation over any domain D. Assume that I models i.e., I[] = T over D.
i.e., I[(x) ( P(x) ~Q(x) )] = and I[(x) ( Q(x) R(x) )] = T T (1) (2)
Cont
From (2), there exist some constant cD such that
I[(Q(c) R(c) )] = i.e., I[Q(c) ] = and I[R(c) ] = T T T F T, T F T (7) (3) (4) (5) (6)
From (4),
I[~ Q(c)] =
From (1),
I[P(c) ~Q(c)] = I[P(c)] I[~Q(c)] =
Cont
From (5) and (8), we get
I[R(c)] I[~ P(c)] I[R(c) ~ P(c)] = = T i.e., T T i.e.,
Hence,
is a logical consequence of and .
Rules Cont
Rule 11: ~ {(x) [x] } ~ [c] for any new constant c not occurring in Rule 12: ( x) [x] [c] for any new constant c Rule 13: ~ {( x) [x] } ~ [t] for any ground term t
Few Definitions
A path in a tableaux is contradictory or closed if some atomic formulae and ~ appear on the same path. If all the paths of a tableau are closed, then it is called a contradictory tableaux. A tableau proof of a formula is a contradictory tableau with root as ~ . Let be any formula. If tableaux with as a root is a contradictory tableaux, then is said to be inconsistent otherwise is said to be consistent. A formula is said to be tableau provable (denoted by |- ) if a tableau constructed with ~ as root is a contradictory tableau.
Prof Saroj Kaushik, CSE, IIT Delhi
Example
Show that the formula (x) (P(x) ~ ( Q(x) P(x)) ) is inconsistent. Solution: We have to show that
tableau for [(x) (P(x) ~ ( Q(x) P(x)))] as a root is a contradictory tableau. Then by definition we can infer that the formula is inconsistent.
Example Cont
{Tableau root} {Apply R10 on 1} {Apply R1 on 2} {Apply R7 on 3} (x) (P(x) ~ ( Q(x) P(x)) (1) P(t) ~ ( Q(t) P(t)) (2) where t is any ground term P(t) ~ ( Q(t) P(t)) (3) Q(t) ~ P(t) Closed {P(t), ~ P(t)}
More Definitions
A set of formulae { 1, 2, .,n } is said to be inconsistent if a tableau with root as ( 1 2 .. n ) is a contradictory tableau. Proof of a formula from the set ={1, 2, .. , n ) is a contradictory tableau with root as ( 1 2 .. n ~ ).
Alternatively, we say that is tableau provable from and denoted by |- .
Exercises
I. Translate the following English sentences into Predicate Logic
Everyone is loyal to someone. All Romans were either loyal to Caesar or hated him. For every number, there is one and only one immediate successor. There is no number for which 0 is immediate successor.
II. Evaluate truth values of the following formulae under the interpretation I (define your own interpretations).
(x) ( P(f (x) ) Q(x, f (c) ) ) (x) ( P(x) Q(x, c) ) (x) ( P(x) Q(x, c) ) (x) (y) ( P(x) Q(x, y) ) (x) (y) ( P(x) Q( f (c), y) )
III. Transform the following formulae into PNF and then into Skolem Standard Form.
(x) ( y) (Q(x, y) P(x)) (x )( (y) P(x, y) ~ ( (z) Q(z) R(x)) ) (x )(y) P(x, y) ( (y) P(x, y) (x )((y) P(x, y) ((z) Q(z) R(x)) ) (x )(P(x) Q(x)) ( (x) P(x) (x)Q(x))