cadical 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +26 -0
  3. data/README.md +101 -0
  4. data/ext/cadical/cadical/LICENSE +28 -0
  5. data/ext/cadical/cadical/README.md +65 -0
  6. data/ext/cadical/cadical/VERSION +1 -0
  7. data/ext/cadical/cadical/src/analyze.cpp +1360 -0
  8. data/ext/cadical/cadical/src/arena.cpp +30 -0
  9. data/ext/cadical/cadical/src/arena.hpp +105 -0
  10. data/ext/cadical/cadical/src/assume.cpp +616 -0
  11. data/ext/cadical/cadical/src/averages.cpp +34 -0
  12. data/ext/cadical/cadical/src/averages.hpp +37 -0
  13. data/ext/cadical/cadical/src/backbone.cpp +631 -0
  14. data/ext/cadical/cadical/src/backtrack.cpp +177 -0
  15. data/ext/cadical/cadical/src/backward.cpp +231 -0
  16. data/ext/cadical/cadical/src/bins.cpp +22 -0
  17. data/ext/cadical/cadical/src/bins.hpp +22 -0
  18. data/ext/cadical/cadical/src/block.cpp +824 -0
  19. data/ext/cadical/cadical/src/block.hpp +37 -0
  20. data/ext/cadical/cadical/src/cadical.cpp +1026 -0
  21. data/ext/cadical/cadical/src/cadical.hpp +1419 -0
  22. data/ext/cadical/cadical/src/ccadical.cpp +208 -0
  23. data/ext/cadical/cadical/src/ccadical.h +74 -0
  24. data/ext/cadical/cadical/src/checker.cpp +649 -0
  25. data/ext/cadical/cadical/src/checker.hpp +173 -0
  26. data/ext/cadical/cadical/src/clause.cpp +689 -0
  27. data/ext/cadical/cadical/src/clause.hpp +190 -0
  28. data/ext/cadical/cadical/src/collect.cpp +545 -0
  29. data/ext/cadical/cadical/src/compact.cpp +550 -0
  30. data/ext/cadical/cadical/src/condition.cpp +940 -0
  31. data/ext/cadical/cadical/src/config.cpp +101 -0
  32. data/ext/cadical/cadical/src/config.hpp +20 -0
  33. data/ext/cadical/cadical/src/congruence.cpp +7880 -0
  34. data/ext/cadical/cadical/src/congruence.hpp +757 -0
  35. data/ext/cadical/cadical/src/constrain.cpp +64 -0
  36. data/ext/cadical/cadical/src/contract.cpp +27 -0
  37. data/ext/cadical/cadical/src/contract.hpp +139 -0
  38. data/ext/cadical/cadical/src/cover.cpp +704 -0
  39. data/ext/cadical/cadical/src/cover.hpp +34 -0
  40. data/ext/cadical/cadical/src/decide.cpp +347 -0
  41. data/ext/cadical/cadical/src/decompose.cpp +738 -0
  42. data/ext/cadical/cadical/src/decompose.hpp +23 -0
  43. data/ext/cadical/cadical/src/deduplicate.cpp +275 -0
  44. data/ext/cadical/cadical/src/definition.cpp +283 -0
  45. data/ext/cadical/cadical/src/delay.hpp +38 -0
  46. data/ext/cadical/cadical/src/drattracer.cpp +153 -0
  47. data/ext/cadical/cadical/src/drattracer.hpp +55 -0
  48. data/ext/cadical/cadical/src/elim.cpp +1171 -0
  49. data/ext/cadical/cadical/src/elim.hpp +53 -0
  50. data/ext/cadical/cadical/src/elimfast.cpp +570 -0
  51. data/ext/cadical/cadical/src/ema.cpp +95 -0
  52. data/ext/cadical/cadical/src/ema.hpp +68 -0
  53. data/ext/cadical/cadical/src/extend.cpp +289 -0
  54. data/ext/cadical/cadical/src/external.cpp +1034 -0
  55. data/ext/cadical/cadical/src/external.hpp +487 -0
  56. data/ext/cadical/cadical/src/external_propagate.cpp +1316 -0
  57. data/ext/cadical/cadical/src/factor.cpp +1011 -0
  58. data/ext/cadical/cadical/src/factor.hpp +54 -0
  59. data/ext/cadical/cadical/src/file.cpp +506 -0
  60. data/ext/cadical/cadical/src/file.hpp +210 -0
  61. data/ext/cadical/cadical/src/flags.cpp +135 -0
  62. data/ext/cadical/cadical/src/flags.hpp +93 -0
  63. data/ext/cadical/cadical/src/flip.cpp +269 -0
  64. data/ext/cadical/cadical/src/format.cpp +89 -0
  65. data/ext/cadical/cadical/src/format.hpp +36 -0
  66. data/ext/cadical/cadical/src/frattracer.cpp +277 -0
  67. data/ext/cadical/cadical/src/frattracer.hpp +67 -0
  68. data/ext/cadical/cadical/src/gates.cpp +766 -0
  69. data/ext/cadical/cadical/src/heap.hpp +212 -0
  70. data/ext/cadical/cadical/src/idruptracer.cpp +566 -0
  71. data/ext/cadical/cadical/src/idruptracer.hpp +112 -0
  72. data/ext/cadical/cadical/src/instantiate.cpp +365 -0
  73. data/ext/cadical/cadical/src/instantiate.hpp +45 -0
  74. data/ext/cadical/cadical/src/internal.cpp +1265 -0
  75. data/ext/cadical/cadical/src/internal.hpp +1941 -0
  76. data/ext/cadical/cadical/src/inttypes.hpp +34 -0
  77. data/ext/cadical/cadical/src/ipasir.cpp +47 -0
  78. data/ext/cadical/cadical/src/ipasir.h +37 -0
  79. data/ext/cadical/cadical/src/kitten.c +2599 -0
  80. data/ext/cadical/cadical/src/kitten.h +97 -0
  81. data/ext/cadical/cadical/src/level.hpp +33 -0
  82. data/ext/cadical/cadical/src/lidruptracer.cpp +657 -0
  83. data/ext/cadical/cadical/src/lidruptracer.hpp +122 -0
  84. data/ext/cadical/cadical/src/limit.cpp +146 -0
  85. data/ext/cadical/cadical/src/limit.hpp +168 -0
  86. data/ext/cadical/cadical/src/logging.cpp +214 -0
  87. data/ext/cadical/cadical/src/logging.hpp +98 -0
  88. data/ext/cadical/cadical/src/lookahead.cpp +520 -0
  89. data/ext/cadical/cadical/src/lratchecker.cpp +833 -0
  90. data/ext/cadical/cadical/src/lratchecker.hpp +168 -0
  91. data/ext/cadical/cadical/src/lrattracer.cpp +200 -0
  92. data/ext/cadical/cadical/src/lrattracer.hpp +61 -0
  93. data/ext/cadical/cadical/src/lucky.cpp +506 -0
  94. data/ext/cadical/cadical/src/message.cpp +218 -0
  95. data/ext/cadical/cadical/src/message.hpp +65 -0
  96. data/ext/cadical/cadical/src/minimize.cpp +224 -0
  97. data/ext/cadical/cadical/src/mobical.cpp +5588 -0
  98. data/ext/cadical/cadical/src/occs.cpp +52 -0
  99. data/ext/cadical/cadical/src/occs.hpp +36 -0
  100. data/ext/cadical/cadical/src/options.cpp +359 -0
  101. data/ext/cadical/cadical/src/options.hpp +442 -0
  102. data/ext/cadical/cadical/src/parse.cpp +471 -0
  103. data/ext/cadical/cadical/src/parse.hpp +75 -0
  104. data/ext/cadical/cadical/src/phases.cpp +56 -0
  105. data/ext/cadical/cadical/src/phases.hpp +19 -0
  106. data/ext/cadical/cadical/src/probe.cpp +990 -0
  107. data/ext/cadical/cadical/src/profile.cpp +107 -0
  108. data/ext/cadical/cadical/src/profile.hpp +283 -0
  109. data/ext/cadical/cadical/src/proof.cpp +691 -0
  110. data/ext/cadical/cadical/src/proof.hpp +125 -0
  111. data/ext/cadical/cadical/src/propagate.cpp +584 -0
  112. data/ext/cadical/cadical/src/queue.cpp +90 -0
  113. data/ext/cadical/cadical/src/queue.hpp +74 -0
  114. data/ext/cadical/cadical/src/radix.hpp +180 -0
  115. data/ext/cadical/cadical/src/random.cpp +207 -0
  116. data/ext/cadical/cadical/src/random.h +44 -0
  117. data/ext/cadical/cadical/src/random.hpp +98 -0
  118. data/ext/cadical/cadical/src/range.hpp +125 -0
  119. data/ext/cadical/cadical/src/reap.cpp +127 -0
  120. data/ext/cadical/cadical/src/reap.hpp +28 -0
  121. data/ext/cadical/cadical/src/reduce.cpp +278 -0
  122. data/ext/cadical/cadical/src/reluctant.hpp +82 -0
  123. data/ext/cadical/cadical/src/rephase.cpp +402 -0
  124. data/ext/cadical/cadical/src/report.cpp +313 -0
  125. data/ext/cadical/cadical/src/resources.cpp +160 -0
  126. data/ext/cadical/cadical/src/resources.hpp +16 -0
  127. data/ext/cadical/cadical/src/restart.cpp +178 -0
  128. data/ext/cadical/cadical/src/restore.cpp +267 -0
  129. data/ext/cadical/cadical/src/score.cpp +51 -0
  130. data/ext/cadical/cadical/src/score.hpp +16 -0
  131. data/ext/cadical/cadical/src/shrink.cpp +507 -0
  132. data/ext/cadical/cadical/src/signal.cpp +136 -0
  133. data/ext/cadical/cadical/src/signal.hpp +33 -0
  134. data/ext/cadical/cadical/src/solution.cpp +50 -0
  135. data/ext/cadical/cadical/src/solver.cpp +1871 -0
  136. data/ext/cadical/cadical/src/stable.cpp +31 -0
  137. data/ext/cadical/cadical/src/stack.h +110 -0
  138. data/ext/cadical/cadical/src/stats.cpp +920 -0
  139. data/ext/cadical/cadical/src/stats.hpp +418 -0
  140. data/ext/cadical/cadical/src/subsume.cpp +645 -0
  141. data/ext/cadical/cadical/src/sweep.cpp +1960 -0
  142. data/ext/cadical/cadical/src/sweep.hpp +61 -0
  143. data/ext/cadical/cadical/src/terminal.cpp +38 -0
  144. data/ext/cadical/cadical/src/terminal.hpp +96 -0
  145. data/ext/cadical/cadical/src/ternary.cpp +450 -0
  146. data/ext/cadical/cadical/src/testing.hpp +24 -0
  147. data/ext/cadical/cadical/src/tier.cpp +189 -0
  148. data/ext/cadical/cadical/src/tracer.hpp +186 -0
  149. data/ext/cadical/cadical/src/transred.cpp +253 -0
  150. data/ext/cadical/cadical/src/unstable.cpp +29 -0
  151. data/ext/cadical/cadical/src/util.cpp +129 -0
  152. data/ext/cadical/cadical/src/util.hpp +181 -0
  153. data/ext/cadical/cadical/src/var.cpp +39 -0
  154. data/ext/cadical/cadical/src/var.hpp +22 -0
  155. data/ext/cadical/cadical/src/veripbtracer.cpp +427 -0
  156. data/ext/cadical/cadical/src/veripbtracer.hpp +106 -0
  157. data/ext/cadical/cadical/src/version.cpp +107 -0
  158. data/ext/cadical/cadical/src/version.hpp +13 -0
  159. data/ext/cadical/cadical/src/vivify.cpp +1893 -0
  160. data/ext/cadical/cadical/src/vivify.hpp +50 -0
  161. data/ext/cadical/cadical/src/walk.cpp +1088 -0
  162. data/ext/cadical/cadical/src/walk.hpp +91 -0
  163. data/ext/cadical/cadical/src/walk_full_occs.cpp +966 -0
  164. data/ext/cadical/cadical/src/warmup.cpp +403 -0
  165. data/ext/cadical/cadical/src/watch.cpp +126 -0
  166. data/ext/cadical/cadical/src/watch.hpp +77 -0
  167. data/ext/cadical/cadical_ext.c +778 -0
  168. data/ext/cadical/extconf.rb +26 -0
  169. data/lib/cadical/version.rb +3 -0
  170. data/lib/cadical.rb +12 -0
  171. metadata +218 -0
