Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multi-Domain Logic and its Applications to SAT Implementation Issues Tudor Jebelean, Johannes Kepler Unversity Linz Gábor Kusper, Eszterházy Károly College.

Similar presentations


Presentation on theme: "Multi-Domain Logic and its Applications to SAT Implementation Issues Tudor Jebelean, Johannes Kepler Unversity Linz Gábor Kusper, Eszterházy Károly College."— Presentation transcript:

1 Multi-Domain Logic and its Applications to SAT Implementation Issues Tudor Jebelean, Johannes Kepler Unversity Linz Gábor Kusper, Eszterházy Károly College Eger SYNASC 2008

2 Outline History Implementation issues –Data structure: Spare literal matrix with pointers –Branching: Propagate as much information as possible! Clustering –Test results Deletion of Weaker Assignments –Test results Future work

3 History Philosophy: Propagate as much information as possible at once! Gábor Kusper: Investigation of Binary Representations of SAT especially 2-Literal Representation. Proceedings of CSCS-2002, 2002. Gábor Kusper: Solving the Resolution-Free SAT Problem by Hyper- Unit Propagation in Linear Time. Annals of Mathematics and Artificial Intelligence 43, 129-136, 2005. Gábor Kusper: Solving and Simplifying the Propositional Satisability Problem by Sub-Model Propagation. PhD thesis. Johannes Kepler University Linz, RISC, 2005. Gábor Kusper, Lajos Csőke: Better Test Results for the Graph Coloring and the Pigeonhole Problems using DPLL with k-Literal Representation. Proceedings of ICAI-2007, Volume II. 127-135, 2007.

4 Literal in Multi-Domain Logic A literal is the set of the Boolean assignments which make the function true. The representation: {}FALSE {0}  a {1}a{0,1}TRUE { }FALSE{00}  a  b {11}a  b{00,11}a  b {10}a  b {00,10}  b {10,11}a {00,10,11}a  b {01}  a  b {00,01}  a {01,11}b {00,01,11}  a  b {01,10}a  b {00,01,10}  a  b {01,10,11}a  b{00,01,10,11} TRUE a  b 0 1 0 0 0 1 1 0 0 1 1 1

5 Literal Representation Note that we need 2 k bits. The representation: 00FALSE 10  a 01a11TRUE 0000FALSE1000  a  b 0001a  b1001a  b 0010a  b 1010  b 0011a 1011a  b 0100  a  b 1100  a 0101b 1101  a  b 0110a  b 1110  a  b 0111a  b1111TRUE a  b 0 1 0 0 0 1 1 0 0 1 1 1

6 Basics of the implementation

7 Literal Representation A literal is represented as an integer array. This allows us to use bitwise operations: Intersectionbitwise and (&) Unionbitwise or (|) Based on these fast methods we can implement –Unit Propagation –Deletion of Weak Assignments

8 Unit Propagation on Literal Level Up to 5 prop. variables / multi-variable we can represent a literal by 1 integer (32 bits). In this case we need only 3 elementary operations: –public void unitPropagation(int unit) { bits &= unit; if ( bits == unit ) { subsumed = true; } }

9 Unit Propagation on Literal Level In general a literal is an integer array. Then we need O(3 * 2 k / 32) elementary operations: public void unitPropagation(Literal unit) { intersection(unit); if (equals(unit)) { subsumed = true; } } public void intersection(Literal lit) { int[] input = lit.getBits(); for (int i=0; i<bits.length; i++) { bits[i] &= input[i]; } } public boolean equals(Literal lit) { boolean isEqu = true; int[] input = lit.getBits(); for (int i=0; i<bits.length; i++) { if (bits[i] != input[i]) { isEqu = false; break; } } return isEqu; }

10 Details of the implementation Data structure: Spare literal matrix with pointers Branching: Propagate as much information as possible!

11 Data structure Spare literal matrix with pointers Example: ( a  ¬b )  (¬a  c )  (¬a  ¬c ) 01 10 10 01 10 1011 1100 0011 1100 Multi-var_1 … 2 var. / multi-var: 11 10 11 1011 1111 Domains: Clause_1 Clause_2 …

12 Literal Representation, Once more Note that we need 2 k bits. The representation: 00FALSE 10  a 01a11TRUE 0000FALSE1000  a  b 0001a  b1001a  b 0010a  b 1010  b 0011a 1011a  b 0100  a  b 1100  a 0101b 1101  a  b 0110a  b 1110  a  b 0111a  b1111TRUE a  b 0 1 0 0 0 1 1 0 0 1 1 1

13 Granularity of Unit Propagation A unit has exactly one literal, which is an integer array (with k = 2^number of prop. var / multi-var bits). With this representation we may propagate: 1, 2, …, k-1 bits at once Most coarse grained UP (lot of information):1 bit … Normal UP (half of the information):k/2 bits … Most fine grained UP (very little information):k-1 bits We may mix kind of UPs when we branch!

