PageRenderTime 52ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/Satisfiability/Reductions/UnitClausePropagation/plans/general.hpp

https://github.com/exp04shy/oklibrary
C++ Header | 166 lines | 9 code | 3 blank | 154 comment | 0 complexity | 622397960de88d063db9237fbd6ea51c MD5 | raw file
  1. // Oliver Kullmann, 25.11.2005 (Swansea)
  2. /* Copyright 2005 - 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 Satisfiability/Reductions/UnitClausePropagation/plans/general.hpp
  9. \brief Plans for the module on unit-clause propagation
  10. \todo DONE Update namespaces.
  11. \todo Update namespace usage
  12. \todo Connections
  13. <ul>
  14. <li> Old first prototype:
  15. OKsolver/Experimental/AllgKlassen200203/UnitPropagation.hpp. </li>
  16. <li> See Satisfiability/Lisp/Reductions/plans/UnitClausePropagation.hpp
  17. for the Maxima/Lisp level. </li>
  18. <li> See
  19. Experimentation/Investigations/Reductions/UnitClausePropagation/plans/general.hpp
  20. for investigations. </li>
  21. </ul>
  22. \todo Update the plans.
  23. \todo Create milestones.
  24. \todo Implement trivial unit-propagation (quadratic time)
  25. <ul>
  26. <li> We only need to update function
  27. UnitPropagation::unit_propagation_simple in
  28. Reductions/UnitClausePropagation/UnitPropagation.hpp. </li>
  29. <li> However, also the concepts used need to be updated. </li>
  30. </ul>
  31. \todo Implement generic standard linear-time algorithm for boolean
  32. clause-sets
  33. <ul>
  34. <li> We have the generic function
  35. UnitPropagation::unit_propagation_improved in
  36. Reductions/UnitClausePropagation/UnitPropagation.hpp. </li>
  37. <li> Here the clause-literal graph is assumed to be given. </li>
  38. <li> A more lightweight approach constructs the necessary data structures
  39. by the algorithm itself. </li>
  40. <li> Reductions/UnitClausePropagation/UnitClausePropagation.cpp implements
  41. currently two such approaches; see /plans/UnitClausePropagation.hpp. </li>
  42. </ul>
  43. \todo Implement initial UCP based on head-tail clauses
  44. <ul>
  45. <li> See "Head-tail clauses" in ProblemInstances/Clauses/plans/general.hpp
  46. for the underlying clause-implementation. </li>
  47. <li> Binary clauses should be taken out, and treated directly. </li>
  48. </ul>
  49. \todo Implementing the standard linear-time UCP-algorithm
  50. (based on the bipartite structure) for Power-clause-sets.
  51. \todo Investigate how to specialise the general UCP-algorithm
  52. for clause-sets and boolean clause-sets.
  53. \todo The basic algorithm should assume an "active clause-set" and
  54. an "active partial assignment"
  55. <ul>
  56. <li> The clause-sets receives the variable-domains from the partial
  57. assignment. </li>
  58. <li> Based on this, it computes unit-clauses (i.e. literals), which further
  59. restrict the partial assignment; these are transmitted to the partial
  60. assignment, which reacts with a list of further restricted literals, etc.
  61. </li>
  62. <li> At each point the clause-set as well as the partial assignment can
  63. report "unsatisfiability", and the clause-set can report "satisfied". </li>
  64. <li> Since unit-clause propagation is necessary, it doesn't seem necessary
  65. that it is remembered whether for example a power literal has been reduced
  66. several times --- only the final result is needed. </li>
  67. <li> However it seems more efficient if the partial assignment notifies the
  68. clause-set only about the updates (what has changed compared to last time),
  69. and this is different for different active clause-sets connected to the
  70. partial assignment. </li>
  71. <li> If in the alliance of active clause-set actually each active clause-set
  72. is just a single clause, then it would be good if the communication scheme
  73. could ensure that the whole process is linear time; to do so the partial
  74. assignment must know for each literal which (subset of) clause-sets to
  75. notify. </li>
  76. </ul>
  77. \todo A clause-set F can be constructed with a binding to a partial
  78. assignment F.phi().
  79. <ul>
  80. <li> With F.sat_status() we get whether F with the current value of F.phi()
  81. is unsatisfiable, satisfied or unknown (we need also the autarky-information
  82. somehow). </li>
  83. <li> With F.implied_literals() a sequence of implied literals is returned.
  84. </li>
  85. </ul>
  86. \todo Regarding unit-clause-propagation for an alliance of active clause-sets
  87. <ul>
  88. <li> There is a "variable-constraint graph" (or "factor-graph"; possibly
  89. trivial) which enables access for every variable to the set of relevant
  90. active clause-sets (of course, assuming here variable-based literals). </li>
  91. <li> When active clause-sets apply partial assignments, they can update this
  92. graph. </li>
  93. </ul>
  94. \todo UCP for clause-sets has the following interesting property
  95. <ul>
  96. <li> When applying an assignment v -> eps, running through all relevant
  97. clauses, then when evaluating the clauses the current partial assignment is
  98. used, which involves all assignments from the buffer, not just the
  99. assignments already performed. </li>
  100. <li> This can be exploited by using a timestamp for the buffer
  101. (see Utilities/TimeStamps/plans/general.hpp), incremented each time a new
  102. assignment is added; and when processing a clause the current timestamp is
  103. stored with this clause, so that we can always check whether the last
  104. evaluation of this clause already included the currently processed literal
  105. (in which case we don't have to go through this clause again). </li>
  106. </ul>
  107. \todo A variation point is whether we want to go also through the satisfied
  108. clauses or not (marking them as satisfied)
  109. <ul>
  110. <li> This makes a difference for example for associated statistics
  111. gathering. </li>
  112. <li> In the (old) OKsolver there was a clear separation: UCP didn't look at
  113. satisfied clauses and didn't gather statistics; this was the responsibility
  114. of the branching heuristics look-ahead (together with autarky reduction).
  115. </li>
  116. </ul>
  117. */
  118. /*!
  119. \namespace OKlib::Satisfiability::Reductions::UnitClausePropagation
  120. \brief Components for unit-clause propagation ("UCP")
  121. Alias "Ucp".
  122. */
  123. namespace OKlib {
  124. namespace Satisfiability {
  125. namespace Reductions {
  126. namespace UnitClausePropagation {
  127. }
  128. namespace Ucp = UnitClausePropagation;
  129. }
  130. }
  131. }