Documente Academic
Documente Profesional
Documente Cultură
Predicate vs Propositional
Logic Propositional Logic Revised
Predicate logic uses the same connectives Propositional Logic is a formal approach to
as propositional logic but allows you to reasoning with or about declarative
refer to different elements of the sentences.
universe.
It also introduces quantifiers…so you can If David likes Mary then Mary likes David
say things like.. David likes Mary
It always rains in England. Mary likes David
Sometimes it is sunny in Bristol.
1
Semantics vs Proof Theory Truth-Tables
The truth value of compound sentences can then be
There are two approaches to reasoning in
2
Predicate Logic: Introducing
Decidability Quantifiers
A formal logic is decidable if there is a mechanical Predicate logic allows for quantified statements by
(algorithmic) way of determining whether A follows introducing the quantifiers ∀ “for all” and ∃ “there
from T. exists”.
T|=A ? Why do we need quantifiers ? Consider
Propositional logic is
decidable: at worst we All birds have wings
need only consider Tweety is a bird
every row of the truth- Therefore, Tweety has wings
yes
table for which T is Propositional logic: All birds have wings= (Robins have
true, and there are only wings)∧(Crows have wings)∧(Eagles have wings)
finitely many. ∧..........etc.
No This is impractical.
Quantifiers 2: Functions
In predicate logic this translates to It is also desirable to be able to represent functional
relationships in predicate logic. Consider
∀x(B(x ) → W (x ))
• Unlike propositional logic,
predicate logic has variables- in
this case x.
Blue eyed people have blue eyed fathers
B(Tweety ) • It also has constants – in this Some people have blue eyes
case Tweety Therefore, some people’s fathers have blue eyes
∴W (Tweety ) • Tweety is an instantiation of
the predicates B and W. Translates to x is a variable ranging across all people
3
Syntax: Building Blocks for
Predicate Logic Syntax (2)
(2) Functions: FNL is a set of n-ary
Formula in predicate are built up from the functions.
following elements
F(x)=Father of x, D(x,y,z)=Day of the
(1) Predicates: PL is a set of n-ary weeks falling on the date x/y/z.
predicates. e.g. (3) Constants: CL is a set of constants
B(x)=x is a bird –unary e.g. Tweety, numbers, Aunty Ethel
M(x,y)=x is married to y –binary (4) Variables: a set of variables, x,y,z etc
BT(x,y,z)=y is between x and z –tertiary (5) Connectives, Quantifiers and
Brackets: ∀,∃,¬,∧,∨, (,),[,]
4
Translating from Logic to
Formula 2 English
Well-Formed Formula: The set of well-formed Example: PL ={married, younger-than, equal} all binary
VL={x,y,z} ranging over all parents
formula WFL is defined recursively as follows: CL={bill, john, george, mary}
FNL={father, mother, first-child} -all unary
(i) all atomic formula are well-formed formula Connectives ∧,∨,¬,→,↔
(ii) If F and G are well-formed formula so are (¬F), Quantifiers ∀,∃, Brackets
(F∧G), (F∨G), (F→G), (F↔G)
married(mary,john) translates to ”Mary is married to John”
(iii) If F is a well-formed formula and x∈VL then equal(father(bill),george) translates to ”George is the father of Bill”
(∀xF) and (∃xF) are well-formed formula. equal(mother(mother(bill)),mary) translates to ”Mary is the maternal
grandmother of Bill”
E.g. Rich(x)∧Happy(x), Rich(x)→Happy(y), (equal(mother(x),y)∨equal(father(x),y)) translates to ”y is a parent of x”
∀x∀y(married(x,y)→ married(y,x)) translates to ”for any parents x and y
Rich(bill)∨Happy(father(fred)),
if x is married to y then y is married to x”
(∀x¬ Happy(x))∧ ∃yRich(y)), ∀x(Rich(x) →Happy(x)) ∀x∃y(equal(mother(x),y) translates to ”everyone has a mother”
5
Whoops-Missed a bit Declarative Formula
Some formula have a truth-value while others don’t.
Its only me!
So the correct translation is ∀x∃y(equal(mother(x),y) has a truth-value
∃xKF(x)∧ So does ∀x(Rich(x)→Happy(x))
∀x(KF(x)→∀y(KF(y)→equals(x,y)))∧
∀x(KF(x)→B(x)) But neither Rich(x) nor married(x,y)→ married(y,x)
have truth values.
Still false though! In predicate logic declarative formula are closed.
Non-declarative form are open.
6
Interpretations Interpretations:2
Really a language of predicate logic is only a set of U1 U2
symbols which can be interpreted in different ways. Formal Logic
Consider the formula: ∃y∀xP(x,y) I
PL={P,Q,R,..}
J PLJ={PJ,QJ,RJ,..}
PLI={PI,QI,RI,..} FLJ={fJ,gJ,hJ,..}
Quantification over natural numbers, P(x,y) means FLI={fI,gI,hI,..} FL={f,g,h,..}
CLJ={aJ,bJ,cJ,..}
CL={a,b,c,..}
x≥y then interpretation is `for all natural numbers x CLI={aI,bI,cI,..}
there is some natural y for which x≥y’
Quantification over people, P(x,y) means `y is the
father of x’ then interpretation is `there is some who
is the father of everyone’
7
Satisfiability: 2 Example
Consider the following theories:
The theory consisting of the single
Example: 2 Example: 3
Under I Under J
T1 means T1 means
If for every integer x there is some integer y such that x>y If for every integer x there is some integer y such that x≠y
then 0>0+1 then 0 ≠ 0-1
Clearly this is false since the antecedent is true and the Clearly this is true since both the antecedent and
consequence is false - I is not a model of T1 consequence are true - J is a model of T1
T2 means T2 means
If for every integer x x>x+1 then there exists an integer y If for every integer x, x ≠x-1 then there exists an integer y
such that 0>y such that 0≠y
This is true since the antecedent is false - I is a model of T2 This is true since, again, both antecedent and consequence
are true - J is a model of T2
8
Example: 4 Example: 5
We see that T1 is not a valid theory since I Two possibilities
is not a model of T1. Antecedent false -in this case the
Both I and J are models of T2. Is T2 valid? conditional is automatically true.
Let K be any interpretation of L then T2 Antecedent true -in this case since cK∈U
means we have PK (cK, fK(cK)) and hence the
If for every element x∈U PK (x, fK(x)) then consequence of the conditional must
there exists some element y∈U such that also be true since we can select y to be
PK(cK, y ). fK(cK).
models of F models of ¬F T ≠F
Algorithm terminate Algorithm may or
models of T T ≠¬F
and answers “yes” may not terminate
and answers “no”