1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w...

42
1 Consensus Consensus Definition Definition Let Let w, x, y, z be cubes, and a w, x, y, z be cubes, and a be a variable such that be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus Then the cube xz is called the consensus cube of w and y cube of w and y In particular, w + y = w + y + xz In particular, w + y = w + y + xz Example: ab + a’c = ab + a’c + bc Example: ab + a’c = ab + a’c + bc a a c c b
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    214
  • download

    0

Transcript of 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w...

Page 1: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

1

ConsensusConsensus

Definition Definition Let Let w, x, y, z be cubes, w, x, y, z be cubes, and a be a variable such that and a be a variable such that

w = ax and y = a’zw = ax and y = a’z

Then the cube xz is called the Then the cube xz is called the consensus cube of w and yconsensus cube of w and y

In particular, w + y = w + y + xzIn particular, w + y = w + y + xz

Example: ab + a’c = ab + a’c + bcExample: ab + a’c = ab + a’c + bc

aa

ccbb

Page 2: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

2

Quine-McCluskey SummaryQuine-McCluskey Summary

Q-M:Q-M:1. Generate cover of all primes1. Generate cover of all primes2. Make G irredundant (in optimum way)2. Make G irredundant (in optimum way)

NoteNote: Q-M is : Q-M is exactexact i.e. it gives an exact minimum i.e. it gives an exact minimum

Heuristic Methods:Heuristic Methods:1.1. Generate Generate (somehow)(somehow) a a covercover of of using using somesome

of the primesof the primes

2.2. Make G irredundant (maybe not optimally)Make G irredundant (maybe not optimally)

3.3. Keep best result - try again (i.e. go to 1)Keep best result - try again (i.e. go to 1)

nnpppG/321

kiii pppG 21

Page 3: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

3

ESPRESSO - Heuristic Two-Level ESPRESSO - Heuristic Two-Level MinimizationMinimization

ESPRESSO( )

{

(F,D,R) DECODE( )

F EXPAND(F,R)

F IRREDUNDANT(F,D)

E ESSENTIAL_PRIMES(F,D)

F F-E; D D E

do{

do{

F REDUCE(F,D)

F EXPAND(F,R)

F IR

}while few

REDUND

er ter

ANT

ms

(F,D)

in F

//LASTGASP

G REDUCE_GASP(F,D)

G EXPAND(G,R)

F IRREDUNDANT(F G,D)

}while G

F F E; D D-E

LOWER_OUTPUT(F,D)

RAISE_I

//LASTGAS

NPUTS(F,R)

P

erro

on oldr (F F) or (F F D)

return (F,error)

}

Page 4: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

4

ESPRESSO IllustratedESPRESSO Illustrated

minimum Local

REDUCE

EXPAND

minimum Local

TIRREDUNDAN

Page 5: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

5

IRREDUNDANTIRREDUNDANT

Problem:Problem:Given a cover of cubes {cGiven a cover of cubes {cii}, find a minimal subset }, find a minimal subset

{c{ciikk} that is also a cover, i.e.} that is also a cover, i.e.

dfcfki

Idea:Idea:We are going to create a function g(y) and a new set of We are going to create a function g(y) and a new set of

variables yvariables yii, one for each cube c, one for each cube cii. A minterm in the y-. A minterm in the y-space will indicate a subset of the cubes {cspace will indicate a subset of the cubes {cii}.}.

Example 1:Example 1:

y=011010 = {cy=011010 = {c22,c,c33,c,c55}}

Page 6: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

6

IRREDUNDANTIRREDUNDANT

Idea 2:Idea 2:Create g(y) so that it is the function such that:Create g(y) so that it is the function such that:

g(y) = 1 g(y) = 1 is a cover is a cover

i.e. if g(yi.e. if g(ykk) = 1 if and only if {c) = 1 if and only if {cii | y | ykkii =1} is a cover. =1} is a cover.

NoteNote: g(y) is positive unate (monotone increasing) in all : g(y) is positive unate (monotone increasing) in all its variables.its variables.

1k

ik

iy

c

Page 7: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

7

ExampleExample

cbbacabcf