@@ -0,0 +1,442 @@
1
+ #ifndef _options_hpp_INCLUDED
2
+ #define _options_hpp_INCLUDED
3
+
4
+ /*------------------------------------------------------------------------*/
5
+
6
+ // In order to add a new option, simply add a new line below. Make sure that
7
+ // options are sorted correctly (with '!}sort -k 2' in 'vi'). Otherwise
8
+ // initializing the options will trigger an internal error. For the model
9
+ // based tester 'mobical' the policy is that options which become redundant
10
+ // because another one is disabled (set to zero) should have the name of the
11
+ // latter as prefix. The 'O' column determines the options which are
12
+ // target to 'optimize' them ('-O[1-3]'). A zero value in the 'O' column
13
+ // means that this option is not optimized. A value of '1' results in
14
+ // optimizing its value exponentially with exponent base '2', and a value
15
+ // of '2' uses base '10'. The 'P' column determines simplification
16
+ // options (disabled with '--plain') and 'R' which values can be reset.
17
+
18
+ // clang-format off
19
+
20
+ #define OPTIONS \
21
+ \
22
+ /* NAME DEFAULT, LO, HI,O,P,R, USAGE */ \
23
+ \
24
+ OPTION( arena, 1, 0, 1,0,0,1, "allocate clauses in arena") \
25
+ OPTION( arenacompact, 1, 0, 1,0,0,1, "keep clauses compact") \
26
+ OPTION( arenasort, 1, 0, 1,0,0,1, "sort clauses in arena") \
27
+ OPTION( arenatype, 3, 1, 3,0,0,1, "1=clause, 2=var, 3=queue") \
28
+ OPTION( backbone, 1, 0, 2,0,0,1, "binary clause backbone") \
29
+ OPTION( backboneeffort, 20, 0,1e5,0,0,1, "binary effort in per mile") \
30
+ OPTION( backbonemaxrounds,1e3, 0,1e5,0,0,1, "backbone rounds limit") \
31
+ OPTION( backbonerounds, 100, 0,1e5,0,0,1, "backbone rounds limit") \
32
+ OPTION( backbonethresh, 5, 0,1e9,1,0,1, "delay if ticks smaller thresh*clauses") \
33
+ OPTION( binary, 1, 0, 1,0,0,1, "use binary proof format") \
34
+ OPTION( block, 0, 0, 1,0,1,1, "blocked clause elimination") \
35
+ OPTION( blockmaxclslim, 1e5, 1,2e9,2,0,1, "maximum clause size") \
36
+ OPTION( blockminclslim, 2, 2,2e9,0,0,1, "minimum clause size") \
37
+ OPTION( blockocclim, 1e2, 1,2e9,2,0,1, "occurrence limit") \
38
+ OPTION( bump, 1, 0, 1,0,0,1, "bump variables") \
39
+ OPTION( bumpreason, 1, 0, 1,0,0,1, "bump reason literals too") \
40
+ OPTION( bumpreasondepth, 1, 1, 3,0,0,1, "bump reason depth") \
41
+ OPTION( bumpreasonlimit, 10, 1,2e9,0,0,1, "bump reason limit") \
42
+ OPTION( bumpreasonrate, 100, 1,2e9,0,0,1, "bump reason decision rate") \
43
+ OPTION( check, 0, 0, 1,0,0,0, "enable internal checking") \
44
+ OPTION( checkassumptions, 1, 0, 1,0,0,0, "check assumptions satisfied") \
45
+ OPTION( checkconstraint, 1, 0, 1,0,0,0, "check constraint satisfied") \
46
+ OPTION( checkfailed, 1, 0, 1,0,0,0, "check failed literals form core") \
47
+ OPTION( checkfrozen, 0, 0, 1,0,0,0, "check all frozen semantics") \
48
+ OPTION( checkproof, 3, 0, 3,0,0,0, "1=drat, 2=lrat, 3=both") \
49
+ OPTION( checkwitness, 1, 0, 1,0,0,0, "check witness internally") \
50
+ OPTION( chrono, 1, 0, 2,0,0,1, "chronological backtracking") \
51
+ OPTION( chronoalways, 0, 0, 1,0,0,1, "force always chronological") \
52
+ OPTION( chronolevelim, 1e2, 0,2e9,0,0,1, "chronological level limit") \
53
+ OPTION( chronoreusetrail, 1, 0, 1,0,0,1, "reuse trail chronologically") \
54
+ OPTION( compact, 1, 0, 1,0,1,1, "compact internal variables") \
55
+ OPTION( compactint, 2e3, 1,2e9,0,0,1, "compacting interval") \
56
+ OPTION( compactlim, 1e2, 0,1e3,0,0,1, "inactive limit per mille") \
57
+ OPTION( compactmin, 1e2, 1,2e9,0,0,1, "minimum inactive limit") \
58
+ OPTION( condition, 0, 0, 1,0,1,1, "globally blocked clause elim") \
59
+ OPTION( conditioneffort, 100, 1,1e5,0,0,1, "relative efficiency per mille") \
60
+ OPTION( conditionint, 1e4, 1,2e9,0,0,1, "initial conflict interval") \
61
+ OPTION( conditionmaxeff, 1e7, 0,2e9,1,0,1, "maximum condition efficiency") \
62
+ OPTION( conditionmaxrat, 100, 1,2e9,1,0,1, "maximum clause variable ratio") \
63
+ OPTION( conditionmineff, 0, 0,2e9,1,0,1, "minimum condition efficiency") \
64
+ OPTION( congruence, 1, 0, 1,0,1,1, "congruence closure") \
65
+ OPTION( congruenceand, 1, 0, 1,0,0,1, "extract AND gates") \
66
+ OPTION( congruenceandarity,1e6,2,5e7,0,0,1, "AND gate arity limit") \
67
+ OPTION( congruencebinaries,1, 0, 1,0,0,1, "extract binary and strengthen ternary clauses") \
68
+ OPTION( congruenceite, 1, 0, 1,0,0,1, "extract ITE gates") \
69
+ OPTION( congruencexor, 1, 0, 1,0,0,1, "extract XOR gates") \
70
+ OPTION( congruencexorarity,4, 2, 31,0,0,1, "XOR gate arity limit") \
71
+ OPTION( congruencexorcounts,1, 1,5e6,0,0,1, "XOR gate round") \
72
+ OPTION( cover, 0, 0, 1,0,1,1, "covered clause elimination") \
73
+ OPTION( covereffort, 4, 1,1e5,1,0,1, "relative efficiency per mille") \
74
+ OPTION( covermaxclslim, 1e5, 1,2e9,2,0,1, "maximum clause size") \
75
+ OPTION( covermaxeff, 1e8, 0,2e9,1,0,1, "maximum cover efficiency") \
76
+ OPTION( coverminclslim, 2, 2,2e9,0,0,1, "minimum clause size") \
77
+ OPTION( covermineff, 0, 0,2e9,1,0,1, "minimum cover efficiency") \
78
+ OPTION( decompose, 1, 0, 1,0,1,1, "decompose BIG in SCCs and ELS") \
79
+ OPTION( decomposerounds, 2, 1, 16,1,0,1, "number of decompose rounds") \
80
+ OPTION( deduplicate, 1, 0, 1,0,1,1, "remove duplicated binaries") \
81
+ OPTION( deduplicateallinit,0, 0, 1,0,1,1, "remove duplicated clauses once before solving") \
82
+ OPTION( eagersubsume, 1, 0, 1,0,1,1, "subsume recently learned") \
83
+ OPTION( eagersubsumelim, 20, 1,1e3,0,0,1, "limit on subsumed candidates") \
84
+ OPTION( elim, 1, 0, 1,0,1,1, "bounded variable elimination") \
85
+ OPTION( elimands, 1, 0, 1,0,0,1, "find AND gates") \
86
+ OPTION( elimbackward, 1, 0, 1,0,0,1, "eager backward subsumption") \
87
+ OPTION( elimboundmax, 16, -1,2e6,1,0,1, "maximum elimination bound") \
88
+ OPTION( elimboundmin, 0, -1,2e6,0,0,1, "minimum elimination bound") \
89
+ OPTION( elimclslim, 1e2, 2,2e9,2,0,1, "resolvent size limit") \
90
+ OPTION( elimdef, 0, 0, 1,0,0,1, "mine definitions with kitten") \
91
+ OPTION( elimdefcores, 1, 1,100,0,0,1, "number of unsat cores") \
92
+ OPTION( elimdefticks, 2e5, 0,2e9,1,0,1, "kitten ticks limit") \
93
+ OPTION( elimeffort, 1e3, 1,1e5,1,0,1, "relative efficiency per mille") \
94
+ OPTION( elimequivs, 1, 0, 1,0,0,1, "find equivalence gates") \
95
+ OPTION( elimint, 2e3, 1,2e9,0,0,1, "elimination interval") \
96
+ OPTION( elimites, 1, 0, 1,0,0,1, "find if-then-else gates") \
97
+ OPTION( elimlimited, 1, 0, 1,0,0,1, "limit resolutions") \
98
+ OPTION( elimmaxeff, 2e9, 0,2e9,1,0,1, "maximum elimination efficiency") \
99
+ OPTION( elimmineff, 1e7, 0,2e9,1,0,1, "minimum elimination efficiency") \
100
+ OPTION( elimocclim, 1e2, 0,2e9,2,0,1, "occurrence limit") \
101
+ OPTION( elimprod, 1, 0,1e4,0,0,1, "elim score product weight") \
102
+ OPTION( elimrounds, 2, 1,512,1,0,1, "usual number of rounds") \
103
+ OPTION( elimsubst, 1, 0, 1,0,0,1, "elimination by substitution") \
104
+ OPTION( elimsum, 1, 0,1e4,0,0,1, "elimination score sum weight") \
105
+ OPTION( elimxorlim, 5, 2, 27,1,0,1, "maximum XOR size") \
106
+ OPTION( elimxors, 1, 0, 1,0,0,1, "find XOR gates") \
107
+ OPTION( emadecisions, 1e5, 1,2e9,0,0,1, "window decision rate") \
108
+ OPTION( emagluefast, 33, 1,2e9,0,0,1, "window fast glue") \
109
+ OPTION( emaglueslow, 1e5, 1,2e9,0,0,1, "window slow glue") \
110
+ OPTION( emajump, 1e5, 1,2e9,0,0,1, "window back-jump level") \
111
+ OPTION( emalevel, 1e5, 1,2e9,0,0,1, "window back-track level") \
112
+ OPTION( emasize, 1e5, 1,2e9,0,0,1, "window learned clause size") \
113
+ OPTION( ematrailfast, 1e2, 1,2e9,0,0,1, "window fast trail") \
114
+ OPTION( ematrailslow, 1e5, 1,2e9,0,0,1, "window slow trail") \
115
+ OPTION( exteagerreasons, 1, 0, 1,0,0,1, "eagerly ask for all reasons (0: only when needed)") \
116
+ OPTION( exteagerrecalc, 1, 0, 1,0,0,1, "after eagerly asking for reasons recalculate all levels (0: trust the external tool)") \
117
+ OPTION( externallrat, 0, 0, 1,0,0,1, "external lrat") \
118
+ OPTION( factor, 1, 0, 1,0,1,1, "bounded variable addition") \
119
+ OPTION( factorcandrounds, 2, 0,2e9,0,0,1, "candidates reduction rounds") \
120
+ OPTION( factorcheck, 1, 0, 2,0,0,1, "API checks that variables have been declared (1 = only with factor on, 2 = always)") \
121
+ OPTION( factordelay, 4, 0, 12,0,0,1, "delay bounded variable addition between eliminations") \
122
+ OPTION( factoreffort, 50, 0,1e6,0,0,1, "relative effort per mille") \
123
+ OPTION( factoriniticks, 300, 1,1e6,0,0,1, "initial effort in millions") \
124
+ OPTION( factorsize, 5, 2,2e9,0,0,1, "clause size limit") \
125
+ OPTION( factorthresh, 7, 0,100,1,0,1, "delay if ticks smaller thresh*clauses") \
126
+ OPTION( factorunbump, 1, 0, 1,0,1,1, "extension variable with lowest importance [1: as in kissat]") \
127
+ OPTION( fastelim, 1, 0, 1,0,1,1, "fast BVE during preprocessing") \
128
+ OPTION( fastelimbound, 8, 1,1e3,1,0,1, "fast BVE bound during preprocessing") \
129
+ OPTION( fastelimclslim, 1e2, 2,2e9,2,0,1, "fast BVE resolvent size limit") \
130
+ OPTION( fastelimocclim, 100, 1,2e9,2,0,1, "fast BVE occurence limit during preprocessing") \
131
+ OPTION( fastelimrounds, 4, 1,512,1,0,1, "number of fastelim rounds") \
132
+ OPTION( flush, 0, 0, 1,0,1,1, "flush redundant clauses") \
133
+ OPTION( flushfactor, 3, 1,1e3,0,0,1, "interval increase") \
134
+ OPTION( flushint, 1e5, 1,2e9,0,0,1, "initial limit") \
135
+ OPTION( forcephase, 0, 0, 1,0,0,1, "always use initial phase") \
136
+ OPTION( frat, 0, 0, 2,0,0,1, "1=frat(lrat), 2=frat(drat)") \
137
+ OPTION( idrup, 0, 0, 1,0,0,1, "incremental proof format") \
138
+ OPTION( ilb, 0, 0, 2,0,0,1, "ILB (incremental lazy backtrack) (0: no, 1: assumptions only, 2: everything)") \
139
+ OPTION( incdecay, 1, 0, 4,0,0,1, "decay clauses when doing incremental clauses" ) \
140
+ OPTION( incdecayint, 1e6, 1,2e9,0,0,1, "decay interval when doing incremental clauses" ) \
141
+ OPTION( inprobeint, 100, 1,2e9,0,0,1, "inprobing interval" ) \
142
+ OPTION( inprobing, 1, 0, 1,0,1,1, "enable probe inprocessing") \
143
+ OPTION( inprocessing, 1, 0, 1,0,1,1, "enable general inprocessing") \
144
+ OPTION( instantiate, 0, 0, 1,0,1,1, "variable instantiation") \
145
+ OPTION( instantiateclslim, 3, 2,2e9,0,0,1, "minimum clause size") \
146
+ OPTION( instantiateocclim, 1, 1,2e9,2,0,1, "maximum occurrence limit") \
147
+ OPTION( instantiateonce, 1, 0, 1,0,0,1, "instantiate each clause once") \
148
+ OPTION( lidrup, 0, 0, 1,0,0,1, "linear incremental proof format") \
149
+ LOGOPT( log, 0, 0, 1,0,0,0, "enable logging") \
150
+ LOGOPT( logsort, 0, 0, 1,0,0,0, "sort logged clauses") \
151
+ OPTION( lrat, 0, 0, 1,0,0,1, "use LRAT proof format") \
152
+ OPTION( lucky, 1, 0, 1,0,0,1, "lucky phases") \
153
+ OPTION( luckyassumptions, 1, 0, 1,0,0,1, "lucky phases with assumptions") \
154
+ OPTION( luckyearly, 1, 0, 1,0,0,1, "lucky phases before preprocessing") \
155
+ OPTION( luckylate, 1, 0, 1,0,0,1, "lucky phases after preprocessing") \
156
+ OPTION( minimize, 1, 0, 1,0,0,1, "minimize learned clauses") \
157
+ OPTION( minimizedepth, 1e3, 0,1e3,0,0,1, "minimization depth") \
158
+ OPTION( minimizeticks, 1, 0, 1,0,0,1, "increment ticks in minimization") \
159
+ OPTION( otfs, 1, 0, 1,0,0,1, "on-the-fly self subsumption") \
160
+ OPTION( phase, 1, 0, 1,0,0,1, "initial phase") \
161
+ OPTION( preprocessinit, 2e6, 0,2e9,2,0,1, "initial preprocessing base limit" ) \
162
+ OPTION( preprocesslight, 1, 0, 1,0,1,1, "lightweight preprocessing" ) \
163
+ OPTION( probe, 1, 0, 1,0,1,1, "failed literal probing" ) \
164
+ OPTION( probeeffort, 8, 1,1e5,1,0,1, "relative efficiency per mille") \
165
+ OPTION( probehbr, 1, 0, 1,0,0,1, "learn hyper binary clauses") \
166
+ OPTION( probethresh, 0, 0,100,1,0,1, "delay if ticks smaller thresh*clauses") \
167
+ OPTION( profile, 2, 0, 4,0,0,0, "profiling level") \
168
+ QUTOPT( quiet, 0, 0, 1,0,0,0, "disable all messages") \
169
+ OPTION( radixsortlim, 32, 0,2e9,0,0,1, "radix sort limit") \
170
+ OPTION( randec, 0, 0, 1,0,0,1, "random decisions") \
171
+ OPTION( randecfocused, 1, 0, 1,0,0,1, "random decisions in focused mode") \
172
+ OPTION( randecinit, 1e3, 2,2e9,0,0,1, "inital random decision interval") \
173
+ OPTION( randecint, 500, 0,2e9,0,0,1, "random conflict length") \
174
+ OPTION( randeclength, 10, 1,1e9,0,0,1, "length random decisions phases") \
175
+ OPTION( randecstable, 0, 0, 1,0,0,1, "random decisions in stable mode") \
176
+ OPTION( realtime, 0, 0, 1,0,0,0, "real instead of process time") \
177
+ OPTION( recomputetier, 1, 0, 1,0,0,1, "recompute tiers") \
178
+ OPTION( reduce, 1, 0, 1,0,0,1, "reduce useless clauses") \
179
+ OPTION( reduceinit, 300, 1,1e6,0,0,1, "initial interval") \
180
+ OPTION( reduceint, 25, 2,1e6,0,0,1, "reduce interval") \
181
+ OPTION( reduceopt, 1, 0, 2,0,0,1, "0=prct,1=sqrt,2=max") \
182
+ OPTION( reducetarget, 75, 10,1e2,0,0,1, "reduce fraction in percent") \
183
+ OPTION( reducetier1glue, 2, 1,2e9,0,0,1, "glue of kept learned clauses") \
184
+ OPTION( reducetier2glue, 6, 1,2e9,0,0,1, "glue of tier two clauses") \
185
+ OPTION( reluctant, 1, 0, 1,0,0,1, "stable reluctant doubling restarts") \
186
+ OPTION( reluctantint, 1024, 0,2e9,0,0,1, "reluctant doubling period") \
187
+ OPTION( reluctantmax,1048576, 0,2e9,0,0,1, "maximum reluctant doubling period") \
188
+ OPTION( rephase, 1, 0, 2,0,0,1, "enable resetting phase (0=no,1=always,2=stable-only)") \
189
+ OPTION( rephaseint, 1e3, 1,2e9,0,0,1, "rephase interval") \
190
+ OPTION( report,reportdefault, 0, 1,0,0,1, "enable reporting") \
191
+ OPTION( reportall, 0, 0, 1,0,0,1, "report even if not successful") \
192
+ OPTION( reportsolve, 0, 0, 1,0,0,1, "use solving not process time") \
193
+ OPTION( restart, 1, 0, 1,0,0,1, "enable restarts") \
194
+ OPTION( restartint, 2, 1,2e9,0,0,1, "restart interval") \
195
+ OPTION( restartmarginfocused,10,0,25,0,0,1, "focused slow fast margin in percent") \
196
+ OPTION( restartmarginstable ,25,0,25,0,0,1, "stable slow fast margin in percent") \
197
+ OPTION( restartreusetrail, 1, 0, 1,0,0,1, "enable trail reuse") \
198
+ OPTION( restoreall, 0, 0, 2,0,0,1, "restore all clauses (2=really)") \
199
+ OPTION( restoreflush, 0, 0, 1,0,0,1, "remove satisfied clauses") \
200
+ OPTION( reverse, 0, 0, 1,0,0,1, "reverse variable ordering") \
201
+ OPTION( score, 1, 0, 1,0,0,1, "use EVSIDS scores") \
202
+ OPTION( scorefactor, 950,500,1e3,0,0,1, "score factor per mille") \
203
+ OPTION( seed, 0, 0,2e9,0,0,1, "random seed") \
204
+ OPTION( shrink, 3, 0, 3,0,0,1, "shrink conflict clause (1=binary-only,2=minimize-on-pulling,3=full)") \
205
+ OPTION( shrinkreap, 1, 0, 1,0,0,1, "use a reap for shrinking") \
206
+ OPTION( shuffle, 0, 0, 1,0,0,1, "shuffle variables") \
207
+ OPTION( shufflequeue, 1, 0, 1,0,0,1, "shuffle variable queue") \
208
+ OPTION( shufflerandom, 0, 0, 1,0,0,1, "not reverse but random") \
209
+ OPTION( shufflescores, 1, 0, 1,0,0,1, "shuffle variable scores") \
210
+ OPTION( stabilize, 1, 0, 1,0,0,1, "enable stabilizing phases") \
211
+ OPTION( stabilizeinit, 1e3, 1,2e9,0,0,1, "stabilizing interval") \
212
+ OPTION( stabilizeonly, 0, 0, 1,0,0,1, "only stabilizing phases") \
213
+ OPTION( stats, 0, 0, 1,0,0,1, "print all statistics at the end of the run") \
214
+ OPTION( stubbornIOfocused, 0, 0, 1,0,0,1, "force phases to I/O in focused mode every once in a while (requires rephase==2)") \
215
+ OPTION( subsume, 1, 0, 1,0,1,1, "enable clause subsumption") \
216
+ OPTION( subsumebinlim, 1e4, 0,2e9,1,0,1, "watch list length limit") \
217
+ OPTION( subsumeclslim, 1e2, 0,2e9,2,0,1, "clause length limit") \
218
+ OPTION( subsumeeffort, 1e3, 1,1e5,1,0,1, "relative efficiency per mille") \
219
+ OPTION( subsumelimited, 1, 0, 1,0,0,1, "limit subsumption checks") \
220
+ OPTION( subsumemaxeff, 1e8, 0,2e9,1,0,1, "maximum subsuming efficiency") \
221
+ OPTION( subsumemineff, 0, 0,2e9,1,0,1, "minimum subsuming efficiency") \
222
+ OPTION( subsumeocclim, 1e2, 0,2e9,1,0,1, "watch list length limit") \
223
+ OPTION( subsumestr, 1, 0, 1,0,0,1, "subsume strengthen") \
224
+ OPTION( sweep, 1, 0, 1,0,1,1, "enable SAT sweeping") \
225
+ OPTION( sweepclauses, 1024, 0,2e9,1,0,1, "environment clauses") \
226
+ OPTION( sweepcomplete, 0, 0, 1,0,0,1, "run SAT sweeping to completion") \
227
+ OPTION( sweepcountbinary, 1, 0, 1,0,0,1, "count binaries to environment") \
228
+ OPTION( sweepdepth, 2, 0,2e9,1,0,1, "environment depth") \
229
+ OPTION( sweepeffort, 1e2, 0,1e4,0,0,1, "relative effort in ticks per mille") \
230
+ OPTION( sweepfliprounds, 1, 0,2e9,1,0,1, "flipping rounds") \
231
+ OPTION( sweepmaxclauses, 3e5, 2,2e9,1,0,1, "maximum environment clauses") \
232
+ OPTION( sweepmaxdepth, 3, 1,2e9,1,0,1, "maximum environment depth") \
233
+ OPTION( sweepmaxvars, 8192, 2,2e9,1,0,1, "maximum environment variables") \
234
+ OPTION( sweeprand, 0, 0, 1,0,0,1, "randomize sweeping environment") \
235
+ OPTION( sweepthresh, 5, 0,100,1,0,1, "delay if ticks smaller thresh*clauses") \
236
+ OPTION( sweepvars, 256, 0,2e9,1,0,1, "environment variables") \
237
+ OPTION( target, 1, 0, 2,0,0,1, "target phases (1=stable only)") \
238
+ OPTION( terminateint, 10, 0,1e4,0,0,1, "termination check interval") \
239
+ OPTION( ternary, 1, 0, 1,0,1,1, "hyper ternary resolution") \
240
+ OPTION( ternaryeffort, 8, 1,1e5,1,0,1, "relative efficiency per mille") \
241
+ OPTION( ternarymaxadd, 1e3, 0,1e4,1,0,1, "max clauses added in percent") \
242
+ OPTION( ternaryocclim, 1e2, 1,2e9,2,0,1, "ternary occurrence limit") \
243
+ OPTION( ternaryrounds, 2, 1, 16,1,0,1, "maximum ternary rounds") \
244
+ OPTION( ternarythresh, 6, 0,100,1,0,1, "delay if ticks smaller thresh*clauses") \
245
+ OPTION( tier1limit, 50, 0,100,0,0,1, "limit of tier1 usage in percentage") \
246
+ OPTION( tier1minglue, 0, 0,100,0,0,1, "lowest tier1 limit") \
247
+ OPTION( tier2limit, 90, 0,100,0,0,1, "limit of tier2 usage in percentage") \
248
+ OPTION( tier2minglue, 0, 0,100,0,0,1, "lowest tier2 limit") \
249
+ OPTION( transred, 1, 0, 1,0,1,1, "transitive reduction of BIG") \
250
+ OPTION( transredeffort, 1e2, 1,1e5,1,0,1, "relative efficiency per mille") \
251
+ OPTION( transredmaxeff, 1e8, 0,2e9,1,0,1, "maximum efficiency") \
252
+ OPTION( transredmineff, 0, 0,2e9,1,0,1, "minimum efficiency") \
253
+ QUTOPT( verbose, 0, 0, 3,0,0,0, "more verbose messages") \
254
+ OPTION( veripb, 0, 0, 4,0,0,1, "odd=check-deletions, >2 drat") \
255
+ OPTION( vivify, 1, 0, 1,0,1,1, "vivification") \
256
+ OPTION( vivifycalctier, 0, 0, 1,0,0,1, "recalculate tier limits") \
257
+ OPTION( vivifydemote, 0, 0, 1,0,1,1, "demote irredundant or delete directly") \
258
+ OPTION( vivifyeffort, 50, 0,1e5,1,0,1, "overall efficiency per mille") \
259
+ OPTION( vivifyflush, 1, 0, 1,1,0,1, "flush subsumed before vivification rounds") \
260
+ OPTION( vivifyinst, 1, 0, 1,0,0,1, "instantiate last literal when vivify") \
261
+ OPTION( vivifyirred, 1, 0, 1,0,0,1, "vivification of irredundant clauses") \
262
+ OPTION( vivifyirredeff, 3, 1,100,1,0,1, "irredundant efficiency per mille") \
263
+ OPTION( vivifyonce, 0, 0, 2,0,0,1, "vivify once: 1=red, 2=red+irr") \
264
+ OPTION( vivifyretry, 0, 0, 5,0,0,1, "re-vivify clause if vivify was successful") \
265
+ OPTION( vivifyschedmax, 5e3, 10,2e9,0,0,1, "maximum schedule size") \
266
+ OPTION( vivifythresh, 20, 0,100,1,0,1, "delay if ticks smaller thresh*clauses") \
267
+ OPTION( vivifytier1, 1, 0, 1,0,0,1, "vivification tier1") \
268
+ OPTION( vivifytier1eff, 4, 0,100,1,0,1, "relative tier1 effort") \
269
+ OPTION( vivifytier2, 1, 0, 1,0,0,1, "vivification tier2") \
270
+ OPTION( vivifytier2eff, 2, 1,100,1,0,1, "relative tier2 effort") \
271
+ OPTION( vivifytier3, 1, 0, 1,0,0,1, "vivification tier3") \
272
+ OPTION( vivifytier3eff, 1, 1,100,1,0,1, "relative tier3 effort") \
273
+ OPTION( walk, 1, 0, 1,0,0,1, "enable random walks") \
274
+ OPTION( walkeffort, 80, 1,1e5,1,0,1, "relative efficiency per mille") \
275
+ OPTION( walkfullocc, 0, 0, 1,1,0,1, "use Kissat's full occurrences instead of the single watched") \
276
+ OPTION( walkmaxeff, 1e7, 0,2e9,1,0,1, "maximum efficiency (in 1e3 ticks)") \
277
+ OPTION( walkmineff, 0, 0,1e7,1,0,1, "minimum efficiency") \
278
+ OPTION( walknonstable, 1, 0, 1,0,0,1, "walk in non-stabilizing phase") \
279
+ OPTION( walkredundant, 0, 0, 1,0,0,1, "walk redundant clauses too") \
280
+ OPTION( warmup, 1, 0, 1,0,0,1, "warmup before walk using propagation") \
281
+
282
+ // Note, keep an empty line right before this line because of the last '\'!
283
+ // Also keep those single spaces after 'OPTION(' for proper sorting.
284
+
285
+ // clang-format on
286
+
287
+ /*------------------------------------------------------------------------*/
288
+
289
+ // Some of the 'OPTION' macros above should only be included if certain
290
+ // compile time options are enabled. This has the effect, that for instance
291
+ // if 'LOGGING' is defined, and thus logging code is included, then also the
292
+ // 'log' option is defined. Otherwise the 'log' option is not included.
293
+
294
+ #ifdef LOGGING
295
+ #define LOGOPT OPTION
296
+ #else
297
+ #define LOGOPT(...) /**/
298
+ #endif
299
+
300
+ #ifdef QUIET
301
+ #define QUTOPT(...) /**/
302
+ #else
303
+ #define QUTOPT OPTION
304
+ #endif
305
+
306
+ /*------------------------------------------------------------------------*/
307
+
308
+ namespace CaDiCaL {
309
+
310
+ struct Internal;
311
+
312
+ /*------------------------------------------------------------------------*/
313
+
314
+ class Options;
315
+
316
+ struct Option {
317
+ const char *name;
318
+ int def, lo, hi;
319
+ int optimizable;
320
+ bool preprocessing;
321
+ const char *description;
322
+ int &val (Options *);
323
+ };
324
+
325
+ /*------------------------------------------------------------------------*/
326
+
327
+ // Produce a compile time constant for the number of options.
328
+
329
+ static const size_t number_of_options =
330
+ #define OPTION(N, V, L, H, O, P, R, D) 1 +
331
+ OPTIONS
332
+ #undef OPTION
333
+ + 0;
334
+
335
+ /*------------------------------------------------------------------------*/
336
+
337
+ class Options {
338
+
339
+ Internal *internal;
340
+
341
+ void set (Option *, int val); // Force to [lo,hi] interval.
342
+
343
+ friend struct Option;
344
+ static Option table[];
345
+
346
+ static void initialize_from_environment (int &val, const char *name,
347
+ const int L, const int H);
348
+
349
+ friend Config;
350
+
351
+ void reset_default_values ();
352
+ void disable_preprocessing ();
353
+
354
+ public:
355
+ // For library usage we disable reporting by default while for the stand
356
+ // alone SAT solver we enable it by default. This default value has to
357
+ // be set before the constructor of 'Options' is called (which in turn is
358
+ // called from the constructor of 'Solver'). If we would simply overwrite
359
+ // its initial value while initializing the stand alone solver, we will
360
+ // get that change of the default value (from 'false' to 'true') shown
361
+ // during calls to 'print ()', which is confusing to the user.
362
+ //
363
+ static int reportdefault;
364
+
365
+ Options (Internal *);
366
+
367
+ // Makes options directly accessible, e.g., for instance declares the
368
+ // member 'int restart' here. This will give fast access to option values
369
+ // internally in the solver and thus can also be used in tight loops.
370
+ //
371
+ private:
372
+ int __start_of_options__; // Used by 'val' below.
373
+ public:
374
+ #define OPTION(N, V, L, H, O, P, R, D) \
375
+ int N; // Access option values by name.
376
+ OPTIONS
377
+ #undef OPTION
378
+
379
+ // It would be more elegant to use an anonymous 'struct' of the actual
380
+ // option values overlayed with an 'int values[number_of_options]' array
381
+ // but that is not proper ISO C++ and produces a warning. Instead we use
382
+ // the following construction which relies on '__start_of_options__' and
383
+ // that the following options are really allocated directly after it.
384
+ //
385
+ inline int &val (size_t idx) {
386
+ assert (idx < number_of_options);
387
+ return (&__start_of_options__ + 1)[idx];
388
+ }
389
+
390
+ // With the following function we can get rather fast access to the option
391
+ // limits, the default value and the description. The code uses binary
392
+ // search over the sorted option 'table'. This static data is shared
393
+ // among different instances of the solver. The actual current option
394
+ // values are here in the 'Options' class. They can be accessed by the
395
+ // offset of the static options using 'Option::val' if you have an
396
+ // 'Option' or to have even faster access directly by the member function
397
+ // (the 'N' above, e.g., 'restart').
398
+ //
399
+ static Option *has (const char *name);
400
+
401
+ bool set (const char *name, int); // Explicit version.
402
+ int get (const char *name); // Get current value.
403
+
404
+ void print (); // Print current values in command line form
405
+ static void usage (); // Print usage message for all options.
406
+
407
+ void optimize (int val); // increase some limits (val=0..31)
408
+
409
+ static bool is_preprocessing_option (const char *name);
410
+
411
+ // Parse long option argument
412
+ //
413
+ // --<name>
414
+ // --<name>=<val>
415
+ // --no-<name>
416
+ //
417
+ // where '<val>' is as in 'parse_option_value'. If parsing succeeds,
418
+ // 'true' is returned and the string will be set to the name of the
419
+ // option. Additionally the parsed value is set (last argument).
420
+ //
421
+ static bool parse_long_option (const char *, string &, int &);
422
+
423
+ // Iterating options.
424
+
425
+ typedef Option *iterator;
426
+ typedef const Option *const_iterator;
427
+
428
+ static iterator begin () { return table; }
429
+ static iterator end () { return table + number_of_options; }
430
+
431
+ void copy (Options &other) const; // Copy 'this' into 'other'.
432
+ };
433
+
434
+ inline int &Option::val (Options *opts) {
435
+ assert (Options::table <= this &&
436
+ this < Options::table + number_of_options);
437
+ return opts->val (this - Options::table);
438
+ }
439
+
440
+ } // namespace CaDiCaL
441
+
442
+ #endif