14 Propagate as much as possible Use always the most coarse grained UP for branching, i.e., propagate as much information as you can! 0001 1000 0010 1011 1100 0011 1100

15 Test results We tested our Java implementation on unsatisfiable SAT problems from the SATLIB page: http://www.cs.ubc.ca/~hoos/SATLIB/

16 What is the value of Multi-Domain Logic? Multi-Domain Logic brings new ideas, which result in new simplification techniques: –Clustering –Deletion of Weak Assignments –Variable merging We implemented DPLL using Multi-Domain Logic to judge these techniques.

17 Clustering Clustering is a method which shuffles the propositional variables in order to have more multi-variable units at the beginning of the search.

18 Search Space BRANCHING UNIT PROPAGATION Early UNIT PROPAGATIONS small search space!

19 Does Multi-Domain Logic allow early units? YES! Do this: –Take the shortest clause. –Merge its variables. –Now it is a unit! BUT! –The number of bits grows exponential by increasing the number of merged Boolean variables! The solution! –Cluster the input clause set before the search starts!

20 Clustering uuf50-010.cnf, rate = 7 Before clustering: 34 28 4 0 %TERNARY -43 -19 48 0 %BINARY 12 6 33 0 %TERNARY 22 21 10 0 %TERNARY 11 -5 48 0 %TERNARY -24 -29 49 0 %BINARY -45 26 -35 0 %TERNARY -49 -14 -37 0 %TERNARY 3 48 8 0 %TERNARY 20 -23 26 0 %BINARY … After clustering: 33 37 29 0 %BINARY -34 -30 13 0 %BINARY 16 2 19 0 %BINARY 18 51 3 0 %TERNARY 45 -44 13 0 %BINARY -31 -38 35 0 %BINARY -49 53 -55 0 %BINARY -35 -17 -56 0 %TERNARY 8 13 9 0 %UNIT 4 -52 53 0 %BINARY … Borders are at: 1, 8, 15, 22, 29, 36, 43, 50, 57, …

21 Test Result, Clustering UUF050: Unsatisfiable Uniform Random-3-SAT Problems with 50 propositional variables

22 The same result in table form Propositional variables / multi-variable: 1234567 Running time without clustering (ms): 32542953264867210964702 Running time with clustering (ms): 325336319342351627758 Clustering gives significant speed-up! Best running time (319 ms) is in case of clustering and 3 prop. var. / multi-var. Note that the longest clause is 3-clause!

23 Weaker Assignments Let F be a formula, D be a domain and v, w elements of D. Then w is weaker than v iff v occurs in any literal where w occurs. The weaker assignment w can be eliminated from D, because any solution using w can be transformed in a solution using v. 1011 1100 0011 1100

24 Search Space 1 0 1 1 1 0 0 00 0 1 00 0 0 1

25 Search Space after Deleting the Weaker Assignments 1 0 0 0

26 Test Results Pigeon Hole Problem with 6 holes and 7 pigeons hole6.cnf: 6 5 4 3 2 1 0 12 11 10 9 8 7 0 18 17 16 15 14 13 0 24 23 22 21 20 19 0 30 29 28 27 26 25 0 36 35 34 33 32 31 0 42 41 40 39 38 37 0 -1 -7 0 -1 -13 0 -1 -19 0 -1 -25 0 -1 -31 0 -1 -37 0 -7 -13 0 …

27 The same result in table form Propositional variables / multi-variable: 123456789 Running time (ms) with no Deletion of Weaker Assignments (DoWA): 1000375469235203172203219297 Running time (ms) with DoWA only once in the preprocessing: 10003754692191877994110110 Running time (ms) with DoWA also after a new unit is found: 100020315610993627894109 Deletion of Weaker Assignments gives significant speed-up! Best running times is in case of 6 prop. var. / multi-var. Note that the longest clause is 6-clause!

28 The same table for hole7.cnf Propositional variables / multi-variable: 123456789 Running time (ms) with no Deletion of Weaker Assignments (DoWA): 2278147663313228121882265212521252781 Running time (ms) with DoWA only once in the preprocessing: 22781482832032187207822506407971047 Running time (ms) with DoWA also after a new unit is found: 22781 20781219922813859547703860 Deletion of Weaker Assignments gives significant speed-up! Best running times is in case of 7 prop. var. / multi-var. Note that the longest clause is 7-clause!

29 Future work Now it is implemented in Java. –Migrate it to C / C++. We would like to implement –Variable merging, –Lazy data structure, –Watch literals, –Pure literal elimination.

30 Thank you for your attention!


Download ppt "Multi-Domain Logic and its Applications to SAT Implementation Issues Tudor Jebelean, Johannes Kepler Unversity Linz Gábor Kusper, Eszterházy Károly College."

Similar presentations


Ads by Google