Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Fopl

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 29

First Order Predicate Logic

• Limitation of Propositional Logic


• The facts: –
“Peter is a man” , : P
“Paul is a man” , : Q
“John is a man” : R
we can be symbolize by P, Q and R respectively in
propositional logic, but can’t draw any conclusions about
similarities between P, Q and R.
• Better to represent these facts as
– MAN(Peter), MAN(Paul) and MAN(John).
Contd.
• 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
Contd.
• 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.
• Quantifiers: Variables are used in conjunction with quantifiers.
– There are two types of quantifiers viz..,
“there exist” (∃) and “for all” (∀).
– “every man is mortal” can be represented as
(∀x) (MAN(x) → MORTAL(x)).
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
Contd.
• A statement “john loves everyone” is represented as
– (∀x) LOVE(john , x) which maps it to true when x
gets instantiated to actual values.
• A statement “Every father loves his child” is
represented as – (∀x) LOVE(father(x), x).
– Here father is a function that maps x to his father.
• The predicate name LOVE takes two terms and map
to T or F depending upon the values of their terms.
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
• 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)
First Order Predicate Logic
• First order predicate calculus becomes First Order
Predicate Logic if inference rules are added to it.
• Using inference rules one can derive new formula
using the existing ones.
• Interpretations of Formulae in Predicate Logic
– In propositional logic, an interpretation is simply
an assignment of truth values to the atoms.
– In Predicate Logic, there are variables, so we
have to do more than that.
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 α.
• It is denoted by I and is defined as follows:
– Assign a value to each constant from the domain D.
– Each n-place function f (mapping from Dn to D) is assigned a
value from D such as f(x1, …, xn) = x, where (x1, …, xn) ∈ Dn and x
∈ D.
– Assign a value from a set {T, F} to each n-place predicate P
(mapping from Dn to {T, F}).
Here T represents true value and F represents false value.
Contd.
• 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 can
be evaluated to be true or false.
Contd.
• Let α and β are formulae and I is an interpretation over any domain D.
The following holds true.
– I[α Λ β] = I[α] Λ I[β]
– I[α V β] = I[α] V I[β]
– I[α → β] = I[α] → I[β]
– I[~α] = ~ I[α]
• For any interpretation I and a formula using (∀x) & (∃ x), the following
results holds true.
– I[(∀x)P(x)] = T iff I[P(x)] = T, ∀x ∈ D
= F, otherwise
– I[(∃x) P(x)] = T iff ∃ c∈D such that I[P(c)] = T
= F, 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
Contd.
• 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.
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 said to be inconsistent (unsatisfiable) if and only if


– ∃ no interpretation that satisfies α or there exists no model for α.

• 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.
Inference Rules in Predicate Logic
• Modus Ponen Rule:
Lemma 1:
If α : (∀x) ( P(x) → Q(x) ) and β : P(c) are two formulae,
then Q(c) is a logical consequence of α and β , where c
is a constant.
• Modus Tollen Rule:
Lemma 2:
If α : (∀x) ( P(x) → Q(x) ) and β : ~ Q(c) are two
formulae, then ~ P(c) is a logical consequence of α and
β, where c is a constant.
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) )] = T (1)
– and I[(∃x) ( Q(x) Λ R(x) )] = T (2)
Contd.
• From (2), there exist some constant c∈D such that
– I[(Q(c) Λ R(c) )] = T (3)
– i.e., I[Q(c) ] = T (4)
– and I[R(c) ] = T (5)

• From (4),
– I[~ Q(c)] = F (6)

• From (1),
– I[P(c) → ~Q(c)] = T ,
where c is the same constant
– I[P(c)] → I[~Q(c)] = T (7)

• From (6) and (7), we get


– I[P(c)] = F
– I[~ P(c)] = T (8)
Contd.
• From (5) and (8), we get
– I[R(c)] Λ I[~ P(c)] = T i.e.,
– I[R(c) Λ ~ P(c)] = T
• According to the definition of interpretation, we get
– I[(∃ x)( R(x) Λ ~ P(x))] = T i.e.,
– I[δ] = T
• Hence,
– δ is a logical consequence of α and β.
• This is a direct proof, often difficult.
Semantic Tableaux (Pred Logic)
• There are four more rules handling variables in a
predicate formula in addition to one given for
Propositional logic.
• Let us denote a formula containing a variable x by
α[x].
• Rule 10: (∀ x) α [x]
α [t]
for any ground term t, where t is a term
free from variables.
Contd.
• 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.
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.
Contd.
• {Tableau root}
(∀x) (P(x) Λ ~ ( Q(x) → P(x)) (1)
{Apply R10 on 1} P(t) Λ ~ ( Q(t) → P(t)) (2)
where t is any ground term
{Apply R1 on 2} P(t)
~ ( Q(t) → P(t)) (3)
{Apply R7 on 3} Q(t)
~ P(t)

Closed {P(t), ~ P(t)}


Soundness and completeness
• Theorem:
(Soundness and completeness) :
• A formula α is valid ( |= α ) iff α is tableau provable ( |- α ).
Example:
Show a validity of the following formula using tableaux method.
(∀x) P(x) → (∃x) P(x)
• Solution: If we show that
~ [(∀x) P(x) → (∃x) P(x)] has a contradictory tableau
then α is tableau provable and hence by above
theorem (∀x) P(x) → (∃x) P(x) is valid.
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 ∑ |- α.
• A formula α is a logical consequence of ∑ iff α is
tableau provable from ∑ and is denoted by ∑ |- α.

You might also like