cse 311 lecture 03: equivalence and proofs€¦ · logical proofs a method for establishing...
TRANSCRIPT
![Page 1: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/1.jpg)
CSE 311 Lecture 03:Equivalence and ProofsEmina Torlak and Kevin Zatloukal
1
![Page 2: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/2.jpg)
TopicsEquivalence and circuits
A brief review of .Checking equivalence
Applications and a basic brute-force algorithm.Logical proofs
A method for establishing equivalence that extends to richer logics.
Lecture 02
2
![Page 3: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/3.jpg)
Equivalence and circuitsA brief review of .Lecture 02
3
![Page 4: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/4.jpg)
Logical equivalence is an assertion that two propositions and have the same
truth values in all possible cases.
and have the same meaning.
A ≡ B A B
A ≡ B (A ↔ B) ≡ # $%&$'(')*
p ∧ q ≡ q ∧ pp q p ∧ q q ∧ p p ∧ q ↔ q ∧ p, , , , #, # , , ## , , , ## # # # #
p ∧ q ≢ q ∨ p
When and , is false but is true!
p = # q = , p ∧ qp ∨ q
4
![Page 5: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/5.jpg)
Important equivalencesDeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
We will always give you this list!
5
![Page 6: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/6.jpg)
Digital circuitsDigital circuits implement propositional logic:
corresponds to 1 or high voltage. corresponds to 0 or low voltage.
Digital gates are functions that
take values 0/1 as inputs and produce 0/1 as output;correspond to logical connectives (many of them).
#,
6
![Page 7: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/7.jpg)
AND, OR, and NOT gates
ANDpq out 0 0 0
0 1 0
1 0 0
1 1 1
ORpq out 0 0 0
0 1 1
1 0 1
1 1 1
NOTp out 0 1
1 0
p q '&$ p q p ∧ q, , ,, # ,# , ,# # #
p q '&$ p q p ∨ q, , ,, # ## , ## # #
p '&$ p ¬p, ## ,
7
![Page 8: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/8.jpg)
Combinational logic circuits: wiring up gates
NOTq
ORrs
AND
AND outNOTp
Values get sent along wires connecting gates.
¬p ∧ (¬q ∧ (r ∨ s))
8
![Page 9: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/9.jpg)
Combinational logic circuits: wiring up gates
ANDp
ANDr
NOTq OR out
Wires can send one value to multiple gates.
(p ∧ ¬q) ∨ (¬q ∧ r)
9
![Page 10: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/10.jpg)
Other useful gates
NAND gate
0 0 1
0 1 1
1 0 1
1 1 0
NOR gate
0 0 1
0 1 0
1 0 0
1 1 0
XOR gate
0 0 0
0 1 1
1 0 1
1 1 0
XNOR gate
0 0 1
0 1 0
1 0 0
1 1 1
¬(p ∧ q)
p q '&$
¬(p ∨ q)
p q '&$
p ⊕ q
p q '&$
p ↔ q
p q '&$
10
![Page 11: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/11.jpg)
Checking equivalenceApplications and a basic brute-force algorithm.
11
![Page 12: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/12.jpg)
Why do we care about checking equivalence?
Many practical problems are solved by logical equivalence checking!Hardware verification, program verification, query optimization andcaching, compiler optimization, …
12
![Page 13: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/13.jpg)
Why do we care about checking equivalence?
Many practical problems are solved by logical equivalence checking!Hardware verification, program verification, query optimization andcaching, compiler optimization, …
Example: verifying compiler optimizationsGiven a sequence of instructions and an optimized sequence , we canconstruct logical formulas and that encode their meaning. To verifythat behaves exactly like , we check that .
S Ps p
P S p ↔ s ≡ #
12
![Page 14: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/14.jpg)
Why do we care about checking equivalence?
Many practical problems are solved by logical equivalence checking!Hardware verification, program verification, query optimization andcaching, compiler optimization, …
Example: verifying compiler optimizationsGiven a sequence of instructions and an optimized sequence , we canconstruct logical formulas and that encode their meaning. To verifythat behaves exactly like , we check that .
Demo: verifying compiler with Is correct?
S Ps p
P S p ↔ s ≡ #peephole optimizations Alive
this optimization
; Original program (S)%a = xor %y, %x ; a = y ^ x%b = and %y, %x ; b = x & x%c = ashr %b, 1 ; c = b >> 1%d = add %c, %a ; d = c + a =>; Optimized program (P)%d = add %x, %y ; d = x + y
12
![Page 15: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/15.jpg)
Why do we care about checking equivalence?
Many practical problems are solved by logical equivalence checking!Hardware verification, program verification, query optimization andcaching, compiler optimization, …
Example: verifying compiler optimizationsGiven a sequence of instructions and an optimized sequence , we canconstruct logical formulas and that encode their meaning. To verifythat behaves exactly like , we check that .
Demo: verifying compiler with Is correct?
S Ps p
P S p ↔ s ≡ #peephole optimizations Alive
this optimization
; Original program (S)%a = xor %y, %x ; a = y ^ x%b = and %y, %x ; b = x & x%c = ashr %b, 1 ; c = b >> 1%d = add %c, %a ; d = c + a =>; Optimized program (P)%d = add %x, %y ; d = x + y
No! The right shi! (ashr)should be replaced with a le!shi! (shl).
12
![Page 16: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/16.jpg)
Checking logical (and circuit) equivalence
Can we write an algorithm to decide if two propositions are equivalent?
What is the run time of the algorithm?
In theory, the news are bad …
But in practice, the news are pretty good …
13
![Page 17: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/17.jpg)
Checking logical (and circuit) equivalence
Can we write an algorithm to decide if two propositions are equivalent?Yes! Generate the truth tables for both propositions and check if they arethe same for every entry.
What is the run time of the algorithm?
In theory, the news are bad …
But in practice, the news are pretty good …
13
![Page 18: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/18.jpg)
Checking logical (and circuit) equivalence
Can we write an algorithm to decide if two propositions are equivalent?Yes! Generate the truth tables for both propositions and check if they arethe same for every entry.
What is the run time of the algorithm?Every propositional variable has two possibilities ( , ). If there are variables, there are rows in the truth table. So the running time isexponential in the number of variables.
In theory, the news are bad …
But in practice, the news are pretty good …
# , n2n
13
![Page 19: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/19.jpg)
Checking logical (and circuit) equivalence
Can we write an algorithm to decide if two propositions are equivalent?Yes! Generate the truth tables for both propositions and check if they arethe same for every entry.
What is the run time of the algorithm?Every propositional variable has two possibilities ( , ). If there are variables, there are rows in the truth table. So the running time isexponential in the number of variables.
In theory, the news are bad …We know of no algorithm that performs better in general. If you foundone, or proved that it doesn’t exist, you’d solve incomputer science and .
But in practice, the news are pretty good …
# , n2n
a famous open problemwin $1 million
13
![Page 20: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/20.jpg)
Checking logical (and circuit) equivalence
Can we write an algorithm to decide if two propositions are equivalent?Yes! Generate the truth tables for both propositions and check if they arethe same for every entry.
What is the run time of the algorithm?Every propositional variable has two possibilities ( , ). If there are variables, there are rows in the truth table. So the running time isexponential in the number of variables.
In theory, the news are bad …We know of no algorithm that performs better in general. If you foundone, or proved that it doesn’t exist, you’d solve incomputer science and .
But in practice, the news are pretty good …Provers like can solve equivalence checking problems with millions ofvariables and formulas. And that’s enough for many real applications!
# , n2n
a famous open problemwin $1 million
Z3
13
![Page 21: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/21.jpg)
Logical proofsA method for establishing equivalence that extends to richer logics.
14
![Page 22: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/22.jpg)
Proof: use known equivalences to derive new ones
To show that is equivalent to Apply a series of logical equivalences tosubexpressions to convert to .
A B
A B
To show that is a tautologyApply a series of logical equivalences tosubexpressions to convert to .
A
A #
15
![Page 23: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/23.jpg)
Example: show that is equivalent to Let be , and let be .
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
A BA p ∨ (p ∧ p) B p
p ∨ (p ∧ p) ≡≡ p
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
16
![Page 24: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/24.jpg)
Example: show that is equivalent to Let be , and let be .
Idempotence
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
A BA p ∨ (p ∧ p) B p
p ∨ (p ∧ p) ≡ p ∨ p≡ p
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
16
![Page 25: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/25.jpg)
Example: show that is equivalent to Let be , and let be .
IdempotenceIdempotence
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
A BA p ∨ (p ∧ p) B p
p ∨ (p ∧ p) ≡ p ∨ p≡ p
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
16
![Page 26: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/26.jpg)
Example: show that is a tautologyLet be .
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
AA ¬p ∨ (p ∨ p)
¬p ∨ (p ∨ p) ≡≡≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
17
![Page 27: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/27.jpg)
Example: show that is a tautologyLet be .
Idempotence
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
AA ¬p ∨ (p ∨ p)
¬p ∨ (p ∨ p) ≡ ¬p ∨ p≡≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
17
![Page 28: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/28.jpg)
Example: show that is a tautologyLet be .
IdempotenceCommutativity
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
AA ¬p ∨ (p ∨ p)
¬p ∨ (p ∨ p) ≡ ¬p ∨ p≡ p ∨ ¬p≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
17
![Page 29: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/29.jpg)
Example: show that is a tautologyLet be .
IdempotenceCommutativityNegation
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
AA ¬p ∨ (p ∨ p)
¬p ∨ (p ∨ p) ≡ ¬p ∨ p≡ p ∨ ¬p≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
17
![Page 30: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/30.jpg)
Example: show equivalence with a truth table and proof
A truth table for .
p ∧ (p → q) ≡ p ∧ q
p ∧ (p → q) ↔ p ∧ q ≡ #p q p → q p ∧ (p → q) p ∧ q p ∧ (p → q) ↔ p ∧ q, , # , , #, # # , , ## , , , , ## # # # # #
18
![Page 31: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/31.jpg)
Example: show equivalence with a truth table and proof
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
p ∧ (p → q) ≡ p ∧ qp ∧ (p → q) ≡
≡≡≡≡ p ∧ q
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
19
![Page 32: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/32.jpg)
Example: show equivalence with a truth table and proof
Law of implication
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
p ∧ (p → q) ≡ p ∧ qp ∧ (p → q) ≡ p ∧ (¬p ∨ q)
≡≡≡≡ p ∧ q
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
19
![Page 33: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/33.jpg)
Example: show equivalence with a truth table and proof
Law of implicationDistributivity
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
p ∧ (p → q) ≡ p ∧ qp ∧ (p → q) ≡ p ∧ (¬p ∨ q)
≡ (p ∧ ¬p) ∨ (p ∧ q)≡≡≡ p ∧ q
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
19
![Page 34: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/34.jpg)
Example: show equivalence with a truth table and proof
Law of implicationDistributivityNegation
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
p ∧ (p → q) ≡ p ∧ qp ∧ (p → q) ≡ p ∧ (¬p ∨ q)
≡ (p ∧ ¬p) ∨ (p ∧ q)≡ , ∨ (p ∧ q)≡≡ p ∧ q
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
19
![Page 35: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/35.jpg)
Example: show equivalence with a truth table and proof
Law of implicationDistributivityNegationCommutativity
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
p ∧ (p → q) ≡ p ∧ qp ∧ (p → q) ≡ p ∧ (¬p ∨ q)
≡ (p ∧ ¬p) ∨ (p ∧ q)≡ , ∨ (p ∧ q)≡ (p ∧ q) ∨ ,≡ p ∧ q
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
19
![Page 36: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/36.jpg)
Example: show equivalence with a truth table and proof
Law of implicationDistributivityNegationCommutativityIdentity
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
p ∧ (p → q) ≡ p ∧ qp ∧ (p → q) ≡ p ∧ (¬p ∨ q)
≡ (p ∧ ¬p) ∨ (p ∧ q)≡ , ∨ (p ∧ q)≡ (p ∧ q) ∨ ,≡ p ∧ q
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
19
![Page 37: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/37.jpg)
Example: show tautology with a truth table and proof
A truth table for .
(p ∧ q) → (q ∨ p)
(p ∧ q) → (q ∨ p) ≡ #p q p ∧ q q ∨ p (p ∧ q) → (q ∨ p), , , , #, # , # ## , , # ## # # # #
20
![Page 38: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/38.jpg)
Example: show tautology with a truth table and proof
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
(p ∧ q) → (q ∨ p)(p ∧ q) → (q ∨ p) ≡
≡≡≡≡≡≡≡≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
21
![Page 39: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/39.jpg)
Example: show tautology with a truth table and proof
Law of implication
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
(p ∧ q) → (q ∨ p)(p ∧ q) → (q ∨ p) ≡ ¬(p ∧ q) ∨ (q ∨ p)
≡≡≡≡≡≡≡≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
21
![Page 40: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/40.jpg)
Example: show tautology with a truth table and proof
Law of implicationDeMorgan
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
(p ∧ q) → (q ∨ p)(p ∧ q) → (q ∨ p) ≡ ¬(p ∧ q) ∨ (q ∨ p)
≡ (¬p ∨ ¬q) ∨ (q ∨ p)≡≡≡≡≡≡≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
21
![Page 41: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/41.jpg)
Example: show tautology with a truth table and proof
Law of implicationDeMorganAssociativity
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
(p ∧ q) → (q ∨ p)(p ∧ q) → (q ∨ p) ≡ ¬(p ∧ q) ∨ (q ∨ p)
≡ (¬p ∨ ¬q) ∨ (q ∨ p)≡ ¬p ∨ (¬q ∨ (q ∨ p))≡≡≡≡≡≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
21
![Page 42: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/42.jpg)
Example: show tautology with a truth table and proof
Law of implicationDeMorganAssociativityAssociativity
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
(p ∧ q) → (q ∨ p)(p ∧ q) → (q ∨ p) ≡ ¬(p ∧ q) ∨ (q ∨ p)
≡ (¬p ∨ ¬q) ∨ (q ∨ p)≡ ¬p ∨ (¬q ∨ (q ∨ p))≡ ¬p ∨ ((¬q ∨ q) ∨ p)≡≡≡≡≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
21
![Page 43: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/43.jpg)
Example: show tautology with a truth table and proof
Law of implicationDeMorganAssociativityAssociativityCommutativity
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
(p ∧ q) → (q ∨ p)(p ∧ q) → (q ∨ p) ≡ ¬(p ∧ q) ∨ (q ∨ p)
≡ (¬p ∨ ¬q) ∨ (q ∨ p)≡ ¬p ∨ (¬q ∨ (q ∨ p))≡ ¬p ∨ ((¬q ∨ q) ∨ p)≡ ¬p ∨ (p ∨ (¬q ∨ q))≡≡≡≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
21
![Page 44: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/44.jpg)
Example: show tautology with a truth table and proof
Law of implicationDeMorganAssociativityAssociativityCommutativityAssociativity
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
(p ∧ q) → (q ∨ p)(p ∧ q) → (q ∨ p) ≡ ¬(p ∧ q) ∨ (q ∨ p)
≡ (¬p ∨ ¬q) ∨ (q ∨ p)≡ ¬p ∨ (¬q ∨ (q ∨ p))≡ ¬p ∨ ((¬q ∨ q) ∨ p)≡ ¬p ∨ (p ∨ (¬q ∨ q))≡ (¬p ∨ p) ∨ (¬q ∨ q)≡≡≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
21
![Page 45: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/45.jpg)
Example: show tautology with a truth table and proof
Law of implicationDeMorganAssociativityAssociativityCommutativityAssociativityCommutativity (twice)
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
(p ∧ q) → (q ∨ p)(p ∧ q) → (q ∨ p) ≡ ¬(p ∧ q) ∨ (q ∨ p)
≡ (¬p ∨ ¬q) ∨ (q ∨ p)≡ ¬p ∨ (¬q ∨ (q ∨ p))≡ ¬p ∨ ((¬q ∨ q) ∨ p)≡ ¬p ∨ (p ∨ (¬q ∨ q))≡ (¬p ∨ p) ∨ (¬q ∨ q)≡ (p ∨ ¬p) ∨ (q ∨ ¬q)≡≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
21
![Page 46: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/46.jpg)
Example: show tautology with a truth table and proof
Law of implicationDeMorganAssociativityAssociativityCommutativityAssociativityCommutativity (twice)Negation (twice)
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
(p ∧ q) → (q ∨ p)(p ∧ q) → (q ∨ p) ≡ ¬(p ∧ q) ∨ (q ∨ p)
≡ (¬p ∨ ¬q) ∨ (q ∨ p)≡ ¬p ∨ (¬q ∨ (q ∨ p))≡ ¬p ∨ ((¬q ∨ q) ∨ p)≡ ¬p ∨ (p ∨ (¬q ∨ q))≡ (¬p ∨ p) ∨ (¬q ∨ q)≡ (p ∨ ¬p) ∨ (q ∨ ¬q)≡ # ∨ #≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
21
![Page 47: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/47.jpg)
Example: show tautology with a truth table and proof
Law of implicationDeMorganAssociativityAssociativityCommutativityAssociativityCommutativity (twice)Negation (twice)Idempotence
DeMorgan’s laws
Law of implication
Contrapositive
Biconditional
Double negation
Identity
Domination
Idempotence
Commutativity
Associativity
Distributivity
Absorption
Negation
(p ∧ q) → (q ∨ p)(p ∧ q) → (q ∨ p) ≡ ¬(p ∧ q) ∨ (q ∨ p)
≡ (¬p ∨ ¬q) ∨ (q ∨ p)≡ ¬p ∨ (¬q ∨ (q ∨ p))≡ ¬p ∨ ((¬q ∨ q) ∨ p)≡ ¬p ∨ (p ∨ (¬q ∨ q))≡ (¬p ∨ p) ∨ (¬q ∨ q)≡ (p ∨ ¬p) ∨ (q ∨ ¬q)≡ # ∨ #≡ #
¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q
p → q ≡ ¬p ∨ q
p → q ≡ ¬q → ¬p
p ↔ q ≡ (p → q) ∧ (q → p)
p 𠪪p
p ∧ # ≡ pp ∨ , ≡ p
p ∧ , ≡ ,p ∨ # ≡ #
p ∧ p ≡ pp ∨ p ≡ p
p ∧ q ≡ q ∧ pp ∨ q ≡ q ∨ p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (p ∨ q) ≡ pp ∨ (p ∧ q) ≡ p
p ∧ ¬p ≡ ,p ∨ ¬p ≡ #
21
![Page 48: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/48.jpg)
Truth tables versus proofsProofs are not smaller than truth tables where there are a fewpropositional variables.
But proofs are usually much smaller when there are many variables.
We can extend the proof method to reason about richer logics for whichtruth tables don’t apply.
Theorem provers use a combination of search (truth tables) anddeduction (proofs) to automate equivalence checking.
22
![Page 49: CSE 311 Lecture 03: Equivalence and Proofs€¦ · Logical proofs A method for establishing equivalence that extends to richer logics. Lecture 02 2. Equivalence and circuits A brief](https://reader035.vdocuments.site/reader035/viewer/2022063009/5fc01a7ff121435e91754cc2/html5/thumbnails/49.jpg)
SummaryChecking equivalence has many real-world applications.
Verification, optimization, and more!There are two ways to check equivalence of propositional formulas.
Brute-force: compare their truth tables.Proof-based: apply equivalences to transform one into the other.
23