You are on page 1of 8

Propositional logic, MFCS -2010, Mihaiela Lupea

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
-

: {p,, pr,...} - a set of propositional variables


;

Connectives = {-(negation), n (conjunction), v (clisjunction),-+ (implication),<,+ (equivatence))

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

variables and thr

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.

They have the definitions: pI q:= -(p rrq), p I q:=-(pv

q),

p@q

::-(p

The semantics of the connectives is provided by the following truth tables:

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

e q is true whenp and q have the same truth value.

Propositional logic, MFCS -2010, Mihaiela Lupea

Definition L: An interpretation of
i : {pt, p2,...,

a formula Ll(h,p2,...,pn)eFP is a function


; : Fp

p}
=

-->

{F

,T} that can be extended to

-+ {F,T} using the relations:

i(-P)

-i(P) i(p" q)=i(Dv

i(P n q) = i(P) ni(q)

i(q)

i(p -+ q)=i(p) ->i(q)

i(P <+ q) = 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.

The truth table

of a propositional formula U(h,p2,...,p)eFp

corresponds

to

the

evaluation of the formula in all its 2n interpretations.

Definition 2 (semantic concePts) Let u (py, p2,..., p )be a propositional formula.

1. An interpretation i which
i:{p1,...,pn} -+ {2,tr} such

evaluates the formula (J as true is called a model

for

U.

thati(L\:T.
fot

2. An interpretation i which evaluates the formula U as false is called an anti-model


U. i : {p1,..., p n\ -+ {7, F} such that i((D:F
.

3. A formula U is called consistent (sutisfiable) if it has a


1i : {p1,...,

model:

pr\ + {T,F}

such that r((I):T

'

4.

The

formula tl is called volid (tautology) and we use the notation:

l:

U,

evaluated

as true in all

interpretations: Yi :{p1,..., Pn\ + {T,F\,i(U)

if U is =7. All

interpretations of IJ are models for U.

The formuta U is called inconsistent

if

U does not have any model, [/ is evaluated as

false in all interpretations: Vi : {p1,..., pn\ -+ {T,F\, i(U)

F'

6. Theformuta tl is called contingent if tl is consistent,


Remarks:

but is not valid'

o o o

If

the truth table of U contains only "T", then U is a tautology.

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--

Propositional logic, MFCS -2010, Mihaiela Lupea


The logicul consequence notion is

a generalization of the taatologynotion:

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

equivalent, notation: Ll = V , if they have identical truth tables.

Remark:
formulas.

"l:"

and " = " are metasymbols used

to express logical relations between

Example 1: Build the truth tables for the formulas:


U(p,q,r) = (-pv q) n(r v p), V(p,q,r) = (_p nr)v (q r,.r)v W(p,q,r) p
r1

(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

- We remark that only the interpretations


uQt,c1,r), thus these are all the models of

il, 12, i5 and i7 evaluate as true the fbrmula

'

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.

U l= -Pv Q, because in all interpretations (i 1,12,i5,17) which evaluate the formula U as

true, the formula

-p v Q is also evaluated

as true.

Propositional logic, MFCS -2010, Mihaiela Lupea

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

-(UnV)=-(Jv-V --.(U v V) =--(J n-V


Associativity laws:

(u nV) n Z =(l n(V n Z) ({J vV)v Z =U v (V v Z)

o Distribution laws:
LI

r,(V v

Z): (U nV)v (U n Z)

Uv(V

Definition of the connectives

^Z):(UvV)n(LIvZ)
-(U n-V) U +V=V<>QrvV)
LI -+ V =
Lr @V =

U-+V:-[JvV
U -+V =U <> (U nV)

U <+V -(U -+V) n(V -+rJ) U <+V:(UvV)-->(U r,V)

-((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)

-(-U v -V) U ,",V = -(LI -+ -V) -U =U {U


U
=

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.

Dual connectives: ( n.v ) . ( t. J

;.1

*,o

). Dual truth values:

(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:

The set {ur,Uz,...,Un} is called consistent

consistent:

li

if the formula u1 n u2 n ... n IJ,


.

is

Fp -+

{T

,F} such that i(IJ 1n IJ2 n

..

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.

the formula Ur ntJzn..AlJn is

The formulas rJt,IJz,...,Un are called premises, hypotheses, facts, and


conclusion.

V is called

Theorem 1: Let (Jt,(J2,...,U,,U,V bepropositional formulas.

. 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.

S = {Ur ,(J2,...,U,}be a set of

propositional formulas.

ff,sis

a consistent set, then vy, 1<

<n,s -{(J.,} is a consistent set.


^s

2. rf s is a consistent set and v is a valid formula, then 3.

{v} is consistent.

If

,s

is an inconsistent set, then yv

Fr, s v {v}is

inconsistent.

4' If'sis an inconsistent set and uris valid, where

1<

i <n,then.9-{ui } is inconsistent.

t,

Propositional logic, MFCS -2010, Mihaiela Lupea


3. Normal forms in propositional logic

Aim: to transform
Definition 6:

a formula into another equivalent formula having a cerlain character o

"normal" or "canonical" form.

1. A literal

is

propositional variable or its negation (ex: p,-Q,r).

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:

is in disjunctive normal form (DNF),


(nq1-riu) ,

if it is written as a disjunctior

of cubes: v!=,

where

l,

are literals.

p
p

- DNF with one cube

p Y -Q v

- DNF with three cubes

^q

- DNF with one cube

pv

(q n r) v

(-p

^rr A s) -DNF with 3 cubes


if it is written as a conjunctior

6. A formula
of clauses :

is in conjunctive normal form (CNF),


,r','=,

(v'l'-,/u ) , where

l,

are literals.

Ex:

p
p

- CNF with one clause


one clause

pv -Q v r - CNF with

'

^q

- CNF with two clauses

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

a) The clause vir l, is a tautology; b)


The cube n','.1, is inconsistent;

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,

"

Ex: - the clause IJ: pv qv r v -p is a tautology (U =D,

p,-p

are opposite literals

Y:

p Aq Ar

n:p iS an inconsistent formula (V=F)


It

Propositional logic, MFCS _2010, Mihaiela Lupea

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

Dual concepts: clause-cube, DNF_CNF.


Example 2: write the equivalent cNF of A2 (the second axiom of propositional logic). A2:((u + (v ) z)) + ((u +'t/) + ((_/ + z)): (replace _> from inside formulas)
=

((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

-Z)v (U n-V)v -(J v Z -U


v Z) n(U v

___

DNF with 4 cubes


(application of distribution laws)

-V v -(J v Z) n(V v U v _U v Z) n '^'(v v -v v -(J v z) n (-Z v (J v -(J v Z) n (-Z v -v v -Lr v z)

(U v U v

---

cNF with 6 clauses

which are tautologies. Thus, according to the previous theorem, the formula A2 is a tautology .

Propositional logic, MFCS -2010, Mihaiela Lupea

Example 3: Write the equivalent DNF of the formula:

X:-A1:--(U

-+ (t/

+U))

X:--(U +(V

)U)) =-,(-Uv(--VvtJ)): Un'-(-Vvu))=U


X is an inconsistent

nV n'-U
formula and A1 is

We have obtained CNF (with 3 clauses) and DNF (with one cube).

DNF contains an inconsistent cube. thus


tautology.

Example 4: Write the equivalent DNF of the formula:


We apply the normahzatron algorithm:

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

:{p,q,r}->{T,F}, i1(p):T, i1(q):T, i1(r):F


Q
:

Cube: -p
12

{p,q,r} -> { T,F }, i2(p):F, i2(q):T,

l2(r):T

i3

{p,q,r}->{T,F}, i3(p):F, i3(q):T, i3(r):F

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.

We will transform the DNF of X to its CNF, using distribution laws:

^q)v

=(pv -pv r) ^(pv -pv


n(q v -pv r)

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

You might also like