1 / 30

Multi-Domain Logic and its Applications to SAT Implementation Issues

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. Outline. History Implementation issues Data structure: Spare literal matrix with pointers

yeva
Download Presentation

Multi-Domain Logic and its Applications to SAT Implementation Issues

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. Multi-Domain Logic and its Applications to SATImplementation 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 2k bits. • The representation:00 FALSE 10 a01 a 11 TRUE • 0000 FALSE 1000 ab0001 ab 1001 ab0010 ab 1010 b0011 a 1011 ab0100 ab 1100 a0101 b 1101 ab0110 ab 1110 ab0111 ab 1111 TRUE 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: • Intersection bitwise and (&) • Union bitwise 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-variablewe 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 * 2k / 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. 01 10 10 01 10 10 1011 1100 0011 1100 1100 Data structure • Spare literal matrix with pointers • Example: ( a  ¬b )  (¬a c )  (¬a  ¬c ) Multi-var_1 … 2 var. / multi-var: Clause_1 Clause_2 … 11 10 11 1011 1111 Domains:

  12. Literal Representation, Once more • Note that we need 2k bits. • The representation:00 FALSE 10 a01 a 11 TRUE • 0000 FALSE 1000 ab0001 ab 1001 ab0010 ab 1010 b0011 a 1011 ab0100 ab 1100 a0101 b 1101 ab0110 ab 1110 ab0111 ab 1111 TRUE 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! 1011 1100 0011 1100 1100 0001 1000 0010

  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 Early UNIT PROPAGATIONS small search space! UNIT PROPAGATION

  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. Before clustering: 34 28 4 0 %TERNARY -43 -19 480 %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 … Clustering uuf50-010.cnf, rate = 7 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: • 1 2 3 4 5 6 7 • Running time without clustering (ms): • 325 429 532 648 672 1096 4702 • Running time with clustering (ms): • 325 336 319 342 351 627 758 • 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 1011 1100 0011 1100 1100 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.

  24. Search Space 1 0 11 1 0 0 0 0 0 1 0 0 0 0 1

  25. Search Space after Deleting the Weaker Assignments 1 0 00 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: • 1 2 3 4 5 6 7 8 9 • Running time (ms) with no Deletion of Weaker Assignments (DoWA): • 1000 375 469 235 203 172 203 219 297 • Running time (ms) with DoWA only once in the preprocessing: • 1000 375 469 219 187 79 94 110 110 • Running time (ms) with DoWA also after a new unit is found: • 1000 203 156 109 93 62 78 94 109 • 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: • 1 2 3 4 5 6 7 8 9 • Running time (ms) with no Deletion of Weaker Assignments (DoWA): • 22781 4766 3313 2281 2188 2265 2125 2125 2781 • Running time (ms) with DoWA only once in the preprocessing: • 22781 4828 3203 2187 2078 2250 640 797 1047 • Running time (ms) with DoWA also after a new unit is found: • 22781 2078 1219 922 813 859 547 703 860 • 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!

More Related