1. Boolean Algebra 1.1 Boolean Algebra Basics Verification - - PowerPoint PPT Presentation

1 boolean algebra
SMART_READER_LITE
LIVE PREVIEW

1. Boolean Algebra 1.1 Boolean Algebra Basics Verification - - PowerPoint PPT Presentation

Fachgebiet Rechnersysteme Technische Universitt Verification Technology Darmstadt 1. Boolean Algebra Fachgebiet Rechnersysteme 1 1. Boolean Algebra 3 1.1 Boolean algebra basics 1. Boolean Algebra 1.1 Boolean Algebra Basics


slide-1
SLIDE 1

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

1

  • 1. Boolean Algebra
  • 1. Boolean Algebra

Content

Fachgebiet Rechnersysteme Verification Technology

Content

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

2

  • 1. Boolean Algebra

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

=1

a b a b

& &

g

& &

3

  • 1. Boolean Algebra

AND-operation (conjunction) Gate representation

1.1 Boolean algebra basics

1.1 Boolean Algebra Basics a b a b 1 1 0  a b German (old) IEEE a &

 0-dominance

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

4

  • 1. Boolean Algebra

OR-operation (disjunction) a b a b Gate representation a

1.1 Boolean algebra basics

a b a b 1 1 1 0 1 1 1 1  b German (old) IEEE- standard a b 1

 1-dominance

a b US-standard (old)

slide-2
SLIDE 2

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

5

  • 1. Boolean Algebra

NOT-operation (negation, complement) Gate representation

1.1 Boolean algebra basics

a a 0 1 1 0 a German (old) IEEE- Standard a 1 a US-standard (old)

6

  • 1. Boolean Algebra

More notations ... a • b a  b a & b

1.1 Boolean algebra basics

a + b a  b a | b a

  • a

a' Propositional Calculus

7

  • 1. Boolean Algebra

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

b b b 

Gate representation

1.1 Boolean algebra basics

Definition:

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

Gate representation a b =1 German (old) IEEE a  1 1 1 1 1 IEEE- standard a b a b US-standard (old)

8

  • 1. Boolean Algebra

 NAND Gate representation

1.1 Boolean algebra basics