Example 2:Example 2:

)(),,,( 32414321 yyyyyyyyg

NoteNote:: We are after a minimum subset of cubes. Thus we We are after a minimum subset of cubes. Thus we

want: the want: the largest prime of largest prime of gg (least literals). (least literals).Consider Consider g g : it is monotone : it is monotone decreasingdecreasing in y, e.g. in y, e.g.

32414321 ),,,( yyyyyyyyg

12

3

4

Page 8: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

8

ExampleExample

Example 3:Example 3: {1,2,4} {1,2,4} y y11 y y22 y y44 (i.e. cubes 1,2,4) (i.e. cubes 1,2,4)

Create a Boolean matrix for g:Create a Boolean matrix for g:

cbc,abc,

• Recall a minimal column cover of B is a prime of Recall a minimal column cover of B is a prime of

• We want a minimal column cover of BWe want a minimal column cover of B( )g g

cbbacabcf

32414321 ),,,( yyyyyyyyg

Page 9: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

9

Deriving g(y)Deriving g(y)

Modify tautology algorithm:Modify tautology algorithm:

F = cover of F = cover of =(=(f,d,rf,d,r))

D = cover of D = cover of dd

Pick a cube cPick a cube ci i F. F. ((NoteNote: c: ci i F F F Fcci i

1) 1)

Do the following for each Do the following for each cube ccube ci i F : F :

i

i

C

C

FA

DB

Page 10: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

10

Deriving g(y)Deriving g(y)

11. All leaves will be tautologies. All leaves will be tautologies

22. g means how can we make . g means how can we make it it notnot the tautology. We must the tautology. We must exactly delete exactly delete allall rows of all rows of all 2’s that are not part of D2’s that are not part of D

33. Each row of all 2’s came . Each row of all 2’s came from some row of A/Bfrom some row of A/B

44. Each row of A is associated with some cube of F.. Each row of A is associated with some cube of F.

55. Each cube of B associated with some cube of D . Each cube of B associated with some cube of D ( we ( we don’t need to know which, and we can’t delete its don’t need to know which, and we can’t delete its rows).rows).

66. Rows that must be deleted are written as a cube, . Rows that must be deleted are written as a cube, e.g. ye.g. y11yy22yy77 delete rows 1,3,7 of F. delete rows 1,3,7 of F.

Page 11: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

11

Example 4:Example 4: Suppose unate leaf is in Suppose unate leaf is in subspace xsubspace x11x’x’22xx33 : :Thus we write down: yThus we write down: y10 10 yy1818 (actually, (actually, yyii must be one of y must be one of y10 , 10 , yy1818). Thus, F is ). Thus, F is not a covernot a cover if we leave out cubes c if we leave out cubes c10 10 ,,

cc1818..

Row of all 2’sin don’t cares

NoteNote:: If row of all 2’s in don’t If row of all 2’s in don’t cares,cares,then there is no way not to then there is no way not to have tautology at that leaf. have tautology at that leaf. So in the example to the So in the example to the right, we do not write yright, we do not write y10 10 yy1818

Unate leaf

Deriving g(y)Deriving g(y)

Page 12: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

12

D

F

ci cj

)(ygi )(yg j

)()()( ygygyg ji

x1

x2

x3

10 18( )ig y y y

Deriving g(y)Deriving g(y)

Page 13: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

13

SummarySummary

Convert Convert g(y)g(y) into a Boolean matrix B into a Boolean matrix B (note that (note that g(y)g(y) is unate).is unate). Then find a minimum cover of B. For Then find a minimum cover of B. For example, if example, if yy11yy33yy1818 is a minimum cover, then the is a minimum cover, then the set of cubes:set of cubes:

{c{c1 1 , c, c3 3 , c, c18 18 }}

is a minimum sub cover of { cis a minimum sub cover of { ci i | i=1,…,k}. | i=1,…,k}. (Recall (Recall that a minimal cover of B is a prime of g(y), and that a minimal cover of B is a prime of g(y), and g(y) gives all possible sub-covers of F).g(y) gives all possible sub-covers of F).

Note: We are just checking for tautology, so unate reduction can be used as well…

Page 14: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

14

Back to Q-MBack to Q-M

We want a maximum prime of We want a maximum prime of g(y)g(y)..

NoteNote: A row of B says if we leave out primes: A row of B says if we leave out primes

{{pp1 1 , , pp3 3 , , pp4 4 , , pp6 6 }}

we we ceasecease to have a cover. to have a cover.

1011010All primes

B = Minterms of f

6431)( yyyyygB

So basically, the only difference between Q-M and So basically, the only difference between Q-M and IRREDUNDANT is that for the latter, we just constructed a IRREDUNDANT is that for the latter, we just constructed a g(y) where we did not consider all primes, but only those in g(y) where we did not consider all primes, but only those in

somesome cover: F = cover: F = {{cc1 1 , , cc3 3 ,…, ,…, cck k }}

Page 15: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

15

EXPANDEXPAND

Problem:Problem: Take a cube c and make it prime by removing Take a cube c and make it prime by removing literals.literals.

a). Greedy way which we saw earlier: (uses D and not R)a). Greedy way which we saw earlier: (uses D and not R)

