temporal induction and sat solving
play

Temporal Induction and SAT-Solving Niklas Srensson April 21, 2010 - PowerPoint PPT Presentation

Temporal Induction and SAT-Solving Niklas Srensson April 21, 2010 Niklas Srensson Temporal Induction and SAT-Solving April 21, 2010 1 / 21 Simple Induction i 0 s 0 (Base-case) F ok? i n + 1 i n s n (Step-case) F F ok! ok? Niklas


  1. Temporal Induction and SAT-Solving Niklas Sörensson April 21, 2010 Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 1 / 21

  2. Simple Induction i 0 s 0 (Base-case) F ok? i n + 1 i n s n (Step-case) F F ok! ok? Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 2 / 21

  3. Reachability State Space Bad States Reachable States Init States Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 3 / 21

  4. Example: Simple Induction Fails State Space Bad States Reachable States Init States Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 4 / 21

  5. Induction with Depth (k=3) i 0 i 1 i 2 s 0 (Base-case) F F F ok? ok? ok? i n + 1 i n + 2 i n + 3 i n s n (Step-case) F F F F ok! ok! ok! ok? Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 5 / 21

  6. Correctness of Induction with Depth (k=3) s 0 s 1 s 2 s 3 s 4 s 5 s 6 . . . For any trace: Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 6 / 21

  7. Correctness of Induction with Depth (k=3) s 0 s 1 s 2 s 3 s 4 s 5 s 6 . . . ok ok ok For any trace: ◮ First 3 states are ok Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 6 / 21

  8. Correctness of Induction with Depth (k=3) s 0 s 1 s 2 s 3 s 4 s 5 s 6 . . . ok ok ok ok For any trace: ◮ First 3 states are ok ◮ 3 consecutive ok states must be succeeded by an ok state Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 6 / 21

  9. Correctness of Induction with Depth (k=3) s 0 s 1 s 2 s 3 s 4 s 5 s 6 . . . ok ok ok ok ok For any trace: ◮ First 3 states are ok ◮ 3 consecutive ok states must be succeeded by an ok state ◮ And so on Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 6 / 21

  10. Correctness of Induction with Depth (k=3) s 0 s 1 s 2 s 3 s 4 s 5 s 6 . . . ok ok ok ok ok ok For any trace: ◮ First 3 states are ok ◮ 3 consecutive ok states must be succeeded by an ok state ◮ And so on Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 6 / 21

  11. Example: Induction with Depth Fails State Space Bad States Reachable States Init States Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 7 / 21

  12. Unique State Induction (k=3) i n + 1 i n + 2 i n + 3 i n s n F F F F ok! ok! ok! ok? Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 8 / 21

  13. Unique State Induction (k=3) i n + 1 i n + 2 i n + 3 i n s n F F F F ok! ok! ok! ok? All Different! Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 8 / 21

  14. Correctness of Unique State Induction ◮ Unique state induction proves that all loop-free paths are ok ◮ Why can paths with loops be ignored? Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 9 / 21

  15. Correctness of Unique State Induction ◮ Unique state induction proves that all loop-free paths are ok ◮ Why can paths with loops be ignored? Example trace: s 1 = s 3 , s 4 = s 5 s 0 s 1 s 2 s 3 s 4 s 5 s 6 ok ok ok ok ok ok ¬ ok Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 9 / 21

  16. Correctness of Unique State Induction ◮ Unique state induction proves that all loop-free paths are ok ◮ Why can paths with loops be ignored? Example trace: s 1 = s 3 , s 4 = s 5 s 0 s 1 s 1 s 2 s 3 s 3 s 4 s 5 s 6 ok ok ok ok ok ok ¬ ok Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 9 / 21

  17. Correctness of Unique State Induction ◮ Unique state induction proves that all loop-free paths are ok ◮ Why can paths with loops be ignored? Example trace: s 1 = s 3 , s 4 = s 5 s 0 s 3 s 4 s 5 s 6 ok ok ok ok ¬ ok Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 9 / 21

  18. Correctness of Unique State Induction ◮ Unique state induction proves that all loop-free paths are ok ◮ Why can paths with loops be ignored? Example trace: s 1 = s 3 , s 4 = s 5 s 0 s 3 s 4 s 4 s 5 s 5 s 6 ok ok ok ok ¬ ok Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 9 / 21

  19. Correctness of Unique State Induction ◮ Unique state induction proves that all loop-free paths are ok ◮ Why can paths with loops be ignored? Example trace: s 1 = s 3 , s 4 = s 5 s 0 s 3 s 5 s 6 ok ok ok ¬ ok Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 9 / 21

  20. Correctness of Unique State Induction ◮ Unique state induction proves that all loop-free paths are ok ◮ Why can paths with loops be ignored? Example trace: s 1 = s 3 , s 4 = s 5 s 0 s 3 s 5 s 6 ok ok ok ¬ ok Counter-examples with loops can always be made loop-free! Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 9 / 21

  21. Property Generalization State Space Bad States Reachable States Init States Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 10 / 21

  22. Property Generalization State Space Bad States Reachable States Init States Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 10 / 21

  23. Induction in Practice ◮ Complete Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 11 / 21

  24. Induction in Practice ◮ Complete ◮ Increase depth until proof goes through (or counter example is found) Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 11 / 21

  25. Induction in Practice ◮ Complete ◮ Increase depth until proof goes through (or counter example is found) ◮ Necessary depth can be very large (exponential) Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 11 / 21

  26. Induction in Practice ◮ Complete ◮ Increase depth until proof goes through (or counter example is found) ◮ Necessary depth can be very large (exponential) ◮ Induction may be strengthened by: Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 11 / 21

  27. Induction in Practice ◮ Complete ◮ Increase depth until proof goes through (or counter example is found) ◮ Necessary depth can be very large (exponential) ◮ Induction may be strengthened by: ◮ Multiple properties Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 11 / 21

  28. Induction in Practice ◮ Complete ◮ Increase depth until proof goes through (or counter example is found) ◮ Necessary depth can be very large (exponential) ◮ Induction may be strengthened by: ◮ Multiple properties ◮ Manual generalization Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 11 / 21

  29. Induction in Practice ◮ Complete ◮ Increase depth until proof goes through (or counter example is found) ◮ Necessary depth can be very large (exponential) ◮ Induction may be strengthened by: ◮ Multiple properties ◮ Manual generalization ◮ Automatic generalization Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 11 / 21

  30. Satisfiability (SAT) in BMC and Induction x 0 x 1 x 2 F x 3 x 4 ok? Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 12 / 21

  31. Satisfiability (SAT) in BMC and Induction x 0 x 1 x 2 F x 3 x 4 ok? ◮ Find values for inputs x 0 . . . x n such that ok becomes false Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 12 / 21

  32. Satisfiability (SAT) in BMC and Induction x 0 x 1 x 2 F x 3 x 4 ok? ◮ Find values for inputs x 0 . . . x n such that ok becomes false ◮ Or, prove that no such set of values exists Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 12 / 21

  33. Why is it hard? x 0 x 1 x 2 x 3 ok 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 ◮ Enumeration does not work 0 1 1 0 0 0 1 1 1 0 ◮ Given k inputs there are 2 k 1 0 0 0 0 combinations 1 0 0 1 0 1 0 1 0 0 1 0 1 1 1 1 1 0 0 0 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 13 / 21

  34. Conjunctive Normal Form Variables: a , b , c , . . . Literals: a , ¬ a , b , ¬ b , c , ¬ c , . . . Clauses: Disjunctions of literals Ex: ( ¬ a ∨ b , ¬ c ) CNF: Conjunction of clauses Ex: ( ¬ a ∨ b ) ∧ ( ¬ a ∨ c ) ∧ ( ¬ a ∨ ¬ b ∨ c ) Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 14 / 21

  35. SAT-Problem Definition ◮ A CNF is satisfiable if there is a variable assignment that evaluates all clauses to true ◮ (i.e. each clause contains at least one true literal) ◮ If no satisfying assignment exists, the CNF is unsatisfiable Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 15 / 21

  36. SAT-Problem Definition ◮ A CNF is satisfiable if there is a variable assignment that evaluates all clauses to true ◮ (i.e. each clause contains at least one true literal) ◮ If no satisfying assignment exists, the CNF is unsatisfiable Example ( a ∨ b ) ( ¬ a ∨ ¬ b ) Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 15 / 21

  37. SAT-Problem Definition ◮ A CNF is satisfiable if there is a variable assignment that evaluates all clauses to true ◮ (i.e. each clause contains at least one true literal) ◮ If no satisfying assignment exists, the CNF is unsatisfiable Example ( a ∨ b ) ( ¬ a ∨ ¬ b ) ◮ a = 1 , b = 1 is not a satisfying assignment Niklas Sörensson Temporal Induction and SAT-Solving April 21, 2010 15 / 21

Recommend


More recommend