Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

26
Reachability Analysis Reachability Analysis using AIGs using AIGs (instead of BDDs?) (instead of BDDs?) 290N: The Unknown Component 290N: The Unknown Component Problem Problem Lecture 23 Lecture 23
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    213
  • download

    0

Transcript of Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Page 1: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Reachability Analysis using AIGs Reachability Analysis using AIGs (instead of BDDs?)(instead of BDDs?)

290N: The Unknown Component 290N: The Unknown Component ProblemProblem

Lecture 23Lecture 23

Page 2: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

OutlineOutline AND-INV graphs (AIGs)AND-INV graphs (AIGs)

Non-canonicityNon-canonicity Structural hashingStructural hashing ApplicationsApplications

Reachability analysis (implementation using AIGs)Reachability analysis (implementation using AIGs) Image computationImage computation Boolean operationsBoolean operations Structural fixed pointStructural fixed point

Discussion (advantages and disadvantages compared to BDDs)Discussion (advantages and disadvantages compared to BDDs) Delayed Boolean operationsDelayed Boolean operations Need efficient logic synthesis for highly redundant AIGsNeed efficient logic synthesis for highly redundant AIGs

Developing a hybrid approach (combining AIGs and BDDs)Developing a hybrid approach (combining AIGs and BDDs) Collapsing Collapsing Sliding boundarySliding boundary Other methods?Other methods?

Page 3: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

And/Inverter Graphs (AIGs)And/Inverter Graphs (AIGs)

ExampleExample Non-canonicityNon-canonicity Structural hashingStructural hashing Typical applicationsTypical applications

Page 4: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

ExampleExamplecdcd

abab 0000 0101 1111 1010

0000 00 00 11 000101 00 00 11 111111 00 11 11 001010 00 00 11 00

F(a,b,c,d) = ab + d(ac’+bc)

F(a,b,c,d) = ac’(b’d’)’ + c(a’d’)’ = ac’(b+d) + bc(a+d)

cdcdabab 0000 0101 1111 1010

0000 00 00 11 000101 00 00 11 111111 00 11 11 001010 00 00 11 00 a c’ b d b c a d

b ca c’

a b d

Page 5: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Structural HashingStructural Hashing

No structural hashingNo structural hashing Always add a new AND-nodeAlways add a new AND-node

One-level structural hashingOne-level structural hashing When a new AND-node is to be added, check a When a new AND-node is to be added, check a

hash table for an existence of a node with the same hash table for an existence of a node with the same pair of inputs; if it exists, return it; otherwise, create pair of inputs; if it exists, return it; otherwise, create a new nodea new node

Two-level structural hashingTwo-level structural hashing When a new AND-node is to be added, consider its When a new AND-node is to be added, consider its

predecessors, and hash the three AND-gates into a predecessors, and hash the three AND-gates into a canonical form (two-level canonicity)canonical form (two-level canonicity)

Page 6: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Applications of AIGsApplications of AIGs

A data structure for circuit-based SATA data structure for circuit-based SAT A data structure for EC and BMCA data structure for EC and BMC A alternative representation of functionality A alternative representation of functionality

of a node in the Boolean networkof a node in the Boolean network A uniform representation for both A uniform representation for both

algebraic factored forms, and algebraic factored forms, and the result of Boolean decompositionthe result of Boolean decomposition

Page 7: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Reachability Analysis using AIGsReachability Analysis using AIGs

Computation using AIGsComputation using AIGs Reachability pseudo-codeReachability pseudo-code Using AIGs for reachabilityUsing AIGs for reachability ExampleExample Structural fixed pointStructural fixed point ConsequencesConsequences

Page 8: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Using AIGs for ComputationUsing AIGs for Computation

Boolean operationsBoolean operations Express an operation in terms of ANDs and INVsExpress an operation in terms of ANDs and INVs

CofactoringCofactoring Propagate a constantPropagate a constant

QuantificationQuantification Propagate two constants and OR the resultsPropagate two constants and OR the results

Variable replacementVariable replacement Reconstruct a graph in terms of different variablesReconstruct a graph in terms of different variables

Page 9: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Reachable State ComputationReachable State Computation

Relation(cs,ns) = Relation(cs,ns) = i i k [ nsk [ nskk NS NSkk( i, cs ) ];( i, cs ) ]; ReachedReached(cs)(cs) = = 00;;

FrontFront(cs)(cs) = InitState = InitState(cs)(cs);;

dodo{{      Reached = Reached + Front;      Reached = Reached + Front;      Next(cs) =       Next(cs) = cs [ Relation(cs,ns) & Front(cs) ] cs [ Relation(cs,ns) & Front(cs) ] ns ns cscs;;

            Front =  Next & Reached;Front =  Next & Reached;}}while ( Front while ( Front 0 )0 );;

Page 10: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Using AIGs for ReachabilityUsing AIGs for Reachability

General idea General idea Take any BDD-based computation and perform it Take any BDD-based computation and perform it

using AIGs, instead of BDDsusing AIGs, instead of BDDs

ConsequencesConsequences Prevents unexpected “BDD blow-ups” Prevents unexpected “BDD blow-ups” Instead, creates AIGs monotonically growing from Instead, creates AIGs monotonically growing from

one iteration to anotherone iteration to another

Requires efficient reduction proceduresRequires efficient reduction procedures A good test for logic synthesis algorithms and toolsA good test for logic synthesis algorithms and tools

Page 11: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Example: s27, initial stateExample: s27, initial state

Page 12: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Example: s27, transition relationExample: s27, transition relation

Page 13: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Example: s27, quantified relationExample: s27, quantified relation

