Boo M A Decision Procedure for Boolean Matching
Boo. M: A Decision Procedure for Boolean Matching with Abstraction & Dynamic Learning Chih-Fan Lai 1, J. -H. Roland Jiang 1, and Kuo-Hua Wang 2 1 National Taiwan University 2 Fu Jen Catholic University 2010/6/16 DAC 2010
Outline p Introduction to Boolean matching p Our formulation and solution p Experimental evaluation p Conclusions and future work 2010/6/16 DAC 2010 2
Introduction p Combinational equivalence checking (CEC) n n n Known input correspondence co. NP-complete Well solved in practical applications x 1 x 2 xn … 2010/6/16 g f DAC 2010 y 1 y 2 yn … 3
Introduction p Boolean matching n P-equivalence p p n N NP-equivalence p p n Unknown input permutation O(n!) CEC iterations Unknown input negation and permutation O(2 nn!) CEC iterations x 1 x 2 NPN-equivalence p p 2010/6/16 g f Unknown input negation, input permutation, and output negation O(2 n+1 n!) CEC iterations DAC 2010 y 1 y 2 xn … yn … P N 4
Introduction p Example f = g y 1 y 2 y 3 x 1 x 2 x 3 2010/6/16 DAC 2010 5
Introduction p Motivations n PSPACE Theoretically p Complexity in between co. NP (for all …) and 2 (there exists … for all …) in the Polynomial Hierarchy (PH) § Special candidate to test PH collapse p n Known as Boolean congruence/isomorphism dating back to the 19 th century Practically p p 2010/6/16 2 co. NP NP P Broad applications § § § 2 Library binding FPGA technology mapping Detection of generalized symmetry Logic verification Design debugging/rectification Functional engineering change order Intensively studied over the last two decades DAC 2010 6
Introduction p Prior methods Complete ? Function type Equivalence type Solution type Scalability Spectral methods yes CS mostly P one –– Signature based methods no mostly CS P/NP N/A – ~ ++ Canonical-form based methods yes CS mostly P one + SAT based methods yes CS mostly P one/all + Boo. M (QBF/SAT-like) yes CS / IS NPN one/all ++ CS: completely specified IS: incompletely specified 2010/6/16 DAC 2010 7
Main Results p Features of Boo. M n n General computation framework Effective search space reduction techniques p n Dynamic learning and abstraction Theoretical SAT-iteration upper-bound: O(2 nn!) 2010/6/16 O(22 n) DAC 2010 8
Formulation p Reduce NPN-equiv to 2 NP-equiv checks n p Matching f and g; matching f and g 2 nd order formula of NP-equivalence 。 , x ((fc(x) gc( 。 (x))) (f(x) g( 。 (x)))) n p fc and gc are the care conditions of f and g, respectively Need 1 st order formula instead for SAT solving 2010/6/16 DAC 2010 9
Formulation p 0 -1 matrix representation of 。 =1 aij (xj y i) 2010/6/16 DAC 2010 bij ( xj yi) 10
Formulation p Quantified Boolean formula (QBF) for NP-equivalence a, b, x, y ( C A ((fc gc) (f g)) n n p C: cardinality constraint A: /i, j (aij (yi xj)) (bij (yi xj)) Look for an assignment to a- and b-variables that satisfies C and makes the miter constraint unsatisfiable p = A (f g) fc gc Refine C iteratively in a sequence 0 , 1 , …, k , for i+1 i through conflict-based learning 2010/6/16 DAC 2010 11
Boo. M Flow g (and gc ) f (and fc) Preprocess (sig. , abs. ) i=0 How to compute all matches? Solve mapping Solve i i No match no SAT ? yes i=i+1 Add learned clause to i Solve miter i characterizes Match found all matches 2010/6/16 no SAT ? DAC 2010 yes 12
NP-Equivalence Conflict-based Learning p Observation ≠ 1 0 f 1 0 g 1 0 1 2010/6/16 How to avoid these 6 mappings at once? 1 。 0 DAC 2010 1 From SAT 1 1 13
NP-Equivalence Conflict-based Learning p Learnt clause generation ( aa 11 ∨ bb 12 ∨ aa 13 ∨ bb 21 ∨ aa 22 ∨ bb 23 ∨ bb 31 ∨ aa 32 ∨ bb 33 ) 13 21 11 12 22 23 31 32 33 0 1 f 1 0 g 1 0 1 1 。 1 2010/6/16 DAC 2010 0 1 14
NP-Equivalence Conflict-based Learning p Proposition: If f(u) g(v) with v = 。 (u) for some 。 satisfying i , then the learned clause /ij lij for literals lij = (vi uj) ? aij : bij excludes from i the mappings { 。 | 。 (u) = 。 (u)} p Proposition: The learned clause prunes n! infeasible mappings p Proposition: The refinement process 0 , 1 , …, k is bounded by 22 n iterations 2010/6/16 DAC 2010 15
NP-Equivalence Abstraction p Abstract Boolean matching n n n Abstract f(x 1, …, xk+1, …, xn) to f(x 1, …, xk, z, …, z) = f*(x 1, …, xk, z) Match g(y 1, …, yn) against f*(x 1, …, xk, z) Infeasible matching solutions of f* and g are also infeasible for f and g f f* g zn x 1 x 1 xkxxzkk+1 z x y 1 yk yk+1 yn …… … … P 2010/6/16 DAC 2010 … N 16
NP-Equivalence Abstraction p Abstract Boolean matching n Similar matrix representation of negation/permutation =1 p 2010/6/16 Similar cardinality constraints, except for allowing multiple y-variables mapped to z DAC 2010 17
NP-Equivalence Abstraction p Used for preprocessing p Information learned for abstract model is valid for concrete model p Simplified matching in reduced Boolean space 2010/6/16 DAC 2010 18
P-Equivalence Conflict-based Learning p Proposition: If f(u) g(v) with v = (u) for some satisfying i , then the learned clause /ij lij for literals lij = (vi=0 and uj=1) ? aij : excludes from i the mappings { | (u) = (u)} 2010/6/16 DAC 2010 19
P-Equivalence Abstraction p Abstraction enforces search in biased truth assignments and makes learning strong n For f* having k support variables, a learned clause converted back to the concrete model consists of at most (k– 1)(n–k+1) literals 2010/6/16 DAC 2010 20
Experimental Setup Boo. M implemented in ABC using Mini. SAT p A function is matched against its synthesized, and input-permuted/negated version p n Match individual output functions of MCNC, ISCAS, ITC benchmark circuits p n n 717 functions with 10~39 support variables and 15~2160 AIG nodes Time-limit 600 seconds Baseline preprocessing exploits symmetry, unateness, and simulation for initial matching 2010/6/16 DAC 2010 21
Experimental Results Learning Abstraction (P-equivalence; find all matches) 2010/6/16 DAC 2010 22
Experimental Results P-equivalence 2010/6/16 NP-equivalence DAC 2010 23
Experimental Results Boo. M vs. Dep. QBF (runtime after same preprocessing; P-equivalence; find one match) 2010/6/16 DAC 2010 24
Conclusions p Proposed Boo. M, a dedicated decision procedure for Boolean matching n Effective learning and abstraction p p Far faster than state-of-the-art QBF solver Theoretical upper bound reduced from O(2 nn!) to O(22 n) § Empirically exponent ~7 times less for P, ~3 times less for NP n General computation framework p p p Handles NPN-equivalence, incompletely specified functions Allows easy integration with signature based methods Anticipate Boo. M to be a common platform for other Boolean matching developments and to facilitate practical applications 2010/6/16 DAC 2010 25
Ongoing and Future Work Generalize to multiple-output functions p Strengthen learning p Customize decision procedures for more computation problems p 2010/6/16 DAC 2010 26
Thanks for Your Attention p Questions? 2010/6/16 DAC 2010 27
- Slides: 27