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

a dynamic programming algorithm for prime implicates
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

A dynamic programming algorithm for prime implicates.

Andrew Matusiewicz

slide-2
SLIDE 2

What are prime implicates and why care?

◮ Smallest, simplest disjunctions implied by a statement

slide-3
SLIDE 3

What are prime implicates and why care?

◮ Smallest, simplest disjunctions implied by a statement ◮ Knowing all prime implicates, clausal implication is easy

slide-4
SLIDE 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

slide-5
SLIDE 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

slide-6
SLIDE 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.)

slide-7
SLIDE 7

Propositional Clauses

◮ Propositional variables v1, v2, . . . are either true or false ◮ Connectives ∧ (and), ∨ (or), ¬ (not). ◮ A literal ℓ is a negated or non-negated variable: vi, ¬vi ◮ A clause is an “or” of literals:

(v1 ∨ ¬v3 ∨ v2 ∨ v9) = {v1, ¬v3, v2, v9}

slide-8
SLIDE 8

Prime Implicates

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

slide-9
SLIDE 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.

slide-10
SLIDE 10

Formulas as Graphs

slide-11
SLIDE 11

Formulas as Graphs

slide-12
SLIDE 12

Formulas as Graphs

slide-13
SLIDE 13

“Tree-Like” formula

◮ Their graphs “resemble trees” at a macro level

slide-14
SLIDE 14

“Tree-Like” formula

◮ Their graphs “resemble trees” at a macro level ◮ The common “closeness” measure to a tree is treewidth

(Robertson and Seymour)

slide-15
SLIDE 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.

slide-16
SLIDE 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.

slide-17
SLIDE 17

Structure Trees

slide-18
SLIDE 18

Structure Trees

slide-19
SLIDE 19

Structure Trees

slide-20
SLIDE 20

Structure Trees

slide-21
SLIDE 21

Structure Trees

slide-22
SLIDE 22

Channel Variables

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

slide-23
SLIDE 23

Channel Variables

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

◮ appear at or above that node

slide-24
SLIDE 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

slide-25
SLIDE 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

slide-26
SLIDE 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

slide-27
SLIDE 27

Channel Variables

slide-28
SLIDE 28

Properties of prime implicates

◮ With P0 = P(F[0/v]) and P1 = P(F[1/v]), we say

S(P0, P1, v) = P(F) (S runs in O(n4) time)

slide-29
SLIDE 29

Properties of prime implicates

◮ With P0 = P(F[0/v]) and P1 = P(F[1/v]), we say

S(P0, P1, v) = P(F) (S runs in O(n4) time)

◮ If F and G share no variables and are satisfiable,

P(F) ∪ P(G) = P(F ∧ G)

slide-30
SLIDE 30

Properties of prime implicates

◮ With P0 = P(F[0/v]) and P1 = P(F[1/v]), we say

S(P0, P1, v) = P(F) (S runs in O(n4) time)

◮ If F and G share no variables and are satisfiable,

P(F) ∪ P(G) = P(F ∧ G)

◮ P(0) = {} and P(1) = {}

slide-31
SLIDE 31

Tables

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

slide-32
SLIDE 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[γ])

slide-33
SLIDE 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

slide-34
SLIDE 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

slide-35
SLIDE 35

Obtaining tables

◮ For a structure tree S of F, let Fi be the formula

  • btained by collecting all the clauses under node i.
slide-36
SLIDE 36

Obtaining tables

◮ For a structure tree S of F, let Fi be the formula

  • btained by collecting all the clauses under node i.

◮ Let Ti be the table for Fi with scope CV (i)

slide-37
SLIDE 37

Obtaining tables

◮ For a structure tree S of F, let Fi be the formula

  • btained by collecting all the clauses under node i.

◮ Let Ti be the table for Fi with scope CV (i) ◮ We call Ti “i’s table” or “the table of i”

slide-38
SLIDE 38

Obtaining tables

◮ If i is a leaf, Ti can be obtained by the rules

P(0) = {} and P(1) = {}

slide-39
SLIDE 39

Obtaining tables

◮ If i is a leaf, Ti can be obtained by the rules

P(0) = {} and P(1) = {}

◮ If i is an internal node, Ti can be obtained from the

tables of i’s children using the rules S(P0, P1, v) = P(F) and P(F) ∪ P(G) = P(F ∧ G)

slide-40
SLIDE 40

Obtaining tables

◮ If i is a leaf, Ti can be obtained by the rules

P(0) = {} and P(1) = {}

◮ If i is an internal node, Ti can be obtained from the

tables of i’s children using the rules S(P0, P1, v) = P(F) and P(F) ∪ P(G) = P(F ∧ G)

◮ Thus the table of any node may be obtained recursively.

slide-41
SLIDE 41

Obtaining P(F)

Let r be the root of S. Note that Fr = F.

◮ Obtain Tr recursively.

slide-42
SLIDE 42

Obtaining P(F)

Let r be the root of S. Note that Fr = F.

◮ Obtain Tr recursively. ◮ Narrow the scope of Tr until it is empty, using

S(P0, P1, v) = P(F)

slide-43
SLIDE 43

Obtaining P(F)

◮ A table r with scope ∅ results

slide-44
SLIDE 44

Obtaining P(F)

◮ A table r with scope ∅ results ◮ The domain of this table is Γ(∅), which contains only the

empty assignment γ∅

slide-45
SLIDE 45

Obtaining P(F)

◮ A table r with scope ∅ results ◮ The domain of this table is Γ(∅), which contains only the

empty assignment γ∅

◮ r(γ∅) = P(Fr[γ∅])

slide-46
SLIDE 46

Obtaining P(F)

◮ A table r with scope ∅ results ◮ The domain of this table is Γ(∅), which contains only the

empty assignment γ∅

◮ r(γ∅) = P(Fr[γ∅]) ◮ Fr[γ∅] = Fr = F

slide-47
SLIDE 47

Obtaining P(F)

◮ A table r with scope ∅ results ◮ The domain of this table is Γ(∅), which contains only the

empty assignment γ∅

◮ r(γ∅) = P(Fr[γ∅]) ◮ Fr[γ∅] = Fr = F ◮ Thus r(γ∅) = P(F)

slide-48
SLIDE 48

Final words

◮ This is the first width-parameterized algorithm for prime

implicate production

slide-49
SLIDE 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.

slide-50
SLIDE 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?