Page 14: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Example: s27, reached 1Example: s27, reached 1

Page 15: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Example: s27, reached 2Example: s27, reached 2

Page 16: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Example: s27, reached 1Example: s27, reached 1

Page 17: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Reduction Procedures TriedReduction Procedures Tried

Merging functionally-equivalent nodes Merging functionally-equivalent nodes (up to complementation)(up to complementation)

AIG rewriting using pre-computed tableAIG rewriting using pre-computed table Applying optimization scripts in SIS/MVSISApplying optimization scripts in SIS/MVSIS BDD-based collapsingBDD-based collapsing BDD-based partial collapsingBDD-based partial collapsing

Page 18: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Reduction Procedures To TryReduction Procedures To Try

Key insightKey insight AIGs record delayed BDD computations!AIGs record delayed BDD computations!

BDD-based partial collapsingBDD-based partial collapsing Using a shifting BDD/AIG boundaryUsing a shifting BDD/AIG boundary

Page 19: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Structural Fixed PointStructural Fixed Point Definition.Definition. The The functional fixed pointfunctional fixed point is reached is reached

when in the above computationwhen in the above computation Front = Constant-0 Boolean functionFront = Constant-0 Boolean function Definition.Definition. The The structural fixed pointstructural fixed point is reached is reached

when in the above computation when in the above computation Front = Constant-0 AIGFront = Constant-0 AIG

Theorem.Theorem. Suppose BDD-based reachable state Suppose BDD-based reachable state computation reaches the functional fixed point computation reaches the functional fixed point after after nn iterations. Then, a similar AIG-based iterations. Then, a similar AIG-based computation reachescomputation reaches thethe structural fixed point structural fixed point after after nn or or nn+1+1 iterations iterations. .

Page 20: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

ProofProof After After nn iterations, iterations, NextNext contains only visited contains only visited

states and states and FrontFront is is Constant 0 Boolean functionConstant 0 Boolean function. . If If FrontFront is also is also Constant 0 AIGConstant 0 AIG, the structural , the structural

fixed point is reached after fixed point is reached after nn iterations. iterations. If If FrontFront is not is not Constant-0 AIGConstant-0 AIG, then we show , then we show

that, after the next image computation, that, after the next image computation, NextNext becomes becomes Constant-0 AIGConstant-0 AIG (see (see LemmaLemma)). In this . In this case, thecase, the fixed point is reached after fixed point is reached after nn+1+1 iterations.iterations.

Page 21: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

LemmaLemma Lemma.Lemma. I If f FrontFront is is Constant-0 Boolean functionConstant-0 Boolean function

but notbut not Constant-0 AIGConstant-0 AIG, the result of image , the result of image computation is always computation is always Constant-0 AIGConstant-0 AIG..

Proof:Proof: Each cofactor of Each cofactor of ProductProduct w.r.t. the w.r.t. the cscs variables is variables is

Constant 0 AIGConstant 0 AIG. . QQuantification is performed by ORing all of the uantification is performed by ORing all of the

ccofactors of ofactors of ProductProduct w.r.t. the w.r.t. the cscs variables. variables. ORing any number of ORing any number of Constant 0 AIGsConstant 0 AIGs gives gives

Constant 0 AIGConstant 0 AIG.. Q.E.D. Q.E.D.

Page 22: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Reachable State ComputationReachable State Computation

Relation(cs,ns) = Relation(cs,ns) = i i k [ nsk [ nskk NS NSkk( i, cs ) ];( i, cs ) ]; ReachedReached(cs)(cs) = = 00;;

FrontFront(cs)(cs) = InitState = InitState(cs)(cs);;

dodo{{      Reached = Reached + Front;      Reached = Reached + Front;      Next(cs) =       Next(cs) = cs [ Relation(cs,ns) & Front(cs) ] cs [ Relation(cs,ns) & Front(cs) ] ns ns cscs;;

            Front =  Next & Reached;Front =  Next & Reached;}}while ( Front while ( Front 0 )0 );;

Page 23: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Proof IllustrationProof Illustration

cs

ns cs

P(cs,ns) = P(cs,ns) = Relation(cs,ns) & Front(cs)Relation(cs,ns) & Front(cs)

QuantificationQuantification

RelationRelation

FrontFront

PPPP PP PP

ns 00 ns 01 ns 10 ns 11

cscs P(cs,ns)P(cs,ns)

Page 24: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

DiscussionDiscussion

It would be nice if AIGs could beat BDDs for It would be nice if AIGs could beat BDDs for reachable state computationreachable state computation

In practice, this did not happen (so far)In practice, this did not happen (so far)

Page 25: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

Towards a Hybrid ApproachTowards a Hybrid Approach

Perhaps AIGs alone cannot beat BDDsPerhaps AIGs alone cannot beat BDDs A hybrid approach should exploit respective A hybrid approach should exploit respective

strengths of these data structuresstrengths of these data structures BDDs: canonicity, non-redundancyBDDs: canonicity, non-redundancy AIGs: no blow-up, structural fixed pointAIGs: no blow-up, structural fixed point

The sliding boundary ideaThe sliding boundary idea AIGs represent delayed BDD computationAIGs represent delayed BDD computation

Page 26: Reachability Analysis using AIGs (instead of BDDs?) 290N: The Unknown Component Problem Lecture 23.

ConclusionConclusion

Reviewed AIG data structureReviewed AIG data structure Presented AIG-based computationPresented AIG-based computation Proved an existence of structural fixed point in Proved an existence of structural fixed point in

the AIG-based reachable state computationthe AIG-based reachable state computation Reported on preliminary experimental resultsReported on preliminary experimental results Outlined future research Outlined future research