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.

150 lines
2.3 KiB

  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. rm -f *.tmp*
  20. echo "---------------------------------------------------------------------------"
  21. echo "--------------------- TESTING Load BDD and Store CNF ----------------------"
  22. echo "---------------------------------------------------------------------------"
  23. ./../testdddmp << END1
  24. mi
  25. 150
  26. hlc
  27. 4.cnf.bis
  28. bl
  29. 4.bdd
  30. 0
  31. cs
  32. 4.node1.tmp
  33. 0
  34. N
  35. 100
  36. cs
  37. 4.max1.tmp
  38. 0
  39. M
  40. 100
  41. cs
  42. 4.node2.tmp
  43. 0
  44. B
  45. -1
  46. 0
  47. 100
  48. cs
  49. 4.node3.tmp
  50. 0
  51. B
  52. 0
  53. -1
  54. 100
  55. cs
  56. 4.max2.tmp
  57. 0
  58. B
  59. -1
  60. -1
  61. 100
  62. cs
  63. 4.best1.tmp
  64. 0
  65. B
  66. 1
  67. -1
  68. 100
  69. cs
  70. 4.best2.tmp
  71. 0
  72. B
  73. 1
  74. 2
  75. 100
  76. mq
  77. quit
  78. END1
  79. echo "---------------------------------------------------------------------------"
  80. echo "--------------------- TESTING Load CNF and Store BDD ----------------------"
  81. echo "---------------------------------------------------------------------------"
  82. ./../testdddmp << END2
  83. mi
  84. 150
  85. hlc
  86. 4.node2.tmp
  87. cl
  88. 4.node2.tmp
  89. 0
  90. hw
  91. bs
  92. 4.node2.bdd.tmp
  93. 0
  94. mq
  95. quit
  96. END2
  97. ./../testdddmp << END3
  98. mi
  99. 150
  100. hlc
  101. 4.node3.tmp
  102. cl
  103. 4.node3.tmp
  104. 0
  105. hw
  106. bs
  107. 4.node3.bdd.tmp
  108. 0
  109. mq
  110. quit
  111. END3
  112. ./../testdddmp << END4
  113. mi
  114. 150
  115. hlc
  116. 4.best1.tmp
  117. cl
  118. 4.best1.tmp
  119. 0
  120. hw
  121. bs
  122. 4.best1.bdd.tmp
  123. 0
  124. mq
  125. quit
  126. END4
  127. ./../testdddmp << END5
  128. mi
  129. 150
  130. hlc
  131. 4.best2.tmp
  132. cl
  133. 4.best2.tmp
  134. 0
  135. hw
  136. bs
  137. 4.best2.bdd.tmp
  138. 0
  139. mq
  140. quit
  141. END5
  142. echo "----------------------------- ... RESULTS ... -----------------------------"
  143. diff --brief 4.max1 4.max1.tmp
  144. diff --brief 4.max2 4.max2.tmp
  145. diff --brief 4.bdd.bis1 4.node2.bdd.tmp
  146. diff --brief 4.bdd.bis2 4.node3.bdd.tmp
  147. diff --brief 4.bdd.bis3 4.best1.bdd.tmp
  148. diff --brief 4.bdd.bis4 4.best2.bdd.tmp
  149. echo "-------------------------------- ... END ----------------------------------"
  150. rm -f *.tmp*