R)EXPAND(F,F

remove literal from c (results in )

test if (same as 1)

repeat, removing valid literals in order found.c

c c

c f d (f d)il

Page 16: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

16

EXPANDEXPAND

R)EXPAND(F,F

b). b). Better way:Better way: (uses R and not D) (uses R and not D)Want to see Want to see allall possible ways to remove maximal possible ways to remove maximal subset of literals.subset of literals.IdeaIdea: Create a function g(y) such that g(y)=1 iff : Create a function g(y) such that g(y)=1 iff literals:literals:

can be removed without hitting R.can be removed without hitting R.

}0|{ ii yl

rcdfc

yl ii

~,~

}1|{

i.e. make still willc, in kept if that such

literals of subset a is or

Page 17: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

17

Main Idea of EXPANDMain Idea of EXPAND

Outline:Outline:

1.1. Expand one cube, cExpand one cube, cii , at a time , at a time

2.2. Build Build “blocking”“blocking” matrix matrix B = B B = B ccii

3.3. See which other cubes cSee which other cubes cjj can be can be feasiblyfeasibly covered covered using B.using B.

4.4. Choose expansion Choose expansion (literals to be removed)(literals to be removed) to cover to cover most other cmost other cjj . .

NoteNote::

( ) is monotone increasing

( ) is easily built if we have , a cover of .

We do not need all of (reduced offset).

g y

B g y R r

R

Page 18: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

18

Blocking Matrix B (for cube C)Blocking Matrix B (for cube C)

Given R = {Given R = {rri i }, a cover of }, a cover of rr. [ . [ = ( = (f,d,rf,d,r) ]) ]

ijj

ijjij rlCl

rlClB

and

and 1

What does row What does row ii of B say? of B say?

ij

i ij

i

j | B c

c r B c

r

It says that if literals 1 are removed from ,

then , i.e. 1 is one reason why is

orthogonal to offset cube .

rcdfc

yyyygB

~~

)( 1031

get to removed be canc of literalsthat waysall gives Thus

Page 19: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

19

EXPAND exampleEXPAND example

dy

by

ay

keep 1

keep 1

keep 1

3

2

1

(y)gyyB i 311 101

BB11 means if do not keep literals 1 and 3 of means if do not keep literals 1 and 3 of cc, then the subsequent is not an , then the subsequent is not an implicant). If literals 1, 3 are removed we get . But :implicant). If literals 1, 3 are removed we get . But :

so obviously so obviously bb is not an implicant since it has an non-null intersection with R. is not an implicant since it has an non-null intersection with R.

c~bcc ~ irc~

ebdaebdab

Suppose c = abd, and rSuppose c = abd, and r11 = abde, r = abde, r22 = abe. Then we first construct y = abe. Then we first construct y11, y, y22, y, y33 corresponding to a, b, d respectively. Their meaning is: corresponding to a, b, d respectively. Their meaning is:

So B is:So B is:

010

101B

Page 20: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

20

EXPAND continuedEXPAND continued

Thus Thus all minimal column coversall minimal column covers ( ( g(y) g(y) ) of B are the minimal ) of B are the minimal subsets of literals of c that must be kept to ensure that subsets of literals of c that must be kept to ensure that

Thus each minimal column cover is a prime Thus each minimal column cover is a prime pp that covers that covers cc, i.e. , i.e. p p c c..

ic f d c r ( i.e. )

1p 2p

3pc cpi

Page 21: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

21

Expanding cExpanding cii

F = { cF = { cii }, }, = ( = (f,d,rf,d,r) ) f f F F f+df+d

QQ: Why do we want to expand c: Why do we want to expand ci i ??

AA: To cover some other c: To cover some other cjj ‘s. ‘s.

QQ: Can we cover c: Can we cover cj j ??

AA: If and only if : If and only if (SCC = (SCC = “smallest cube containing”“smallest cube containing” also also called “supercube” )called “supercube” )

equivalent to:equivalent to:

equivalent to:equivalent to:

literals literals ”conflicting””conflicting” between c between cii, c, cjj can be removed and still can be removed and still have an implicanthave an implicant

dfccSCC ji

ic jcp

iji rccSCC

Page 22: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

22

Expanding cExpanding cii

