1 / 22

Decision Procedures An Algorithmic Point of View

Decision Procedures An Algorithmic Point of View. BDDs Modified by Aditya Kanade E0 223 – Indian Institute of Science. Part I. Reminders - What is Logic Proofs by deduction Proofs by enumeration Soundness and Completeness Deciding Propositional Logic SAT tools BDDs. . . . . .

berget
Download Presentation

Decision Procedures An Algorithmic Point of View

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. Decision ProceduresAn Algorithmic Point of View BDDs Modified by Aditya Kanade E0 223 – Indian Institute of Science Daniel Kroening and Ofer Strichman

  2. Part I • Reminders - • What is Logic • Proofs by deduction • Proofs by enumeration • Soundness and Completeness • Deciding Propositional Logic • SAT tools • BDDs       Decision Procedures An algorithmic point of view

  3. Next: Binary Decision Diagrams • SAT looked for a satisfying solution to CNF • We will now examine a graph-based data structure called Binary Decision Diagrams. • It has several advantages and disadvantages compared to SAT • Developed by Bryant [1986]. Next few slides are from the source … Decision Procedures An algorithmic point of view

  4. A B C 0 1 A B C 0 1 Alternate Approach • Generate complete representation of function • Canonicity: functions are equal iff representations are identical (A  C)  (C  B) (A  B)  (C) Decision Procedures An algorithmic point of view

  5. Decision Structures • Vertex represents decision • Follow green (dashed) line for value 0 • Follow red (solid) line for value 1 • Function value determined by leaf value. Truth Table Decision Tree Decision Procedures An algorithmic point of view

  6. Variable Ordering • Assign arbitrary total ordering to variables • e.g., x1 < x2 < x3 • Variables must appear in ascending order along all paths OK Not OK x x 3 1 x 2 x x3 1 Decision Procedures An algorithmic point of view

  7. a a a Reduction Rule #1 Merge equivalent leaves Decision Procedures An algorithmic point of view

  8. x x x x x x y z y z y z Reduction Rule #2 Merge isomorphic nodes Decision Procedures An algorithmic point of view

  9. x y y Reduction Rule #3 Eliminate Redundant Tests Decision Procedures An algorithmic point of view

  10. Example OBDD • Canonical representation of Boolean functions • For a given variable ordering • Two functions are equivalent iff graphs are isomorphic • Can be tested in linear time Initial Graph Reduced Graph (x1 x2)  x3 Decision Procedures An algorithmic point of view

  11. Constants Unique unsatisfiable function Unique tautology Satisfiability etc. • Conclusion: given a BDD it takes constant time to check: • Validity • Contradiction • Satisfiability • Is this a free lunch ? … Decision Procedures An algorithmic point of view

  12. Linear Growth Exponential Growth Effect of Variable Ordering Good Ordering Bad Ordering Decision Procedures An algorithmic point of view

  13. Selecting Good Variable Ordering • Intractable Problem • Even when problem represented as OBDD • i.e., to find optimum improvement to current ordering • Application-Based Heuristics • Exploit characteristics of application • e.g., Ordering for functions of combinational circuit • Traverse circuit graph depth-first from outputs to inputs Decision Procedures An algorithmic point of view

  14. Building BDDs ‘from below’ • Starting from a binary decision tree is too hard for formulas with many variables. • Goal: construct the BDD ‘from below’. Decision Procedures An algorithmic point of view

  15. Building BDDs ‘from below’ • For this we will need a function called APPLY: • Given the BDDs for f1 and f2, • and a binary connective o, • Construct the BDD for f1o f2, Decision Procedures An algorithmic point of view

  16. x 1 x 3 0 1 Building BDDs ‘from below’ • Def: a restriction of a function f to x=d, denoted f|x=d where xbelongs to vars(f), d in {0,1}, is equal to f after assigning x=d. • Given the BDD of f, deriving the BDD of f|x=0 is simple: f: (x1 x2)  x3 f|x2=1 x 3 0 1 Decision Procedures An algorithmic point of view

  17. Now, APPLY (1/3) • Let v1,v2 denote that root nodes of f1, f2, respectively, with var(v1) = x1 and var(v2)=x2. • If v1 and v2 are leafs, f1 o f2 is a leaf node with value val(v1) o val(v2)  1 = 0 1  1 = 0 0 Decision Procedures An algorithmic point of view

  18. x BDD for f1|x=1 f2|x=1 BDD for f1|x=0 f2|x=0 Now, APPLY (2/3) • If x1 = x2 = x, apply Shanon expansion:f1 o f2 = (xf1|x=0of2|x=0xf1|x=1 o f2|x=1) x x  = BDD for f1|x=1 BDD for f2|x=1 BDD for f1|x=0 BDD for f2|x=0 Decision Procedures An algorithmic point of view

  19. Now, APPLY (3/3) • else, suppose x1 < x2 in the variable order.f1 o f2 = (x1f1|x1=0of2x1f1|x1=1of2) x1 x2 x1  = BDD for f1|x=1 f2 BDD for f1|x=0 f2 BDD for f1|x1=1 BDD for f2|x2=1 BDD for f1|x1=0 BDD for f2|x2=0 Decision Procedures An algorithmic point of view

  20. BDD for f1|x1=0 f2 BDD for f1|x1=1 f2 x x 1 1 BDD for f1|x1=0 f2 = x2  x x x x 2 2 2 2 = 0 1 1 1 1 1 0 0 0 0 0  0 = 0 1  1 = 1 BDDs from below: example. x 2 =  f2= x2 f1= x1 x2 Decision Procedures An algorithmic point of view

  21. BDD for f1|x=0 f2 BDD for f1|x=1 f2 x x x x 1 1 1 1 x x x x x x 2 2 2 2 2 2 = 1 1 1 1 1 0 0 0 0 BDDs from below: example. x 2 =  f2=x2 f1= x1 x2 f1 f2 = x1 (x1x2) = Decision Procedures An algorithmic point of view

  22. Comparing SAT to BDDs • BDD is a canonical data structure that represents the semantic of a function, i.e. all its solutions • Some applications (e.g. symbolic model checking) need canonicity to detect when two sets are equivalent. • Can require exponential space & time (highly sensitive to variable ordering) • SAT searches through CNF for a single solution • CNF is not canonical. • Poly-space algorithms exists. Time can be exponential. Decision Procedures An algorithmic point of view

More Related