Professional Documents
Culture Documents
Lwt
rii
LI
Propositional logic
1. Syntax
Logical propositions are rnodels of propositional assertions from natural language, whicl can bg "true" or "false" .
Zp =Var _proposwConnectivesu{(,y} - alphabet
- Var _propos
-
The logical connectives are from the natural language, and their priority in the decreasinS order is the one provided above.
Fr: the set of well formed formulas built using the propositional
connectives.(ex: (.p -+ -q) n(r v q <+ p) n s ) 2. Semantics of propositional logic
o o
the aim of the semantics is to give a meaning (to assign a truth value) to propositional formulas.
the semantic domain is the set of truth values: the relatioflst
the
lF (fatse), T (true)|,which
satisSi
-F =7,-T
=F
New connectives J
("nand"), J("nor"),
("xor,)
<,> q)
can be defined.
q),
p@q
::-(p
p
T
q
T
F
-p
F F
P^q
T
a F
pvq
T
T
p-+q
T
peq
I
pIq
tr
pIq
F F
F
p@q
F
T
F F
F
F
T
T
T
F
T T
T
F
T T
Remarks:
- A conjunction is true only when all its components are true. - A disjunction is false only when all its components are false.
- The implication p -) 4 is false only when the hypothesispis true and the conclusion
is false ("true" can't imply "false"). - The equivalence p
Definition L: An interpretation of
i : {pt, p2,...,
p}
=
-->
{F
i(-P)
i(q)
Interpretations assign truth values to propositional variables and using the semantics of
the connectives evaluate formulas assigning to them truth values.
corresponds
to
the
1. An interpretation i which
i:{p1,...,pn} -+ {2,tr} such
for
U.
thati(L\:T.
fot
model:
pr\ + {T,F}
'
4.
The
l:
U,
evaluated
as true in all
if U is =7. All
if
F'
o o o
If
If the truth table of U contains only "F", then U is an inconsistent formula. For a propositional formula, its models conespond to the interpretations (the table
rows) in which the formula is evaluated as true and its anti-models correspond to the
interpretations (the table rows) in which the formula is evaluated as false'
7--
Definition 3: The formula v(h,pz,...,pn)e Fp is a rogicar consequence ofthe formuli U(pt,pz,..,pn)eFp, notation: u l: v, if vi:Fp-+{T,F)such that i(U):T, we havr
i(v):T.
Definition 4: The fomulas U(pt,p2,...,pn)eFp
and,
V(pt,p2,...,pn)eFp
are
logicoltl
Remark:
formulas.
"l:"
(q n
p),
=@l Gp nd)v r gi
r
T
F
Z(p,q,r) = p n((_Qv r)
I q)
a
T T
F
PvQ
T T
F
T
rvp
T
T
U(p,q,r)
T
v(p,q ,r)
T
w(p,q,r)
T
i2 IJ i4 t5
r6
T
T
T
Z(p,q,r) r
tr
T
F
F
T
tr
T
T
tr
F F
F
T
T
F F
T
F
T
T T
T
F
T
F
T
F
i7 i8
T
F
T
T
i i
T
t
F F F F
T
F
T
F
'
u. The formula uis contingent. i1 :{p,q,r}->{T,F} , ilQ):T, il(q):T, il(r):T and i1(U):T il:{p,q,r}-t{T,F} , |SQ):F, i5(q):T, i5(r):T and i5(U):T
- The formula W(p,q,r) is a tautology, all its 8 interpretations are also its models. - The formula Z(p,q,r) is inconsistent, it is evaluated as false in all its g interpretations. - tl : Z, because (J and Vhave identical truth tables.
-p v Q is also evaluated
as true.
Logical equivalences:
Simplification laws: --LJ =[J and u -+U =T (J n-(J = F and (J v -(J =T Tr,U=L/ and FvU=U U +T=T and (J-+F=-(l T ,+u =U and F -+U =T U<+T=U and LJ<>F=-(J IJ@T:-U ANd U@F=U U<+U=T and U@U=F Idempotency laws:
Comutativity laws:
UnV=VnU UvV=VvU
o o
DeMorgan laws:
UnU=U UvU=U
Absorption laws:
U n(UvV)=U U v (U nV)=U
o Distribution laws:
LI
r,(V v
Z): (U nV)v (U n Z)
Uv(V
^Z):(UvV)n(LIvZ)
-(U n-V) U +V=V<>QrvV)
LI -+ V =
Lr @V =
U-+V:-[JvV
U -+V =U <> (U nV)
-((J
-->
V) v
(V -+ U)
(JvV
UvV=-(J-+V _u =t_l t U
LJvV =(U
=-(-U n-V)
(Jvv=(Lttu)t(rIr)
I'nI(tt Itt)
(Jr,V=(UIqI(rtIr.r) (JnV=(UInT(UTtr)
nV
The following sets are minimal sets ofconnectives such that all the other connectives can be expressed using them. +. {t}; 3. {-, 2. l. {- , n}; 8. {@, +}; 7. {@, v}; 6. {O, n}; s.{}};
{-,v};
+};
The principle of duality: For every logical equivalence (J =Zcontaining only tht connectives r,A,V,t,.t,<+,8 there is another local equivalence (J'=V', where LI',V'ar< formulas obtained from Il Vby interchanging the connectives (r.,t), (t,J),(<+,8) anc
the truth values (7, F). We can remark that some of the above laws are pairs of duul logical equivalences.
;.1
*,o
(T,F).
q
Propositional logic, MFCS -2010, Mihaiela Lupea The following definitions show that a set of formulas is considered as the conjunction its elements from the semantic point of view:
of
Definition 5:
consistent:
li
is
Fp -+
{T
..
n Un
The formula V is a togical consequence of the set {Ul,U2,...,Un} of formulas, notation: fJr,fJz,...,Un l: V, if Vi:Fp -+{T,F} such that i(U1n IJzn...nUn):T, we have i(V):T.
- The set {Ul,Uz,".,Un} is called inconsistent if inconsistent: Vi : Fp -+ {7, F}, i(U1 nUz n...n(} ) = p.
):T.
V is called
. l: U if and only tf _t/ is inconsistent. ' u l: v if and onry tf l: U -+ v if and onry if {ry ,--v) is inconsistent. U =V if and only tf l= j <+V U1,U2,...,U ,l: V if and only tf n...n[J, -+ V if and only i/ the set l= Ut ^Uz {(J1,U 2,...,U r, -Z} is inconsistent.
.
Theorem 2: Let
1.
propositional formulas.
ff,sis
{v} is consistent.
If
,s
Fr, s v {v}is
inconsistent.
1<
i <n,then.9-{ui } is inconsistent.
t,
Aim: to transform
Definition 6:
1. A literal
is
2.
A clause is a disjunction of a finite number of literals (ex: p,-pv q,rv qvs). A cube is a conjunction of a finite number of literals (ex q,p A-Q,r ns n p).
3.
4.
The empty clause, denoted by n, is the clause without any literal and it is the onll inconsistent clause.
5. A formula
Ex:
if it is written as a disjunctior
of cubes: v!=,
where
l,
are literals.
p
p
p Y -Q v
^q
pv
(q n r) v
(-p
6. A formula
of clauses :
(v'l'-,/u ) , where
l,
are literals.
Ex:
p
p
pv -Q v r - CNF with
'
^q
v r) n(-p v -r v s) - CNF with 3 clauses ^(q Properfy: Let { 1,12...,1n } be a set of literals. The following sentences are equivalent:
p
c) The set {1t,12...,1,} of literals contains at least one pair of opposite literals
li, j e {1,..,r}
- the cube
such that
l, = --1,
"
p,-p
Y:
p Aq Ar
Theorem 3: Every propositional formula admits an equivalent cNF and an equivalent DNF Norma I iz at ion a lgo r ithm
;
on the initial formula we apply transformations which preserve the logical equivalence: stepl: The formulas of " x -) y " type are replaced by the equivalent Lorm__x v y . The formulas of " X qs y " type are replaced by the equivalent forn
(Jvy)n(-yvX).
Step2:- DeMorgan laws are applied::) the negation will be only in front of propositional variables
- Multiple negations are eliminated by the reduction Step3: The distribution laws are applied.
rule:
____x
:x
Theorem 4: 1' A forrnula in cNF is a tautology if and only if all its clauses are tautologies. 2' A formula in DNF is inconsist*t irand oniy if all its cubes are inconsistent. Remarks
tautology.
- The first part of the above theorem provides a direct method to prove that aformula is
interpretations that evaluate, the cubes as true. - cNF of a propositional formula provides all the anti-models of that formula, finding all the interpretations that evaluate, one by one, the clauses as false.
- DNF of a propositional formula provides all the models of that formula, finding all the
((u -+ (-- It v z)) -+ ((- U v v) -+ (--u v z)): (replace the main connective _> )
Z))v((-U vV)+ (- U v Z))=(replace both -) connectives) = -(--U v --v v Z)v (--(-- u v v)v --(I v z) :(application ofDeMorgan laws)
='-([J
v
+(-It
r',
: :
(U nV
___
(U v U v
---
which are tautologies. Thus, according to the previous theorem, the formula A2 is a tautology .
X:-A1:--(U
-+ (t/
+U))
X:--(U +(V
nV n'-U
formula and A1 is
We have obtained CNF (with 3 clauses) and DNF (with one cube).
X: (.p
^q
-) r) -+ (p -+ r) nq
-+ r)v (p -+ r) nq : -) r) -+ (p+ r)n Q = -(p X:(p ^q ^q : -(-(p r)v (-pvr)n q = (p nq n-r)v (-pv r) xq : ^q)v =(p ^q n-r)v (-p nq)v (r nq) --- DNF with 3 cubes
The models of X are the interpretations that evaluate one by one the cubes of DNF as true.
Cube: p AQ
i1
A-r
Cube: -p
12
l2(r):T
i3
Cube: r n q
i4:{p,q,r}->{T,F}, i4(p):T, i4(q):T, i4(r):T {p,q,r}*>{T,F}, i5(p):F, i5(q):T, i5(r):T We remark that r2:i5. The models of X are the interpretations:i1,i2,i3,i4.
i5
:
,All the other four interpretations evaluate the formula X DNF(X): (p nq n-r) v (-p (r nq):
as false.
^q)v
Q)
n(pv qv r)
^(pv
qy
q)
qv q) n(qv qv r) ^(qv ^(qv -pv Q) ^ y q) n(-rv qv r) n(-r v qv q): n(-r -py r) n(-rv -pv =T nT ^(pv qv r) ^(pv q) n(qy -py r) n(qv -p) n(qv r) nq n nT n (-r v -pv Q) nT n (-r v q):- q We have applied the absorption law: a n(av b): a and a nT = a
+, v