You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
3.3 KiB

2 months ago
  1. #! /bin/sh
  2. #
  3. # Check CNF (long check - all methods involved):
  4. # Load BDDs
  5. # Store corresponding CNF in different format:
  6. # NodeByNode method -> file 4.node1.tmp
  7. # MaxtermByMaxterm -> file 4.max1.tmp
  8. # Best with different options:
  9. # MaxEdge=-1 MaxPath= 0 -> similar to NodeByNode -> file 4.node2.tmp
  10. # MaxEdge= 0 MaxPath=-1 -> similar to NodeByNode -> file 4.node3.tmp
  11. # MaxEdge=-1 MaxPath=-1 -> = MaxtermByMaxterm -> file 4.max2.tmp
  12. # MaxEdge= 1 MaxPath=-1 -> = Original Best -> file 4.best1.tmp
  13. # MaxEdge= 1 MaxPath= 2 -> = Original Best, With Path Shorter than 3
  14. # file 4.best2.tmp
  15. # Read CNF
  16. # Store corresponding BDD
  17. # Compare original and final BDDs
  18. #
  19. EXE=@EXEEXT@
  20. srcdir=@top_srcdir@
  21. where=${srcdir}/dddmp/exp
  22. dest=.
  23. exitval=0
  24. echo "---------------------------------------------------------------------------"
  25. echo "--------------------- TESTING Load BDD and Store CNF ----------------------"
  26. echo "---------------------------------------------------------------------------"
  27. ../testdddmp$EXE << END1
  28. mi
  29. 150
  30. hlc
  31. ${where}/4.cnf.bis
  32. bl
  33. ${where}/4.bdd
  34. 0
  35. cs
  36. ${dest}/4.node1.tmp
  37. 0
  38. N
  39. 100
  40. cs
  41. ${dest}/4.max1.tmp
  42. 0
  43. M
  44. 100
  45. cs
  46. ${dest}/4.node2.tmp
  47. 0
  48. B
  49. -1
  50. 0
  51. 100
  52. cs
  53. ${dest}/4.node3.tmp
  54. 0
  55. B
  56. 0
  57. -1
  58. 100
  59. cs
  60. ${dest}/4.max2.tmp
  61. 0
  62. B
  63. -1
  64. -1
  65. 100
  66. cs
  67. ${dest}/4.best1.tmp
  68. 0
  69. B
  70. 1
  71. -1
  72. 100
  73. cs
  74. ${dest}/4.best2.tmp
  75. 0
  76. B
  77. 1
  78. 2
  79. 100
  80. mq
  81. quit
  82. END1
  83. test $? != 1 && exitval=1
  84. echo "---------------------------------------------------------------------------"
  85. echo "--------------------- TESTING Load CNF and Store BDD ----------------------"
  86. echo "---------------------------------------------------------------------------"
  87. ../testdddmp$EXE << END2
  88. mi
  89. 150
  90. hlc
  91. ${dest}/4.node2.tmp
  92. cl
  93. ${dest}/4.node2.tmp
  94. 0
  95. hw
  96. bs
  97. ${dest}/4.node2.bdd.tmp
  98. 0
  99. mq
  100. quit
  101. END2
  102. test $? != 1 && exitval=1
  103. ../testdddmp$EXE << END3
  104. mi
  105. 150
  106. hlc
  107. ${dest}/4.node3.tmp
  108. cl
  109. ${dest}/4.node3.tmp
  110. 0
  111. hw
  112. bs
  113. ${dest}/4.node3.bdd.tmp
  114. 0
  115. mq
  116. quit
  117. END3
  118. test $? != 1 && exitval=1
  119. ../testdddmp$EXE << END4
  120. mi
  121. 150
  122. hlc
  123. ${dest}/4.best1.tmp
  124. cl
  125. ${dest}/4.best1.tmp
  126. 0
  127. hw
  128. bs
  129. ${dest}/4.best1.bdd.tmp
  130. 0
  131. mq
  132. quit
  133. END4
  134. test $? != 1 && exitval=1
  135. ../testdddmp$EXE << END5
  136. mi
  137. 150
  138. hlc
  139. ${dest}/4.best2.tmp
  140. cl
  141. ${dest}/4.best2.tmp
  142. 0
  143. hw
  144. bs
  145. ${dest}/4.best2.bdd.tmp
  146. 0
  147. mq
  148. quit
  149. END5
  150. test $? != 1 && exitval=1
  151. echo "----------------------------- ... RESULTS ... -----------------------------"
  152. diff --strip-trailing-cr --brief ${where}/4.max1 ${dest}/4.max1.tmp
  153. test $? != 0 && exitval=1
  154. diff --strip-trailing-cr --brief ${where}/4.max2 ${dest}/4.max2.tmp
  155. test $? != 0 && exitval=1
  156. diff --strip-trailing-cr --brief ${where}/4.bdd.bis1 ${dest}/4.node2.bdd.tmp
  157. test $? != 0 && exitval=1
  158. diff --strip-trailing-cr --brief ${where}/4.bdd.bis2 ${dest}/4.node3.bdd.tmp
  159. test $? != 0 && exitval=1
  160. diff --strip-trailing-cr --brief ${where}/4.bdd.bis3 ${dest}/4.best1.bdd.tmp
  161. test $? != 0 && exitval=1
  162. diff --strip-trailing-cr --brief ${where}/4.bdd.bis4 ${dest}/4.best2.bdd.tmp
  163. test $? != 0 && exitval=1
  164. echo "-------------------------------- ... END ----------------------------------"
  165. rm -f ${dest}/4.max1.tmp ${dest}/4.max2.tmp ${dest}/4.node2.bdd.tmp \
  166. ${dest}/4.node3.bdd.tmp ${dest}/4.best1.bdd.tmp ${dest}/4.best2.bdd.tmp \
  167. ${dest}/4b.bdd.tmp ${dest}/4.best1.tmp ${dest}/4.best2.tmp \
  168. ${dest}/4.node1.tmp ${dest}/4.node2.tmp ${dest}/4.node3.tmp
  169. exit $exitval