Can check SCC(cCan check SCC(cii, c, cjj) with blocking matrix:) with blocking matrix:

ccii = 12 = 12010122

ccjj = 12 = 12121200

implies that literals 3 and 4 must be removed for to cover implies that literals 3 and 4 must be removed for to cover ccj j . .

So check if column 3, 4 of B can be removed without causing So check if column 3, 4 of B can be removed without causing a row of all 0’s. If so, ca row of all 0’s. If so, cii can be expanded to cover c can be expanded to cover cjj

ic~

ic jcp

Page 23: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

23

Covering functionCovering function

The objective of EXPAND is to expand cThe objective of EXPAND is to expand c ii to cover as many to cover as many cubes ccubes cjj as possible. The blocking function g(y)=1 as possible. The blocking function g(y)=1 whenever the subset of literalswhenever the subset of literalsyields a cube . (Note that ).yields a cube . (Note that ).

We now build the We now build the covering functioncovering function,,h h , such that:, such that:

h(y)h(y) = 1 = 1

whenever the cube covers another cube cwhenever the cube covers another cube c jj F. F.

NoteNote: : h(y)h(y) is easy to build. is easy to build.

Thus a minterm Thus a minterm mm g(y) h(y)g(y) h(y) is such that it gives is such that it gives ( ( g(m) g(m) =1 ) =1 ) andand covers at least one cube covers at least one cube ((h(m) h(m) =1).=1). In fact every cube is covered. We seek In fact every cube is covered. We seek mm which which results in the most cubes covered.results in the most cubes covered.

