Interpolating Functions from Large Boolean Relations

23
ICCAD 2009 ALCom Lab Interpolating Functions from Large Boolean Relations Jie-Hong Roland Jiang, Hsuan-Po Lin, and Wei-Lun Hung Grad. Inst. of Electronics Eng. / Dept of Electrical Eng. National Taiwan University

description

Interpolating Functions from Large Boolean Relations. Jie-Hong Roland Jiang, Hsuan-Po Lin, and Wei-Lun Hung Grad. Inst. of Electronics Eng. / Dept of Electrical Eng. National Taiwan University. Outline. ◆ Introduction. ◆ Our Approach. ◆ Experimental Results. ◆ Conclusions. - PowerPoint PPT Presentation

Transcript of Interpolating Functions from Large Boolean Relations

Page 1: Interpolating Functions  from Large Boolean Relations

ICCAD 2009ALCom Lab

Interpolating Functions from Large Boolean Relations

Jie-Hong Roland Jiang, Hsuan-Po Lin, and Wei-Lun Hung

Grad. Inst. of Electronics Eng. / Dept of Electrical Eng.

National Taiwan University

Page 2: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Outline

2

◆ Introduction

◆ Our Approach

◆ Experimental Results

◆ Conclusions

Page 3: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Relations vs. Functions

Boolean relation R(X, Y) Allow one-to-many

mappings Can describe non-

deterministic behavior

More generic than functions

Boolean function F(X) Disallow one-to-many

mappings Can only describe

deterministic behavior

A special case of relation

3

11100100

11100100

x1x2 y1y2

11100100

11100100

x1x2 y1y2

f1x1 x2

f2 x1 x2

Page 4: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Total Relations vs. Partial Relations

Total relation Every input element

is mapped to at least one output element

Partial relation Some input element

is not mapped to any output element

4

11100100

1

0

x1x2 y

11100100

1

0

x1x2 y

Page 5: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Totalization

A partial relation can be totalized Assume that the input element not

mapped to any output element is a don’t care

5

11100100

1

0

x1x2 y

11100100

1

0

x1x2 yPartial relation

Totalize

Total relation

T(X, y) = R(X, y) y. R(X, y)

Page 6: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Application of Boolean Relations In high-level design, Boolean

relations can be used to describe (nondeterministic) specifications

In gate-level design, Boolean relations can be used to characterize the flexibility of sub-circuits Boolean relations are more powerful than

traditional don’t-care representations

6

11100100

11100100

x1x2 y1y2

Page 7: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Needs of Relation Determinization For hardware implement of a system,

we need functions rather than relations Physical realization are deterministic by

nature One input stimulus results in one output

response

7

Page 8: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Needs of Relation Determinization To simplify implementation, we can

explore the flexibilities described by a relation for optimization

f1x1 x2

f2 x1 x2

f1x2

f2 x1

11100100

11100100

x1x2 y1y2

11100100

z1z2

z1

z2

z1

z2

y1

y2

y1

y2

x1x2

x1

x2

8

Page 9: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Problem Statement

Given a nondeterministic Boolean relation R(X, Y), how to determinize and extract functions from it?

For a deterministic total relation, we can uniquely extract the corresponding functions

9

Page 10: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Related Work

Prior Work BDD- or SOP-based representation

Not scalable Focused on function optimization

Ours AIG representation Focus on scalability with reasonable

optimization quality

10

Page 11: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Enabling Technique

Craig Interpolation Theorem

11

If φA φB is UNSAT for propositional formulas φA ,φB,

then there exists an interpolant I such that

φA → I

I φB is UNSAT

I refers only to the common

variables of φA and φB

IφBφA

Page 12: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Single-Output Relations

For a single-output total relation R(X, y), we derive a function f for variable y using interpolation

12

11100100

1

0

x1x2 yI

φBφA

φA R(X,0)Minimal care onset of f

φB R(X,1) Minimal care offset of f

00

11

