1 Boolean Algebra 1. Boolean Algebra Verification Technology - - PowerPoint PPT Presentation

1 boolean algebra 1 boolean algebra
SMART_READER_LITE
LIVE PREVIEW

1 Boolean Algebra 1. Boolean Algebra Verification Technology - - PowerPoint PPT Presentation

Fachgebiet Rechnersysteme 1. Boolean Algebra 1 1 Boolean Algebra 1. Boolean Algebra Verification Technology Content 1.1 Boolean algebra basics (recap) 1 2 Reasoning about Boolean expressions 1.2 Reasoning about Boolean expressions 1.


slide-1
SLIDE 1

1

  • 1. Boolean Algebra

1 Boolean Algebra

Fachgebiet Rechnersysteme

  • 1. Boolean Algebra

Verification Technology

Content

1.1 Boolean algebra basics (recap) 1 2 Reasoning about Boolean expressions 1.2 Reasoning about Boolean expressions

slide-2
SLIDE 2

2

  • 1. Boolean Algebra

The problem of logic verification: Show that two circuits implement the same boolean function, or: Show that a p , circuit correctly implements a specification a g

=1

b

1

a a

&

g a b

&

g

& &

b

&

slide-3
SLIDE 3

3

  • 1. Boolean Algebra

1.1 Boolean algebra basics

1.1 Boolean Algebra Basics 1.1 Boolean Algebra Basics

AND-operation (conjunction) Gate representation

a b a b 

a b German (old)

1 1 0

b

1 0 1 1 1

IEEE- standard a b &

 0 d

i a

 0-dominance

b US-standard (old)

slide-4
SLIDE 4

4

  • 1. Boolean Algebra

1.1 Boolean algebra basics

OR-operation (disjunction) Gate representation

a b a b 

a b German (old)

1 1

b ( )

1 0 1 1 1 1

IEEE- standard a b 1

1 1 1

a

 1-dominance

b US-standard (old)

slide-5
SLIDE 5

5

  • 1. Boolean Algebra

1.1 Boolean algebra basics

NOT-operation (negation, complement) Gate representation Gate representation a German (old) a a 0 1 ( ) 1 0 IEEE- Standard a 1 a US-standard (old)

slide-6
SLIDE 6

6

  • 1. Boolean Algebra

1.1 Boolean algebra basics

More notations ... a • b a  b a & b a + b a  b a | b a + b a  b a | b a

  • a

a' Propositional Calculus Propositional Calculus

slide-7
SLIDE 7

7

  • 1. Boolean Algebra

1.1 Boolean algebra basics

More operations:  (E)XOR  (exclusive-or unequal addition modulo 2)  (E)XOR  (exclusive-or, unequal, addition modulo 2) Definition:

b a b a b a     

Gate representation

b a b a 

a b German (old) 

1 1 b a b a 

b German (old)

1 1 1 1 1 1

=1 IEEE- standard a b

1 1

a b US-standard (old)

slide-8
SLIDE 8

8

  • 1. Boolean Algebra

1.1 Boolean algebra basics

 NAND G t t ti Gate representation

