PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/ComputerAlgebra/Satisfiability/Lisp/Resolution/plans/Proofs.hpp

https://github.com/OKullmann/oklibrary
C++ Header | 168 lines | 0 code | 2 blank | 166 comment | 0 complexity | 834c23020bd929cad124069ab638bddf MD5 | raw file
  1. // Oliver Kullmann, 7.10.2011 (Swansea)
  2. /* Copyright 2011, 2012 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/Resolution/plans/Proofs.hpp
  9. \brief Plans regarding handling of resolution proofs
  10. \todo php_ext_resl
  11. <ul>
  12. <li> php_ext_resl defines the resolution proof of the extension of
  13. the pigeon-hole formulas as discussed by Cook in
  14. [A short proof of the pigeon hole principle using extended resolution";
  15. Stephen Cook]. </li>
  16. <li> We need the following for this function:
  17. <ul>
  18. <li> A full specification, including:
  19. <ul>
  20. <li> the order resolvents are generated in the proof; </li>
  21. <li> the precise number of resolvents the proof for all n; </li>
  22. <li> the proof given in full detail in the docus (transferred from
  23. Annotations). </li>
  24. </ul>
  25. </li>
  26. <li> Tests. </li>
  27. </ul>
  28. </li>
  29. <li> Resolution lists:
  30. <ul>
  31. <li> The function currently defines the resolution proof as a list
  32. of clauses and "resolvents", where the resolvents are pairs [C,[C1,C2]]
  33. where C, C1 and C2 are clauses. </li>
  34. <li> This list is then converted to a "resolution list" by mapping
  35. the clauses C1 and C2 to their (smaller) index in the list. </li>
  36. <li> Using clauses rather than indices for the parents of the resolvent
  37. is much more readable when writing the generators for such proofs. </li>
  38. <li> We should define another type to encompass this "raw" resolution
  39. list, and a conversion function. </li>
  40. <li> We should also have a type which just specifies a list of clauses
  41. generated (in the order of the list), and then a function which
  42. converts this to a resolution list assuming a resolvent was
  43. generated by resolving the first two possible parents. </li>
  44. </ul>
  45. </li>
  46. </ul>
  47. \todo Resolution trees
  48. <ul>
  49. <li> Function st2reslrt_cs in
  50. ComputerAlgebra/Satisfiability/Lisp/Backtracking/SplittingTrees.mac
  51. transforms splitting trees into resolution trees. </li>
  52. <li> There is also a function for outputting resolution trees; this
  53. function should move here. </li>
  54. <li> We need to make this concept explicit. </li>
  55. <li> A "resolution tree" ("reslrt"; for the boolean case) is a rooted binary
  56. tree labelled with clauses such that each inner node-label is the resolvent
  57. of the labels of the two children. </li>
  58. <li> We can represent such a labelled rooted binary tree in Maxima using
  59. our notion of a labelled rooted tree, given in
  60. ComputerAlgebra/Trees/Lisp/Basics.mac. </li>
  61. <li> When translating a resldg (see below) into a reslrt, then we loose
  62. the vertex labels. In order to represent them, one needed rooted trees
  63. where the labels are pairs, the clause and the original label. </li>
  64. <li> Such "labelled resolution trees" ("resllrt", for 2 labels) should also
  65. be useful. </li>
  66. <li> We will also have collections (at least sets) of resolution trees; one
  67. might introduce the notion of a "resolution forest". </li>
  68. </ul>
  69. \todo Resolution proofs
  70. <ul>
  71. <li> The natural format for a resolution proof is a non-empty list,
  72. where each entry is either a clause (an "axiom") or a pair consisting
  73. of a clause (the "resolvent") and a pair of (smaller) indices (the
  74. indices of the "parent clauses"). </li>
  75. <li> Resolution proofs as digraphs:
  76. <ul>
  77. <li> The graph notions are defined in
  78. ComputerAlgebra/Graphs/Lisp/Basic.mac. </li>
  79. <li> A "resolution proof as directed graph" ("resdg") is a dg [V,E]
  80. such that
  81. <ul>
  82. <li> V is a set of clauses </li>
  83. <li> For every edge [C,D] in E, there is another edge [C,D']
  84. such that D and D' resolve to C. </li>
  85. </ul>
  86. We have that:
  87. <ul>
  88. <li> every resolvent points to its two parent clauses; </li>
  89. <li> every sink node in the graph is an axiom; </li>
  90. <li> all vertices have out-degree 0 or >= 2 (not 1). </li>
  91. </ul>
  92. </li>
  93. <li> A "resolution proof as labelled directed graph" ("resldg") is a
  94. labelled dg [[V,E],f] such that:
  95. <ul>
  96. <li> f maps V to clauses </li>
  97. <li> for every edge [u,v] in E, there is another edge [u,v'] such that
  98. f(v) and f(v') resolve to f(u) </li>
  99. <li> every node has out-degree 0 or 2. </li>
  100. </ul>
  101. </li>
  102. <li> The notion of "(vertex-)labelled graph" needs to be made explicit
  103. and implemented at the Maxima level, as discussed in "Representing edge
  104. and vertex labellings" in ComputerAlgebra/Graphs/Lisp/plans/Basic.hpp.
  105. </li>
  106. </ul>
  107. </li>
  108. <li> We need a correctness-checker for each different form. </li>
  109. <li> We need functions to translate between each of the different
  110. forms of resolution proofs. </li>
  111. <li> We also need functions to check various properties of the proof
  112. structures. For example:
  113. <ul>
  114. <li> Is a proof tree-like? </li>
  115. <li> Is a proof regular? </li>
  116. <li> Is the proof repetition-free? </li>
  117. </ul>
  118. </li>
  119. <li> Some or all of the relevant properties of resolution proofs will be
  120. implementable directly using existing functions on the underlying
  121. representations. </li>
  122. <li> Likely at first, we implement just the functions for lists
  123. and digraphs, as the notions for the underlying datastructures
  124. are already developed in the library. </li>
  125. <li> Naming conventions:
  126. <ul>
  127. <li> We need abbreviations for the following notions:
  128. <ul>
  129. <li> resolution proof as a list; </li>
  130. <li> resolution proof as a digraph; </li>
  131. <li> resolution proof as a labelled digraph; </li>
  132. <li> (tree-)resolution proof as a rooted tree (discussed
  133. in "Resolution trees" above). </li>
  134. </ul>
  135. </li>
  136. <li> We use "resl","reslrt", "resdg", "resldg". </li>
  137. <li> DONE (irrelevant: if one would read it as this word, it wouldn't
  138. make sense)
  139. It *is* unfortunate that "rest" is a word, as this might
  140. create confusion. </li>
  141. </ul>
  142. </li>
  143. <li> We should also investigate the existing file-formats for resolution
  144. proofs, and we should provide input- and output-facilities. </li>
  145. <li> The above can easily be generalised to non-boolean clause-sets.
  146. </li>
  147. <li> DONE (discussed separately w.r.t labelled digraphs)
  148. This linear format is in 1-1 correspondence to the representation
  149. via labelled dag's; we need a representation of labelled graphs,
  150. digraphs and labelled digraphs. </li>
  151. </ul>
  152. \todo Read-once resolution proofs
  153. <ul>
  154. <li> Write a checker whether a resolution proof is read-once. </li>
  155. <li> Implement the translation of "has read-once refutation" into SAT. </li>
  156. </ul>
  157. */