R(X,0) R(X,1) is UNSAT

10

Page 13: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Naïve derivation of f is by cofactoring R(X,1) (largest onset of f) or R(X,0) (smallest onset of f)

Interpolantion vs. Cofactoring

13

11100100

1

0

x1x2 y

R(X,0) I R(X,1)⊆ ⊆

φB= R(X,1) Largest onset of f

φA= R(X,0) Smallest onset of f

The function extracted from a single-output relation using cofactor is usually of similar size as the relation

Interpolation may extract smaller functions and prevent AIG explosion

I

φBφA

00

1110

Page 14: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Multiple-Output Relations

Two-phase computation: Phase 1 : Backward reduction

Reduce to single-output case R(X, y1, …, yn) → y2, …, yn. R(x, y1, …, yn)

Existential quantification using expansion y. φ(x,y) = φ(x,1) + φ(x,0)

Existential quantification using substitution [CAV 2009] y. φ(x,y) = φ(x, f(x))

Phase 2 : Forward substitution Extract functions

14

Page 15: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Multiple-Output Relations

Example (Xp)

15

Phase1: (expansion reduction)y3.R(X, y1, y2 , y3) → R(3)(X, y1, y2)y2.R(3)(X, y1, y2) → R(2)(X, y1)

y1 y2X y3

f3

X

RR(3)R(2)

Phase2:R(2)(X, y1) → y1 = f1

(X)R(3)(X, y1, y2) → R(3)(X, f1(X), y2) → y2 = f2

(X)R(X, y1, y2 , y3) → R(X, f1(X), f2(X), y2) → y3 = f3

(X)f1

Xf2

X

Page 16: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Multiple-Output Relations

Example (St)

16

Phase1: (substitution reduction)R(X, y1, y2 , y3) → y3 = f3’(X , y1, y2 ) → R<3>(X, y1, y2)R<3>(X, y1, y2) → y2 = f2’(X , y1 ) → R<2>(X, y1)

y1 y2X y3

f3

X

RR<3>R<2>

Phase2:R<2>(X, y1) → y1 = f1

(X)R<3>(X, y1, y2) → R<3>(X, f1(X), y2) → y2 = f2

(X)R(X, y1, y2 , y3) → R(X, f1(X), f2(X), y2) → y3 = f3

(X)y1X

f3'

y2 y1X

f2'

f2

X

f1

X

Page 17: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Multiple-Output Relations

Example (SD)

17

Phase1: (substitution reduction)R(X, y1, y2 , y3) → y3 = f3’(X , y1, y2 ) → R<3>(X, y1, y2)R<3>(X, y1, y2) → y2 = f2’(X , y1 ) → R<2>(X, y1) R<2>(X, y1, y2) → y1 = f1’(X)y1 y2X y3

f3

X

RR<3>R<2>

Phase2: (interpolation for deterministic rel.)D = R Λ ∏i (yi ≡ fi’)fi

(X) = Interpolant(Dyi, D yi)y1X

f3'

y2 y1X

f2'

f2

X

f1

X

X

f1'

Page 18: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Experimental Setup

Our methods were implemented in ABC using MiniSAT

We prepare Boolean relations by computing the transition relations of ISCAS and ITC circuits Insert don’t cares to introduce

nondeterminism Represent transition relations using AIGs

18

Page 19: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Experimental Results – w/o DC

19

Original BDD Xp

