1 / 20

Improvements to Bounded Model Checking

Improvements to Bounded Model Checking. EECS 290A Sequential Logic Synthesis and Verification. Overview. Foundations of SAT solving CNF- and circuit-based solvers Deriving and using CNF representation (two literal watching, etc) Conflict-driven learning and non-chronological back-tracking

vicky
Télécharger la présentation

Improvements to Bounded Model Checking

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. Improvements to Bounded Model Checking EECS 290A Sequential Logic Synthesis and Verification

  2. Overview • Foundations of SAT solving • CNF- and circuit-based solvers • Deriving and using CNF representation (two literal watching, etc) • Conflict-driven learning and non-chronological back-tracking • Dynamic vs. static variable ordering • Incremental SAT solving • Clause forwarding (J.P.Whittemore et al, 2001) • Conditional addition and removal of clauses (N. Een et al, 2003) • Topological ordering of subproblems (F. Lu et al, 2003) • Recent improvements to BMC • Mixing BDDs and SAT (A. Gupta et al, 2003) • Fine-tuning clause forwarding and var. ordering (L. Zhang et al, 2004) • Simplifying the transition relation (A. Kuehlmann, 2004)

  3. Overview • Foundations of SAT solving • CNF- and circuit-based solvers • Deriving and using CNF representation (two literal watching, etc) • Conflict-driven learning and non-chronological back-tracking • Dynamic vs. static variable ordering • Incremental SAT solving • Clause forwarding (J.P.Whittemore et al, 2001) • Conditional addition and removal of clauses (N. Een et al, 2003) • Topological ordering of subproblems (F. Lu et al, 2003) • Recent improvements to BMC • Mixing BDDs and SAT (A. Gupta et al, 2003) • Fine-tuning clause forwarding and var. ordering (L. Zhang et al, 2004) • Simplifying the transition relation (A. Kuehlmann, 2004)

  4. status Satisfiablity() { while (true) { if (!decide()) // if no vars left return SAT; while (!bcp()) { if (!ResolveConflict()) return UNSAT; } } } bool ResolveConflict() { d = most recent decision not tried; if (d == NULL) // no d found return false; flip the value of d; mark d as tried both ways; undo any invalidated implications; backtrack to the level of conflict; return true; } SAT Pseudo-Code M. Moskewicz, C. Madigan, Y. Zhao, L.Zhang, S. Malik. “Chaff: engineering an efficient SAT solver”. Proc. DAC ’01, pp. 530–535

  5. CNF- and Circuit-Based Solvers • The SAT procedure can be implemented using the circuit representation or the CNF representation • Differences in implementation of constraint propagation and variable ordering • The performance is implementation- and problem-dependent • A hybrid solver can be designed • M. K. Ganai, P. Ashar, A. Gupta, L. Zhang, and S. Malik. “Combining strengths of circuit-based and CNF-based algorithms for a highperformance SAT solver”. DAC 2002.

  6. Deriving and Using CNF • CNF can be derived from the circuit • CNF for the circuit is a product of CNFs for each node • The CNF of node y = F(X) is derived by complementing the SOP of the relation R = y  F(X)= y’F(X) + yF(X)’ (deMorgan rule) • In equivalence checking, the miter cone is used • The miter cone is the circuit with a single output, which is 1 iff there is a difference between the two versions of the circuit • To assert that the circuit satisfies the property, we simply union the CNFs of the circuit and the property • CNF provides a convenient representation for SAT solvers to perform constraint propagation

  7. Conflict-Based Learning Picture taken from: M. R. Prasad, A. Biere, A. Gupta, “A survey of recent advances in SAT-based formal verification”. International Journal on Software Tools for Technology Transfer, Vol. 7(2), April 2005, pp. 156 - 173.

  8. Pseudo-Code of Variable Ordering • Perform the following steps: • Compute initial scores using Metric • Sort variables by score and resolve ties using Criterion • At each conflict, increment scores of variables involved in the conflict • Periodically decay all scores and update variable order • The CHAFF solver family uses the variable ordering heuristic called Variable State Independent Decaying Sum (VSIDS) • This ordering may not be the best for BMC

  9. Overview • Foundations of SAT solving • CNF- and circuit-based solvers • Deriving and using CNF representation (two literal watching, etc) • Conflict-driven learning and non-chronological back-tracking • Dynamic vs. static variable ordering • Incremental SAT solving • Clause forwarding (J.P.Whittemore et al, 2001) • Conditional addition and removal of clauses (N. Een et al, 2003) • Topological ordering of subproblems (F. Lu et al, 2003) • Recent improvements to BMC • Mixing BDDs and SAT (A. Gupta et al, 2003) • Fine-tuning clause forwarding and var. ordering (L. Zhang et al, 2004) • Simplifying the transition relation (A. Kuehlmann, 2004)

  10. Clause Forwarding • Learned clauses can be added without changing the SAT problem • Arbitrary clauses can be added without adding new solutions • If two SAT problems have common clauses, the learned clauses derived for one problem can be added to another problem under some conditions (if the learned clauses result from the common clauses) • Theorem [L. Zhang et al, 2004] Let 1, 2, , 1, 2 and  be CNF formulas, and let 1 =   1, 2 =   2. If solving SAT(1) produces the clauses  as learned clauses, such that each clause in  is implied by , then SAT(2)  SAT(2  ). • Proof: Since every clause in  is implied by ,   . Hence   (  ). Therefore, (  2)  (  2   ) and 2  2  .

  11. Conditional Addition/Removal of Clauses • Incremental SAT may involve adding and removing additional clauses • When clauses are removed, the learned clauses, which depend on the clauses that are being removed, should also be removed • Analysis of clause dependency can be complicated (see J. P. Whittemore, J. Kim, K. A. Sakallah, “SATIRE: A new incremental satisfiability engine”. DAC ’01.) • The following simple trick allows us to remove clauses without removing the learned clauses • N. Een, N. Sorensson, “Temporal induction by incremental SAT solving”, Intl. Workshop on BMC 2003.

  12. Conditional Addition/Removal of Clauses • Add one “enabling variable” to each clause that may need to be removed • To enable (add) the clause, set the literals to 0 • To disable (remove) the clause, set the literal to 1 • The number of “enabling variables” is equal to the number of clause groups that may need to be removed independently of each other Group 1 Group 2 z1  a  b’. z2  a  d  e’. z1  a’  c. z1  d.

  13. Topological Ordering of Subproblems • Decompose the SAT problem into a sequence of incremental subproblems, such that the earlier subproblems helped solve the later subproblems. • When subproblems are equivalences among the pairs (groups) of SAT variables, this approach leads to “sat sweeping” • F. Lu, L. Wang, K. Cheng, R. Huang. “A circuit SAT solver with signal correlation guided learning”. Proc. DATE 2003. • A. Kuehlmann, “Dynamic Transition Relation Simplification for Bounded Property Checking”. Proc. ICCAD 2004. T2 T3 T4 T0 T1 I P

  14. Overview • Foundations of SAT solving • CNF- and circuit-based solvers • Deriving and using CNF representation (two literal watching, etc) • Conflict-driven learning and non-chronological back-tracking • Dynamic vs. static variable ordering • Incremental SAT solving • Clause forwarding (J.P.Whittemore et al, 2001) • Conditional addition and removal of clauses (N. Een et al, 2003) • Topological ordering of subproblems (F. Lu et al, 2003) • Recent improvements to BMC • Mixing BDDs and SAT (A. Gupta et al, 2003) • Fine-tuning clause forwarding and var. ordering (L. Zhang et al, 2004) • Simplifying the transition relation (A. Kuehlmann, 2004)

  15. Combining SAT and BDDs (1) • A hybrid SAT solvers have been developed combining CNF with BDDs • The main idea: • Represent some (or all) of the constraints using BDDs rather than CNF • Propagate constraints on both CNF and BDDs • Can be used to reduce the number of variables in the problem, by clustering the constraints • Works well for problems having compact BDD representation R. Damiano, J. Kukula, “Checking satisfiability of a conjunction of BDDs”, DAC 2003

  16. Combining SAT and BDDs (2) • Use BDDs to learn additional conflict clauses and add them dynamically to the problem during the SAT search • The learned clauses correspond to paths to the 0 terminal in a BDD representation, denoting unsatisfiable assignments on the path variables. • The BDDs are created on-the-fly for heuristically selected small regions (i.e., sub-circuits) in the design unrolled for BMC • Several heuristics are proposed to keep the overhead low, while increasing the usefulness of the added clauses • Demonstrated significant speedups in BMC performance. Aarti Gupta, Malay Ganai, Chao Wang, Zijiang Yang, Pranav Ashar, “Learning from BDDs in SAT-based bounded model checking”, DAC 2003.

  17. Fine-Tuning Clause Forwarding new • To maximize the number of forwarded clauses and to simplify the computation, add the new block in the middle I Pn New block is added to the right new I New block is added to the left Pn new I New block is added in the middle Pn Liang Zhang, Mukul Prasad, Michael Hsiao, "Incremental deductive and inductive reasoning for SAT-based bounded model checking“, ICCAD 2004

  18. Improvements in Variable Ordering • Perform the following steps: • Compute initial scores using Metric • Sort variables by score and resolve ties using Criterion • At each conflict, increment scores of variables involved in the conflict • Periodically decay all scores and update variable order • The following heuristics are proposed for BMC: • Metric = The number of clauses the variable appears in. • Criterion = Prefer variables appearing earlier in the topological order Liang Zhang, Mukul Prasad, Michael Hsiao, "Incremental deductive and inductive reasoning for SAT-based bounded model checking“, ICCAD 2004

  19. Dynamic Simplification of Transition Relation Un-initialized unfolding (simplification) ~ ~ ~ … T2 T3 T1    Initialized unfolding (BMC) ~ ~ ~ … T2 I T1 T3     P P P P ~ ~ ~ ~ T3 T4 T1 T2 A. Kuehlmann, “Dynamic transition relation simplication”, ICCAD 2004.

  20. Conclusions and Future Work • SAT-based BMC improved and to some extent replaced BDD-based symbolic model checking • Industry continues to use BDD-based techniques along with SAT • While originally SAT was used in BMC to find bugs, recently several approaches appeared that extend it to the unbounded case • Challenges: • Computation of sequential depth • Implicit timeframe unrolling to replace the explicit one • Evaluation of quantified Boolean formula (QBF solvers, AIGs, etc) • Efficient solution to these challenges are crucial to make the technology widely applicable

More Related