a dynamic programming algorithm for prime implicates
play

A dynamic programming algorithm for prime implicates. Andrew - PowerPoint PPT Presentation

A dynamic programming algorithm for prime implicates. Andrew Matusiewicz What are prime implicates and why care? Smallest, simplest disjunctions implied by a statement What are prime implicates and why care? Smallest, simplest


  1. A dynamic programming algorithm for prime implicates. Andrew Matusiewicz

  2. What are prime implicates and why care? ◮ Smallest, simplest disjunctions implied by a statement

  3. What are prime implicates and why care? ◮ Smallest, simplest disjunctions implied by a statement ◮ Knowing all prime implicates, clausal implication is easy

  4. What are prime implicates and why care? ◮ Smallest, simplest disjunctions implied by a statement ◮ Knowing all prime implicates, clausal implication is easy ◮ Used in non-monotonic and abductive reasoning

  5. What are prime implicates and why care? ◮ Smallest, simplest disjunctions implied by a statement ◮ Knowing all prime implicates, clausal implication is easy ◮ Used in non-monotonic and abductive reasoning ◮ Dual, prime implicants, used for circuit minimization

  6. What are prime implicates and why care? ◮ Smallest, simplest disjunctions implied by a statement ◮ Knowing all prime implicates, clausal implication is easy ◮ Used in non-monotonic and abductive reasoning ◮ Dual, prime implicants, used for circuit minimization ◮ Research partner uses in code gen. for embedded systems (Sandeep Shukla, Virginia Tech.)

  7. Propositional Clauses ◮ Propositional variables v 1 , v 2 , . . . are either true or false ◮ Connectives ∧ (and), ∨ (or), ¬ (not). ◮ A literal ℓ is a negated or non-negated variable: v i , ¬ v i ◮ A clause is an “or” of literals: ( v 1 ∨ ¬ v 3 ∨ v 2 ∨ v 9 ) = { v 1 , ¬ v 3 , v 2 , v 9 }

  8. Prime Implicates A clause C is an “ implicate ” of a formula F iff the statement F ⇒ C is a tautology.

  9. Prime Implicates A clause C is an “ implicate ” of a formula F iff the statement F ⇒ C is a tautology. C is a “ prime implicate ” of F , written C ∈ P ( F ) iff C is an implicate of minimal length.

  10. Formulas as Graphs

  11. Formulas as Graphs

  12. Formulas as Graphs

  13. “Tree-Like” formula ◮ Their graphs “resemble trees” at a macro level

  14. “Tree-Like” formula ◮ Their graphs “resemble trees” at a macro level ◮ The common “closeness” measure to a tree is treewidth (Robertson and Seymour)

  15. “Tree-Like” formula ◮ Their graphs “resemble trees” at a macro level ◮ The common “closeness” measure to a tree is treewidth (Robertson and Seymour) ◮ SAT instances F with fixed treewidth k may be solved in linear time.

  16. Treewidth ◮ Synonyms for treewidth ◮ thin junction-tree or jointree (AI literature) ◮ k -tree embeddable (graph theory) ◮ triangularization, clique number k (Lauritzen and Spiegelhalter) ◮ channelwidth k (Hunt and Stearns) ◮ The channelwidth formalism is constructed for analysis of formulas ◮ Channelwidth uses objects called structure trees .

  17. Structure Trees

  18. Structure Trees

  19. Structure Trees

  20. Structure Trees

  21. Structure Trees

  22. Channel Variables ◮ Channel variables CV ( i ) of a node i are those that both

  23. Channel Variables ◮ Channel variables CV ( i ) of a node i are those that both ◮ appear at or above that node

  24. Channel Variables ◮ Channel variables CV ( i ) of a node i are those that both ◮ appear at or above that node ◮ appear in a clause at or below that node

  25. Channel Variables ◮ Channel variables CV ( i ) of a node i are those that both ◮ appear at or above that node ◮ appear in a clause at or below that node ◮ The channelwidth of a formula is min S ∈ S max i ∈ I | CV ( i ) | where S is all valid structure trees for that formula

  26. Channel Variables ◮ Channel variables CV ( i ) of a node i are those that both ◮ appear at or above that node ◮ appear in a clause at or below that node ◮ The channelwidth of a formula is min S ∈ S max i ∈ I | CV ( i ) | where S is all valid structure trees for that formula ◮ Channelwidth corresponds exactly to the graph theoretic notion of treewidth

  27. Channel Variables

  28. Properties of prime implicates ◮ With P 0 = P ( F [0 / v ]) and P 1 = P ( F [1 / v ]), we say S ( P 0 , P 1 , v ) = P ( F ) ( S runs in O ( n 4 ) time)

  29. Properties of prime implicates ◮ With P 0 = P ( F [0 / v ]) and P 1 = P ( F [1 / v ]), we say S ( P 0 , P 1 , v ) = P ( F ) ( S runs in O ( n 4 ) time) ◮ If F and G share no variables and are satisfiable, P ( F ) ∪ P ( G ) = P ( F ∧ G )

  30. Properties of prime implicates ◮ With P 0 = P ( F [0 / v ]) and P 1 = P ( F [1 / v ]), we say S ( P 0 , P 1 , v ) = P ( F ) ( S runs in O ( n 4 ) time) ◮ If F and G share no variables and are satisfiable, P ( F ) ∪ P ( G ) = P ( F ∧ G ) ◮ P (0) = { � } and P (1) = {}

  31. Tables ◮ Let Γ( V ) be the set of interpretations of the variables V

  32. Tables ◮ Let Γ( V ) be the set of interpretations of the variables V ◮ The table t for F with scope V is a mapping from Γ( V ) to clause sets such that t ( γ ) = P ( F [ γ ])

  33. Tables ◮ Let Γ( V ) be the set of interpretations of the variables V ◮ The table t for F with scope V is a mapping from Γ( V ) to clause sets such that t ( γ ) = P ( F [ γ ]) ◮ Tables are determined exactly by their scope and formula

  34. Tables ◮ Let Γ( V ) be the set of interpretations of the variables V ◮ The table t for F with scope V is a mapping from Γ( V ) to clause sets such that t ( γ ) = P ( F [ γ ]) ◮ Tables are determined exactly by their scope and formula ◮ Tables “split” the prime implicates of a formula along all interpretations of some of its variables

  35. Obtaining tables ◮ For a structure tree S of F , let F i be the formula obtained by collecting all the clauses under node i .

  36. Obtaining tables ◮ For a structure tree S of F , let F i be the formula obtained by collecting all the clauses under node i . ◮ Let T i be the table for F i with scope CV ( i )

  37. Obtaining tables ◮ For a structure tree S of F , let F i be the formula obtained by collecting all the clauses under node i . ◮ Let T i be the table for F i with scope CV ( i ) ◮ We call T i “ i ’s table” or “the table of i ”

  38. Obtaining tables ◮ If i is a leaf, T i can be obtained by the rules P (0) = { � } and P (1) = {}

  39. Obtaining tables ◮ If i is a leaf, T i can be obtained by the rules P (0) = { � } and P (1) = {} ◮ If i is an internal node, T i can be obtained from the tables of i ’s children using the rules S ( P 0 , P 1 , v ) = P ( F ) and P ( F ) ∪ P ( G ) = P ( F ∧ G )

  40. Obtaining tables ◮ If i is a leaf, T i can be obtained by the rules P (0) = { � } and P (1) = {} ◮ If i is an internal node, T i can be obtained from the tables of i ’s children using the rules S ( P 0 , P 1 , v ) = P ( F ) and P ( F ) ∪ P ( G ) = P ( F ∧ G ) ◮ Thus the table of any node may be obtained recursively.

  41. Obtaining P ( F ) Let r be the root of S . Note that F r = F . ◮ Obtain T r recursively.

  42. Obtaining P ( F ) Let r be the root of S . Note that F r = F . ◮ Obtain T r recursively. ◮ Narrow the scope of T r until it is empty, using S ( P 0 , P 1 , v ) = P ( F )

  43. Obtaining P ( F ) ◮ A table r with scope ∅ results

  44. Obtaining P ( F ) ◮ A table r with scope ∅ results ◮ The domain of this table is Γ( ∅ ), which contains only the empty assignment γ ∅

  45. Obtaining P ( F ) ◮ A table r with scope ∅ results ◮ The domain of this table is Γ( ∅ ), which contains only the empty assignment γ ∅ ◮ r ( γ ∅ ) = P ( F r [ γ ∅ ])

  46. Obtaining P ( F ) ◮ A table r with scope ∅ results ◮ The domain of this table is Γ( ∅ ), which contains only the empty assignment γ ∅ ◮ r ( γ ∅ ) = P ( F r [ γ ∅ ]) ◮ F r [ γ ∅ ] = F r = F

  47. Obtaining P ( F ) ◮ A table r with scope ∅ results ◮ The domain of this table is Γ( ∅ ), which contains only the empty assignment γ ∅ ◮ r ( γ ∅ ) = P ( F r [ γ ∅ ]) ◮ F r [ γ ∅ ] = F r = F ◮ Thus r ( γ ∅ ) = P ( F )

  48. Final words ◮ This is the first width-parameterized algorithm for prime implicate production

  49. Final words ◮ This is the first width-parameterized algorithm for prime implicate production ◮ The task is still difficult with small treewidth, but this style of algorithm can prevent much repeated work.

  50. Final words ◮ This is the first width-parameterized algorithm for prime implicate production ◮ The task is still difficult with small treewidth, but this style of algorithm can prevent much repeated work. ◮ Questions? Comments?

Recommend


More recommend