Circuit(#pi, #po)

#n #l #v #n #l #v time #n #l #v time

s5378 (214, 179) 624 12 1570 783 10 1561 286.4 1412 25 1561 49.6

s9234.1 (247, 211) 1337 25 3065 --- --- --- --- 7837 59 2764 158.6

s13207 (700, 669) 1979 23 3836 --- --- --- --- 5772 140 3554 769.3

s15850 (611, 597) 2648 36 15788 --- --- --- --- 42622 188 13348 2700

s35932 (1763, 1728) 8820 12 7099 --- --- --- --- 7280 10 6843 4178.5

s38584 (1464, 1452) 9664 26 19239 --- --- --- --- 22589 277 17678 5772.8

b10 (28, 17) 167 11 159 200 10 152 0.1 197 8 152 0.9

b11 (38, 31) 482 21 416 1301 18 394 0.9 1504 57 394 5.1

b12 (126, 121) 953 16 1639 1663 14 1574 56.7 2166 25 1574 24

b13 (63, 53) 231 10 383 240 10 349 3.1 224 10 349 2.2

Ratio 1 1 1 1 3.40 4.16 0.91

Ratio 2 1 1 1 1.70 0.89 0.97 2.24 1.79 0.97

Ratio 3 1 1 1 1.31 2.02 1

--- : BDD nodes are over 500K during computation

Page 20: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Experimental Results – w/ DC

20

Original BDD Xp

Circuit(#pi, #po)

#n #l #v #n #l #v time #n #l #v time

s5378 (214, 179) 624 12 1570 769 11 1561 200.2 1332 25 1561 49.1

s9234.1 (247, 211) 1337 25 3065 --- --- --- --- 7696 55 2765 166.7

s13207 (700, 669) 1979 23 3836 --- --- --- --- 5818 202 3554 897.9

s15850 (611, 597) 2648 36 15788 --- --- --- --- 40078 136 13309 2596.9

s35932 (1763, 1728) 8820 12 7099 --- --- --- --- 7360 25 6843 4811.1

s38584 (1464, 1452) 9664 26 19239 --- --- --- --- 23726 331 17676 5476.7

b10 (28, 17) 167 11 159 199 9 152 0.1 193 8 152 1.0

b11 (38, 31) 482 21 416 1221 20 394 0.9 1562 52 394 5.5

b12 (126, 121) 953 16 1639 1619 15 1574 452.5 2261 23 1574 27.0

b13 (63, 53) 231 10 383 243 11 349 1.6 229 12 349 2.5

Ratio 1 1 1 1 3.35 4.53 0.91

Ratio 2 1 1 1 1.65 0.94 0.97 2.27 1.71 0.97

Ratio 3 1 1 1 1.38 1.82 1

--- : BDD nodes are over 500K during computation

Page 21: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Experimental Results (cont’d)

Further synthesis by ABC commands “collapse” and “dc2”

21

Original Xp

Circuit #n #l #v #n_c #l_C #v_C #n #l #v #n_c #l_C #v_C time_c

s5378 624 12 1570 772 11 1561 1412 25 1561 760 11 1561 0.4

s9234.1 1337 25 3065 2791 25 2764 7837 59 2764 2751 22 2764 6.4

s13207 1979 23 3836 2700 20 3554 5772 140 3554 2709 20 3554 5.2

S15850* 2648 36 15788 --- --- --- 42622 188 13348 --- --- --- ---

s35932 8820 12 7099 7825 9 6843 7280 10 6843 7857 9 6843 39.9

s38584 9664 26 19239 12071 23 17676 22589 277 17678 12132 21 17676 36.5

b10 167 11 159 195 10 152 197 8 152 195 10 152 0

b11 482 21 416 1187 21 394 1504 57 394 1226 21 394 0.2

b12 953 16 1639 1556 17 1574 2166 25 1574 1645 16 1574 0.4

b13 231 10 383 237 9 349 224 10 349 237 9 349 0.1

Ratio 1 1 1 1 1.21 0.93 0.93 2.02 3.92 0.93 1.22 0.89 0.93

Ratio 2 1 1 1 1.01 0.96 1

Page 22: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Experimental Results (cont’d)

Interpolant vs. cofactor

22

Page 23: Interpolating Functions  from Large Boolean Relations

ICCAD 2009

Conclusions

Scalable function extraction from Boolean relations Interpolation plays an essential role Relations with up to thousands of

variables can be determinized inexpensively

Extracted functions are of reasonable sizes

Future work Determinization scheduling Simple function extraction

23