170 likes | 283 Views
A failed attempt to optimize variable ordering with tools for Constraints Solving. Edmund Clarke Ofer Strichman Carnegie Mellon University. Outline. What is the minimal cut-width problem ? Why is it relevant to verification ? Modeling min cut-width as CSP Experimental results.
E N D
A failed attempt to optimize variable ordering with tools for Constraints Solving Edmund Clarke Ofer Strichman Carnegie Mellon University
Outline • What is the minimal cut-width problem ? • Why is it relevant to verification ? • Modeling min cut-width as CSP • Experimental results
Edges crossing vi: e e vi vi Minimal Cut-width problem (1/3) • Let G(V,E) be a hyper-graph, where |V| = n. • An edge ecrosses variable vi in a given variable order if vie or if e contains vertices both to the left and right of vi.
Minimal Cut-width problem (2/3) • Definition: The cut-width of G at vi (1in) with respect to a given order is the number of edges crossing vi Cut-width: 1 1 2 2 1 • Definition: The cut-width of Gwith respect to a given order is the maximal cut-width of G among all vi V
Minimal Cut-width problem (3/3) • Variable Order affects the cut-width: e1 e1 e2 e3 e3 e2 v5 v1 v2 v3 v4 v1 v2 v3 v4 v5 Cut-width = 2 Cut-width = 3 • The min cut-width problem: Given a hyper-graph G(V,E), find a variable order which minimizes the cut-width of G.
Relevance to Verification • Definitions: • n = # input variables • c = cut-width • Berman [1991]: The size of a BDD representing a circuit is bounded by n*2c • Wang, Clarke, Zhu, Kukula [2001]: CNF-SAT time complexity is bounded by O(n*2c) • ....
DNF-Cutwidth O1 : 1 x1 x2 x3 x4 x5 x6 DNF-Cutwidth O2 : n x1 x3 x5 ... x2 x4 Cut-width and BDD’s Bryant, 1986: : (x1 x2) (x3 x4) ... (x2n-1 x2n) O1: x1, x2, ... ,x2n-1,x2nBDD size: 2n+2 O2: x1, x3, ... x2n-1, x2, x4, ... x2nBDD size: 2n+1
v Relevance to SAT • CNF-SAT time complexity is bounded by O(n*2c) • n is the number of variables; c is the cut-width • The reason: • Assume the number of literals in each clause is fixed. • Assume we backtrack over a cut v • We must change at least one variable in cutset(v) • Conclusion: we will not cross v more than 2 cutset(v), or, O(2c)
In a standard SAT solver: : (x = y1 y2 y3) ..... x = T y1 = F y2 = F y3 = T x = T y1 = F y2 = F y3 = T Suppose is sat only if x=y1=T Relevance to SAT Small cut-width means that related variables are kept close to each other.
Min Cut-width as CSP (1/5) Input:
Min Cut-width as CSP (2/5) • Every variable is positioned in one location: • Every location is assigned one variable: indicates whether variable j is located in position i
Min Cut-width as CSP (3/5) • indicates whether literal i of clause c is positioned in the left (-1) or right (1) to position k: k lci= ‘a’ a x1a x2a x3a x4a x5a x6a 0 0 1 0 0 0
2 2 1 -1 -2 Min Cut-width as CSP (4/5) • indicates whether clause c crosses location k:
2 1 0 -1 -2 Min Cut-width as CSP (4/5) • indicates whether clause c crosses location k:
Min Cut-width as CSP (5/5) • CutWidth is the largest no. of clauses crossing any location: Objective:
Complexity of formulation • Overall No. of constraints: • n is the number of variables • l is the number of literals • Cl is the number of clauses • # Binary variables:
Results • OPLstudio / ‘Solver’: • B-Prolog: similar 2-CNF formulas