1 b) (a b a 

a b German (old)

1 1 1 1

IEEE- a &

1 1 1 1

IEEE- standard b a b US-standard b (old)

slide-9
SLIDE 9

9

  • 1. Boolean Algebra

1.1 Boolean algebra basics

 NOR Gate representation Gate representation a b German (old)

1 b) (a b a 

IEEE- a 1

1 1

IEEE standard b

1 1 1

a b US-standard ( ld) b (old)

slide-10
SLIDE 10

10

  • 1. Boolean Algebra

1.1 Boolean algebra basics

 Implikation :  Equivalence  (equality):

b a b a   

 Equivalence  (equality):

b a b a b a     

— The equivalence-function equals one iff the arguments have equal values Th f ti l iff th t — The exor-function equals one iff the arguments have unequal values Generally: a  b = (a  b) — Generally: a  b = (a  b)

slide-11
SLIDE 11

11

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Boolean functions Traffic-light checker: inputs: r red g green e — Traffic-light checker: inputs: r red, g green, e yellow r e g p? 0 0 0 0 0 1 0 1 0 0 1 0 0 1 1 1 0 0 1 0 1 23 = 8 cases 1 0 1 1 1 0 1 1 1

Traffic- r

1 1 1

Light Checker e g p

slide-12
SLIDE 12

12

  • 1. Boolean Algebra

1.1 Boolean algebra basics

r, e, g are Boolean variables

B = {0 1} is the set of Boolean values

B = {0, 1} is the set of Boolean values

A Boolean function in n variables is a mapping F: Bn  B

 Such a function models a circuit with n inputs

and one output, in the example we have B3 B B3  B

Traffic- r Light Checker e g p

slide-13
SLIDE 13

13

  • 1. Boolean Algebra

1.1 Boolean algebra basics

2 2 2 2 x x x x

3 2 1 3 2 1 0 f

Representation of Boolean functions by means of function tables and Veitch-

0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 2

x3

function tables and Veitch- (Karnaugh-) maps

4 8 12

0 0 1 0 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 1 2 3 4 5

1 1

1 5 9 13

0 1 0 1 1 0 1 1 0 0 0 1 1 1 1 1 0 0 0 5 6 7 8

x0

1 1 1 1 1 1

2 3 6 7 10 11 15

1 0 0 0 0 1 0 0 1 1 1 0 1 0 0 1 0 1 1 8 9 10

x1

1 1

2 6 10 14

1 0 1 1 0 1 1 0 0 1 1 1 0 1 1 11 12 13

x2

1 1 1 0 0 1 1 1 1 1 14 15

2

slide-14
SLIDE 14

14

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Boolean terms are textual representations of Boolean functions, e.g., , g ,

b) + (e a c + c b a    

The syntax of Boolean terms:  The constants 0 and 1 are Boolean terms  Literals (variables and complemented variables) are Boolean terms, for instance,  If a and b are Boolean terms then so are

a and a

 If a and b are Boolean terms then so are

a b), + (a b), (a 

slide-15
SLIDE 15

15

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Product-terms (products, cubes) are conjunctions of literals  Each variable occurs only once — Example: x•y•z or xyz for short Example: x y z or xyz for short  Special case: Minterm (product-term in all variables)

Sum-terms (clauses) are disjunctions of literals

Sum terms (clauses) are disjunctions of literals  Special case: Maxterm (sum-term in all variables)

slide-16
SLIDE 16

16

  • 1. Boolean Algebra

1.1 Boolean algebra basics

A Sum-of-Products (sop) (also called a disjunctive normal form, dnf) is a disjunction of products , ) j p — Example: cyz + d + ax

A Product-of-Sums (pos) (also called a conjunctive normal form, cnf) is a conjunction of sums — Example: (c + x + b)(s + x)(a + x)

slide-17
SLIDE 17

17

  • 1. Boolean Algebra

1.1 Boolean algebra basics

The Rules of Boolean Algebra: (T1) x + 0 = x (T1') x • 1 = x Identity (T1) x + 0 = x (T1 ) x • 1 = x Identity (T2) x + 1 = 1 (T2') x • 0 = 0 0/1-Element (T3) x + x = x (T3') x • x = x Idempotence (T4) x = x (T4') 1 = 0 Involution (T5) x + x = 1 (T5') x • x = 0 Complement (T5) x + x = 1 (T5') x • x = 0 Complement

slide-18
SLIDE 18

18

  • 1. Boolean Algebra

1.1 Boolean algebra basics

(T6) x + y = y + x (T6') x • y = y • x Commutativity ( ) y y ( ) y y y (T7) (x + y) + z = x + (y + z) = x + y + z Associativity (T7') (x • y) • z = x • (y • z) = x • y • z (T7 ) (x • y) • z = x • (y • z) = x • y • z (T8) x•y + x•z = x•(y + z) Distributivity (T8') (x + y)•(x + z) = x + y•z (T9) (x + y) = x • y (T9') (x • y) = x + y De Morgan's (T9) (x + y) x y (T9 ) (x y) x + y De Morgan s Law (T10) ( + + ) G li d (T10) (x1 +...+ xn )= x1 •...• xn Generalized De Morgan's (T10') (x1 •...• xn )= x1 +...+ xn Law ( ) (

1 n ) 1 n