icc ~

}1|{ ii yldfc ~

)1(

~jy

jlc

dfc ~

lm cc ~

Page 24: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

24

Covering functionCovering function

Thus define h(y) by a set of cubes where dThus define h(y) by a set of cubes where dkk = k = kthth cube is: cube is:

(Thus each (Thus each ddkk gives gives minimalminimal expansion to cover expansion to cover cckk ) )

Thus dThus dkk if cube c if cube ckk can be feasibly covered by expanding cube c can be feasibly covered by expanding cube c ii. d. dkk says which literals we have leave out to minimally cover csays which literals we have leave out to minimally cover ckk . Thus . Thus h(y) is defined by h(y) is defined by h(y) = dh(y) = d11 + d + d22 +… + d +… + d|F|-1|F|-1 (one for each cube of F, (one for each cube of F, except cexcept cii itself. It is monotone itself. It is monotone decreasingdecreasing).).

if [ ] else

2 1

if i.e. 0 1

1 0

2 otherwise

k i k

j jj k ij

k

d SCC c c f d

y c cd

Page 25: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

25

Covering functionCovering function

We want We want mm g(y)h(y)g(y)h(y) contained in a contained in a maximummaximum number of number of ddkk ‘s. ‘s.

In In EspressoEspresso, we build a Boolean covering matrix C , we build a Boolean covering matrix C (note that h(y) is unate negative)(note that h(y) is unate negative) representing h(y) representing h(y) and solve this problem with greedy heuristics. and solve this problem with greedy heuristics.

Note: Note:

101001

101010

110110

100101

101011

010110

BC )()(~

)(

yhyhC

ygB

but

Page 26: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

26

Covering functionCovering function

Want set of columns such that if eliminated from B and Want set of columns such that if eliminated from B and C results in C results in no empty rows of Bno empty rows of B (i.e. a valid (i.e. a valid expansion) and a expansion) and a maximum of empty rows in Cmaximum of empty rows in C (i.e. (i.e. an expansion that covers as many other cubes as an expansion that covers as many other cubes as possible)possible)

NoteNote: :

a 1 in C can be interpreted as a reason why does a 1 in C can be interpreted as a reason why does notnot cover ccover cjj . .

101001

101010

110110

100101

101011

010110

BC

c~

Page 27: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

27

EndgameEndgame

What do we do if What do we do if h(y) h(y) 0 0 ? ?

Some things to try:Some things to try:• generate largest prime covering cgenerate largest prime covering cii

• cover most care points of another cube ccover most care points of another cube ckk

• coordinate two or more cube expansions, i.e. try to coordinate two or more cube expansions, i.e. try to cover another cube by a combination of several other cover another cube by a combination of several other cube expansionscube expansions

So far we have not come up with a really So far we have not come up with a really satisfactory endgame. This could be satisfactory endgame. This could be important in many hard problems, since it is important in many hard problems, since it is often the case that often the case that h(y) h(y) 0 0 . .

Page 28: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

28

REDUCEREDUCE

Problem:Problem: Given a cover F and c Given a cover F and c F, find the F, find the smallestsmallest cube cube cc c such that c such that

F\{ c } + { F\{ c } + { cc } }

is still a cover. is still a cover. cc is called the is called the maximallymaximally reduced reduced cube of c.cube of c.

offoff

onon

Don’t Don’t carecare

GOODBAD

REDUCE isorder dependent

Page 29: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

29

REDUCE ExampleREDUCE Example

Example 5:Example 5:

Two orders:Two orders:

REDUCE is REDUCE is order dependentorder dependent ! !

cacbbcacF

F ac bc bc ac abc bc abc ac

F bc bc ac ac abc ac abc ac

1. REDUCE , , ,

2. REDUCE , , ,

GOODBAD

Page 30: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

30

REDUCE AlgorithmREDUCE Algorithm

j

j j

F D

F

c

c c

REDUCE , {

F ORDER( F)

for (1 j ) do {

MAX_REDUCE( c, F, D)

F (F { }) \ { }

}

return F

}

Page 31: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

31

REDUCEREDUCE

Main Idea:Main Idea: Make a prime not a prime but still Make a prime not a prime but still maintain cover:maintain cover:

{{cc1 1 ,…, ,…, ccii,…, ,…, cckk} } { {cc1 1 ,…,,…,ccii,,cci+1 i+1 ,…,,…,cck k }}

ButBut

i k

ij jj j i

f c c c f d1

0 1

• Get out of a local minimum Get out of a local minimum (prime (prime and irredundant is local minimum)and irredundant is local minimum)

• Then have nonprimes, so can Then have nonprimes, so can expand again in different directions. expand again in different directions. (Since EXPAND is “smart”, it may (Since EXPAND is “smart”, it may know best direction)know best direction)

Page 32: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

32

REDUCEREDUCE

FF = { = {cc1 1 ,,cc22,, …,…,cckk}}

F F (i) = ((i) = (FF + + D)D) \ { \ { cci i }}

Reduced cube:Reduced cube:

cc i i = smallest cube containing ( = smallest cube containing (ccii F(i) )F(i) )

• Note that Note that ccii F(i)F(i) is the set of points uniquely is the set of points uniquely covered by covered by ccii (and not by any other (and not by any other ccjj or D). or D).

• Thus, Thus, ccii is the smallest cube containing the is the smallest cube containing the minterms of minterms of ccii which are not in F(i). which are not in F(i).

Page 33: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

33

i

i

i

i i

i c

i c

i c

c SCC c F i

SCC c F i

c SCC F i

c SCCC F i

( )

( )

( )

( )

REDUCEREDUCE

• SCC == “supercube”SCC == “supercube”• SCCC = “smallest cube containing complement”SCCC = “smallest cube containing complement”

2C

1C

2C

1C

offoff

onon

Don’t Don’t carecare

Page 34: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

34

Efficient Algorithm for SCCCEfficient Algorithm for SCCC

Unate Recursive Paradigm:Unate Recursive Paradigm:• select most binate variableselect most binate variable• cofactorcofactor• until unate leafuntil unate leaf

What is SCCC (unate cover) ?What is SCCC (unate cover) ?• Note that for a cube c with at least 2 literals, Note that for a cube c with at least 2 literals,

SCCC(c) is the SCCC(c) is the universeuniverse::

1x 1x

2x 2x

3x3x

01222 cube 20222

12222 cube

unate

So SCCC(cube) = 22222So SCCC(cube) = 22222

Page 35: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

35

SCCCSCCC

SCCC (U) = SCCC (U) = ClaimClaim: if unate cover has row of: if unate cover has row of

– all 2’s except one 0, then complement is in all 2’s except one 0, then complement is in x x ii , i.e. , i.e. ii = 1 = 1

– all 2’s except one 1, complement is inall 2’s except one 1, complement is in x x ii, i.e. , i.e. ii = 0 = 0

otherwise in both subspaces, i.e. otherwise in both subspaces, i.e. ii = 2 = 2

FinallyFinally

Implies that only need to look at 1-literal cubes.Implies that only need to look at 1-literal cubes.

1 2 1 2

1

k k

k

SCCC c c c SCC c c c

SCC c SCC c

Page 36: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

36

SCCC ExampleSCCC Example

Example1:Example1:

NoteNote: 0101 and 0001 are both in: 0101 and 0001 are both inff . So SCCC could not have . So SCCC could not have literal literal bb or or bb in it. in it.

Example2:Example2:

NoteNote that columns 1 and 5 are essential: they must be in every that columns 1 and 5 are essential: they must be in every minimal cover. Sominimal cover. So U = U = xx11xx55(...).(...). Hence Hence SCCC(U) = SCCC(U) = xx11xx55

dadcbafdbcaf )(

U unate

2 2 2 2

2 2 2 2

( ) 2 1 1 2 2

2 1 2 1 0

0

0

Page 37: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

37

SCCC ExampleSCCC Example

ProofProof. . (sketch):(sketch):

The marked columns contain both 0’s and 1’s. But every prime The marked columns contain both 0’s and 1’s. But every prime ofofU contains literals U contains literals xx1 1 ,, xx55

1 5 2 3 4

1 5 2 3 4

( )

( )

1 0 2 2 1

( ) 1 2 0 0 1 12221

U x x x x x

U x x x x x

U unate

1 0 1 1 1

1 0 0 1 1

1 0 1 0 1minterms of

1 0 0 0 1

1 0 0 0 1

1 1 0 0 1

U

Page 38: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

38

SCCCSCCC

ThusThus

Thus unate leaf is Thus unate leaf is easy !easy !

SCCC(unate) if row of all 2's

if column has a row singleton with a 0 in it

if column has a row singleton with a 1 in it

2 otherwise

j

jj

γ

x j

γ x j

Page 39: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

39

MergingMerging

We need to produceWe need to produce

i iSCCC f SCC x c x c1 2

k

i

i

j i j j

l l l

x c

x c

l l c l c

1 2

2

1

1 2( ) ( )

If If cc11 cc2 2 , then points in both , then points in both xxii and andxxjj, so, so

( SCC(( SCC(xxiicc1 1 ++xxiicc22) )) )ii = 2 = 2

If If lljjcc1 1 , or , or lljjcc2 2 , then both , then both xxjj and andxxjj points exit, hence points exit, hence jj =2. =2.

Also if Also if lljjcc11 and and lljjcc22 , then , then jj =2. =2.

Page 40: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

40

ESPRESSO - Heuristic ESPRESSO - Heuristic Two-Level Two-Level

MinimizationMinimization

F in terms fewer }while D)T(F,IRREDUNDANF

R)EXPAND(F,F D)REDUCE(F,F

do{ do{

EDD E;-FF D)PRIMES(F,ESSENTIAL_E

D)T(F,IRREDUNDANF R)EXPAND(F,F

)DECODE(R)D,(F, {

)ESPRESSO(

//LASTGASP

G REDUCE_GASP(F,D)

G EXPAND(G,R)

F IRREDUNDANT(F G,D)

}while G

F F E; D D-E

LOWER_OUTPUT(F,D)

RAISE_INPUTS(F,R

/

)

/LASTG

ASP

erro on oldr (F F) or (F F D)

return(F,error)

}

Page 41: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

41

LASTGASPLASTGASP

Reduce is order dependent:Reduce is order dependent: Expand can’t do anything with Expand can’t do anything with

the reduction produced by the reduction produced by REDUCE 2.REDUCE 2.

Maximal Reduce:Maximal Reduce:

1REDUCE

2REDUCE

i.e. we reduce all cubes as if each were the first one.i.e. we reduce all cubes as if each were the first one.

Note:Note:

{{cc11MM

,,cc22MM ,...} is not a cover. ,...} is not a cover.

GOODBAD

iiciFSCCC

iciF

icSCCM

ic ))(())((

Page 42: 1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.

42

LASTGASPLASTGASP

Now expand use EXPAND, but try to cover only Now expand use EXPAND, but try to cover only ccjjMM‘s. ‘s. (Note (Note

here we callhere we call EXPAND(G,R),EXPAND(G,R), wherewhere G = G = {{cc11MM

,,cc22MM ,…, ,…, cckk

MM}} ) ) If a If a covering is possible, take the resulting prime:covering is possible, take the resulting prime:

and add to F:and add to F:

Since F is a cover, so is . Now make irredundant (using Since F is a cover, so is . Now make irredundant (using IRREDUNDANT).IRREDUNDANT).

Mj

Mii ccpdf

}{~

ipFF

What about “supergasp” ?What about “supergasp” ?

Main IdeaMain Idea: Generally, think of : Generally, think of ways to throw in ways to throw in a few morea few more primes and then use primes and then use IRREDUNDANT. If generate all IRREDUNDANT. If generate all primes, then just Quine-primes, then just Quine-McCluskeyMcCluskey

F F