1 / 21

Reachability Analysis

Reachability Analysis. 290N: The Unknown Component Problem Lecture 14. Outline. Image computation Input splitting Output splitting Quantification scheduling IWLS-95 ICCAD-01 Implementations BDDs SAT Hybrid Reachability analysis Exact reachability analysis

shino
Download Presentation

Reachability Analysis

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Reachability Analysis 290N: The Unknown Component Problem Lecture 14

  2. Outline • Image computation • Input splitting • Output splitting • Quantification scheduling • IWLS-95 • ICCAD-01 • Implementations • BDDs • SAT • Hybrid • Reachability analysis • Exact reachability analysis • Approximate reachability analysis

  3. Image Computation Output space • Given a mapping of minterms from one Boolean space (input space) into another Boolean space (output space) • For a set of minterms (care set) in the input space • The image of this set is the set of corresponding minterms in the output space • For a set of minterms in the output space • The pre-image of this set is the set of corresponding minterms in the input space Input space Image Care set

  4. Example Input space abc 000 y Output space x Care set 001 xy 010 00 Image 011 01 a b c 100 10 101 11 110 111

  5. Image Computation • Implements formula:Image(Y) = x [R(X,Y) & C(X)] • Implicit methods by far outperform explicit ones • Successfully computing images with more than 2^100 minterms in the input/output spaces • Operations & and are basic Boolean manipulations • They are efficiently implemented in the BDD package • To avoid large intermediate results (during and after the product computation), operation AND-EXIST can be used, which performs product and quantification simultaneously (in one pass over the BDDs)

  6. Image Computation Techniques • When the relation is a monolithic one, these technique do not work • Unless the relation can be decomposed using disjoint-support decomposition, etc. • The techniques discussed below work for the case of partitioned representation • This representation is natural when the system is represented on the gate level • In this case, the transition relation is given in the form of the set of partitions: T(x,cs,ns) = i Ti(x,cs,nsi)

  7. Input Splitting Input space • Select an input variable • Cofactor partition w.r.t. this variable • Compute the images for the cofactors • Union the resulting images abc 000 Output space Care set 001 xy 010 00 Image 011 01 x = a + b y = bc 100 10 a=1 a=0 101 11 x = b y = bc x = 1 y = bc 110 111

  8. Reducing Image Computation to Range Computation • Operator “constrain” () is an image restrictor • It allows us to reduce image computation to range computation: Im(y) = Image( R(x,y), C(x) ) = Image( R(x,y)C(x) ) bdd constrain( bdd R, bdd C ) { if ( C = 0 ) return 0; if ( C = 1 or R = const ) return R; (C0,C1) = Cofactors( C, x ); (R0,R1) = Cofactors( R, x ); if ( C0 = 0 ) return constrain( R1, C1 ); if ( C1 = 0 ) return constrain( R0, C0 ); R0 = constrain( R0, C0 ); R1 = constrain( R1, C1 ); return ITE( x, R1, R0 ); }

  9. Example Input space R(X,Y) = {a+b, bc} C(X) = a’(b’+c’) Constrain: R(X,Y)  C(X) = {a’(b’+c’), 0} Image( R(X,Y)  C(X) ) = y’ abc 000 Output space Care set 001 xy 010 00 Image 011 01 100 10 101 11 110 111

  10. Output Splitting • Constrain each function Yi(x) w.r.t the care set C(x) • Recursively compute the image as follows: • Select an output variable yi • Constrain each remaining function using the function yi=Yi(x) • Use the direct polarity • Use the complemented polarity • Find the images of the two resulting sets of functions, Im1(y) and Im2(y) • Combine the images using the ITE operator and the variable yi. Im(y) = ITE(yi, Im1(y), Im2(y)) • Trivial cases: • When function Yj(x) is constant 0 (1), the image is yj’ (yj) • When there is only one non-constant function left, the image is constant 1 (it does not depend on the y variables) • When functions in the set Y can be split into two parts with disjoint support, the image is the product of the two images • When only two functions are left and, for example, Yj1(x) = Yj2(x)’, then, the image is yj1  yj2

  11. Input vs. Output Splitting • These two methods are “symmetric” • Their efficiency depends on the cardinality of the input/output spaces • Typically output splitting is more efficient because the output space is typically smaller than the input space • As a result, the (potentially exponential) tree depth is bounded by a smaller number Variable 1 Variable 2 Variable 3

  12. Quantification Scheduling • Existential quantification and product commute if a variable to be quantified belongs to only one component in the product x [F(x,y) & G(x,y)]  [x F(x,y)] & [x G(x,y)] x [F(y) & G(x,y)] = F(y) & [x G(x,y)] • Scheduling is performed by ordering the partitions, so that the variables are quantified as early as possible Image(Y) = x,i [A(x) & T1(x,i,y) & T2(x,i,y) & … & Tk(x,i,y)] = = xk,ik [ Tk(x,i,y) & & xk-1,ik-1 [Tk(x,i,y) & … & x1,i1 [T1(x,i,y) & x0,i0 A(x)] … ] ]

  13. IWLS 95 Image Computation Method • BDD variable ordering techniques • Use of clustering • Ordering of the clusters

  14. BDD Variable Ordering • Given a set of partitions yj(i,x), find the permutation  of partitions such that it minimizes the sum • Order supports of yj(i,x) individually and then insert the yj variables as follows:

  15. Partition Clustering • Group partitions based on their support using the overall limit on the BDD size of a partition • Partitions with close support should be grouped together • This facilitates quantification scheduling • Both many small partitions and few large partitions are bad; the best result is somewhere in between • Heuristically, it was found that the partition size of 1000-5000 BDD nodes works well in practice

  16. Ordering Clusters • Start with two sets of clusters, P and Q • P is already ordered; Q is still to be ordered • Order the clusters by first including those clusters that maximize the weight: W = 2 * Vci/Wci + Wci/Xci + Yci/Zci + mci/Mci, where Vci is the number of vars to be quantified by adding ci Wci is the number of cs and i vars in the support ci Xci is the number of cs and i vars that are not yet quantified Yci is the number of ns vars that will be added by ci Zci is the number of ns vars that are not yet in the product mci is the max BDD level of a var to be quantified in ci Mci is the max BDD level of a var to be quantified in Q

  17. Non-Linear Quantification Scheduling (ICCAD91) • Instead of creating the linear order, create a tree order • Use a sample care set to dynamically schedule quantifications • Algorithm takes V (variables) and F (partitions) • Quantify away variables that appear in one partition only • Iterate as long as the set of variables V is not empty • Select a variable with the lowest cost • Cost of is the sum of BDD sizes of functions, to which this var belongs • Select two smallest partitions with this variable in their support • Conjoin these partitions and update the costs • Dynamically build the tree as the quantification proceeds • Use this tree to compute images with other care sets

  18. Example of Non-Linear Scheduling • Three-bit counter • y1 = x1’ • y2 = x1  x2 • y3 = x1x2 x3 • Care set S = x1’ • Partitions • F1(y1,x1) = y1 = x1’ • F2(y2,x1,x2) = y2 = x1  x2 • F3(y3,x1,x2,x3) = y3 = x1x2 x3 • F4(x1) = x1’ • Variables to quantify • x1,x2,x3 x1 & & x2 & x3 F1 F3 F2 F4

  19. Summary • These methods work for the partitioned transition relation • Natural when the FSM (automaton) is represented by a circuit • Different approaches to computing the image • Input splitting • Output splitting • Quantification scheduling • Hybrid methods • Use partition clustering in addition to quantification scheduling (Berkeley, IWLS 95) • Use non-linear quantification scheduling (CMU, ICCAD 01) • Partitioning (OR-decomposition) of the transition relation • “To split, or to conjoin” (mix the quantification scheduling and input/output splitting) (Somenzi, DAC 2000) • “The compositional far side of image computation” (Somenzi, ICCAD 2003) • Tricks and speed-ups • Disjoint decomposition • Caching of intermediate results, etc

  20. Using SAT for Image Computation • Represent transition relation as a CNF • Iterate through the satisfying assignments • It is good if the solver can iterate through cubes rather than minterms of the solution space • Otherwise, it is only applicable to small output spaces (<10 vars) • When the problem becomes UNSAT, the collected solutions represent the image • The care set is a set of additional constraints • Hybrid approaches use SAT and BDDs • To represent the care set (FMCAD-00) • To finish searching subspaces whose size is small (FMCAD-00) • To represent parts of the CNF (DAC-03)

  21. Reachability Analysis • Many applications explore the reachable state space • Given an FSM (automaton) with the transition relation, find all the states reachable from the initial state • Apply image computation repeatedly to compute the sets of reachable states in the next iteration (“onion rings”) until convergence ReachedStates = InitialState; iterate the following computation: ReachedStatesNew = Image( TransitionRelation, ReachedStates ); if (ReachedStatesNew = ReachedStates ) stop; ReachedStates = ReachedStatesNew ; • Reachability analysis uses different methods of image computation • Relies on numerous improvements • Simplification using don’t-cares • Iterative squaring • Approximations, etc

More Related