slide-19
SLIDE 19

19

  • 1. Boolean Algebra

1.1 Boolean algebra basics

(T11) x + x•y = x + y (T11') x•(x + y) = x•y ( ) y y ( ) ( y) y Absorption (T12) x + x•y = x (T12') x•(x + y) = x

 Very important for the simplification of terms

and circuits! Example: x x & 1 x 1 y & y

slide-20
SLIDE 20

20

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Boole's Expansion Theorem (1849)

 also attributed to Shannon  also attributed to Shannon

slide-21
SLIDE 21

21

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Idea: Decompose a function into two sub- 0 0 0 0

4 3 2 1

x x x x

f functions which do not depend on some variable, e g x 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 1 e.g., x1

) x , x , x f(0,

4 3 2

0 0 1 1 0 0 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 1 1 1 0 0 0  1 0 0 0 0 1 0 0 1 1 1 0 1 0 0 1 0 1 1

) x , x , x f(1,

4 3 2

1 0 1 1 0 1 1 0 0 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1

slide-22
SLIDE 22

22

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Expansion Theorem: a Boolean Function f can be decomposed according to a variable x as follows p g

x x

f x f x f    

 are called the Positive (1-) and Negative (0-)

x x

f x f x f 

f f ,  are called the Positive (1 ) and Negative (0 ) Cofactors of f with respect to x  The cofactors can be calculated by replacing the

x x

f f , y g variable x by the constants 0 and 1, respectively

slide-23
SLIDE 23

23

  • 1. Boolean Algebra

1.1 Boolean algebra basics

— Illustration in the Veitch-diagram: b a 1 1 1 1 1 1

f fa

f a c 1 1 1

fa

f c ab b a c f    ab b a c f  

slide-24
SLIDE 24

24

  • 1. Boolean Algebra

1.1 Boolean algebra basics

— Illustration in the Veitch-diagram: b  a 1 1 1 1 1 1

f fa

a c 1 1 1

fa

f c f ab b a c f    ab b a c f  

f a f a f

a a

   

slide-25
SLIDE 25

25

  • 1. Boolean Algebra

1.1 Boolean algebra basics

— Circuit realization: b

&

a

f

a 1 1 1 1 1 1

f fa

1 f

a

a c 1 1 1

fa

f

& fa

c f ab b a c f   

a

ab b a c f  

a a

f a f a f    

slide-26
SLIDE 26

26

  • 1. Boolean Algebra

1.1 Boolean algebra basics

 The cofactors are calculated by replacing a by 0 and 1, respectively: respectively: b

&

a

f

a 1 1 1 1 1 1

f fa

1 f

a

a c 1 1 1

fa

f

& fa

ab + b a + c = f

c f

a

b, + c = 1b + b 1 + c = f ab, + b a + c = f

a

f = a (c + b ) + a (c + b )   , b + c = 0b + b + c = fa

slide-27
SLIDE 27

27

  • 1. Boolean Algebra

1.1 Boolean algebra basics

 The cofactors are calculated by replacing a by 0 and 1, respectively plus simplifications: b

&

f

1 c b

respectively plus simplifications: a 1 1 1 1 1 1

f fa

1 f

a

f

1 c b

a c 1 1 1

fa

f

& fa 1 c b

f = c + a b + a b ,

c f

a

f c + a b + a b , f = c + 1 b + 1 b = c + b ,

a

f = a (c + b ) + a (c + b )   f = c + 0 b + 0 b = c + b ,

a

slide-28
SLIDE 28

28

  • 1. Boolean Algebra

1.1 Boolean algebra basics

The circuit used above is called a 2:1-Multiplexor Symbol:

& 1 a a & b b 1

x

x

 Depending on x, the output is either equal

to a or equal to b to a or equal to b

slide-29
SLIDE 29

29

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Remark: the calculation of a cofactor can be viewed as a step of symbolic simulation: p y  Traditional simulation determines the value at the

  • utput of a gate-network for given values at the

inputs  The calculation of a cofactor determines the function at the output if some inputs assume a function at the output if some inputs assume a constant value (0 or 1) 1

& 1 a 1

1

& 1 a

f = a

& 1 b 0

1

& 1 b

f = a

f x 0 x 0

slide-30
SLIDE 30

30

  • 1. Boolean Algebra

1.1 Boolean algebra basics

3 operations between cofactors:  The Boolean Difference (Exor)  The Boolean Difference (Exor)  The Universal Quantification (And)  Th E i t ti l Q tifi ti (O )  The Existential Quantification (Or)

slide-31
SLIDE 31

31

  • 1. Boolean Algebra

1.1 Boolean algebra basics

The Boolean Difference

x x

f f x f(x)    

 XOR of both cofactors  Ch t i ll it ti f hi h h f  Characterizes all situations for which a change of x implies a change of f

slide-32
SLIDE 32

32

  • 1. Boolean Algebra

1.1 Boolean algebra basics

b — Example: b 1

fa

1 a 1 1

fa

a

 1 c

c ab c b b a f   

b f f f(a)   cofactors are  here b 1

a a

f f a    1 c 1

c f f

a a

 

1

slide-33
SLIDE 33

33

  • 1. Boolean Algebra

1.1 Boolean algebra basics

— Example: 2:1-multiplexor

& a

a x b x f    

& 1 a f

f f a f(a)

a a 

  

& b

) b ( ) b ( ) b x ( ) x b ( a     

x

x ) b x ( ) x b ( ) b x ( ) x b (         

Of course! for x = 0 we have f = a, so a implies f !

slide-34
SLIDE 34

34

  • 1. Boolean Algebra

1.1 Boolean algebra basics

The Boolean Existential Quantifer

( x : f ( x ) ) f f

x x

  

 The disjunction of both cofactors

slide-35
SLIDE 35

35

  • 1. Boolean Algebra

1.1 Boolean algebra basics

( a : f ( a ) ) f f

a a

  

b a 1 1 1 1

f fa

 a c 1 1

fa

f ith f t c b either cofactor is 1 here 1 1

f f

a a

1 c

slide-36
SLIDE 36

36

  • 1. Boolean Algebra

1.1 Boolean algebra basics

The calculation of the Boolean existential quantifier is particularly easy for a Boolean expression in dnf: p y y p  f = ...·x + ... + ...·x + ... + ...

products products products

( x: f(x)) f f

x x

  

products with x products with x products without x,x

( x: f(x)) = ...·1 + ... + ...·0 + ... + ...+ ...·0 + ... + ...·1 + ... + ... = + + + +

( ( ))

x x

fx fx = ... + ... + ... + ... + ...

  • riginal expression where all occurences

— Example: f = ab + bc + abc  f( ) b b b ( b )

  • f x,x are eliminated

a: f(a) = b + bc + bc (= b + c)

slide-37
SLIDE 37

37

  • 1. Boolean Algebra

1.1 Boolean algebra basics

The Boolean Universal Quantor

( x : f ( x ) ) f f

x x

  

 The conjunction of both cofactors

slide-38
SLIDE 38

38

  • 1. Boolean Algebra

1.1 Boolean algebra basics

( a : f ( a ) ) f f

a a

  

b a 1 1 1 1

f fa

 a c 1 1

fa

f c b both cofactors are 1 here 1

a a f

f 

c

slide-39
SLIDE 39

39

  • 1. Boolean Algebra

1.1 Boolean algebra basics

The calculation of the Boolean universal quantifier is particularly easy for a Boolean expression in cnf: p y y p  Rule: Eliminate all occurences of x,x — Example: f = (b + c)(a + b)(a + b + c) Example: f (b c)(a b)(a b c) a: f(a) = (b + c)b(b + c) (= bc)

slide-40
SLIDE 40

40

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Inclusion   A function f is included in (is covered by) function g  A function f is included in (is covered by) function g, f g iff (if and only if) or equivalently f  g = 1 f g    Analogy (set theory):     G F G F     G F G F  g g f

slide-41
SLIDE 41

41

  • 1. Boolean Algebra

1.1 Boolean algebra basics

 Example of f  g using Karnaugh-maps: 1 1 1 1 1 1 1 1 1 1 f g

slide-42
SLIDE 42

42

  • 1. Boolean Algebra

1.1 Boolean algebra basics

The following statements are equivalent:

g f  1 f g f g f   

g (f 1)

f g 1 g f   

g f (f  g = 1)

f g f g g f    

slide-43
SLIDE 43

43

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Assume (i) a function f in dnf and assume (ii) that g is the function f where some of the products of f are p eliminated. Then g f

products not in g

 Proof: f can be written in the form f = a + g. g f is equivalent to g  f = 1 or g + f = 1. g + (a + g) = g + a + g = 1. g (a g) g a g 1.

 We have always: a  a + g.

slide-44
SLIDE 44

44

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Assume (i) a function f in cnf and assume (ii) that g is the function f where some of the clauses are eliminated. Then f g  Proof: f can be written in the form f = a·g. f g is equivalent to f  g = 1 or f + g = 1. (a·g) + g = a + g + g = 1.

 We have always: a·g  g.

y g g

slide-45
SLIDE 45

45

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Implicant of a Boolean function  A product-term p is an implicant of a Boolean  A product-term p is an implicant of a Boolean function f iff p f 1 d abd is implicant of f 1 1 1 1 a 1 1 a c

 C

t f i i li t i t l l f b

 Concept of prime-implicants in two-level

logic synthesis

slide-46
SLIDE 46

46

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Tautology:  A Boolean function f is called a Tautology iff f = 1  A Boolean function f is called a Tautology iff f = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 — Is this a reasonable concept at all ??? E l f — Examples:

1 a a   1 b a b a 1 a a      

slide-47
SLIDE 47

47

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Logicverification: show that two circuits with outputs f and g implement the same boolean function! g p  Show that f  g is a tautology! a f

=1

b

1



1 a a

&

g

a b

&

g

& &

b

&

f  g = f*g + f*g

slide-48
SLIDE 48

48

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Boole's expansion theorem is the basis for a "Divide- and-conquer" approach to tautology checking q pp gy g — f = 1 iff both cofactors are equal to one f = 1 1 f x f x

x x

    f = 1

x x x

f = 1

x

2 problems in n-1 p variables

slide-49
SLIDE 49

49

  • 1. Boolean Algebra

1.1 Boolean algebra basics

— Example: f a b a b 1 ?     

f a b a b 1     

f = 1 + b + 1 b = 1

a

f a b a b 1    

f = 0 + b + 0 b = b + b = 1

a

 Tautology checking may induce an

exponential number of cases ! exponential number of cases !

slide-50
SLIDE 50

50

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Satisfiability: a Boolean function f is satisfiable, if there is at least one combination of variable values for which f = 1  A boolean function f  0 is satisfiable!  f is a tautology iff f is unsatisfiable — Example: f a b a b 1 ?      ) b a b a ( f      is not satisfiable ) b a ( b a    

 May also need an exponential # steps

slide-51
SLIDE 51

51

  • 1. Boolean Algebra

1.1 Boolean algebra basics

Example of application: assume a network of gates with two outputs f and g. If we want to know if both outputs p g p can be 1 for the same combination of input values, then we can check if f·g is satisfiable. ... f 1 1 g 1

slide-52
SLIDE 52

52

  • 1. Boolean Algebra

1.1 Boolean algebra basics

If f is a tautology and if f  g then g is also a tautology

If f is unsatifiable and if g  f then g is also unsatisfiable

If f is unsatifiable and if g  f then g is also unsatisfiable

slide-53
SLIDE 53

53

  • 1. Boolean Algebra

1.1 Grundbegriffe der boolesche Algebra

German/Engl Glossary a, a Literal literal a + b + c Summenterm/Disjunktion/ sum/disjunction/ Oder-Klausel clause abc Produktterm/Konjunktion/ product/conjunction/ Und-Klausel cube ab + bcd disjunktive Normalform (DNF) disjunctive normal form (dnf)/ j ( ) j ( ) sum-of-products (sop) (a + b)(b + c)konjunktive Normalform (KNF) conjunctive normal form (cnf)/ product-of-sums fx 0-/negativer Kofaktor 0-/negative cofactor fx 1-/positiver Kofaktor 1-/positive cofactor f = xfx + xfx Boolescher Entwicklungssatz Boole's expansion theorem f 1 T t l i t t l f = 1 Tautologie tautology f  0 Erfüllbarkeit satisfiability

slide-54
SLIDE 54

54

  • 1. Boolean Algebra

1.2 Reasoning About Boolean Expressions 1.2 Reasoning About Boolean Expressions Th ifi ti f i it i l d b

The verification of a circuit involves some procedures by which we give mathematical evidence that a statement about the circuit is true  A verification problem is not a circuit or a Booelan expression  A verification problem involves statements about a circuit or a Boolean expression

 A Boolean expression is 0 or 1, a statement is

true or false true or false

 "mathematical evidence" means that we are

able to give something like a mathematical g g proof of the truth of some statement

slide-55
SLIDE 55

55

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

Typical statements involved in verification problems are:  "The outputs of two circuits are equal"  "The outputs of two circuits are equal"  "It is not possible that the outputs x and y of a circuit both assume the value 1" both assume the value 1  Implications: "If the inputs are ... then the outputs are ..." or: "If the outputs are ... then the inputs must be ..." p p  ... and many other types of statements involving, for instance, temporal qualifiers like "in the next clock- l " " " " l " " i " cycle", "never", "always", "sometimes", etc.

slide-56
SLIDE 56

56

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

Boolean expressions assume the Boolean values 0 or 1

Statements (about a circuit) are either true or false i e

Statements (about a circuit) are either true or false, i.e., they hold or do not hold (for a circuit)  "it rains" "the colour of my car is red" "a+b=b+a"  it rains , the colour of my car is red , a+b=b+a , …

A proof of a statement establishes the truth of the statement

A proof-procedure is a method by which we can mechanically derive the truth of statements

We are interested in the development of proof-procedures to verify statements about circuits

slide-57
SLIDE 57

57

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

We employ common mathematical notations using symbols like "=", etc. to make statements symbols like , etc. to make statements — Example: "The outputs of two circuits are equal for all possible input combinations", formally: f = g (as in sin2(x) + cos2(x) = 1)

We also used mathematical notations to introduce some b i t lik "" i th f ti basic concepts like "" in the former section

The following paragraphs attempt to be a little bit more precise about symbols like "=" in order avoid confusion precise about symbols like = in order avoid confusion with the symbols of Boolean algebra

 = and  (or  and ) are so similar, what is

( ) , the difference?

 In fact, there IS a very close relationship

between propositional logic and Boolean algebra

slide-58
SLIDE 58

58

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

We employ two different types of notation with different symbols: symbols:  The language of Boolean expressions (or Boolean terms) with the Boolean operators ·, +, , , etc. — Boolean expressions assume the values 0 or 1.  A (mathematical) meta-language to make statements ( ) g g about Boolean expressions using symbols like =, , ,

  • etc. which are well-known from other mathematical

disciplines disciplines. — Statements are true or false. Examples: a+b = b+a a·g  g etc — Examples: a+b = b+a, a·g  g, etc.

slide-59
SLIDE 59

59

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

Again:  A Boolean expression may assume the values 0 or 1  A Boolean expression may assume the values 0 or 1.  A statement may be true of false.

The meta language for statements has two different types of

The meta-language for statements has two different types of symbols:  Predicate-symbols like = and . Applying a predicate to Predicate symbols like and . Applying a predicate to expressions results in a statement which is true or false. — Example: x  x+1 expression expression t t t

 While functions and expressions return a value,

statement p , predicates may be viewed as special functions returning the values true or false

slide-60
SLIDE 60

60

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

 Logical (propositional) connectives like , , ¬,  and . Logical connectives combine statements to statements. g — Example: x  x+1  x = x+1 statement statement statement statement statement xy  yz  xz st. st. st. st. st. st. statement

slide-61
SLIDE 61

61

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

 The resulting truth-values of the logical connectives are defined analogously to the Boolean operators and are defined analogously to the Boolean operators and are typically given by truth-tables. — Example: The truth-table of the propositional and "". p p p Let A and B be two statements. Then the truth of A  B is defined as follows: A false true f l f l f l B false false false true false true A  B

 We try to avoid an "over-formalization" of

A  B verification problems and will use logical connectives only rarely.

slide-62
SLIDE 62

62

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

Due to the close relationship between the Boolean operators and the operators of our mathematical meta-language, we and the operators of our mathematical meta language, we can often transform a verification problem (phrased as a statement) into a different (often more managable) form.  Example: Rather than to prove f = g we show that fg = 1, i.e., that fg is a tautology.

slide-63
SLIDE 63

63

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

Generally, we transform statements F and G involving Boolean expressions into equivalent Boolean expressions p q p Be(F) and Be(G) as follows (f,g Boolean expressions): Statement Boolean expression f = 1 f f = 1 f f = 0 f f = g f  g f  g f  g F  G Be(F)  Be(g) etc. ¬F Be(F) F Be(F) F  G Be(F)  Be(G)

The proof of a statement is equivalent to showing the p q g tautology of the transformed Boolean expression, e.g., to prove f = g we show that f g = 1

slide-64
SLIDE 64

64

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

— Example: The statement "If x is 1 then y is 1 in the p y following circuit" is formalized as the statement x = 1  y = 1 The equivalent Boolean expression is The equivalent Boolean expression is x  y The proof of the original statement is transformed into the proof of the tautology of x  y, i.e., we have to prove the statement x  y = 1

a x & b y & One possible proof: x  y = x+y =ab + a+b = a + b + a + b = 1 (q.e.d.) y

1

slide-65
SLIDE 65

65

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

A note on implications:

In many situation we have to prove the truth of an if then

In many situation, we have to prove the truth of an if-then statement in natural language: "if A then C" where the commitment C follows from another statement, the assumption A.

Formally, this is denoted as an implication A  C.

The definition of the logical implication A  C in terms of a truth-table: C A  C = ¬A  C A false true false true true t f l t A  C = ¬A  C a c = a + c

If we want to prove A  C then we see from the truth table true false true A  C

If we want to prove A  C then we see from the truth-table that for the case where A is false we do not have to prove anything - A  C is true independently of C.

slide-66
SLIDE 66

66

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

All what we have to do is to prove that C is true for the case that A is true. that A is true.

We see this also if we transform the implication into the equivalent Boolean expression. Assume again the statement: x = 1  y = 1 and the equivalent Boolean expression x  y. If we want to show the tautology, i.e., x  y = 1 and create the function table of x  y: function table of x  y: x 1 y

a b x &

x 1 1 1 1 1

b y

1 then we have to show only that y=1 follows from x=1. 1

For the circuit, our argument would be: If x=1 then a=1 and b=1 since x=ab. Thus, y=1 since y=a+b. (q.e.d.)

slide-67
SLIDE 67

67

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

There are many different ways ("decision procedures") to establish the truth of statements, the transformation into , an equivalent Boolean expression is only one possibility.

A very common technique is to create a circuit for the l i l t t f th t t t d bi thi i it logical structure of the statement and combine this circuit with the original circuit.

 Since we are able to transform statements  Since we are able to transform statements

into Boolean expressions we can also transform statements into circuits! — Example: The implication circuit for x  y y 1 x y

Implication circuit

slide-68
SLIDE 68

68

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

— Statement and original circuit in combination:

a b x & For a tautology, the

  • utput must always

y

1

  • utput must always

be 1

1

Implication p circuit

slide-69
SLIDE 69

69

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

— Example we discussed before: Prove f = g

Equality circuit

a f

=1

b

1



a a

&

g a b

&

g

& & For a tautology, the

  • utput must always

b

&

  • utput must always

be 1