Goal Show how propositional equivalences are established amp introduce the most important such equivalences Copyright Peter Cappello 2 Equivalence Name p T p p ID: 538915
Download Presentation The PPT/PDF document "Propositional Equivalence" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Propositional Equivalence
Goal:
Show
how
propositional equivalences
are established
& introduce
the most
important such
equivalences.Slide2
Copyright © Peter
Cappello
2
Equivalence
Name
p
T
≡ p; p
F
≡ p
Identity
p
T
≡
T
;
p
F
≡
F
Domination
p
p
≡
p
;
p
p
≡
p
Idempotent
(
p)
≡
p
Double negation
p
q
≡
q
p
;
p
q
≡
q
p
CommutativeSlide3
Copyright © Peter
Cappello
3
Equivalence
Name
(p
q)
r
≡
p
(q
r )
(p
q)
r
≡
p
(q
r )
Associative
p
(q
r )
≡
(p
q)
(p
r )
p
(q
r )
≡
(p
q)
(p
r )
Distributive
(p
q)
≡
p
q
(p
q)
≡
p
q
DeMorgan
p
(p
q )
≡ p
p
(p
q )
≡ p
Absorption
p
p
≡
T
p
p
≡
F
NegationSlide4
Copyright © Peter
Cappello
4
Exercise
A
tautology
is a compound proposition that always is true.
Is the following a tautology?
(
(p
q)
(
p
r)
)
(q
r) Slide5
Copyright © Peter
Cappello
5
The Satisfiability Problem
Satisfiability Problem
Given a function of
B
oolean variables, is there an assignment of values to its variables that makes it true?
Is f( p, q, r ) =
( (p
q)
(
p
r) )
(q
r) satisfiable?
Satisfiability is important in CS theory, algorithms, program correctness, AI, hardware design, etc.
Algorithm
Construct the truth table.
If
any
assignment (row) evaluates to true, return true;
Else return false.
If the formula has
n
variables
, how many
rows
does the truth table have?Slide6
An example satisfiability problem
Let
p( row, col, n ) denote the proposition “Box( row, col ) contains number n.”Using such propositions, design a compound proposition that is satisfiable if & only if n appears in some
box, for 1 ≤ n ≤ 4.Copyright © Peter Cappello6
1
3
4
1Slide7
Copyright © Peter
Cappello
7
Problem
Give logical expressions for a 2-bit adder, where
true corresponds to 1
false corresponds to 0
For example, 01 + 11 = 100.
Input
:
Operand 1: a
1
a
0
Operand 2: b
1
b
0
Output
s
2
s
1
s
0
That is, define 3 Boolean functions:
s
0
( a
1
, a
0
,
b
1
, b
0
) = ?
s
1
( a
1
, a
0
,
b
1
, b
0
) = ?
s
2
( a
1
, a
0
,
b
1
, b
0
) = ?Slide8
Copyright © Peter
Cappello
8
Can you define a Boolean function in the C programming language?
boolean[] adder( boolean a1, boolean a0, boolean b1, boolean b0 ) { . . . }
Or, for an
n
-bit adder:
boolean[] adder( boolean[] a, boolean[] b ) { . . . }
For an
n
-bit adder, it may be useful to
compute,
for
0
≤
i
≤
n
, a sum bit,
s
i
and a carry bit,
c
i
.
For the sum bit,
s
i
,
we may use:
s
i
=
a
i
b
i
c
i-1
,
where
c
-1
=
0
and
s
n
= c
n-1
.
The equation above is called a
recurrence equation
.
What is a recurrence equation for the carry bit,
c
i
?Slide9
Copyright ©
Peter
Cappello
9
Unraveling the
for
loop, suggests a diagram:
Each box above has 3 inputs & 2 outputs, and is called a
full adder
.
A harder problem
: Compute these sum & carry bits in
parallel
.
s
n-1
s
0
s
1
s
2
s
n
a
n-1
b
n-1
a
2
b
2
a
1
b
1
a
0
b
0
c
0
0
c
1
c
2
c
n-2
c
n-1Slide10
END
Copyright © Peter Cappello 2011
10