of 21/21
Reachability Analysis Reachability Analysis 290N: The Unknown Component 290N: The Unknown Component Problem Problem Lecture 14 Lecture 14

Reachability Analysis

  • View

  • Download

Embed Size (px)


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 - PowerPoint PPT Presentation

Text of Reachability Analysis

  • Reachability Analysis290N: The Unknown Component Problem

    Lecture 14

  • OutlineImage computationInput splittingOutput splittingQuantification schedulingIWLS-95ICCAD-01ImplementationsBDDsSATHybridReachability analysisExact reachability analysis Approximate reachability analysis

  • Image ComputationGiven 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 spaceThe image of this set is the set of corresponding minterms in the output spaceFor a set of minterms in the output spaceThe pre-image of this set is the set of corresponding minterms in the input spaceInput spaceOutput spaceImageCare set

  • ExampleabcyxOutput spaceImageCare set00000101001110010111011100011011abcxyInput space

  • Image ComputationImplements formula: Image(Y) = x [R(X,Y) & C(X)]Implicit methods by far outperform explicit onesSuccessfully computing images with more than 2^100 minterms in the input/output spacesOperations & and are basic Boolean manipulationsThey are efficiently implemented in the BDD packageTo 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)

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

  • Input SplittingSelect an input variableCofactor partition w.r.t. this variableCompute the images for the cofactorsUnion the resulting imagesOutput spaceImageCare set00000101001110010111011100011011abcxyInput spacex = a + b y = bcx = b y = bcx = 1 y = bca=0a=1

  • Reducing Image Computation to Range ComputationOperator constrain () is an image restrictorIt 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 );}

  • ExampleR(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) ) = yOutput spaceImageCare set00000101001110010111011100011011abcxyInput space

  • Output SplittingConstrain each function Yi(x) w.r.t the care set C(x)Recursively compute the image as follows:Select an output variable yiConstrain each remaining function using the function yi=Yi(x)Use the direct polarityUse the complemented polarityFind 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 imagesWhen only two functions are left and, for example, Yj1(x) = Yj2(x), then, the image is yj1 yj2

  • Input vs. Output SplittingThese two methods are symmetricTheir efficiency depends on the cardinality of the input/output spacesTypically output splitting is more efficient because the output space is typically smaller than the input spaceAs a result, the (potentially exponential) tree depth is bounded by a smaller numberVariable 1Variable 2Variable 3

  • Quantification SchedulingExistential quantification and product commute if a variable to be quantified belongs to only one component in the productx [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 possibleImage(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)] ] ]

  • IWLS 95 Image Computation MethodBDD variable ordering techniquesUse of clusteringOrdering of the clusters

  • BDD Variable OrderingGiven 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:

  • Partition ClusteringGroup partitions based on their support using the overall limit on the BDD size of a partitionPartitions with close support should be grouped togetherThis facilitates quantification schedulingBoth many small partitions and few large partitions are bad; the best result is somewhere in betweenHeuristically, it was found that the partition size of 1000-5000 BDD nodes works well in practice

  • Ordering ClustersStart with two sets of clusters, P and QP is already ordered; Q is still to be orderedOrder the clusters by first including those clusters that maximize the weight: W = 2 * Vci/Wci + Wci/Xci + Yci/Zci + mci/Mci, whereVci is the number of vars to be quantified by adding ciWci is the number of cs and i vars in the support ciXci is the number of cs and i vars that are not yet quantifiedYci is the number of ns vars that will be added by ciZci is the number of ns vars that are not yet in the productmci is the max BDD level of a var to be quantified in ciMci is the max BDD level of a var to be quantified in Q

  • Non-Linear Quantification Scheduling (ICCAD91)Instead of creating the linear order, create a tree orderUse a sample care set to dynamically schedule quantificationsAlgorithm takes V (variables) and F (partitions)Quantify away variables that appear in one partition onlyIterate as long as the set of variables V is not emptySelect a variable with the lowest cost Cost of is the sum of BDD sizes of functions, to which this var belongsSelect two smallest partitions with this variable in their support Conjoin these partitions and update the costsDynamically build the tree as the quantification proceedsUse this tree to compute images with other care sets

  • Example of Non-Linear SchedulingThree-bit countery1 = x1y2 = x1 x2y3 = x1x2 x3Care set S = x1PartitionsF1(y1,x1) = y1 = x1F2(y2,x1,x2) = y2 = x1 x2F3(y3,x1,x2,x3) = y3 = x1x2 x3 F4(x1) = x1Variables to quantifyx1,x2,x3F1F2F3F4x3x2x1&&&

  • SummaryThese methods work for the partitioned transition relationNatural when the FSM (automaton) is represented by a circuitDifferent approaches to computing the imageInput splittingOutput splittingQuantification schedulingHybrid methodsUse partition clustering in addition to quantification scheduling (Berkeley, IWLS 95)Use non-linear quantification scheduling (CMU, ICCAD 01)Partitioning (OR-decomposition) of the transition relationTo 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-upsDisjoint decompositionCaching of intermediate results, etc

  • Using SAT for Image ComputationRepresent transition relation as a CNFIterate through the satisfying assignmentsIt is good if the solver can iterate through cubes rather than minterms of the solution spaceOtherwise, it is only applicable to small output spaces (
  • Reachability AnalysisMany applications explore the reachable state spaceGiven an FSM (automaton) with the transition relation, find all the states reachable from the initial stateApply image computation repeatedly to compute the sets of reachable states in the next iteration (onion rings) until convergenceReachedStates = InitialState;iterate the following computation:ReachedStatesNew = Image( TransitionRelation, ReachedStates );if (ReachedStatesNew = ReachedStates ) stop;ReachedStates = ReachedStatesNew ; Reachability analysis uses different methods of image computationRelies on numerous improvementsSimplification using dont-caresIterative squaringApproximations, etc