PageRenderTime 25ms CodeModel.GetById 33ms RepoModel.GetById 0ms app.codeStats 0ms

/ComputerAlgebra/Satisfiability/Lisp/Generators/plans/general.hpp

https://github.com/exp04shy/oklibrary
C++ Header | 217 lines | 0 code | 2 blank | 215 comment | 0 complexity | f3761fde2e638816f66e19eb80deb229 MD5 | raw file
  1. // Oliver Kullmann, 23.12.2007 (Swansea)
  2. /* Copyright 2007, 2008, 2009, 2010 Oliver Kullmann
  3. This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
  4. it and/or modify it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation and included in this library; either version 3 of the
  6. License, or any later version. */
  7. /*!
  8. \file ComputerAlgebra/Satisfiability/Lisp/Generators/plans/general.hpp
  9. \brief Plans for Maxima-generators for clause-sets
  10. \todo Split Generators/Generators.mac
  11. <ul>
  12. <li> Pigeonhole formulas </li>
  13. <li> DONE %Ramsey problems </li>
  14. <li> Special minimally unsatisfiable clause-sets
  15. <ol>
  16. <li> The documentation should mention random_splitting_mus in
  17. ComputerAlgebra/Satisfiability/Lisp/MinimalUnsatisfiability/SplittingAnalysis.mac
  18. </li>
  19. </ol>
  20. </li> DONE (moved to Satisfiability/Lisp/MinimalUnsatisfiability)
  21. <li>
  22. The translations are not generators, and should go somewhere else.
  23. <ol>
  24. <li> Perhaps to modules related to the problems they solve (by
  25. reduction). </li>
  26. <li> Or as kind of transformer-generators to the module where the
  27. transformed problem is solved. </li>
  28. <li> In any case, links should be provided. </li>
  29. </ol>
  30. </li>
  31. <li> Sudoku-problems : DONE </li>
  32. </ul>
  33. \todo Add tests for parity generators
  34. \todo Update milestones
  35. <ul>
  36. <li> Some general development strategies are to be developed. </li>
  37. <li> Perhaps we should have a sub-module "LatinSquares" (including
  38. Sudoku). </li>
  39. <li> What happened to
  40. ComputerAlgebra/Satisfiability/Lisp/Generators/plans/LinearInequality.hpp
  41. (mentioned in milestone 0.1.4) ? </li>
  42. <li> DONE
  43. Generators/plans/RamseyProblems.hpp needs to be re-thought and
  44. completely updated. </li>
  45. <li> DONE
  46. ComputerAlgebra/Satisfiability/Lisp/Generators/RamseyTheory/plans/HindmanProblems.hpp
  47. is not integrated at all. </li>
  48. </ul>
  49. \todo Accompanying statistics
  50. <ul>
  51. <li> We need to establish the scheme how to supply measurements for
  52. generators (i.e., computing measures without creating the problems). </li>
  53. <li> The scheme in ComputerAlgebra/Satisfiability/Lisp/Generators/Sudoku.mac
  54. is to use the respective statistics-function-names as prefixes. </li>
  55. </ul>
  56. \todo Write basic docus
  57. <ul>
  58. <li> We need basic docus for all generators. </li>
  59. </ul>
  60. \todo %Variables
  61. <ul>
  62. <li> Compare "Global variables" in
  63. ComputerAlgebra/plans/Maxima.hpp. </li>
  64. <li> Is the new scheme (using in functions "php_var(i,j)" instead
  65. of "php(i,j)", where php_var(i,j) := nounify(php)(i,j), now right?
  66. Why didn't the old scheme work?? (It kept a memory for the created
  67. symbols about their place of creation!!) Why is nounify(php) needed,
  68. where php is already a "noun" ?? </li>
  69. <li> Given a formal clause-set FF, how to create *new* variables?
  70. <ol>
  71. <li> The need arises in constructions. </li>
  72. <li> Perhaps for each construction a new type of variable is introduced,
  73. like "php" for the pigeonhole formulas. </li>
  74. <li> Transformers which use a given clause-set F should at least
  75. check that F doesn't contain the dedicated "new" variables --- otherwise
  76. perhaps the computation is just aborted with an error message. </li>
  77. <li> This test can be performed with e.g. <code>freeof(php,F)</code>.
  78. </li>
  79. </ol>
  80. </li>
  81. <li> DONE
  82. It seems that "declare(php, noun)" cannot be used twice, and thus
  83. we cannot reload a file containing such a declaration?? Is just to kill
  84. "php" before the solution? </li>
  85. </ul>
  86. \todo Flood-it
  87. <ul>
  88. <li> Motivated by a talk at BCTCS 2010 (Markus Jalsenius). </li>
  89. <li> Their Internet resource is http://floodit.cs.bris.ac.uk . </li>
  90. <li> Rules:
  91. <ol>
  92. <li> The parameters are n (the dimension of the board) and c (the number
  93. of colours). </li>
  94. <li> Additionally we use k for the maximal number of moves. </li>
  95. <li> We have the graph G_{n,n}, the nxn grid, with vertex set
  96. {1,...,n}^2, and with the horizontal and vertical links (so the degree
  97. of a corner vertex is 2, of a border vertex is 3, and of an inner vertex
  98. is 4). </li>
  99. <li> Furthermore we have a map f_0: V -> {1, ..., c}. </li>
  100. <li> The moves will construct further maps
  101. f_1, ..., f_k: V -> {1,...,c}. </li>
  102. <li> For round 0 <= r <= k let C(r) be the connected component of
  103. (1,1), where all vertices w with f_r(w) # f_r((1,1)) have been
  104. removed. </li>
  105. <li> A move in round r in {1,...,k} now consists in choosing a colour i
  106. in {1,...,c}, which results in the colour of all vertices in C(r-1)
  107. being changed to i, that is, a transition f_{r-1} -> f_r is performed.
  108. </li>
  109. <li> The aim is to have all vertices having the same colour, that is,
  110. f_k is a constant function, which is equivalent to C(k) = V. </li>
  111. </ol>
  112. </li>
  113. <li> Translation to non-boolean SAT, encoding the round when a vertex
  114. has been reached:
  115. <ol>
  116. <li> Using variable m_1, ..., m_k, each of domain {1,...,c}, for the
  117. moves. </li>
  118. <li> And variables a_v for v in V, each of domain {0,...,k}, for the
  119. round at which a_v has been "reached" (that is, the minimal r such that
  120. v in C(r)). </li>
  121. <li> The whole problem is given by the set of conditions C(v,r) for
  122. vertices v in V and rounds r in {1,...,k}, where C(v,r) is true iff at
  123. least one neighbour of v has been reached at round r-1 and the initial
  124. colouring f_0(v) is equal to the value of m_r. </li>
  125. <li> (1,1) and neighbours of (1,1) are best handled separately. </li>
  126. <li> And likely one should explicitely state that once a node has been
  127. reached, it stays reached; this needs new variables (see the
  128. b-variables below). </li>
  129. <li> The domain of the condition C(v,r) is {m_r,a_v} plus a_w for the
  130. neighbours w of v. </li>
  131. <li> C(v,r) is a conjunction of c implications, each having as
  132. premisse that m_r = i for i in {1,...,c}, and having as conclusion
  133. that a_v has value r iff at least one of its neighbours of colour i
  134. (initially) has value r-1. </li>
  135. <li> This is not yet complete, since "reached stays reached" is not
  136. expressed. One could handle that by relaxing the condition "has value
  137. r-1" to "has value at most r-1". But this seems inefficient, since
  138. we should keep the domain of C(v,r) small. </li>
  139. <li> One could introduce new boolean variables b_{v,r} with the meaning
  140. that v has been reached in one of the rounds 1, ..., r, that is, v is
  141. equivalent to the conjunction of a_v=i for i in {1,...,r}. </li>
  142. </ol>
  143. </li>
  144. <li> MG had the idea to express the problem via an iterated condition
  145. system. </li>
  146. </ul>
  147. \todo SMUSAT(1) and tree hitting clause-sets
  148. <ul>
  149. <li> We need to establish links in the docus to the generators mentioned
  150. below from other modules. </li>
  151. <li> DONE (see ComputerAlgebra/Trees/Lisp/Basics.mac)
  152. The basic question is how to represent trees. </li>
  153. <li> DONE (see
  154. ComputerAlgebra/Satisfiability/Lisp/ConflictCombinatorics/HittingClauseSets.mac)
  155. And we need two variants: One where the inner nodes are
  156. labelled with variables, and one without (here standard variables
  157. are supplied). </li>
  158. <li> DONE The construction works also in case of "regular variable
  159. labellings", where variables may occur at many places, but only
  160. once on a path. </li>
  161. <li> DONE In this general form we get exactly the "tree hitting clause-sets".
  162. </li>
  163. <li> DONE (see
  164. ComputerAlgebra/Satisfiability/Lisp/MinimalUnsatisfiability/plans/general.hpp
  165. and
  166. ComputerAlgebra/Satisfiability/Lisp/MinimalUnsatisfiability/DeficiencyOne.mac)
  167. How to get the MUSAT(1)-clause-sets from SMUSAT(1) ? </li>
  168. </ul>
  169. \todo Hard clause-sets (for resolution and refinements)
  170. <ul>
  171. <li> Tseitin's formulas </li>
  172. <li> IMP and IMP' [Buresh-Oppenheim, Pitassi; 2007] </li>
  173. <li> GT and GT' [Buresh-Oppenheim, Pitassi; 2007] </li>
  174. <li> SP and SP' [Buresh-Oppenheim, Pitassi; 2007] </li>
  175. </ul>
  176. \todo Operations (new clause-sets from old ones)
  177. <ul>
  178. <li> Again the request to establish links. </li>
  179. <li> DONE (see
  180. ComputerAlgebra/Satisfiability/Lisp/ClauseSets/Constructions.mac)
  181. Product and Sum </li>
  182. <li> Xorification [Buresh-Oppenheim, Pitassi; 2007] </li>
  183. </ul>
  184. \todo Hiding small unsatisfiable clause-sets
  185. <ul>
  186. <li> In [Ouyang, 1999, Implementations of the DPLL algorithm] an
  187. MUSAT(1) clause-set with small variable degree (see
  188. ComputerAlgebra/Satisfiability/Lisp/MinimalUnsatisfiability/plans/DeficiencyOne.hpp)
  189. is hidden inside a "misleading" combination of other clauses (variable-
  190. disjoint). We should implement these clause-sets. </li>
  191. </ul>
  192. */