1 1 1 1 1 b) (a b a  a b German (old) IEEE- standard a b & 1 1 standard b a b US-standard (old)

slide-3
SLIDE 3

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

9

  • 1. Boolean Algebra

 NOR Gate representation

1.1 Boolean algebra basics

a b German (old) IEEE- standard a b 1 1 1 1 b) (a b a  standard b a b US-standard (old) 1 1

10

  • 1. Boolean Algebra

 Implikation :

b a b a   

1.1 Boolean algebra basics

 Equivalence  (equality): — The equivalence-function equals one iff the arguments have equal values — The exor-function equals one iff the arguments

b a b a b a     

have unequal values — Generally: a  b = (a  b)

11

  • 1. Boolean Algebra

Boolean functions — Traffic-light checker: inputs: r red, g green, e yellow r e g p?

1.1 Boolean algebra basics

0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 r e g p? 23 = 8 cases

Traffic- Light Checker r e g p

1 1 0 1 1 1

12

  • 1. Boolean Algebra

r, e, g are Boolean variables

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

A Boolean function in n variables is a mapping

1.1 Boolean algebra basics

pp g F: Bn  B

 Such a function models a circuit with n inputs

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

Traffic- Light Checker r e g p

slide-4
SLIDE 4

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

13

  • 1. Boolean Algebra

0 0 0 0 0 0 0 0 1 1

2 2 2 2 x x x x

3 2 1 3 2 1 0 f

1

x Representation of Boolean functions by means of function tables and Veitch- (Karnaugh-) maps

1.1 Boolean algebra basics

1 3 5 4 7 9 8 11 13 12 15

0 0 0 1 1 0 0 1 0 0 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 0 1 0 0 1 1 1 2 3 4 5 6 7 8

x3 x0 1 1 1 1 1 1 1 1

2 3 6 7 10 11 14 15

1 0 0 1 1 1 0 1 0 0 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 9 10 11 12 13 14 15

x2 x1

14

  • 1. Boolean Algebra

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

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

1.1 Boolean algebra basics

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

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

15

  • 1. Boolean Algebra

Product-terms (products, cubes) are conjunctions of literals  Each variable occurs only once

1.1 Boolean algebra basics

— Example: x•y•z or xyz for short  Special case: Minterm (product-term in all variables)

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

16

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

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

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

17

  • 1. Boolean Algebra

The Rules of Boolean Algebra:

1.1 Boolean algebra basics

(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 (T4) x x (T4 ) 1 0 Involution (T5) x + x = 1 (T5') x • x = 0 Complement

18

  • 1. Boolean Algebra

(T6) x + y = y + x (T6') x • y = y • x Commutativity (T7) (x + y) + z = x + (y + z) = x + y + z Associativity

1.1 Boolean algebra basics

(T7) (x + y) + z = x + (y + z) = x + y + z Associativity (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 Law Law (T10) (x1 +...+ xn )= x1 •...• xn Generalized De Morgan's (T10') (x1 •...• xn )= x1 +...+ xn Law

19

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

 Very important for the simplification of terms

and circuits! Example: (T12) x + x•y = x (T12 ) x•(x + y) = x x 1 x 1 y x & y 1

20

  • 1. Boolean Algebra

Boole's Expansion Theorem (1849)

 also attributed to Shannon

1.1 Boolean algebra basics

slide-6
SLIDE 6

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

21

  • 1. Boolean Algebra

Idea: Decompose a function into two sub- functions which do not depend on some variable 0 0 0 0 0 0 0 0 1 1 0 0 1 0

4 3 2 1

x x x x

f

1.1 Boolean algebra basics

depend on some variable, e.g., x1 ) x , x , x f(0,

4 3 2

0 0 1 0 0 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 0 1 0 0 1 1 

) x , x , x f(1,

4 3 2

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

22

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

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

x x

f x f x f    

x x

f f , y , p y

23

  • 1. Boolean Algebra

— Illustration in the Veitch-diagram: b

1.1 Boolean algebra basics

f a c 1 1 1 1 1 1 fa fa ab b a c f   

24

  • 1. Boolean Algebra

b

1.1 Boolean algebra basics

— Illustration in the Veitch-diagram:  a c 1 1 1 1 1 1 fa fa f ab b a c f   

f a f a f

a a

   

slide-7
SLIDE 7

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

25

  • 1. Boolean Algebra

b

1.1 Boolean algebra basics

— Circuit realization: a c 1 1 1 1 1 1 fa fa  f

& & 1 fa a f

a

f

ab b a c f   

a a

f a f a f    

a

26

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

a c 1 1 1 1 1 1 fa fa  f

& & 1 fa a f

a

f

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

a a

a

27

  • 1. Boolean Algebra

b

1 c

1.1 Boolean algebra basics

 The cofactors are calculated by replacing a by 0 and 1, respectively plus simplifications: a c 1 1 1 1 1 1 fa fa  f

& & 1 a f

a

f

fa 1 1 c b c b

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

a a

a

28

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

& & 1 a b a b 1

 Depending on x, the output is either equal

to a or equal to b x

x

slide-8
SLIDE 8

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

29

  • 1. Boolean Algebra

Remark: the calculation of a cofactor can be viewed as a step of symbolic simulation:  Traditional simulation determines the value at the t t f t t k f i l t th

1.1 Boolean algebra basics

  • 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 constant value (0 or 1)

& a 1 & a & & 1 a b x

1

& & 1 a b x 0

f = a

f

30

  • 1. Boolean Algebra

3 operations between cofactors:  The Boolean Difference (Exor)  The Universal Quantification (And)

1.1 Boolean algebra basics

 The Universal Quantification (And)  The Existential Quantification (Or)

31

  • 1. Boolean Algebra

The Boolean Difference

x x

f f f(x)   

1.1 Boolean algebra basics

 XOR of both cofactors  Characterizes all situations for which a change of x implies a change of f

x x

x 

32

  • 1. Boolean Algebra

b — Example:

1.1 Boolean algebra basics

a c 1 1 1 fa fa  cofactors are c ab c b b a f    1 b c 1 c f f

a a

 

a a

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

slide-9
SLIDE 9

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

33

  • 1. Boolean Algebra

— Example: 2:1-multiplexor

1.1 Boolean algebra basics

& & 1 a b f

a x b x f     ) b ( ) b ( f f a f(a)

a a 

  

& b x

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

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

34

  • 1. Boolean Algebra

The Boolean Existential Quantifer ( x : f ( x ) ) f f

x x

  

1.1 Boolean algebra basics

 The disjunction of both cofactors

35

  • 1. Boolean Algebra

( a : f ( a ) ) f f

a a

   b

1.1 Boolean algebra basics

a c 1 1 1 1 fa fa  f either cofactor b c 1 1

f f

a a

1 is 1 here

36

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

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

( x: f(x)) f f

x x

  

products with x products with x products without x,x

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

  • riginal expression where all occurences
  • f x,x are eliminated
slide-10
SLIDE 10

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

37

  • 1. Boolean Algebra

The Boolean Universal Quantor ( x : f ( x ) ) f f

x x

  

1.1 Boolean algebra basics

 The conjunction of both cofactors

38

  • 1. Boolean Algebra

( a : f ( a ) ) f f

a a

   b

1.1 Boolean algebra basics

a c 1 1 1 1 fa fa  f both cofactors b c 1

a a f

f  both cofactors are 1 here

39

  • 1. Boolean Algebra

The calculation of the Boolean universal quantifier is particularly easy for a Boolean expression in cnf:  Rule: Eliminate all occurences of x,x

1.1 Boolean algebra basics

— Example: f = (b + c)(a + b)(a + b + c) a: f(a) = (b + c)b(b + c) (= bc)

40

  • 1. Boolean Algebra

Inclusion   A function f is included in (is covered by) function g, f g iff (if d l if) i l tl f 1 f

1.1 Boolean algebra basics

iff (if and only if) or equivalently f  g = 1  Analogy (set theory): f g       G F G F  g g f

slide-11
SLIDE 11

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

41

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

1 1 1 1 1 1 1 1 1 1 f g f g

42

  • 1. Boolean Algebra

The following statements are equivalent:

1.1 Boolean algebra basics

g g f f g 1 g f g f g f         g g f (f  g = 1) f g f g g  

43

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics products not in g

Then g f  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.

 We have always: a  a + g.

not in g

y g

44

  • 1. Boolean Algebra

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  P f f b itt i th f f

1.1 Boolean algebra basics

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

slide-12
SLIDE 12

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

45

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

p f 1 1 1 1 a d abd is implicant of f

 Concept of prime-implicants in two-level

logic synthesis f b c

46

  • 1. Boolean Algebra

Tautology:  A Boolean function f is called a Tautology iff f = 1

1.1 Boolean algebra basics

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 f — Is this a reasonable concept at all ??? — Examples: 1 b a b a 1 a a      

47

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

a a b f

=1



1 a b a b

& &

g

& &

f  g = f*g + f*g

48

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

f = 1 1 f x f x

x x

    f = 1

x

f 1 f = 1

x

2 problems in n-1 variables

slide-13
SLIDE 13

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

49

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

f a b a b 1     

f = 1 + b + 1 b = 1

a

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

a

 Tautology checking may induce an

exponential number of cases !

50

  • 1. Boolean Algebra

Satisfiability: a Boolean function f is satisfiable, if there is at least one combination of variable values for which f = 1  A b l f ti f 0 i ti fi bl !

1.1 Boolean algebra basics

 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 ) b a b a ( f       is not satisfiable

 May also need an exponential # steps

) b a ( b a    

51

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

we can check if f g is satisfiable. ... f g 1 1 g

52

  • 1. Boolean Algebra

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

1.1 Boolean algebra basics

slide-14
SLIDE 14

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

53

  • 1. Boolean Algebra

German/Engl Glossary

1.1 Grundbegriffe der boolesche Algebra

a, a Literal literal a + b + c Summenterm/Disjunktion/ sum/disjunction/ 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)/ 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 Tautologie tautology f  0 Erfüllbarkeit satisfiability

54

  • 1. Boolean Algebra

1.2 Reasoning About Boolean Expressions

The verification of a circuit involves some procedures by which we give mathematical evidence that a statement g 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

 "mathematical evidence" means that we are

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

55

  • 1. Boolean Algebra

Typical statements involved in verification problems are:  "The outputs of two circuits are equal"  "It is not possible that the outputs x and y of a circuit

1.2 Reasoning about Boolean expressions

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

56

  • 1. Boolean Algebra

Boolean expressions assume the Boolean values 0 or 1

Statements (about a circuit) are either true or false, i.e., they hold or do not hold (for a circuit)

1.2 Reasoning about Boolean expressions

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

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

slide-15
SLIDE 15

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

57

  • 1. Boolean Algebra

We employ common mathematical notations using symbols like "=", etc. to make statements — Example: "The outputs of two circuits are equal for ll ibl i t bi ti " f ll f

1.2 Reasoning about Boolean expressions

all possible input combinations", formally: f = g (as in sin2(x) + cos2(x) = 1)

We also used mathematical notations to introduce some 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 with the symbols of Boolean algebra 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

58

  • 1. Boolean Algebra

We employ two different types of notation with different symbols:  The language of Boolean expressions (or Boolean terms) ith th B l t t

1.2 Reasoning about Boolean expressions

with the Boolean operators ·, +, , , etc. — Boolean expressions assume the values 0 or 1.  A (mathematical) meta-language to make statements about Boolean expressions using symbols like =, , ,

  • etc. which are well-known from other mathematical

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

59

  • 1. Boolean Algebra

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

1.2 Reasoning about Boolean expressions

y

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

 While functions and expressions return a value,

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

60

  • 1. Boolean Algebra

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

1.2 Reasoning about Boolean expressions

xy  yz  xz statement statement statement st. st. st. statement

slide-16
SLIDE 16

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

61

  • 1. Boolean Algebra

 The resulting truth-values of the logical connectives are defined analogously to the Boolean operators and are typically given by truth-tables.

1.2 Reasoning about Boolean expressions

— Example: The truth-table of the propositional and "". Let A and B be two statements. Then the truth of A  B is defined as follows: A false true false false false B

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

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

62

  • 1. Boolean Algebra

Due to the close relationship between the Boolean operators 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

1.2 Reasoning about Boolean expressions

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.

63

  • 1. Boolean Algebra

Generally, we transform statements F and G involving Boolean expressions into equivalent Boolean expressions Be(F) and Be(G) as follows (f,g Boolean expressions): Statement Boolean expression

1.2 Reasoning about Boolean expressions

Statement Boolean expression 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  G Be(F)  Be(G) F  G Be(F)  Be(G)

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

64

  • 1. Boolean Algebra

— Example: The statement "If x is 1 then y is 1 in the following circuit" is formalized as the statement x = 1  y = 1

1.2 Reasoning about Boolean expressions

x 1  y 1 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 b x y &

1

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

slide-17
SLIDE 17

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

65

  • 1. Boolean Algebra

A note on implications:

In many situation, we have to prove the truth of an if-then statement in natural language: "if A then C" where the it t C f ll f th t t t th

1.2 Reasoning about Boolean expressions

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: A false true C A  C = ¬A  C a c = 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. A false true false true true true false true A  C a c = a + c

66

  • 1. Boolean Algebra

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

We see this also if we transform the implication into the i l t B l i A i th t t t

1.2 Reasoning about Boolean expressions

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: x 1 1 1 y

a b x &

then we have to show only that y=1 follows from x=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.) 1 1 1 1

y

1

67

  • 1. Boolean Algebra

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 t h i i t t i it f th

1.2 Reasoning about Boolean expressions

A very common technique is to create a circuit for the logical structure of the statement and combine this circuit with the original circuit.

 Since we are able to transform statements

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

Implication circuit

68

  • 1. Boolean Algebra

— Statement and original circuit in combination:

1.2 Reasoning about Boolean expressions

a b x y &

1

For a tautology, the

  • utput must always

be 1

1

Implication circuit

slide-18
SLIDE 18

Fachgebiet Rechnersysteme Verification Technology Technische Universität Darmstadt

69

  • 1. Boolean Algebra

1.2 Reasoning about Boolean expressions

Equality

— Example we discussed before: Prove f = g a a b f

=1



circuit

a b a b

& &

g

& & For a tautology, the

  • utput must always

be 1