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.
- checksums.yaml +7 -0
- data/LICENSE.txt +26 -0
- data/README.md +101 -0
- data/ext/cadical/cadical/LICENSE +28 -0
- data/ext/cadical/cadical/README.md +65 -0
- data/ext/cadical/cadical/VERSION +1 -0
- data/ext/cadical/cadical/src/analyze.cpp +1360 -0
- data/ext/cadical/cadical/src/arena.cpp +30 -0
- data/ext/cadical/cadical/src/arena.hpp +105 -0
- data/ext/cadical/cadical/src/assume.cpp +616 -0
- data/ext/cadical/cadical/src/averages.cpp +34 -0
- data/ext/cadical/cadical/src/averages.hpp +37 -0
- data/ext/cadical/cadical/src/backbone.cpp +631 -0
- data/ext/cadical/cadical/src/backtrack.cpp +177 -0
- data/ext/cadical/cadical/src/backward.cpp +231 -0
- data/ext/cadical/cadical/src/bins.cpp +22 -0
- data/ext/cadical/cadical/src/bins.hpp +22 -0
- data/ext/cadical/cadical/src/block.cpp +824 -0
- data/ext/cadical/cadical/src/block.hpp +37 -0
- data/ext/cadical/cadical/src/cadical.cpp +1026 -0
- data/ext/cadical/cadical/src/cadical.hpp +1419 -0
- data/ext/cadical/cadical/src/ccadical.cpp +208 -0
- data/ext/cadical/cadical/src/ccadical.h +74 -0
- data/ext/cadical/cadical/src/checker.cpp +649 -0
- data/ext/cadical/cadical/src/checker.hpp +173 -0
- data/ext/cadical/cadical/src/clause.cpp +689 -0
- data/ext/cadical/cadical/src/clause.hpp +190 -0
- data/ext/cadical/cadical/src/collect.cpp +545 -0
- data/ext/cadical/cadical/src/compact.cpp +550 -0
- data/ext/cadical/cadical/src/condition.cpp +940 -0
- data/ext/cadical/cadical/src/config.cpp +101 -0
- data/ext/cadical/cadical/src/config.hpp +20 -0
- data/ext/cadical/cadical/src/congruence.cpp +7880 -0
- data/ext/cadical/cadical/src/congruence.hpp +757 -0
- data/ext/cadical/cadical/src/constrain.cpp +64 -0
- data/ext/cadical/cadical/src/contract.cpp +27 -0
- data/ext/cadical/cadical/src/contract.hpp +139 -0
- data/ext/cadical/cadical/src/cover.cpp +704 -0
- data/ext/cadical/cadical/src/cover.hpp +34 -0
- data/ext/cadical/cadical/src/decide.cpp +347 -0
- data/ext/cadical/cadical/src/decompose.cpp +738 -0
- data/ext/cadical/cadical/src/decompose.hpp +23 -0
- data/ext/cadical/cadical/src/deduplicate.cpp +275 -0
- data/ext/cadical/cadical/src/definition.cpp +283 -0
- data/ext/cadical/cadical/src/delay.hpp +38 -0
- data/ext/cadical/cadical/src/drattracer.cpp +153 -0
- data/ext/cadical/cadical/src/drattracer.hpp +55 -0
- data/ext/cadical/cadical/src/elim.cpp +1171 -0
- data/ext/cadical/cadical/src/elim.hpp +53 -0
- data/ext/cadical/cadical/src/elimfast.cpp +570 -0
- data/ext/cadical/cadical/src/ema.cpp +95 -0
- data/ext/cadical/cadical/src/ema.hpp +68 -0
- data/ext/cadical/cadical/src/extend.cpp +289 -0
- data/ext/cadical/cadical/src/external.cpp +1034 -0
- data/ext/cadical/cadical/src/external.hpp +487 -0
- data/ext/cadical/cadical/src/external_propagate.cpp +1316 -0
- data/ext/cadical/cadical/src/factor.cpp +1011 -0
- data/ext/cadical/cadical/src/factor.hpp +54 -0
- data/ext/cadical/cadical/src/file.cpp +506 -0
- data/ext/cadical/cadical/src/file.hpp +210 -0
- data/ext/cadical/cadical/src/flags.cpp +135 -0
- data/ext/cadical/cadical/src/flags.hpp +93 -0
- data/ext/cadical/cadical/src/flip.cpp +269 -0
- data/ext/cadical/cadical/src/format.cpp +89 -0
- data/ext/cadical/cadical/src/format.hpp +36 -0
- data/ext/cadical/cadical/src/frattracer.cpp +277 -0
- data/ext/cadical/cadical/src/frattracer.hpp +67 -0
- data/ext/cadical/cadical/src/gates.cpp +766 -0
- data/ext/cadical/cadical/src/heap.hpp +212 -0
- data/ext/cadical/cadical/src/idruptracer.cpp +566 -0
- data/ext/cadical/cadical/src/idruptracer.hpp +112 -0
- data/ext/cadical/cadical/src/instantiate.cpp +365 -0
- data/ext/cadical/cadical/src/instantiate.hpp +45 -0
- data/ext/cadical/cadical/src/internal.cpp +1265 -0
- data/ext/cadical/cadical/src/internal.hpp +1941 -0
- data/ext/cadical/cadical/src/inttypes.hpp +34 -0
- data/ext/cadical/cadical/src/ipasir.cpp +47 -0
- data/ext/cadical/cadical/src/ipasir.h +37 -0
- data/ext/cadical/cadical/src/kitten.c +2599 -0
- data/ext/cadical/cadical/src/kitten.h +97 -0
- data/ext/cadical/cadical/src/level.hpp +33 -0
- data/ext/cadical/cadical/src/lidruptracer.cpp +657 -0
- data/ext/cadical/cadical/src/lidruptracer.hpp +122 -0
- data/ext/cadical/cadical/src/limit.cpp +146 -0
- data/ext/cadical/cadical/src/limit.hpp +168 -0
- data/ext/cadical/cadical/src/logging.cpp +214 -0
- data/ext/cadical/cadical/src/logging.hpp +98 -0
- data/ext/cadical/cadical/src/lookahead.cpp +520 -0
- data/ext/cadical/cadical/src/lratchecker.cpp +833 -0
- data/ext/cadical/cadical/src/lratchecker.hpp +168 -0
- data/ext/cadical/cadical/src/lrattracer.cpp +200 -0
- data/ext/cadical/cadical/src/lrattracer.hpp +61 -0
- data/ext/cadical/cadical/src/lucky.cpp +506 -0
- data/ext/cadical/cadical/src/message.cpp +218 -0
- data/ext/cadical/cadical/src/message.hpp +65 -0
- data/ext/cadical/cadical/src/minimize.cpp +224 -0
- data/ext/cadical/cadical/src/mobical.cpp +5588 -0
- data/ext/cadical/cadical/src/occs.cpp +52 -0
- data/ext/cadical/cadical/src/occs.hpp +36 -0
- data/ext/cadical/cadical/src/options.cpp +359 -0
- data/ext/cadical/cadical/src/options.hpp +442 -0
- data/ext/cadical/cadical/src/parse.cpp +471 -0
- data/ext/cadical/cadical/src/parse.hpp +75 -0
- data/ext/cadical/cadical/src/phases.cpp +56 -0
- data/ext/cadical/cadical/src/phases.hpp +19 -0
- data/ext/cadical/cadical/src/probe.cpp +990 -0
- data/ext/cadical/cadical/src/profile.cpp +107 -0
- data/ext/cadical/cadical/src/profile.hpp +283 -0
- data/ext/cadical/cadical/src/proof.cpp +691 -0
- data/ext/cadical/cadical/src/proof.hpp +125 -0
- data/ext/cadical/cadical/src/propagate.cpp +584 -0
- data/ext/cadical/cadical/src/queue.cpp +90 -0
- data/ext/cadical/cadical/src/queue.hpp +74 -0
- data/ext/cadical/cadical/src/radix.hpp +180 -0
- data/ext/cadical/cadical/src/random.cpp +207 -0
- data/ext/cadical/cadical/src/random.h +44 -0
- data/ext/cadical/cadical/src/random.hpp +98 -0
- data/ext/cadical/cadical/src/range.hpp +125 -0
- data/ext/cadical/cadical/src/reap.cpp +127 -0
- data/ext/cadical/cadical/src/reap.hpp +28 -0
- data/ext/cadical/cadical/src/reduce.cpp +278 -0
- data/ext/cadical/cadical/src/reluctant.hpp +82 -0
- data/ext/cadical/cadical/src/rephase.cpp +402 -0
- data/ext/cadical/cadical/src/report.cpp +313 -0
- data/ext/cadical/cadical/src/resources.cpp +160 -0
- data/ext/cadical/cadical/src/resources.hpp +16 -0
- data/ext/cadical/cadical/src/restart.cpp +178 -0
- data/ext/cadical/cadical/src/restore.cpp +267 -0
- data/ext/cadical/cadical/src/score.cpp +51 -0
- data/ext/cadical/cadical/src/score.hpp +16 -0
- data/ext/cadical/cadical/src/shrink.cpp +507 -0
- data/ext/cadical/cadical/src/signal.cpp +136 -0
- data/ext/cadical/cadical/src/signal.hpp +33 -0
- data/ext/cadical/cadical/src/solution.cpp +50 -0
- data/ext/cadical/cadical/src/solver.cpp +1871 -0
- data/ext/cadical/cadical/src/stable.cpp +31 -0
- data/ext/cadical/cadical/src/stack.h +110 -0
- data/ext/cadical/cadical/src/stats.cpp +920 -0
- data/ext/cadical/cadical/src/stats.hpp +418 -0
- data/ext/cadical/cadical/src/subsume.cpp +645 -0
- data/ext/cadical/cadical/src/sweep.cpp +1960 -0
- data/ext/cadical/cadical/src/sweep.hpp +61 -0
- data/ext/cadical/cadical/src/terminal.cpp +38 -0
- data/ext/cadical/cadical/src/terminal.hpp +96 -0
- data/ext/cadical/cadical/src/ternary.cpp +450 -0
- data/ext/cadical/cadical/src/testing.hpp +24 -0
- data/ext/cadical/cadical/src/tier.cpp +189 -0
- data/ext/cadical/cadical/src/tracer.hpp +186 -0
- data/ext/cadical/cadical/src/transred.cpp +253 -0
- data/ext/cadical/cadical/src/unstable.cpp +29 -0
- data/ext/cadical/cadical/src/util.cpp +129 -0
- data/ext/cadical/cadical/src/util.hpp +181 -0
- data/ext/cadical/cadical/src/var.cpp +39 -0
- data/ext/cadical/cadical/src/var.hpp +22 -0
- data/ext/cadical/cadical/src/veripbtracer.cpp +427 -0
- data/ext/cadical/cadical/src/veripbtracer.hpp +106 -0
- data/ext/cadical/cadical/src/version.cpp +107 -0
- data/ext/cadical/cadical/src/version.hpp +13 -0
- data/ext/cadical/cadical/src/vivify.cpp +1893 -0
- data/ext/cadical/cadical/src/vivify.hpp +50 -0
- data/ext/cadical/cadical/src/walk.cpp +1088 -0
- data/ext/cadical/cadical/src/walk.hpp +91 -0
- data/ext/cadical/cadical/src/walk_full_occs.cpp +966 -0
- data/ext/cadical/cadical/src/warmup.cpp +403 -0
- data/ext/cadical/cadical/src/watch.cpp +126 -0
- data/ext/cadical/cadical/src/watch.hpp +77 -0
- data/ext/cadical/cadical_ext.c +778 -0
- data/ext/cadical/extconf.rb +26 -0
- data/lib/cadical/version.rb +3 -0
- data/lib/cadical.rb +12 -0
- metadata +218 -0
|
@@ -0,0 +1,1941 @@
|
|
|
1
|
+
#ifndef _internal_hpp_INCLUDED
|
|
2
|
+
#define _internal_hpp_INCLUDED
|
|
3
|
+
|
|
4
|
+
/*------------------------------------------------------------------------*/
|
|
5
|
+
|
|
6
|
+
// Wrapped build specific headers which should go first.
|
|
7
|
+
|
|
8
|
+
#include "inttypes.hpp"
|
|
9
|
+
|
|
10
|
+
/*------------------------------------------------------------------------*/
|
|
11
|
+
|
|
12
|
+
// Common 'C' headers.
|
|
13
|
+
|
|
14
|
+
#include <cassert>
|
|
15
|
+
#include <cctype>
|
|
16
|
+
#include <climits>
|
|
17
|
+
#include <cmath>
|
|
18
|
+
#include <csignal>
|
|
19
|
+
#include <cstdio>
|
|
20
|
+
#include <cstdlib>
|
|
21
|
+
#include <cstring>
|
|
22
|
+
#include <variant>
|
|
23
|
+
|
|
24
|
+
// Less common 'C' header.
|
|
25
|
+
|
|
26
|
+
extern "C" {
|
|
27
|
+
#include <unistd.h>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/*------------------------------------------------------------------------*/
|
|
31
|
+
|
|
32
|
+
// Common 'C++' headers.
|
|
33
|
+
|
|
34
|
+
#include <algorithm>
|
|
35
|
+
#include <queue>
|
|
36
|
+
#include <string>
|
|
37
|
+
#include <unordered_set>
|
|
38
|
+
#include <vector>
|
|
39
|
+
|
|
40
|
+
/*------------------------------------------------------------------------*/
|
|
41
|
+
|
|
42
|
+
// All internal headers are included here. This gives a nice overview on
|
|
43
|
+
// what is needed altogether. The 'Internal' class needs almost all the
|
|
44
|
+
// headers anyhow (since the idea is to avoid pointer references as much as
|
|
45
|
+
// possible). Most implementation files need to see the definition of the
|
|
46
|
+
// 'Internal' too. Thus there is no real advantage in trying to reduce the
|
|
47
|
+
// number of header files included here. The other benefit of having all
|
|
48
|
+
// header files here is that '.cpp' files then only need to include this.
|
|
49
|
+
|
|
50
|
+
#include "arena.hpp"
|
|
51
|
+
#include "averages.hpp"
|
|
52
|
+
#include "bins.hpp"
|
|
53
|
+
#include "block.hpp"
|
|
54
|
+
#include "cadical.hpp"
|
|
55
|
+
#include "checker.hpp"
|
|
56
|
+
#include "clause.hpp"
|
|
57
|
+
#include "config.hpp"
|
|
58
|
+
#include "congruence.hpp"
|
|
59
|
+
#include "contract.hpp"
|
|
60
|
+
#include "cover.hpp"
|
|
61
|
+
#include "decompose.hpp"
|
|
62
|
+
#include "drattracer.hpp"
|
|
63
|
+
#include "elim.hpp"
|
|
64
|
+
#include "ema.hpp"
|
|
65
|
+
#include "external.hpp"
|
|
66
|
+
#include "factor.hpp"
|
|
67
|
+
#include "file.hpp"
|
|
68
|
+
#include "flags.hpp"
|
|
69
|
+
#include "format.hpp"
|
|
70
|
+
#include "frattracer.hpp"
|
|
71
|
+
#include "heap.hpp"
|
|
72
|
+
#include "idruptracer.hpp"
|
|
73
|
+
#include "instantiate.hpp"
|
|
74
|
+
#include "internal.hpp"
|
|
75
|
+
#include "level.hpp"
|
|
76
|
+
#include "lidruptracer.hpp"
|
|
77
|
+
#include "limit.hpp"
|
|
78
|
+
#include "logging.hpp"
|
|
79
|
+
#include "lratchecker.hpp"
|
|
80
|
+
#include "lrattracer.hpp"
|
|
81
|
+
#include "message.hpp"
|
|
82
|
+
#include "occs.hpp"
|
|
83
|
+
#include "options.hpp"
|
|
84
|
+
#include "parse.hpp"
|
|
85
|
+
#include "phases.hpp"
|
|
86
|
+
#include "profile.hpp"
|
|
87
|
+
#include "proof.hpp"
|
|
88
|
+
#include "queue.hpp"
|
|
89
|
+
#include "radix.hpp"
|
|
90
|
+
#include "random.hpp"
|
|
91
|
+
#include "range.hpp"
|
|
92
|
+
#include "reap.hpp"
|
|
93
|
+
#include "reluctant.hpp"
|
|
94
|
+
#include "resources.hpp"
|
|
95
|
+
#include "score.hpp"
|
|
96
|
+
#include "stats.hpp"
|
|
97
|
+
#include "sweep.hpp"
|
|
98
|
+
#include "terminal.hpp"
|
|
99
|
+
#include "tracer.hpp"
|
|
100
|
+
#include "util.hpp"
|
|
101
|
+
#include "var.hpp"
|
|
102
|
+
#include "veripbtracer.hpp"
|
|
103
|
+
#include "version.hpp"
|
|
104
|
+
#include "vivify.hpp"
|
|
105
|
+
#include "walk.hpp"
|
|
106
|
+
#include "watch.hpp"
|
|
107
|
+
|
|
108
|
+
// c headers
|
|
109
|
+
extern "C" {
|
|
110
|
+
#include "kitten.h"
|
|
111
|
+
}
|
|
112
|
+
/*------------------------------------------------------------------------*/
|
|
113
|
+
|
|
114
|
+
namespace CaDiCaL {
|
|
115
|
+
|
|
116
|
+
using namespace std;
|
|
117
|
+
|
|
118
|
+
struct Coveror;
|
|
119
|
+
struct External;
|
|
120
|
+
struct WalkerFO;
|
|
121
|
+
struct Walker;
|
|
122
|
+
class Tracer;
|
|
123
|
+
class FileTracer;
|
|
124
|
+
class StatTracer;
|
|
125
|
+
|
|
126
|
+
struct CubesWithStatus {
|
|
127
|
+
int status = 0;
|
|
128
|
+
std::vector<std::vector<int>> cubes;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/*------------------------------------------------------------------------*/
|
|
132
|
+
|
|
133
|
+
struct Internal {
|
|
134
|
+
|
|
135
|
+
/*----------------------------------------------------------------------*/
|
|
136
|
+
|
|
137
|
+
// The actual internal state of the solver is set and maintained in this
|
|
138
|
+
// section. This is currently only used for debugging and testing.
|
|
139
|
+
|
|
140
|
+
enum Mode {
|
|
141
|
+
BLOCK = (1 << 0),
|
|
142
|
+
CONDITION = (1 << 1),
|
|
143
|
+
CONGRUENCE = (1 << 2),
|
|
144
|
+
COVER = (1 << 3),
|
|
145
|
+
DECOMP = (1 << 4),
|
|
146
|
+
DEDUP = (1 << 5),
|
|
147
|
+
ELIM = (1 << 6),
|
|
148
|
+
FACTOR = (1 << 7),
|
|
149
|
+
LUCKY = (1 << 8),
|
|
150
|
+
PROBE = (1 << 9),
|
|
151
|
+
SEARCH = (1 << 10),
|
|
152
|
+
SIMPLIFY = (1 << 11),
|
|
153
|
+
SUBSUME = (1 << 12),
|
|
154
|
+
SWEEP = (1 << 13),
|
|
155
|
+
TERNARY = (1 << 14),
|
|
156
|
+
TRANSRED = (1 << 15),
|
|
157
|
+
VIVIFY = (1 << 16),
|
|
158
|
+
WALK = (1 << 17),
|
|
159
|
+
BACKBONE = (1 << 18),
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
bool in_mode (Mode m) const { return (mode & m) != 0; }
|
|
163
|
+
void set_mode (Mode m) {
|
|
164
|
+
assert (!(mode & m));
|
|
165
|
+
mode |= m;
|
|
166
|
+
}
|
|
167
|
+
void reset_mode (Mode m) {
|
|
168
|
+
assert (mode & m);
|
|
169
|
+
mode &= ~m;
|
|
170
|
+
}
|
|
171
|
+
void require_mode (Mode m) const { assert (mode & m), (void) m; }
|
|
172
|
+
|
|
173
|
+
/*----------------------------------------------------------------------*/
|
|
174
|
+
|
|
175
|
+
int mode; // current internal state
|
|
176
|
+
int tier1[2] = {
|
|
177
|
+
2, 2}; // tier1 limit for 0=focused, 1=stable; aka tier1[stable]
|
|
178
|
+
int tier2[2] = {
|
|
179
|
+
6, 6}; // tier2 limit for 0=focused, 1=stable; aka tier1[stable]
|
|
180
|
+
bool unsat; // empty clause found or learned
|
|
181
|
+
bool iterating; // report learned unit ('i' line)
|
|
182
|
+
bool localsearching; // true during local search
|
|
183
|
+
bool lookingahead; // true during look ahead
|
|
184
|
+
bool preprocessing; // true during preprocessing
|
|
185
|
+
bool protected_reasons; // referenced reasons are protected
|
|
186
|
+
bool force_saved_phase; // force saved phase in decision
|
|
187
|
+
bool searching_lucky_phases; // during 'lucky_phases'
|
|
188
|
+
bool stable; // true during stabilization phase
|
|
189
|
+
bool reported; // reported in this solving call
|
|
190
|
+
bool external_prop; // true if an external propagator is connected
|
|
191
|
+
bool did_external_prop; // true if ext. propagation happened
|
|
192
|
+
bool external_prop_is_lazy; // true if the external propagator is lazy
|
|
193
|
+
bool forced_backt_allowed; // external propagator can force backtracking
|
|
194
|
+
bool private_steps; // no notification of ext. prop during these steps
|
|
195
|
+
char rephased; // last type of resetting phases
|
|
196
|
+
Reluctant reluctant; // restart counter in stable mode
|
|
197
|
+
size_t vsize; // actually allocated variable data size
|
|
198
|
+
int max_var; // internal maximum variable index
|
|
199
|
+
int64_t clause_id; // last used id for clauses
|
|
200
|
+
int64_t original_id; // ids for original clauses to produce LRAT
|
|
201
|
+
int64_t reserved_ids; // number of reserved ids for original clauses
|
|
202
|
+
int64_t conflict_id; // store conflict id for finalize (frat)
|
|
203
|
+
int64_t saved_decisions; // to compute decision rate average
|
|
204
|
+
bool concluded; // keeps track of conclude
|
|
205
|
+
vector<int64_t> conclusion; // store ids of conclusion clauses
|
|
206
|
+
vector<int64_t>
|
|
207
|
+
unit_clauses_idx; // keep track of unit_clauses (LRAT/FRAT)
|
|
208
|
+
vector<int64_t> lrat_chain; // create LRAT in solver: option lratdirect
|
|
209
|
+
vector<int64_t> mini_chain; // used to create LRAT in minimize
|
|
210
|
+
vector<int64_t> minimize_chain; // used to create LRAT in minimize
|
|
211
|
+
vector<int64_t> unit_chain; // used to avoid duplicate units
|
|
212
|
+
vector<Clause *> inst_chain; // for LRAT in instantiate
|
|
213
|
+
vector<vector<vector<int64_t>>>
|
|
214
|
+
probehbr_chains; // only used if opts.probehbr=false
|
|
215
|
+
bool lrat; // generate LRAT internally
|
|
216
|
+
bool frat; // finalize non-deleted clauses in proof
|
|
217
|
+
int level; // decision level ('control.size () - 1')
|
|
218
|
+
Phases phases; // saved, target and best phases
|
|
219
|
+
signed char *vals; // assignment [-max_var,max_var]
|
|
220
|
+
vector<signed char> marks; // signed marks [1,max_var]
|
|
221
|
+
vector<unsigned> frozentab; // frozen counters [1,max_var]
|
|
222
|
+
vector<int> i2e; // maps internal 'idx' to external 'lit'
|
|
223
|
+
vector<unsigned> relevanttab; // Reference counts for observed variables.
|
|
224
|
+
Queue queue; // variable move to front decision queue
|
|
225
|
+
Links links; // table of links for decision queue
|
|
226
|
+
double score_inc; // current score increment
|
|
227
|
+
ScoreSchedule scores; // score based decision priority queue
|
|
228
|
+
vector<double> stab; // table of variable scores [1,max_var]
|
|
229
|
+
vector<Var> vtab; // variable table [1,max_var]
|
|
230
|
+
vector<int> parents; // parent literals during probing
|
|
231
|
+
vector<Flags> ftab; // variable and literal flags
|
|
232
|
+
vector<int64_t> btab; // enqueue time stamps for queue
|
|
233
|
+
vector<int64_t> gtab; // time stamp table to recompute glue
|
|
234
|
+
vector<Occs> otab; // table of occurrences for all literals
|
|
235
|
+
vector<Occs> rtab; // table of redundant occurrences
|
|
236
|
+
vector<int> ptab; // table for caching probing attempts
|
|
237
|
+
vector<int64_t> ntab; // number of one-sided occurrences table
|
|
238
|
+
vector<Bins> big; // binary implication graph
|
|
239
|
+
vector<Watches> wtab; // table of watches for all literals
|
|
240
|
+
Clause *conflict; // set in 'propagation', reset in 'analyze'
|
|
241
|
+
Clause *ignore; // ignored during 'vivify_propagate'
|
|
242
|
+
Clause *dummy_binary; // Dummy binary clause for subsumption
|
|
243
|
+
Clause *external_reason; // used as reason at external propagations
|
|
244
|
+
Clause *newest_clause; // used in external_propagate
|
|
245
|
+
bool force_no_backtrack; // for new clauses with external propagator
|
|
246
|
+
bool from_propagator; // differentiate new clauses...
|
|
247
|
+
bool ext_clause_forgettable; // Is new clause from propagator forgettable
|
|
248
|
+
int changed_val; // used for ILB
|
|
249
|
+
size_t notified; // next trail position to notify external prop
|
|
250
|
+
Clause *probe_reason; // set during probing
|
|
251
|
+
size_t propagated; // next trail position to propagate
|
|
252
|
+
size_t propagated2; // next binary trail position to propagate
|
|
253
|
+
size_t propergated; // propagated without blocking literals
|
|
254
|
+
size_t best_assigned; // best maximum assigned ever
|
|
255
|
+
size_t target_assigned; // maximum assigned without conflict
|
|
256
|
+
size_t no_conflict_until; // largest trail prefix without conflict
|
|
257
|
+
vector<int> trail; // currently assigned literals
|
|
258
|
+
vector<int> clause; // simplified in parsing & learning
|
|
259
|
+
vector<int> assumptions; // assumed literals
|
|
260
|
+
vector<int> constraint; // literals of the constraint
|
|
261
|
+
bool unsat_constraint; // constraint used for unsatisfiability?
|
|
262
|
+
bool marked_failed; // are the failed assumptions marked?
|
|
263
|
+
vector<int> original; // original added literals
|
|
264
|
+
vector<int> levels; // decision levels in learned clause
|
|
265
|
+
vector<int> analyzed; // analyzed literals in 'analyze'
|
|
266
|
+
vector<int> unit_analyzed; // to avoid duplicate units in lrat_chain
|
|
267
|
+
vector<int> sign_marked; // literals skipped in 'decompose'
|
|
268
|
+
vector<int> minimized; // removable or poison in 'minimize'
|
|
269
|
+
vector<int> shrinkable; // removable or poison in 'shrink'
|
|
270
|
+
Reap reap; // radix heap for shrink
|
|
271
|
+
bool factorcheckdone =
|
|
272
|
+
0; // boolean indicated that we have done the resize 1
|
|
273
|
+
|
|
274
|
+
vector<int> sweep_schedule; // remember sweep varibles to reschedule
|
|
275
|
+
bool sweep_incomplete; // sweep
|
|
276
|
+
uint64_t randomized_deciding;
|
|
277
|
+
|
|
278
|
+
kitten *citten;
|
|
279
|
+
|
|
280
|
+
size_t num_assigned; // check for satisfied
|
|
281
|
+
|
|
282
|
+
vector<int> probes; // remaining scheduled probes
|
|
283
|
+
vector<Level> control; // 'level + 1 == control.size ()'
|
|
284
|
+
vector<Clause *> clauses; // ordered collection of all clauses
|
|
285
|
+
Averages averages; // glue, size, jump moving averages
|
|
286
|
+
Delay delay[2]; // Delay certain functions
|
|
287
|
+
Delay congruence_delay; // Delay congruence if not successful recently
|
|
288
|
+
Limit lim; // limits for various phases
|
|
289
|
+
Last last; // statistics at last occurrence
|
|
290
|
+
Inc inc; // increments on limits
|
|
291
|
+
|
|
292
|
+
Delay delaying_vivify_irredundant;
|
|
293
|
+
Delay delaying_sweep;
|
|
294
|
+
|
|
295
|
+
Proof *proof; // abstraction layer between solver and tracers
|
|
296
|
+
vector<Tracer *>
|
|
297
|
+
tracers; // proof tracing objects (ie interpolant calculator)
|
|
298
|
+
vector<FileTracer *>
|
|
299
|
+
file_tracers; // file proof tracers (ie DRAT, LRAT...)
|
|
300
|
+
vector<StatTracer *> stat_tracers; // checkers
|
|
301
|
+
|
|
302
|
+
Options opts; // run-time options
|
|
303
|
+
Stats stats; // statistics
|
|
304
|
+
#ifndef QUIET
|
|
305
|
+
Profiles profiles; // time profiles for various functions
|
|
306
|
+
bool force_phase_messages; // force 'phase (...)' messages
|
|
307
|
+
#endif
|
|
308
|
+
Arena arena; // memory arena for moving garbage collector
|
|
309
|
+
Format error_message; // provide persistent error message
|
|
310
|
+
string prefix; // verbose messages prefix
|
|
311
|
+
|
|
312
|
+
Internal *internal; // proxy to 'this' in macros
|
|
313
|
+
External *external; // proxy to 'external' buddy in 'Solver'
|
|
314
|
+
|
|
315
|
+
static constexpr unsigned max_used =
|
|
316
|
+
31; // must fit into the header of the clause!
|
|
317
|
+
/*----------------------------------------------------------------------*/
|
|
318
|
+
|
|
319
|
+
// Asynchronous termination flag written by 'terminate' and read by
|
|
320
|
+
// 'terminated_asynchronously' (the latter at the end of this header).
|
|
321
|
+
//
|
|
322
|
+
volatile bool termination_forced;
|
|
323
|
+
|
|
324
|
+
/*----------------------------------------------------------------------*/
|
|
325
|
+
|
|
326
|
+
const Range vars; // Provides safe variable iteration.
|
|
327
|
+
const Sange lits; // Provides safe literal iteration.
|
|
328
|
+
|
|
329
|
+
/*----------------------------------------------------------------------*/
|
|
330
|
+
|
|
331
|
+
Internal ();
|
|
332
|
+
~Internal ();
|
|
333
|
+
|
|
334
|
+
/*----------------------------------------------------------------------*/
|
|
335
|
+
|
|
336
|
+
// Internal delegates and helpers for corresponding functions in
|
|
337
|
+
// 'External' and 'Solver'. The 'init_vars' function initializes
|
|
338
|
+
// variables up to and including the requested variable index.
|
|
339
|
+
//
|
|
340
|
+
void init_vars (int new_max_var);
|
|
341
|
+
|
|
342
|
+
void init_enqueue (int idx);
|
|
343
|
+
void init_queue (int old_max_var, int new_max_var);
|
|
344
|
+
|
|
345
|
+
void init_scores (int old_max_var, int new_max_var);
|
|
346
|
+
|
|
347
|
+
void add_original_lit (int lit);
|
|
348
|
+
|
|
349
|
+
// only able to restore irredundant clause
|
|
350
|
+
void finish_added_clause_with_id (int64_t id, bool restore = false);
|
|
351
|
+
|
|
352
|
+
// Reserve ids for original clauses to produce lrat
|
|
353
|
+
void reserve_ids (int number);
|
|
354
|
+
|
|
355
|
+
// Enlarge tables.
|
|
356
|
+
//
|
|
357
|
+
void enlarge_vals (size_t new_vsize);
|
|
358
|
+
void enlarge (int new_max_var);
|
|
359
|
+
|
|
360
|
+
// A variable is 'active' if it is not eliminated nor fixed.
|
|
361
|
+
//
|
|
362
|
+
bool active (int lit) { return flags (lit).active (); }
|
|
363
|
+
|
|
364
|
+
int active () const {
|
|
365
|
+
int res = stats.active;
|
|
366
|
+
#ifndef NDEBUG
|
|
367
|
+
int tmp = max_var;
|
|
368
|
+
tmp -= stats.unused;
|
|
369
|
+
tmp -= stats.now.fixed;
|
|
370
|
+
tmp -= stats.now.eliminated;
|
|
371
|
+
tmp -= stats.now.substituted;
|
|
372
|
+
tmp -= stats.now.pure;
|
|
373
|
+
assert (tmp >= 0);
|
|
374
|
+
assert (tmp == res);
|
|
375
|
+
#endif
|
|
376
|
+
return res;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
void reactivate (int lit); // During 'restore'.
|
|
380
|
+
|
|
381
|
+
// Currently remaining active redundant and irredundant clauses.
|
|
382
|
+
|
|
383
|
+
int64_t redundant () const { return stats.current.redundant; }
|
|
384
|
+
|
|
385
|
+
int64_t irredundant () const { return stats.current.irredundant; }
|
|
386
|
+
|
|
387
|
+
double clause_variable_ratio () const {
|
|
388
|
+
return relative (irredundant (), active ());
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// Scale values relative to clause variable ratio.
|
|
392
|
+
//
|
|
393
|
+
double scale (double v) const;
|
|
394
|
+
|
|
395
|
+
// Unsigned literals (abs) with checks.
|
|
396
|
+
//
|
|
397
|
+
int vidx (int lit) const {
|
|
398
|
+
int idx;
|
|
399
|
+
assert (lit);
|
|
400
|
+
assert (lit != INT_MIN);
|
|
401
|
+
idx = abs (lit);
|
|
402
|
+
assert (idx <= max_var);
|
|
403
|
+
return idx;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// Unsigned version with LSB denoting sign. This is used in indexing
|
|
407
|
+
// arrays by literals. The idea is to keep the elements in such an array
|
|
408
|
+
// for both the positive and negated version of a literal close together.
|
|
409
|
+
//
|
|
410
|
+
unsigned vlit (int lit) const {
|
|
411
|
+
return (lit < 0) + 2u * (unsigned) vidx (lit);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
int u2i (unsigned u) {
|
|
415
|
+
assert (u > 1);
|
|
416
|
+
int res = u / 2;
|
|
417
|
+
assert (res <= max_var);
|
|
418
|
+
if (u & 1)
|
|
419
|
+
res = -res;
|
|
420
|
+
return res;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
int citten2lit (unsigned ulit) {
|
|
424
|
+
int res = (ulit / 2) + 1;
|
|
425
|
+
assert (res <= max_var);
|
|
426
|
+
if (ulit & 1)
|
|
427
|
+
res = -res;
|
|
428
|
+
return res;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
unsigned lit2citten (int lit) {
|
|
432
|
+
int idx = vidx (lit) - 1;
|
|
433
|
+
return (lit < 0) + 2u * (unsigned) idx;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
int64_t unit_id (int lit) const {
|
|
437
|
+
assert (lrat || frat);
|
|
438
|
+
assert (val (lit) > 0);
|
|
439
|
+
const unsigned uidx = vlit (lit);
|
|
440
|
+
int64_t id = unit_clauses_idx[uidx];
|
|
441
|
+
assert (id);
|
|
442
|
+
return id;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
inline int64_t &unit_clauses (int uidx) {
|
|
446
|
+
assert (lrat || frat);
|
|
447
|
+
assert (uidx > 0);
|
|
448
|
+
assert ((size_t) uidx < unit_clauses_idx.size ());
|
|
449
|
+
return unit_clauses_idx[uidx];
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Helper functions to access variable and literal data.
|
|
453
|
+
//
|
|
454
|
+
Var &var (int lit) { return vtab[vidx (lit)]; }
|
|
455
|
+
Link &link (int lit) { return links[vidx (lit)]; }
|
|
456
|
+
Flags &flags (int lit) { return ftab[vidx (lit)]; }
|
|
457
|
+
int64_t &bumped (int lit) { return btab[vidx (lit)]; }
|
|
458
|
+
int &propfixed (int lit) { return ptab[vlit (lit)]; }
|
|
459
|
+
double &score (int lit) { return stab[vidx (lit)]; }
|
|
460
|
+
|
|
461
|
+
const Flags &flags (int lit) const { return ftab[vidx (lit)]; }
|
|
462
|
+
|
|
463
|
+
bool occurring () const { return !otab.empty (); }
|
|
464
|
+
bool watching () const { return !wtab.empty (); }
|
|
465
|
+
|
|
466
|
+
Bins &bins (int lit) { return big[vlit (lit)]; }
|
|
467
|
+
Occs &occs (int lit) { return otab[vlit (lit)]; }
|
|
468
|
+
int64_t &noccs (int lit) { return ntab[vlit (lit)]; }
|
|
469
|
+
Watches &watches (int lit) { return wtab[vlit (lit)]; }
|
|
470
|
+
|
|
471
|
+
// Variable bumping through exponential VSIDS (EVSIDS) as in MiniSAT.
|
|
472
|
+
//
|
|
473
|
+
bool use_scores () const { return opts.score && stable; }
|
|
474
|
+
void bump_variable_score (int lit);
|
|
475
|
+
void bump_variable_score_inc ();
|
|
476
|
+
void rescale_variable_scores ();
|
|
477
|
+
|
|
478
|
+
// Marking variables with a sign (positive or negative).
|
|
479
|
+
//
|
|
480
|
+
signed char marked (int lit) const {
|
|
481
|
+
signed char res = marks[vidx (lit)];
|
|
482
|
+
if (lit < 0)
|
|
483
|
+
res = -res;
|
|
484
|
+
return res;
|
|
485
|
+
}
|
|
486
|
+
void mark (int lit) {
|
|
487
|
+
assert (!marked (lit));
|
|
488
|
+
marks[vidx (lit)] = sign (lit);
|
|
489
|
+
assert (marked (lit) > 0);
|
|
490
|
+
assert (marked (-lit) < 0);
|
|
491
|
+
}
|
|
492
|
+
void unmark (int lit) {
|
|
493
|
+
marks[vidx (lit)] = 0;
|
|
494
|
+
assert (!marked (lit));
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// Use only bits 6 and 7 to store the sign or zero. The remaining
|
|
498
|
+
// bits can be used as additional flags.
|
|
499
|
+
//
|
|
500
|
+
signed char marked67 (int lit) const {
|
|
501
|
+
signed char res = marks[vidx (lit)] >> 6;
|
|
502
|
+
if (lit < 0)
|
|
503
|
+
res = -res;
|
|
504
|
+
return res;
|
|
505
|
+
}
|
|
506
|
+
void mark67 (int lit) {
|
|
507
|
+
signed char &m = marks[vidx (lit)];
|
|
508
|
+
const signed char mask = 0x3f;
|
|
509
|
+
#ifndef NDEBUG
|
|
510
|
+
const signed char bits = m & mask;
|
|
511
|
+
#endif
|
|
512
|
+
m = (m & mask) | (sign (lit) << 6);
|
|
513
|
+
assert (marked (lit) > 0);
|
|
514
|
+
assert (marked (-lit) < 0);
|
|
515
|
+
assert ((m & mask) == bits);
|
|
516
|
+
assert (marked67 (lit) > 0);
|
|
517
|
+
assert (marked67 (-lit) < 0);
|
|
518
|
+
}
|
|
519
|
+
void unmark67 (int lit) {
|
|
520
|
+
signed char &m = marks[vidx (lit)];
|
|
521
|
+
const signed char mask = 0x3f;
|
|
522
|
+
#ifndef NDEBUG
|
|
523
|
+
const signed bits = m & mask;
|
|
524
|
+
#endif
|
|
525
|
+
m &= mask;
|
|
526
|
+
assert ((m & mask) == bits);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
void unmark (vector<int> &lits) {
|
|
530
|
+
for (const auto &lit : lits)
|
|
531
|
+
unmark (lit);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
// The other 6 bits of the 'marks' bytes can be used as additional
|
|
535
|
+
// (unsigned) marking bits. Currently we only use the least significant
|
|
536
|
+
// bit in 'condition' to mark variables in the conditional part.
|
|
537
|
+
//
|
|
538
|
+
bool getbit (int lit, int bit) const {
|
|
539
|
+
assert (0 <= bit), assert (bit < 6);
|
|
540
|
+
return marks[vidx (lit)] & (1 << bit);
|
|
541
|
+
}
|
|
542
|
+
void setbit (int lit, int bit) {
|
|
543
|
+
assert (0 <= bit), assert (bit < 6);
|
|
544
|
+
assert (!getbit (lit, bit));
|
|
545
|
+
marks[vidx (lit)] |= (1 << bit);
|
|
546
|
+
assert (getbit (lit, bit));
|
|
547
|
+
}
|
|
548
|
+
void unsetbit (int lit, int bit) {
|
|
549
|
+
assert (0 <= bit), assert (bit < 6);
|
|
550
|
+
assert (getbit (lit, bit));
|
|
551
|
+
marks[vidx (lit)] &= ~(1 << bit);
|
|
552
|
+
assert (!getbit (lit, bit));
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// Marking individual literals.
|
|
556
|
+
//
|
|
557
|
+
bool marked2 (int lit) const {
|
|
558
|
+
unsigned res = marks[vidx (lit)];
|
|
559
|
+
assert (res <= 3);
|
|
560
|
+
unsigned bit = bign (lit);
|
|
561
|
+
return (res & bit) != 0;
|
|
562
|
+
}
|
|
563
|
+
void mark2 (int lit) {
|
|
564
|
+
marks[vidx (lit)] |= bign (lit);
|
|
565
|
+
assert (marked2 (lit));
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
// marks bits 1,2,3 and 4,5,6 depending on fact and sign of lit
|
|
569
|
+
//
|
|
570
|
+
bool getfact (int lit, int fact) const {
|
|
571
|
+
assert (fact == 1 || fact == 2 || fact == 4);
|
|
572
|
+
int res = marks[vidx (lit)];
|
|
573
|
+
if (lit < 0) {
|
|
574
|
+
res >>= 3;
|
|
575
|
+
} else {
|
|
576
|
+
res &= 7;
|
|
577
|
+
}
|
|
578
|
+
// assert (!res || res == 1 || res == 2 || res == 4);
|
|
579
|
+
return res & fact;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
void markfact (int lit, int fact) {
|
|
583
|
+
assert (fact == 1 || fact == 2 || fact == 4);
|
|
584
|
+
assert (!getfact (lit, fact));
|
|
585
|
+
#ifndef NDEBUG
|
|
586
|
+
int before = getfact (-lit, fact);
|
|
587
|
+
#endif
|
|
588
|
+
int res = marks[vidx (lit)];
|
|
589
|
+
if (lit < 0) {
|
|
590
|
+
res |= fact << 3;
|
|
591
|
+
} else {
|
|
592
|
+
res |= fact;
|
|
593
|
+
}
|
|
594
|
+
marks[vidx (lit)] = res;
|
|
595
|
+
assert (getfact (lit, fact));
|
|
596
|
+
#ifndef NDEBUG
|
|
597
|
+
assert (getfact (-lit, fact) == before);
|
|
598
|
+
#endif
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
void unmarkfact (int lit, int fact) {
|
|
602
|
+
assert (fact == 1 || fact == 2 || fact == 4);
|
|
603
|
+
assert (getfact (lit, fact));
|
|
604
|
+
int res = marks[vidx (lit)];
|
|
605
|
+
if (lit < 0) {
|
|
606
|
+
res &= ~(fact << 3);
|
|
607
|
+
} else {
|
|
608
|
+
res &= ~fact;
|
|
609
|
+
}
|
|
610
|
+
marks[vidx (lit)] = res;
|
|
611
|
+
assert (!getfact (lit, fact));
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
// Marking and unmarking of all literals in a clause.
|
|
615
|
+
//
|
|
616
|
+
void mark_clause (); // mark 'this->clause'
|
|
617
|
+
void mark (Clause *);
|
|
618
|
+
void mark2 (Clause *);
|
|
619
|
+
void unmark_clause (); // unmark 'this->clause'
|
|
620
|
+
void unmark (Clause *);
|
|
621
|
+
|
|
622
|
+
// Watch literal 'lit' in clause with blocking literal 'blit'.
|
|
623
|
+
// Inlined here, since it occurs in the tight inner loop of 'propagate'.
|
|
624
|
+
//
|
|
625
|
+
inline void watch_literal (int lit, int blit, Clause *c) {
|
|
626
|
+
assert (lit != blit);
|
|
627
|
+
Watches &ws = watches (lit);
|
|
628
|
+
ws.push_back (Watch (blit, c));
|
|
629
|
+
assert (c->literals[0] == lit || c->literals[1] == lit);
|
|
630
|
+
LOG (c, "watch %d blit %d in", lit, blit);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// Watch literal 'lit' in clause with blocking literal 'blit'.
|
|
634
|
+
// Inlined here, since it occurs in the tight inner loop of 'propagate'.
|
|
635
|
+
//
|
|
636
|
+
inline void watch_binary_literal (int lit, int blit, Clause *c) {
|
|
637
|
+
assert (lit != blit);
|
|
638
|
+
Watches &ws = watches (lit);
|
|
639
|
+
ws.push_back (Watch (true, blit, c));
|
|
640
|
+
LOG (c, "watch binary %d blit %d in", lit, blit);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// Add two watches to a clause. This is used initially during allocation
|
|
644
|
+
// of a clause and during connecting back all watches after preprocessing.
|
|
645
|
+
//
|
|
646
|
+
inline void watch_clause (Clause *c) {
|
|
647
|
+
const int l0 = c->literals[0];
|
|
648
|
+
const int l1 = c->literals[1];
|
|
649
|
+
watch_literal (l0, l1, c);
|
|
650
|
+
watch_literal (l1, l0, c);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
inline void unwatch_clause (Clause *c) {
|
|
654
|
+
const int l0 = c->literals[0];
|
|
655
|
+
const int l1 = c->literals[1];
|
|
656
|
+
remove_watch (watches (l0), c);
|
|
657
|
+
remove_watch (watches (l1), c);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
// Update queue to point to last potentially still unassigned variable.
|
|
661
|
+
// All variables after 'queue.unassigned' in bump order are assumed to be
|
|
662
|
+
// assigned. Then update the 'queue.bumped' field and log it. This is
|
|
663
|
+
// inlined here since it occurs in several inner loops.
|
|
664
|
+
//
|
|
665
|
+
inline void update_queue_unassigned (int idx) {
|
|
666
|
+
assert (0 < idx);
|
|
667
|
+
assert (idx <= max_var);
|
|
668
|
+
queue.unassigned = idx;
|
|
669
|
+
queue.bumped = btab[idx];
|
|
670
|
+
LOG ("queue unassigned now %d bumped %" PRId64 "", idx, btab[idx]);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
void bump_queue (int idx);
|
|
674
|
+
|
|
675
|
+
// Mark (active) variables as eliminated, substituted, pure or fixed,
|
|
676
|
+
// which turns them into inactive variables.
|
|
677
|
+
//
|
|
678
|
+
void mark_eliminated (int);
|
|
679
|
+
void mark_substituted (int);
|
|
680
|
+
void mark_active (int);
|
|
681
|
+
void mark_fixed (int);
|
|
682
|
+
void mark_pure (int);
|
|
683
|
+
|
|
684
|
+
// Managing clauses in 'clause.cpp'. Without explicit 'Clause' argument
|
|
685
|
+
// these functions work on the global temporary 'clause'.
|
|
686
|
+
//
|
|
687
|
+
Clause *new_clause (bool red, int glue = 0);
|
|
688
|
+
void promote_clause (Clause *, int new_glue);
|
|
689
|
+
void promote_clause_glue_only (Clause *, int new_glue);
|
|
690
|
+
size_t shrink_clause (Clause *, int new_size);
|
|
691
|
+
void minimize_sort_clause ();
|
|
692
|
+
void shrink_and_minimize_clause ();
|
|
693
|
+
void reset_shrinkable ();
|
|
694
|
+
void mark_shrinkable_as_removable (int, std::vector<int>::size_type);
|
|
695
|
+
int shrink_literal (int, int, unsigned);
|
|
696
|
+
unsigned shrunken_block_uip (int, int,
|
|
697
|
+
std::vector<int>::reverse_iterator &,
|
|
698
|
+
std::vector<int>::reverse_iterator &,
|
|
699
|
+
std::vector<int>::size_type, const int);
|
|
700
|
+
void shrunken_block_no_uip (const std::vector<int>::reverse_iterator &,
|
|
701
|
+
const std::vector<int>::reverse_iterator &,
|
|
702
|
+
unsigned &, const int);
|
|
703
|
+
void push_literals_of_block (const std::vector<int>::reverse_iterator &,
|
|
704
|
+
const std::vector<int>::reverse_iterator &,
|
|
705
|
+
int, unsigned);
|
|
706
|
+
unsigned shrink_next (int, unsigned &, unsigned &);
|
|
707
|
+
std::vector<int>::reverse_iterator
|
|
708
|
+
minimize_and_shrink_block (std::vector<int>::reverse_iterator &,
|
|
709
|
+
unsigned int &, unsigned int &, const int);
|
|
710
|
+
unsigned shrink_block (std::vector<int>::reverse_iterator &,
|
|
711
|
+
std::vector<int>::reverse_iterator &, int,
|
|
712
|
+
unsigned &, unsigned &, const int, unsigned);
|
|
713
|
+
unsigned shrink_along_reason (int, int, bool, bool &, unsigned);
|
|
714
|
+
|
|
715
|
+
void deallocate_clause (Clause *);
|
|
716
|
+
void delete_clause (Clause *);
|
|
717
|
+
void mark_garbage (Clause *);
|
|
718
|
+
void assign_original_unit (int64_t, int);
|
|
719
|
+
void add_new_original_clause (int64_t);
|
|
720
|
+
Clause *new_learned_redundant_clause (int glue);
|
|
721
|
+
Clause *new_hyper_binary_resolved_clause (bool red, int glue);
|
|
722
|
+
Clause *new_clause_as (const Clause *orig);
|
|
723
|
+
Clause *new_resolved_irredundant_clause ();
|
|
724
|
+
|
|
725
|
+
// Forward reasoning through propagation in 'propagate.cpp'.
|
|
726
|
+
//
|
|
727
|
+
int assignment_level (int lit, Clause *);
|
|
728
|
+
void build_chain_for_units (int lit, Clause *reason, bool forced);
|
|
729
|
+
void build_chain_for_empty ();
|
|
730
|
+
void search_assign (int lit, Clause *);
|
|
731
|
+
void search_assign_driving (int lit, Clause *reason);
|
|
732
|
+
void search_assign_external (int lit);
|
|
733
|
+
void search_assume_decision (int decision);
|
|
734
|
+
static Clause *decision_reason;
|
|
735
|
+
void assign_unit (int lit);
|
|
736
|
+
int64_t cache_lines (size_t bytes) { return (bytes + 127) / 128; }
|
|
737
|
+
int64_t cache_lines (size_t n, size_t bytes) {
|
|
738
|
+
return cache_lines (n * bytes);
|
|
739
|
+
}
|
|
740
|
+
bool propagate ();
|
|
741
|
+
|
|
742
|
+
#ifdef PROFILE_MODE
|
|
743
|
+
bool propagate_wrapper ();
|
|
744
|
+
bool propagate_unstable ();
|
|
745
|
+
bool propagate_stable ();
|
|
746
|
+
void analyze_wrapper ();
|
|
747
|
+
void analyze_unstable ();
|
|
748
|
+
void analyze_stable ();
|
|
749
|
+
int decide_wrapper ();
|
|
750
|
+
int decide_stable ();
|
|
751
|
+
int decide_unstable ();
|
|
752
|
+
#else
|
|
753
|
+
#define propagate_wrapper propagate
|
|
754
|
+
#define analyze_wrapper analyze
|
|
755
|
+
#define decide_wrapper decide
|
|
756
|
+
#endif
|
|
757
|
+
|
|
758
|
+
void propergate (); // Repropagate without blocking literals.
|
|
759
|
+
|
|
760
|
+
// Undo and restart in 'backtrack.cpp'.
|
|
761
|
+
//
|
|
762
|
+
void unassign (int lit);
|
|
763
|
+
void update_target_and_best ();
|
|
764
|
+
void backtrack (int target_level = 0);
|
|
765
|
+
void backtrack_without_updating_phases (int target_level = 0);
|
|
766
|
+
|
|
767
|
+
// Minimized learned clauses in 'minimize.cpp'.
|
|
768
|
+
//
|
|
769
|
+
bool minimize_literal (int lit, int depth = 0);
|
|
770
|
+
void minimize_clause ();
|
|
771
|
+
void calculate_minimize_chain (int lit, std::vector<int> &stack);
|
|
772
|
+
|
|
773
|
+
// Learning from conflicts in 'analyze.cc'.
|
|
774
|
+
//
|
|
775
|
+
void learn_empty_clause ();
|
|
776
|
+
void learn_unit_clause (int lit);
|
|
777
|
+
|
|
778
|
+
void bump_variable (int lit);
|
|
779
|
+
void bump_variables ();
|
|
780
|
+
int recompute_glue (Clause *);
|
|
781
|
+
void bump_clause (Clause *);
|
|
782
|
+
void bump_clause2 (Clause *);
|
|
783
|
+
void clear_unit_analyzed_literals ();
|
|
784
|
+
void clear_analyzed_literals ();
|
|
785
|
+
void clear_analyzed_levels ();
|
|
786
|
+
void clear_minimized_literals ();
|
|
787
|
+
bool bump_also_reason_literal (int lit);
|
|
788
|
+
void bump_also_reason_literals (int lit, int depth_limit,
|
|
789
|
+
size_t size_limit);
|
|
790
|
+
void bump_also_all_reason_literals ();
|
|
791
|
+
void analyze_literal (int lit, int &open, int &resolvent_size,
|
|
792
|
+
int &antecedent_size);
|
|
793
|
+
void analyze_reason (int lit, Clause *, int &open, int &resolvent_size,
|
|
794
|
+
int &antecedent_size);
|
|
795
|
+
Clause *new_driving_clause (const int glue, int &jump);
|
|
796
|
+
int find_conflict_level (int &forced);
|
|
797
|
+
int determine_actual_backtrack_level (int jump);
|
|
798
|
+
void otfs_strengthen_clause (Clause *, int, int,
|
|
799
|
+
const std::vector<int> &);
|
|
800
|
+
void otfs_subsume_clause (Clause *subsuming, Clause *subsumed);
|
|
801
|
+
int otfs_find_backtrack_level (int &forced);
|
|
802
|
+
Clause *on_the_fly_strengthen (Clause *conflict, int lit);
|
|
803
|
+
void update_decision_rate_average ();
|
|
804
|
+
void lazy_external_propagator_out_of_order_clause (int &);
|
|
805
|
+
void analyze ();
|
|
806
|
+
void iterate (); // report learned unit clause
|
|
807
|
+
|
|
808
|
+
// Learning from external propagator in 'external_propagate.cpp'
|
|
809
|
+
//
|
|
810
|
+
bool external_propagate ();
|
|
811
|
+
bool external_check_solution ();
|
|
812
|
+
void add_external_clause (int propagated_lit = 0,
|
|
813
|
+
bool no_backtrack = false);
|
|
814
|
+
Clause *learn_external_reason_clause (int lit, int falsified_elit = 0,
|
|
815
|
+
bool no_backtrack = false);
|
|
816
|
+
Clause *wrapped_learn_external_reason_clause (int lit);
|
|
817
|
+
void explain_external_propagations ();
|
|
818
|
+
void explain_reason (int lit, Clause *, int &open);
|
|
819
|
+
void move_literals_to_watch ();
|
|
820
|
+
void handle_external_clause (Clause *);
|
|
821
|
+
void notify_assignments ();
|
|
822
|
+
void notify_decision ();
|
|
823
|
+
void notify_backtrack (size_t new_level);
|
|
824
|
+
void force_backtrack (int new_level);
|
|
825
|
+
int ask_decision ();
|
|
826
|
+
bool ask_external_clause ();
|
|
827
|
+
void add_observed_var (int ilit);
|
|
828
|
+
void remove_observed_var (int ilit);
|
|
829
|
+
bool observed (int ilit) const;
|
|
830
|
+
bool is_decision (int ilit);
|
|
831
|
+
void check_watched_literal_invariants ();
|
|
832
|
+
void set_changed_val ();
|
|
833
|
+
void renotify_trail_after_ilb ();
|
|
834
|
+
void renotify_trail_after_local_search ();
|
|
835
|
+
void renotify_full_trail ();
|
|
836
|
+
|
|
837
|
+
// adds the assigned literals to assigned
|
|
838
|
+
void renotify_full_trail_between_trail_pos (int start_level,
|
|
839
|
+
int end_level,
|
|
840
|
+
int propagator_level,
|
|
841
|
+
std::vector<int> &assigned,
|
|
842
|
+
bool start_new_level);
|
|
843
|
+
void connect_propagator ();
|
|
844
|
+
void mark_garbage_external_forgettable (int64_t id);
|
|
845
|
+
bool is_external_forgettable (int64_t id);
|
|
846
|
+
#ifndef NDEBUG
|
|
847
|
+
bool get_merged_literals (std::vector<int> &);
|
|
848
|
+
void get_all_fixed_literals (std::vector<int> &);
|
|
849
|
+
#endif
|
|
850
|
+
|
|
851
|
+
void recompute_tier ();
|
|
852
|
+
void decay_clauses_upon_incremental_clauses ();
|
|
853
|
+
void print_tier_usage_statistics ();
|
|
854
|
+
// Use last learned clause to subsume some more.
|
|
855
|
+
//
|
|
856
|
+
void eagerly_subsume_recently_learned_clauses (Clause *);
|
|
857
|
+
|
|
858
|
+
// Restarting policy in 'restart.cc'.
|
|
859
|
+
//
|
|
860
|
+
bool stabilizing ();
|
|
861
|
+
bool restarting ();
|
|
862
|
+
int reuse_trail ();
|
|
863
|
+
void restart ();
|
|
864
|
+
|
|
865
|
+
// Functions to set and reset certain 'phases'.
|
|
866
|
+
//
|
|
867
|
+
void clear_phases (vector<signed char> &); // reset argument to zero
|
|
868
|
+
void copy_phases (vector<signed char> &); // copy 'saved' to argument
|
|
869
|
+
void save_assigned_phases (
|
|
870
|
+
vector<signed char> &); // save assigned literals to argument
|
|
871
|
+
|
|
872
|
+
// Resetting the saved phased in 'rephase.cpp'.
|
|
873
|
+
//
|
|
874
|
+
bool rephasing ();
|
|
875
|
+
char rephase_best ();
|
|
876
|
+
char rephase_flipping ();
|
|
877
|
+
char rephase_inverted ();
|
|
878
|
+
char rephase_original ();
|
|
879
|
+
char rephase_random ();
|
|
880
|
+
char rephase_walk ();
|
|
881
|
+
void shuffle_scores ();
|
|
882
|
+
void shuffle_queue ();
|
|
883
|
+
void rephase ();
|
|
884
|
+
|
|
885
|
+
// Lucky feasible case checking.
|
|
886
|
+
//
|
|
887
|
+
int unlucky (int res);
|
|
888
|
+
int lucky_decide_assumptions ();
|
|
889
|
+
bool lucky_propagate_discrepency (int);
|
|
890
|
+
int trivially_false_satisfiable ();
|
|
891
|
+
int trivially_true_satisfiable ();
|
|
892
|
+
int forward_false_satisfiable ();
|
|
893
|
+
int forward_true_satisfiable ();
|
|
894
|
+
int backward_false_satisfiable ();
|
|
895
|
+
int backward_true_satisfiable ();
|
|
896
|
+
int positive_horn_satisfiable ();
|
|
897
|
+
int negative_horn_satisfiable ();
|
|
898
|
+
|
|
899
|
+
// Asynchronous terminating check.
|
|
900
|
+
//
|
|
901
|
+
bool terminated_asynchronously (int factor = 1);
|
|
902
|
+
|
|
903
|
+
bool search_limits_hit ();
|
|
904
|
+
|
|
905
|
+
void terminate () {
|
|
906
|
+
LOG ("forcing asynchronous termination");
|
|
907
|
+
termination_forced = true;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
// Reducing means determining useless clauses with 'reduce' in
|
|
911
|
+
// 'reduce.cpp' as well as root level satisfied clause and then removing
|
|
912
|
+
// those which are not used as reason anymore with garbage collection.
|
|
913
|
+
//
|
|
914
|
+
bool flushing ();
|
|
915
|
+
bool reducing ();
|
|
916
|
+
void protect_reasons ();
|
|
917
|
+
void mark_clauses_to_be_flushed ();
|
|
918
|
+
void mark_useless_redundant_clauses_as_garbage ();
|
|
919
|
+
bool propagate_out_of_order_units ();
|
|
920
|
+
void unprotect_reasons ();
|
|
921
|
+
void reduce ();
|
|
922
|
+
|
|
923
|
+
// Garbage collection in 'collect.cpp' called from 'reduce' and during
|
|
924
|
+
// inprocessing and preprocessing.
|
|
925
|
+
//
|
|
926
|
+
int clause_contains_fixed_literal (Clause *);
|
|
927
|
+
void remove_falsified_literals (Clause *);
|
|
928
|
+
void mark_satisfied_clauses_as_garbage ();
|
|
929
|
+
void copy_clause (Clause *);
|
|
930
|
+
void flush_watches (int lit, Watches &);
|
|
931
|
+
size_t flush_occs (int lit);
|
|
932
|
+
void flush_all_occs_and_watches ();
|
|
933
|
+
void update_reason_references ();
|
|
934
|
+
void copy_non_garbage_clauses ();
|
|
935
|
+
void delete_garbage_clauses ();
|
|
936
|
+
void check_clause_stats ();
|
|
937
|
+
void check_var_stats ();
|
|
938
|
+
bool arenaing ();
|
|
939
|
+
void garbage_collection ();
|
|
940
|
+
|
|
941
|
+
// only remove binary clauses from the watches
|
|
942
|
+
void remove_garbage_binaries ();
|
|
943
|
+
|
|
944
|
+
// Set-up occurrence list counters and containers.
|
|
945
|
+
//
|
|
946
|
+
void init_occs ();
|
|
947
|
+
void init_bins ();
|
|
948
|
+
void init_noccs ();
|
|
949
|
+
void clear_noccs ();
|
|
950
|
+
void clear_occs ();
|
|
951
|
+
void reset_occs ();
|
|
952
|
+
void reset_bins ();
|
|
953
|
+
void reset_noccs ();
|
|
954
|
+
|
|
955
|
+
// Operators on watches.
|
|
956
|
+
//
|
|
957
|
+
void init_watches ();
|
|
958
|
+
void connect_watches (bool irredundant_only = false);
|
|
959
|
+
void connect_binary_watches ();
|
|
960
|
+
void sort_watches ();
|
|
961
|
+
void clear_watches ();
|
|
962
|
+
void reset_watches ();
|
|
963
|
+
|
|
964
|
+
// Regular forward subsumption checking in 'subsume.cpp'.
|
|
965
|
+
//
|
|
966
|
+
void strengthen_clause (Clause *, int);
|
|
967
|
+
void subsume_clause (Clause *subsuming, Clause *subsumed);
|
|
968
|
+
int subsume_check (Clause *subsuming, Clause *subsumed);
|
|
969
|
+
int try_to_subsume_clause (Clause *, vector<Clause *> &shrunken);
|
|
970
|
+
void reset_subsume_bits ();
|
|
971
|
+
bool subsume_round ();
|
|
972
|
+
void subsume ();
|
|
973
|
+
|
|
974
|
+
// Covered clause elimination of large clauses.
|
|
975
|
+
//
|
|
976
|
+
void covered_literal_addition (int lit, Coveror &);
|
|
977
|
+
void asymmetric_literal_addition (int lit, Coveror &);
|
|
978
|
+
void cover_push_extension (int lit, Coveror &);
|
|
979
|
+
bool cover_propagate_asymmetric (int lit, Clause *ignore, Coveror &);
|
|
980
|
+
bool cover_propagate_covered (int lit, Coveror &);
|
|
981
|
+
bool cover_clause (Clause *c, Coveror &);
|
|
982
|
+
int64_t cover_round ();
|
|
983
|
+
bool cover ();
|
|
984
|
+
|
|
985
|
+
// Strengthening through vivification in 'vivify.cpp'.
|
|
986
|
+
//
|
|
987
|
+
void demote_clause (Clause *);
|
|
988
|
+
void flush_vivification_schedule (std::vector<Clause *> &, int64_t &);
|
|
989
|
+
void vivify_increment_stats (const Vivifier &vivifier);
|
|
990
|
+
void vivify_subsume_clause (Clause *subsuming, Clause *subsumed);
|
|
991
|
+
void compute_tier_limits (Vivifier &);
|
|
992
|
+
void vivify_initialize (Vivifier &vivifier, int64_t &ticks);
|
|
993
|
+
inline void vivify_prioritize_leftovers (char, size_t prioritized,
|
|
994
|
+
std::vector<Clause *> &schedule);
|
|
995
|
+
bool consider_to_vivify_clause (Clause *candidate);
|
|
996
|
+
void vivify_sort_watched (Clause *c);
|
|
997
|
+
bool vivify_instantiate (
|
|
998
|
+
const std::vector<int> &, Clause *,
|
|
999
|
+
std::vector<std::tuple<int, Clause *, bool>> &lrat_stack,
|
|
1000
|
+
int64_t &ticks);
|
|
1001
|
+
void vivify_analyze_redundant (Vivifier &, Clause *start, bool &);
|
|
1002
|
+
void vivify_build_lrat (int, Clause *,
|
|
1003
|
+
std::vector<std::tuple<int, Clause *, bool>> &);
|
|
1004
|
+
void vivify_chain_for_units (int lit, Clause *reason);
|
|
1005
|
+
void vivify_strengthen (Clause *candidate, int64_t &);
|
|
1006
|
+
void vivify_assign (int lit, Clause *);
|
|
1007
|
+
void vivify_assume (int lit);
|
|
1008
|
+
bool vivify_propagate (int64_t &);
|
|
1009
|
+
void vivify_deduce (Clause *candidate, Clause *conflct, int implied,
|
|
1010
|
+
Clause **, bool &);
|
|
1011
|
+
bool vivify_clause (Vivifier &, Clause *candidate);
|
|
1012
|
+
void vivify_analyze (Clause *start, bool &, Clause **,
|
|
1013
|
+
const Clause *const, int implied, bool &);
|
|
1014
|
+
bool vivify_shrinkable (const std::vector<int> &sorted, Clause *c);
|
|
1015
|
+
void vivify_round (Vivifier &, int64_t delta);
|
|
1016
|
+
bool vivify ();
|
|
1017
|
+
|
|
1018
|
+
// Deduplicating clauses
|
|
1019
|
+
//
|
|
1020
|
+
void deduplicate_all_clauses ();
|
|
1021
|
+
|
|
1022
|
+
// Compacting (shrinking internal variable tables) in 'compact.cpp'
|
|
1023
|
+
//
|
|
1024
|
+
bool compacting ();
|
|
1025
|
+
void compact ();
|
|
1026
|
+
|
|
1027
|
+
// Transitive reduction of binary implication graph in 'transred.cpp'
|
|
1028
|
+
//
|
|
1029
|
+
void transred ();
|
|
1030
|
+
|
|
1031
|
+
// backbone computation
|
|
1032
|
+
//
|
|
1033
|
+
void backbone_decision (int lit);
|
|
1034
|
+
bool backbone_propagate (int64_t &);
|
|
1035
|
+
void backbone_propagate2 (int64_t &);
|
|
1036
|
+
unsigned compute_backbone ();
|
|
1037
|
+
void backbone_unit_reassign (
|
|
1038
|
+
int lit); // only for reassigning already derived clauses!
|
|
1039
|
+
void backbone_unit_assign (
|
|
1040
|
+
int lit); // only for reassigning already derived clauses!
|
|
1041
|
+
void backbone_assign_any (int lit, Clause *reason);
|
|
1042
|
+
void backbone_assign (int lit, Clause *reason);
|
|
1043
|
+
void backbone_lrat_for_units (int lit, Clause *c);
|
|
1044
|
+
unsigned compute_backbone_round (std::vector<int> &candidates,
|
|
1045
|
+
std::vector<int> &units,
|
|
1046
|
+
const int64_t ticks_limit,
|
|
1047
|
+
int64_t &ticks, unsigned inconsistent);
|
|
1048
|
+
void schedule_backbone_cands (std::vector<int> &candidates);
|
|
1049
|
+
void keep_backbone_candidates (const std::vector<int> &candidates);
|
|
1050
|
+
int backbone_analyze (Clause *, int64_t &);
|
|
1051
|
+
void binary_clauses_backbone ();
|
|
1052
|
+
|
|
1053
|
+
// We monitor the maximum size and glue of clauses during 'reduce' and
|
|
1054
|
+
// thus can predict if a redundant extended clause is likely to be kept in
|
|
1055
|
+
// the next 'reduce' phase. These clauses are target of subsumption and
|
|
1056
|
+
// vivification checks, in addition to irredundant clauses. Their
|
|
1057
|
+
// variables are also marked as being 'added'.
|
|
1058
|
+
//
|
|
1059
|
+
bool likely_to_be_kept_clause (Clause *c) {
|
|
1060
|
+
if (!c->redundant)
|
|
1061
|
+
return true;
|
|
1062
|
+
if (c->glue <= tier2[false])
|
|
1063
|
+
return true;
|
|
1064
|
+
if (c->glue > lim.keptglue)
|
|
1065
|
+
return false;
|
|
1066
|
+
if (c->size > lim.keptsize)
|
|
1067
|
+
return false;
|
|
1068
|
+
return true;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
// We mark variables in added or shrunken clauses as 'subsume' candidates
|
|
1072
|
+
// if the clause is likely to be kept in the next 'reduce' phase (see last
|
|
1073
|
+
// function above). This gives a persistent (across consecutive
|
|
1074
|
+
// interleaved search and inprocessing phases) set of variables which have
|
|
1075
|
+
// to be reconsidered in subsumption checks, i.e., only clauses with
|
|
1076
|
+
// 'subsume' marked variables are checked to be forward subsumed.
|
|
1077
|
+
// A similar technique is used to reduce the effort in hyper ternary
|
|
1078
|
+
// resolution to focus on variables in new ternary clauses.
|
|
1079
|
+
//
|
|
1080
|
+
void mark_subsume (int lit) {
|
|
1081
|
+
Flags &f = flags (lit);
|
|
1082
|
+
if (f.subsume)
|
|
1083
|
+
return;
|
|
1084
|
+
LOG ("marking %d as subsuming literal candidate", abs (lit));
|
|
1085
|
+
stats.mark.subsume++;
|
|
1086
|
+
f.subsume = true;
|
|
1087
|
+
}
|
|
1088
|
+
void mark_ternary (int lit) {
|
|
1089
|
+
Flags &f = flags (lit);
|
|
1090
|
+
if (f.ternary)
|
|
1091
|
+
return;
|
|
1092
|
+
LOG ("marking %d as ternary resolution literal candidate", abs (lit));
|
|
1093
|
+
stats.mark.ternary++;
|
|
1094
|
+
f.ternary = true;
|
|
1095
|
+
}
|
|
1096
|
+
void mark_factor (int lit) {
|
|
1097
|
+
Flags &f = flags (lit);
|
|
1098
|
+
const unsigned bit = bign (lit);
|
|
1099
|
+
if (f.factor & bit)
|
|
1100
|
+
return;
|
|
1101
|
+
LOG ("marking %d as factor literal candidate", lit);
|
|
1102
|
+
stats.mark.factor++;
|
|
1103
|
+
f.factor |= bit;
|
|
1104
|
+
}
|
|
1105
|
+
void mark_added (int lit, int size, bool redundant);
|
|
1106
|
+
void mark_added (Clause *);
|
|
1107
|
+
|
|
1108
|
+
bool marked_subsume (int lit) const { return flags (lit).subsume; }
|
|
1109
|
+
|
|
1110
|
+
// If irredundant clauses are removed or literals in clauses are removed,
|
|
1111
|
+
// then variables in such clauses should be reconsidered to be eliminated
|
|
1112
|
+
// through bounded variable elimination. In contrast to 'subsume' the
|
|
1113
|
+
// 'elim' flag is restricted to 'irredundant' clauses only. For blocked
|
|
1114
|
+
// clause elimination it is better to have a more precise signed version,
|
|
1115
|
+
// which allows to independently mark positive and negative literals.
|
|
1116
|
+
//
|
|
1117
|
+
void mark_elim (int lit) {
|
|
1118
|
+
Flags &f = flags (lit);
|
|
1119
|
+
if (f.elim)
|
|
1120
|
+
return;
|
|
1121
|
+
LOG ("marking %d as elimination literal candidate", lit);
|
|
1122
|
+
stats.mark.elim++;
|
|
1123
|
+
f.elim = true;
|
|
1124
|
+
}
|
|
1125
|
+
void mark_block (int lit) {
|
|
1126
|
+
Flags &f = flags (lit);
|
|
1127
|
+
const unsigned bit = bign (lit);
|
|
1128
|
+
if (f.block & bit)
|
|
1129
|
+
return;
|
|
1130
|
+
LOG ("marking %d as blocking literal candidate", lit);
|
|
1131
|
+
stats.mark.block++;
|
|
1132
|
+
f.block |= bit;
|
|
1133
|
+
}
|
|
1134
|
+
void mark_removed (int lit) {
|
|
1135
|
+
mark_elim (lit);
|
|
1136
|
+
mark_block (-lit);
|
|
1137
|
+
}
|
|
1138
|
+
void mark_removed (Clause *, int except = 0);
|
|
1139
|
+
|
|
1140
|
+
// The following two functions are only used for testing & debugging.
|
|
1141
|
+
|
|
1142
|
+
bool marked_block (int lit) const {
|
|
1143
|
+
const Flags &f = flags (lit);
|
|
1144
|
+
const unsigned bit = bign (lit);
|
|
1145
|
+
return (f.block & bit) != 0;
|
|
1146
|
+
}
|
|
1147
|
+
void unmark_block (int lit) {
|
|
1148
|
+
Flags &f = flags (lit);
|
|
1149
|
+
const unsigned bit = bign (lit);
|
|
1150
|
+
f.block &= ~bit;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
// During scheduling literals for blocked clause elimination we skip those
|
|
1154
|
+
// literals which occur negated in a too large clause.
|
|
1155
|
+
//
|
|
1156
|
+
void mark_skip (int lit) {
|
|
1157
|
+
Flags &f = flags (lit);
|
|
1158
|
+
const unsigned bit = bign (lit);
|
|
1159
|
+
if (f.skip & bit)
|
|
1160
|
+
return;
|
|
1161
|
+
LOG ("marking %d to be skipped as blocking literal", lit);
|
|
1162
|
+
f.skip |= bit;
|
|
1163
|
+
}
|
|
1164
|
+
bool marked_skip (int lit) {
|
|
1165
|
+
const Flags &f = flags (lit);
|
|
1166
|
+
const unsigned bit = bign (lit);
|
|
1167
|
+
return (f.skip & bit) != 0;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
// During decompose ignore literals where we already built LRAT chains
|
|
1171
|
+
//
|
|
1172
|
+
void mark_decomposed (int lit) {
|
|
1173
|
+
Flags &f = flags (lit);
|
|
1174
|
+
const unsigned bit = bign (lit);
|
|
1175
|
+
assert ((f.marked_signed & bit) == 0);
|
|
1176
|
+
sign_marked.push_back (lit);
|
|
1177
|
+
f.marked_signed |= bit;
|
|
1178
|
+
}
|
|
1179
|
+
void unmark_decomposed (int lit) {
|
|
1180
|
+
Flags &f = flags (lit);
|
|
1181
|
+
const unsigned bit = bign (lit);
|
|
1182
|
+
f.marked_signed &= ~bit;
|
|
1183
|
+
}
|
|
1184
|
+
bool marked_decomposed (int lit) {
|
|
1185
|
+
const Flags &f = flags (lit);
|
|
1186
|
+
const unsigned bit = bign (lit);
|
|
1187
|
+
return (f.marked_signed & bit) != 0;
|
|
1188
|
+
}
|
|
1189
|
+
void clear_sign_marked_literals ();
|
|
1190
|
+
|
|
1191
|
+
// Blocked Clause elimination in 'block.cpp'.
|
|
1192
|
+
//
|
|
1193
|
+
bool is_blocked_clause (Clause *c, int pivot);
|
|
1194
|
+
void block_schedule (Blocker &);
|
|
1195
|
+
size_t block_candidates (Blocker &, int lit);
|
|
1196
|
+
Clause *block_impossible (Blocker &, int lit);
|
|
1197
|
+
void block_literal_with_at_least_two_negative_occs (Blocker &, int lit);
|
|
1198
|
+
void block_literal_with_one_negative_occ (Blocker &, int lit);
|
|
1199
|
+
void block_pure_literal (Blocker &, int lit);
|
|
1200
|
+
void block_reschedule_clause (Blocker &, int lit, Clause *);
|
|
1201
|
+
void block_reschedule (Blocker &, int lit);
|
|
1202
|
+
void block_literal (Blocker &, int lit);
|
|
1203
|
+
bool block ();
|
|
1204
|
+
|
|
1205
|
+
// Find gates in 'gates.cpp' for bounded variable substitution.
|
|
1206
|
+
//
|
|
1207
|
+
int second_literal_in_binary_clause_lrat (Clause *, int first);
|
|
1208
|
+
int second_literal_in_binary_clause (Eliminator &, Clause *, int first);
|
|
1209
|
+
void mark_binary_literals (Eliminator &, int pivot);
|
|
1210
|
+
void find_and_gate (Eliminator &, int pivot);
|
|
1211
|
+
void find_equivalence (Eliminator &, int pivot);
|
|
1212
|
+
|
|
1213
|
+
bool get_ternary_clause (Clause *, int &, int &, int &);
|
|
1214
|
+
bool match_ternary_clause (Clause *, int, int, int);
|
|
1215
|
+
Clause *find_ternary_clause (int, int, int);
|
|
1216
|
+
|
|
1217
|
+
bool get_clause (Clause *, vector<int> &);
|
|
1218
|
+
bool is_clause (Clause *, const vector<int> &);
|
|
1219
|
+
Clause *find_clause (const vector<int> &);
|
|
1220
|
+
void find_xor_gate (Eliminator &, int pivot);
|
|
1221
|
+
|
|
1222
|
+
void find_if_then_else (Eliminator &, int pivot);
|
|
1223
|
+
|
|
1224
|
+
Clause *find_binary_clause (int, int);
|
|
1225
|
+
void find_gate_clauses (Eliminator &, int pivot);
|
|
1226
|
+
void unmark_gate_clauses (Eliminator &);
|
|
1227
|
+
|
|
1228
|
+
// mine definitions for kitten in 'definition.cpp'
|
|
1229
|
+
//
|
|
1230
|
+
void find_definition (Eliminator &, int);
|
|
1231
|
+
void init_citten ();
|
|
1232
|
+
void reset_citten ();
|
|
1233
|
+
void citten_clear_track_log_terminate ();
|
|
1234
|
+
|
|
1235
|
+
// Bounded variable elimination in 'elim.cpp'.
|
|
1236
|
+
//
|
|
1237
|
+
bool ineliminating ();
|
|
1238
|
+
double compute_elim_score (unsigned lit);
|
|
1239
|
+
void mark_redundant_clauses_with_eliminated_variables_as_garbage ();
|
|
1240
|
+
void unmark_binary_literals (Eliminator &);
|
|
1241
|
+
bool resolve_clauses (Eliminator &, Clause *, int pivot, Clause *, bool);
|
|
1242
|
+
void mark_eliminated_clauses_as_garbage (Eliminator &, int pivot, bool &);
|
|
1243
|
+
bool elim_resolvents_are_bounded (Eliminator &, int pivot);
|
|
1244
|
+
void elim_update_removed_lit (Eliminator &, int lit);
|
|
1245
|
+
void elim_update_removed_clause (Eliminator &, Clause *, int except = 0);
|
|
1246
|
+
void elim_update_added_clause (Eliminator &, Clause *);
|
|
1247
|
+
void elim_add_resolvents (Eliminator &, int pivot);
|
|
1248
|
+
void elim_backward_clause (Eliminator &, Clause *);
|
|
1249
|
+
void elim_backward_clauses (Eliminator &);
|
|
1250
|
+
void elim_propagate (Eliminator &, int unit);
|
|
1251
|
+
void elim_on_the_fly_self_subsumption (Eliminator &, Clause *, int);
|
|
1252
|
+
void try_to_eliminate_variable (Eliminator &, int pivot, bool &);
|
|
1253
|
+
void increase_elimination_bound ();
|
|
1254
|
+
int elim_round (bool &completed, bool &);
|
|
1255
|
+
void elim (bool update_limits = true);
|
|
1256
|
+
|
|
1257
|
+
int64_t flush_elimfast_occs (int lit);
|
|
1258
|
+
void elimfast_add_resolvents (Eliminator &, int pivot);
|
|
1259
|
+
bool elimfast_resolvents_are_bounded (Eliminator &, int pivot);
|
|
1260
|
+
void try_to_fasteliminate_variable (Eliminator &, int pivot, bool &);
|
|
1261
|
+
int elimfast_round (bool &completed, bool &);
|
|
1262
|
+
void elimfast ();
|
|
1263
|
+
|
|
1264
|
+
// sweeping in 'sweep.cpp'
|
|
1265
|
+
int sweep_solve ();
|
|
1266
|
+
void sweep_set_kitten_ticks_limit (Sweeper &sweeper);
|
|
1267
|
+
bool kitten_ticks_limit_hit (Sweeper &sweeper, const char *when);
|
|
1268
|
+
void init_sweeper (Sweeper &sweeper);
|
|
1269
|
+
void release_sweeper (Sweeper &sweeper);
|
|
1270
|
+
void clear_sweeper (Sweeper &sweeper);
|
|
1271
|
+
int sweep_repr (Sweeper &sweeper, int lit);
|
|
1272
|
+
void add_literal_to_environment (Sweeper &sweeper, unsigned depth, int);
|
|
1273
|
+
void sweep_clause (Sweeper &sweeper, unsigned depth, Clause *);
|
|
1274
|
+
void sweep_add_clause (Sweeper &sweeper, unsigned depth);
|
|
1275
|
+
void add_core (Sweeper &sweeper, unsigned core_idx);
|
|
1276
|
+
void save_core (Sweeper &sweeper, unsigned core);
|
|
1277
|
+
void clear_core (Sweeper &sweeper, unsigned core_idx);
|
|
1278
|
+
void save_add_clear_core (Sweeper &sweeper);
|
|
1279
|
+
void init_backbone_and_partition (Sweeper &sweeper);
|
|
1280
|
+
void sweep_empty_clause (Sweeper &sweeper);
|
|
1281
|
+
void sweep_refine_partition (Sweeper &sweeper);
|
|
1282
|
+
void sweep_refine_backbone (Sweeper &sweeper);
|
|
1283
|
+
void sweep_refine (Sweeper &sweeper);
|
|
1284
|
+
void flip_backbone_literals (struct Sweeper &sweeper);
|
|
1285
|
+
bool sweep_backbone_candidate (Sweeper &sweeper, int lit);
|
|
1286
|
+
int64_t add_sweep_binary (sweep_proof_clause, int lit, int other);
|
|
1287
|
+
bool scheduled_variable (Sweeper &sweeper, int idx);
|
|
1288
|
+
void schedule_inner (Sweeper &sweeper, int idx);
|
|
1289
|
+
void schedule_outer (Sweeper &sweeper, int idx);
|
|
1290
|
+
int next_scheduled (Sweeper &sweeper);
|
|
1291
|
+
void substitute_connected_clauses (Sweeper &sweeper, int lit, int other,
|
|
1292
|
+
int64_t id);
|
|
1293
|
+
void sweep_remove (Sweeper &sweeper, int lit);
|
|
1294
|
+
void flip_partition_literals (struct Sweeper &sweeper);
|
|
1295
|
+
const char *sweep_variable (Sweeper &sweeper, int idx);
|
|
1296
|
+
bool scheduable_variable (Sweeper &sweeper, int idx, size_t *occ_ptr);
|
|
1297
|
+
unsigned schedule_all_other_not_scheduled_yet (Sweeper &sweeper);
|
|
1298
|
+
bool sweep_equivalence_candidates (Sweeper &sweeper, int lit, int other);
|
|
1299
|
+
unsigned reschedule_previously_remaining (Sweeper &sweeper);
|
|
1300
|
+
unsigned incomplete_variables ();
|
|
1301
|
+
void mark_incomplete (Sweeper &sweeper);
|
|
1302
|
+
unsigned schedule_sweeping (Sweeper &sweeper);
|
|
1303
|
+
void unschedule_sweeping (Sweeper &sweeper, unsigned swept,
|
|
1304
|
+
unsigned scheduled);
|
|
1305
|
+
bool sweep ();
|
|
1306
|
+
void sweep_dense_propagate (Sweeper &sweeper);
|
|
1307
|
+
void sweep_sparse_mode ();
|
|
1308
|
+
void sweep_dense_mode_and_watch_irredundant ();
|
|
1309
|
+
void sweep_substitute_lrat (Clause *c, int64_t id);
|
|
1310
|
+
void sweep_substitute_new_equivalences (Sweeper &sweeper);
|
|
1311
|
+
void sweep_update_noccs (Clause *c);
|
|
1312
|
+
void delete_sweep_binary (const sweep_binary &sb);
|
|
1313
|
+
bool can_sweep_clause (Clause *c);
|
|
1314
|
+
bool sweep_flip (int);
|
|
1315
|
+
int sweep_flip_and_implicant (int);
|
|
1316
|
+
bool sweep_extract_fixed (Sweeper &sweeper, int lit);
|
|
1317
|
+
|
|
1318
|
+
// factor
|
|
1319
|
+
void factor_mode ();
|
|
1320
|
+
void reset_factor_mode ();
|
|
1321
|
+
double tied_next_factor_score (int);
|
|
1322
|
+
Quotient *new_quotient (Factoring &, int);
|
|
1323
|
+
void release_quotients (Factoring &);
|
|
1324
|
+
size_t first_factor (Factoring &, int);
|
|
1325
|
+
void clear_nounted (vector<int> &);
|
|
1326
|
+
void clear_flauses (vector<Clause *> &);
|
|
1327
|
+
Quotient *best_quotient (Factoring &, size_t *);
|
|
1328
|
+
int next_factor (Factoring &, unsigned *);
|
|
1329
|
+
void factorize_next (Factoring &, int, unsigned);
|
|
1330
|
+
void resize_factoring (Factoring &factoring, int lit);
|
|
1331
|
+
void flush_unmatched_clauses (Quotient *);
|
|
1332
|
+
void add_self_subsuming_factor (Quotient *, Quotient *);
|
|
1333
|
+
bool self_subsuming_factor (Quotient *);
|
|
1334
|
+
void add_factored_divider (Quotient *, int);
|
|
1335
|
+
void blocked_clause (Quotient *q, int);
|
|
1336
|
+
void add_factored_quotient (Quotient *, int not_fresh);
|
|
1337
|
+
void eagerly_remove_from_occurences (Clause *c);
|
|
1338
|
+
void delete_unfactored (Quotient *q);
|
|
1339
|
+
void update_factored (Factoring &factoring, Quotient *q);
|
|
1340
|
+
bool apply_factoring (Factoring &factoring, Quotient *q);
|
|
1341
|
+
void update_factor_candidate (Factoring &, int);
|
|
1342
|
+
void schedule_factorization (Factoring &);
|
|
1343
|
+
bool run_factorization (int64_t limit);
|
|
1344
|
+
bool factor ();
|
|
1345
|
+
int get_new_extension_variable ();
|
|
1346
|
+
Clause *new_factor_clause (int);
|
|
1347
|
+
void adjust_scores_and_phases_of_fresh_variables (Factoring &);
|
|
1348
|
+
|
|
1349
|
+
// instantiate
|
|
1350
|
+
//
|
|
1351
|
+
void inst_assign (int lit);
|
|
1352
|
+
bool inst_propagate ();
|
|
1353
|
+
void collect_instantiation_candidates (Instantiator &);
|
|
1354
|
+
bool instantiate_candidate (int lit, Clause *);
|
|
1355
|
+
void instantiate (Instantiator &);
|
|
1356
|
+
|
|
1357
|
+
void new_trail_level (int lit);
|
|
1358
|
+
|
|
1359
|
+
// Hyper ternary resolution.
|
|
1360
|
+
//
|
|
1361
|
+
bool ternary_find_binary_clause (int, int);
|
|
1362
|
+
bool ternary_find_ternary_clause (int, int, int);
|
|
1363
|
+
Clause *new_hyper_ternary_resolved_clause (bool red);
|
|
1364
|
+
Clause *new_hyper_ternary_resolved_clause_and_watch (bool red, bool);
|
|
1365
|
+
bool hyper_ternary_resolve (Clause *, int, Clause *);
|
|
1366
|
+
void ternary_lit (int pivot, int64_t &steps, int64_t &htrs);
|
|
1367
|
+
void ternary_idx (int idx, int64_t &steps, int64_t &htrs);
|
|
1368
|
+
bool ternary_round (int64_t &steps, int64_t &htrs);
|
|
1369
|
+
bool ternary ();
|
|
1370
|
+
|
|
1371
|
+
// Probing in 'probe.cpp'.
|
|
1372
|
+
//
|
|
1373
|
+
bool inprobing ();
|
|
1374
|
+
void failed_literal (int lit);
|
|
1375
|
+
void probe_lrat_for_units (int lit);
|
|
1376
|
+
void probe_assign_unit (int lit);
|
|
1377
|
+
void probe_assign_decision (int lit);
|
|
1378
|
+
void probe_assign (int lit, int parent);
|
|
1379
|
+
void mark_duplicated_binary_clauses_as_garbage ();
|
|
1380
|
+
int get_parent_reason_literal (int lit);
|
|
1381
|
+
void set_parent_reason_literal (int lit, int reason);
|
|
1382
|
+
void clean_probehbr_lrat ();
|
|
1383
|
+
void init_probehbr_lrat ();
|
|
1384
|
+
void get_probehbr_lrat (int lit, int uip);
|
|
1385
|
+
void set_probehbr_lrat (int lit, int uip);
|
|
1386
|
+
void probe_post_dominator_lrat (vector<Clause *> &, int, int);
|
|
1387
|
+
void probe_dominator_lrat (int dom, Clause *reason);
|
|
1388
|
+
int probe_dominator (int a, int b);
|
|
1389
|
+
int hyper_binary_resolve (Clause *);
|
|
1390
|
+
void probe_propagate2 ();
|
|
1391
|
+
bool probe_propagate ();
|
|
1392
|
+
bool is_binary_clause (Clause *c, int &, int &);
|
|
1393
|
+
void generate_probes ();
|
|
1394
|
+
void flush_probes ();
|
|
1395
|
+
int next_probe ();
|
|
1396
|
+
bool probe ();
|
|
1397
|
+
void inprobe (bool update_limits = true);
|
|
1398
|
+
|
|
1399
|
+
// ProbSAT/WalkSAT implementation called initially or from 'rephase'.
|
|
1400
|
+
//
|
|
1401
|
+
void walk_save_minimum (Walker &);
|
|
1402
|
+
ClauseOrBinary walk_pick_clause (Walker &);
|
|
1403
|
+
unsigned walk_break_value (int lit, int64_t &ticks);
|
|
1404
|
+
int walk_pick_lit (Walker &walker, ClauseOrBinary);
|
|
1405
|
+
int walk_pick_lit (Walker &, Clause *);
|
|
1406
|
+
bool walk_flip_lit (Walker &, int lit);
|
|
1407
|
+
int walk_pick_lit (Walker &walker, TaggedBinary c);
|
|
1408
|
+
int walk_round (int64_t limit, bool prev);
|
|
1409
|
+
void walk ();
|
|
1410
|
+
|
|
1411
|
+
int walk_full_occs_round (int64_t limit, bool prev);
|
|
1412
|
+
void walk_full_occs ();
|
|
1413
|
+
void walk_full_occs_save_minimum (WalkerFO &);
|
|
1414
|
+
void make_clauses_along_occurrences (WalkerFO &walker, int lit);
|
|
1415
|
+
void make_clauses_along_unsatisfied (WalkerFO &walker, int lit);
|
|
1416
|
+
|
|
1417
|
+
// Warmup
|
|
1418
|
+
inline void warmup_assign (int lit, Clause *reason);
|
|
1419
|
+
void warmup_propagate_beyond_conflict ();
|
|
1420
|
+
int warmup_decide ();
|
|
1421
|
+
int warmup ();
|
|
1422
|
+
|
|
1423
|
+
// Detect strongly connected components in the binary implication graph
|
|
1424
|
+
// (BIG) and equivalent literal substitution (ELS) in 'decompose.cpp'.
|
|
1425
|
+
//
|
|
1426
|
+
void decompose_conflicting_scc_lrat (DFS *dfs, vector<int> &);
|
|
1427
|
+
void build_lrat_for_clause (const vector<vector<Clause *>> &dfs_chains,
|
|
1428
|
+
bool invert = false);
|
|
1429
|
+
vector<Clause *> decompose_analyze_binary_clauses (DFS *dfs, int from);
|
|
1430
|
+
void decompose_analyze_binary_chain (DFS *dfs, int);
|
|
1431
|
+
bool decompose_round ();
|
|
1432
|
+
void decompose ();
|
|
1433
|
+
|
|
1434
|
+
void reset_limits (); // Reset after 'solve' call.
|
|
1435
|
+
|
|
1436
|
+
// Try flipping a literal while not falsifying a model.
|
|
1437
|
+
|
|
1438
|
+
bool flip (int lit);
|
|
1439
|
+
bool flippable (int lit);
|
|
1440
|
+
|
|
1441
|
+
// Assumption handling.
|
|
1442
|
+
//
|
|
1443
|
+
void assume_analyze_literal (int lit);
|
|
1444
|
+
void assume_analyze_reason (int lit, Clause *reason);
|
|
1445
|
+
void assume (int); // New assumption literal.
|
|
1446
|
+
bool failed (int lit); // Literal failed assumption?
|
|
1447
|
+
void reset_assumptions (); // Reset after 'solve' call.
|
|
1448
|
+
void sort_and_reuse_assumptions (); // reorder the assumptions in order to
|
|
1449
|
+
// reuse parts of the trail
|
|
1450
|
+
void failing (); // Prepare failed assumptions.
|
|
1451
|
+
|
|
1452
|
+
bool assumed (int lit) { // Marked as assumption.
|
|
1453
|
+
Flags &f = flags (lit);
|
|
1454
|
+
const unsigned bit = bign (lit);
|
|
1455
|
+
return (f.assumed & bit) != 0;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
// Add temporary clause as constraint.
|
|
1459
|
+
//
|
|
1460
|
+
void constrain (int); // Add literal to constraint.
|
|
1461
|
+
bool
|
|
1462
|
+
failed_constraint (); // Was constraint used to proof unsatisfiablity?
|
|
1463
|
+
void reset_constraint (); // Reset after 'solve' call.
|
|
1464
|
+
|
|
1465
|
+
// Propagate the current set of assumptions and return the
|
|
1466
|
+
// non-witness assigned literals
|
|
1467
|
+
int propagate_assumptions ();
|
|
1468
|
+
void implied (std::vector<int> &entrailed);
|
|
1469
|
+
|
|
1470
|
+
// Forcing decision variables to a certain phase.
|
|
1471
|
+
//
|
|
1472
|
+
void phase (int lit);
|
|
1473
|
+
void unphase (int lit);
|
|
1474
|
+
|
|
1475
|
+
// Globally blocked clause elimination.
|
|
1476
|
+
//
|
|
1477
|
+
bool is_autarky_literal (int lit) const;
|
|
1478
|
+
bool is_conditional_literal (int lit) const;
|
|
1479
|
+
void mark_as_conditional_literal (int lit);
|
|
1480
|
+
void unmark_as_conditional_literal (int lit);
|
|
1481
|
+
//
|
|
1482
|
+
bool is_in_candidate_clause (int lit) const;
|
|
1483
|
+
void mark_in_candidate_clause (int lit);
|
|
1484
|
+
void unmark_in_candidate_clause (int lit);
|
|
1485
|
+
//
|
|
1486
|
+
void condition_assign (int lit);
|
|
1487
|
+
void condition_unassign (int lit);
|
|
1488
|
+
//
|
|
1489
|
+
bool conditioning ();
|
|
1490
|
+
long condition_round (long unassigned_literal_propagation_limit);
|
|
1491
|
+
void condition (bool update_limits = true);
|
|
1492
|
+
|
|
1493
|
+
// Part on picking the next decision in 'decide.cpp'.
|
|
1494
|
+
//
|
|
1495
|
+
bool satisfied ();
|
|
1496
|
+
void start_random_sequence ();
|
|
1497
|
+
int next_random_decision ();
|
|
1498
|
+
int next_decision_variable_on_queue ();
|
|
1499
|
+
int next_decision_variable_with_best_score ();
|
|
1500
|
+
int next_decision_variable ();
|
|
1501
|
+
int decide_phase (int idx, bool target);
|
|
1502
|
+
int likely_phase (int idx);
|
|
1503
|
+
bool better_decision (int lit, int other);
|
|
1504
|
+
int decide (); // 0=decision, 20=failed
|
|
1505
|
+
|
|
1506
|
+
// Internal functions to enable explicit search limits.
|
|
1507
|
+
//
|
|
1508
|
+
void limit_terminate (int);
|
|
1509
|
+
void limit_decisions (int); // Force decision limit.
|
|
1510
|
+
void limit_conflicts (int); // Force conflict limit.
|
|
1511
|
+
void limit_preprocessing (int); // Enable 'n' preprocessing rounds.
|
|
1512
|
+
void limit_local_search (int); // Enable 'n' local search rounds.
|
|
1513
|
+
void limit_ticks (int64_t); // Force ticks limit.
|
|
1514
|
+
|
|
1515
|
+
// External versions can access limits by 'name'.
|
|
1516
|
+
//
|
|
1517
|
+
static bool is_valid_limit (const char *name);
|
|
1518
|
+
bool limit (const char *name, int); // 'true' if 'name' valid
|
|
1519
|
+
|
|
1520
|
+
// Set all the CDCL search limits and increments for scheduling
|
|
1521
|
+
// inprocessing, restarts, clause database reductions, etc.
|
|
1522
|
+
//
|
|
1523
|
+
void init_report_limits ();
|
|
1524
|
+
void init_preprocessing_limits ();
|
|
1525
|
+
void init_search_limits ();
|
|
1526
|
+
|
|
1527
|
+
// The computed averages are local to the 'stable' and 'unstable' phase.
|
|
1528
|
+
// Their main use is to be reported in 'report', except for the 'glue'
|
|
1529
|
+
// averages, which are used to schedule (prohibit actually) restarts
|
|
1530
|
+
// during 'unstable' phases ('stable' phases use reluctant doubling).
|
|
1531
|
+
//
|
|
1532
|
+
void init_averages ();
|
|
1533
|
+
void swap_averages ();
|
|
1534
|
+
|
|
1535
|
+
int try_to_satisfy_formula_by_saved_phases ();
|
|
1536
|
+
void produce_failed_assumptions ();
|
|
1537
|
+
|
|
1538
|
+
// Main solve & search functions in 'internal.cpp'.
|
|
1539
|
+
//
|
|
1540
|
+
// We have three pre-solving techniques. These consist of preprocessing,
|
|
1541
|
+
// local search and searching for lucky phases, which in full solving
|
|
1542
|
+
// mode except for the last are usually optional and then followed by
|
|
1543
|
+
// the main CDCL search loop with inprocessing. If only preprocessing
|
|
1544
|
+
// is requested from 'External::simplify' only preprocessing is called
|
|
1545
|
+
// though. This is all orchestrated by the 'solve' function.
|
|
1546
|
+
//
|
|
1547
|
+
int already_solved ();
|
|
1548
|
+
int restore_clauses ();
|
|
1549
|
+
bool preprocess_round (int round);
|
|
1550
|
+
void preprocess_quickly (bool always);
|
|
1551
|
+
int preprocess (bool always);
|
|
1552
|
+
int local_search_round (int round);
|
|
1553
|
+
int local_search ();
|
|
1554
|
+
int lucky_phases ();
|
|
1555
|
+
int cdcl_loop_with_inprocessing ();
|
|
1556
|
+
void reset_solving ();
|
|
1557
|
+
int solve (bool preprocess_only = false);
|
|
1558
|
+
void finalize (int);
|
|
1559
|
+
|
|
1560
|
+
//
|
|
1561
|
+
int lookahead ();
|
|
1562
|
+
CubesWithStatus generate_cubes (int, int);
|
|
1563
|
+
int most_occurring_literal ();
|
|
1564
|
+
int lookahead_probing ();
|
|
1565
|
+
int lookahead_next_probe ();
|
|
1566
|
+
void lookahead_flush_probes ();
|
|
1567
|
+
void lookahead_generate_probes ();
|
|
1568
|
+
std::vector<int> lookahead_populate_locc ();
|
|
1569
|
+
int lookahead_locc (const std::vector<int> &);
|
|
1570
|
+
|
|
1571
|
+
bool terminating_asked ();
|
|
1572
|
+
|
|
1573
|
+
#ifndef QUIET
|
|
1574
|
+
// Built in profiling in 'profile.cpp' (see also 'profile.hpp').
|
|
1575
|
+
//
|
|
1576
|
+
void start_profiling (Profile &p, double);
|
|
1577
|
+
void stop_profiling (Profile &p, double);
|
|
1578
|
+
|
|
1579
|
+
double update_profiles (); // Returns 'time ()'.
|
|
1580
|
+
void print_profile ();
|
|
1581
|
+
#endif
|
|
1582
|
+
|
|
1583
|
+
// Get the value of an internal literal: -1=false, 0=unassigned, 1=true.
|
|
1584
|
+
// We use a redundant table for both negative and positive literals. This
|
|
1585
|
+
// allows a branch-less check for the value of literal and is considered
|
|
1586
|
+
// substantially faster than negating the result if the argument is
|
|
1587
|
+
// negative. We also avoid taking the absolute value.
|
|
1588
|
+
//
|
|
1589
|
+
signed char val (int lit) const {
|
|
1590
|
+
assert (-max_var <= lit);
|
|
1591
|
+
assert (lit);
|
|
1592
|
+
assert (lit <= max_var);
|
|
1593
|
+
return vals[lit];
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
// As suggested by Matt Ginsberg it might be useful to factor-out a common
|
|
1597
|
+
// setter function for setting and resetting the value of a literal.
|
|
1598
|
+
//
|
|
1599
|
+
void set_val (int lit, signed char val) {
|
|
1600
|
+
assert (-1 <= val);
|
|
1601
|
+
assert (val <= 1);
|
|
1602
|
+
assert (-max_var <= lit);
|
|
1603
|
+
assert (lit);
|
|
1604
|
+
assert (lit <= max_var);
|
|
1605
|
+
vals[lit] = val;
|
|
1606
|
+
vals[-lit] = -val;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
// As 'val' but restricted to the root-level value of a literal.
|
|
1610
|
+
// It is not that time critical and also needs to check the decision level
|
|
1611
|
+
// of the variable anyhow.
|
|
1612
|
+
//
|
|
1613
|
+
int fixed (int lit) {
|
|
1614
|
+
assert (-max_var <= lit);
|
|
1615
|
+
assert (lit);
|
|
1616
|
+
assert (lit <= max_var);
|
|
1617
|
+
const int idx = vidx (lit);
|
|
1618
|
+
int res = vals[idx];
|
|
1619
|
+
if (res && vtab[idx].level)
|
|
1620
|
+
res = 0;
|
|
1621
|
+
if (lit < 0)
|
|
1622
|
+
res = -res;
|
|
1623
|
+
return res;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
// Map back an internal literal to an external.
|
|
1627
|
+
//
|
|
1628
|
+
int externalize (int lit) {
|
|
1629
|
+
assert (lit != INT_MIN);
|
|
1630
|
+
const int idx = abs (lit);
|
|
1631
|
+
assert (idx);
|
|
1632
|
+
assert (idx <= max_var);
|
|
1633
|
+
int res = i2e[idx];
|
|
1634
|
+
if (lit < 0)
|
|
1635
|
+
res = -res;
|
|
1636
|
+
return res;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
// Explicit freezing and melting of variables.
|
|
1640
|
+
//
|
|
1641
|
+
void freeze (int lit) {
|
|
1642
|
+
int idx = vidx (lit);
|
|
1643
|
+
if ((size_t) idx >= frozentab.size ()) {
|
|
1644
|
+
size_t new_vsize = vsize ? 2 * vsize : 1 + (size_t) max_var;
|
|
1645
|
+
while (new_vsize <= (size_t) max_var)
|
|
1646
|
+
new_vsize *= 2;
|
|
1647
|
+
frozentab.resize (new_vsize);
|
|
1648
|
+
}
|
|
1649
|
+
unsigned &ref = frozentab[idx];
|
|
1650
|
+
if (ref < UINT_MAX) {
|
|
1651
|
+
ref++;
|
|
1652
|
+
LOG ("variable %d frozen %u times", idx, ref);
|
|
1653
|
+
} else
|
|
1654
|
+
LOG ("variable %d remains frozen forever", idx);
|
|
1655
|
+
}
|
|
1656
|
+
void melt (int lit) {
|
|
1657
|
+
int idx = vidx (lit);
|
|
1658
|
+
unsigned &ref = frozentab[idx];
|
|
1659
|
+
if (ref < UINT_MAX) {
|
|
1660
|
+
if (!--ref) {
|
|
1661
|
+
if (relevanttab[idx]) {
|
|
1662
|
+
LOG ("variable %d is observed, can not be completely molten",
|
|
1663
|
+
idx);
|
|
1664
|
+
ref++;
|
|
1665
|
+
} else
|
|
1666
|
+
LOG ("variable %d completely molten", idx);
|
|
1667
|
+
} else
|
|
1668
|
+
LOG ("variable %d melted once but remains frozen %u times", lit,
|
|
1669
|
+
ref);
|
|
1670
|
+
} else
|
|
1671
|
+
LOG ("variable %d remains frozen forever", idx);
|
|
1672
|
+
}
|
|
1673
|
+
bool frozen (int lit) {
|
|
1674
|
+
return (size_t) vidx (lit) < frozentab.size () &&
|
|
1675
|
+
frozentab[vidx (lit)] > 0;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
// Congruence closure
|
|
1679
|
+
bool extract_gates (bool remove_units_before_run = false);
|
|
1680
|
+
|
|
1681
|
+
// Parsing functions in 'parse.cpp'.
|
|
1682
|
+
//
|
|
1683
|
+
const char *parse_dimacs (FILE *);
|
|
1684
|
+
const char *parse_dimacs (const char *);
|
|
1685
|
+
const char *parse_solution (const char *);
|
|
1686
|
+
|
|
1687
|
+
// Enable and disable proof logging and checking.
|
|
1688
|
+
//
|
|
1689
|
+
void new_proof_on_demand ();
|
|
1690
|
+
void force_lrat (); // sets lrat=true
|
|
1691
|
+
void resize_unit_clauses_idx (); // resizes unit_clauses_idx
|
|
1692
|
+
void close_trace (bool stats = false); // Stop proof tracing.
|
|
1693
|
+
void flush_trace (bool stats = false); // Flush proof trace file.
|
|
1694
|
+
void trace (File *); // Start write proof file.
|
|
1695
|
+
void check (); // Enable online proof checking.
|
|
1696
|
+
|
|
1697
|
+
void connect_proof_tracer (Tracer *tracer, bool antecedents,
|
|
1698
|
+
bool finalize_clauses = false);
|
|
1699
|
+
void connect_proof_tracer (InternalTracer *tracer, bool antecedents,
|
|
1700
|
+
bool finalize_clauses = false);
|
|
1701
|
+
void connect_proof_tracer (StatTracer *tracer, bool antecedents,
|
|
1702
|
+
bool finalize_clauses = false);
|
|
1703
|
+
void connect_proof_tracer (FileTracer *tracer, bool antecedents,
|
|
1704
|
+
bool finalize_clauses = false);
|
|
1705
|
+
bool disconnect_proof_tracer (Tracer *tracer);
|
|
1706
|
+
bool disconnect_proof_tracer (StatTracer *tracer);
|
|
1707
|
+
bool disconnect_proof_tracer (FileTracer *tracer);
|
|
1708
|
+
void conclude_unsat ();
|
|
1709
|
+
void reset_concluded ();
|
|
1710
|
+
|
|
1711
|
+
// Dump to '<stdout>' as DIMACS for debugging.
|
|
1712
|
+
//
|
|
1713
|
+
void dump (Clause *);
|
|
1714
|
+
void dump ();
|
|
1715
|
+
|
|
1716
|
+
// Export and traverse all irredundant (non-unit) clauses.
|
|
1717
|
+
//
|
|
1718
|
+
bool traverse_clauses (ClauseIterator &);
|
|
1719
|
+
|
|
1720
|
+
// Export and traverse all irredundant (non-unit) clauses.
|
|
1721
|
+
//
|
|
1722
|
+
bool traverse_constraint (ClauseIterator &);
|
|
1723
|
+
|
|
1724
|
+
/*----------------------------------------------------------------------*/
|
|
1725
|
+
|
|
1726
|
+
double solve_time (); // accumulated time spent in 'solve ()'
|
|
1727
|
+
|
|
1728
|
+
double process_time () const; // since solver was initialized
|
|
1729
|
+
double real_time () const; // since solver was initialized
|
|
1730
|
+
|
|
1731
|
+
double time () { return opts.realtime ? real_time () : process_time (); }
|
|
1732
|
+
|
|
1733
|
+
// Regularly reports what is going on in 'report.cpp'.
|
|
1734
|
+
//
|
|
1735
|
+
void report (char type, int verbose_level = 0);
|
|
1736
|
+
void report_solving (int);
|
|
1737
|
+
|
|
1738
|
+
void print_statistics ();
|
|
1739
|
+
void print_resource_usage ();
|
|
1740
|
+
|
|
1741
|
+
/*----------------------------------------------------------------------*/
|
|
1742
|
+
|
|
1743
|
+
#ifndef QUIET
|
|
1744
|
+
|
|
1745
|
+
void print_prefix ();
|
|
1746
|
+
|
|
1747
|
+
// Non-verbose messages and warnings, i.e., always printed unless 'quiet'
|
|
1748
|
+
// is set, which disables messages at run-time, or even 'QUIET' is defined
|
|
1749
|
+
// through the configuration option './configure --quiet', which disables
|
|
1750
|
+
// such messages completely at compile-time.
|
|
1751
|
+
//
|
|
1752
|
+
void vmessage (const char *, va_list &);
|
|
1753
|
+
void message (const char *, ...) CADICAL_ATTRIBUTE_FORMAT (2, 3);
|
|
1754
|
+
void message (); // empty line
|
|
1755
|
+
|
|
1756
|
+
// Verbose messages with explicit verbose 'level' controlled by
|
|
1757
|
+
// 'opts.verbose' (verbose level '0' gives the same as 'message').
|
|
1758
|
+
//
|
|
1759
|
+
void vverbose (int level, const char *fmt, va_list &);
|
|
1760
|
+
void verbose (int level, const char *fmt, ...)
|
|
1761
|
+
CADICAL_ATTRIBUTE_FORMAT (3, 4);
|
|
1762
|
+
void verbose (int level);
|
|
1763
|
+
|
|
1764
|
+
// This is for printing section headers in the form
|
|
1765
|
+
//
|
|
1766
|
+
// c ---- [ <title> ] ---------------------
|
|
1767
|
+
//
|
|
1768
|
+
// nicely aligned (and of course is ignored if 'quiet' is set).
|
|
1769
|
+
//
|
|
1770
|
+
void section (const char *title);
|
|
1771
|
+
|
|
1772
|
+
// Print verbose message about phases if 'opts.verbose > 1' (but not if
|
|
1773
|
+
// 'quiet' is set). Note that setting 'log' or '-l' forces all verbose
|
|
1774
|
+
// output (and also ignores 'quiet' set to true'). The 'phase' argument
|
|
1775
|
+
// is used to print a 'phase' prefix for the message as follows:
|
|
1776
|
+
//
|
|
1777
|
+
// c [<phase>] ...
|
|
1778
|
+
//
|
|
1779
|
+
void phase (const char *phase, const char *, ...)
|
|
1780
|
+
CADICAL_ATTRIBUTE_FORMAT (3, 4);
|
|
1781
|
+
|
|
1782
|
+
// Same as the last 'phase' above except that the prefix gets a count:
|
|
1783
|
+
//
|
|
1784
|
+
// c [<phase>-<count>] ...
|
|
1785
|
+
//
|
|
1786
|
+
void phase (const char *phase, int64_t count, const char *, ...)
|
|
1787
|
+
CADICAL_ATTRIBUTE_FORMAT (4, 5);
|
|
1788
|
+
#endif
|
|
1789
|
+
|
|
1790
|
+
// Print error messages which are really always printed (even if 'quiet'
|
|
1791
|
+
// is set). This leads to exit the current process with exit status '1'.
|
|
1792
|
+
//
|
|
1793
|
+
// TODO add possibility to use a call back instead of calling exit.
|
|
1794
|
+
//
|
|
1795
|
+
void error_message_end ();
|
|
1796
|
+
void verror (const char *, va_list &);
|
|
1797
|
+
void error (const char *, ...) CADICAL_ATTRIBUTE_FORMAT (2, 3);
|
|
1798
|
+
void error_message_start ();
|
|
1799
|
+
|
|
1800
|
+
// Warning messages.
|
|
1801
|
+
//
|
|
1802
|
+
void warning (const char *, ...) CADICAL_ATTRIBUTE_FORMAT (2, 3);
|
|
1803
|
+
};
|
|
1804
|
+
|
|
1805
|
+
// Fatal internal error which leads to abort.
|
|
1806
|
+
//
|
|
1807
|
+
void fatal_message_start ();
|
|
1808
|
+
void fatal_message_end ();
|
|
1809
|
+
void fatal (const char *, ...) CADICAL_ATTRIBUTE_FORMAT (1, 2);
|
|
1810
|
+
|
|
1811
|
+
/*------------------------------------------------------------------------*/
|
|
1812
|
+
|
|
1813
|
+
// Has to be put here, i.e., not into 'score.hpp', since we need the
|
|
1814
|
+
// definition of 'Internal::score' above (after '#include "score.hpp"').
|
|
1815
|
+
|
|
1816
|
+
inline bool score_smaller::operator() (unsigned a, unsigned b) {
|
|
1817
|
+
|
|
1818
|
+
// Avoid computing twice 'abs' in 'score ()'.
|
|
1819
|
+
//
|
|
1820
|
+
assert (1 <= a);
|
|
1821
|
+
assert (a <= (unsigned) internal->max_var);
|
|
1822
|
+
assert (1 <= b);
|
|
1823
|
+
assert (b <= (unsigned) internal->max_var);
|
|
1824
|
+
double s = internal->stab[a];
|
|
1825
|
+
double t = internal->stab[b];
|
|
1826
|
+
|
|
1827
|
+
if (s < t)
|
|
1828
|
+
return true;
|
|
1829
|
+
if (s > t)
|
|
1830
|
+
return false;
|
|
1831
|
+
|
|
1832
|
+
return a > b;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
/*------------------------------------------------------------------------*/
|
|
1836
|
+
|
|
1837
|
+
// Implemented here for keeping it all inline (requires Internal::fixed).
|
|
1838
|
+
|
|
1839
|
+
inline int External::fixed (int elit) const {
|
|
1840
|
+
assert (elit);
|
|
1841
|
+
assert (elit != INT_MIN);
|
|
1842
|
+
int eidx = abs (elit);
|
|
1843
|
+
if (eidx > max_var)
|
|
1844
|
+
return 0;
|
|
1845
|
+
int ilit = e2i[eidx];
|
|
1846
|
+
if (!ilit)
|
|
1847
|
+
return 0;
|
|
1848
|
+
if (elit < 0)
|
|
1849
|
+
ilit = -ilit;
|
|
1850
|
+
return internal->fixed (ilit);
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
/*------------------------------------------------------------------------*/
|
|
1854
|
+
|
|
1855
|
+
// We want to have termination checks inlined, particularly the first
|
|
1856
|
+
// function which appears in preprocessor loops. Even though this first
|
|
1857
|
+
// 'termination_forced' is set asynchronously, this should not lead to a
|
|
1858
|
+
// data race issue (it also has been declared 'volatile').
|
|
1859
|
+
|
|
1860
|
+
inline bool Internal::terminated_asynchronously (int factor) {
|
|
1861
|
+
// First way of asynchronous termination is through 'terminate' which sets
|
|
1862
|
+
// the 'termination_forced' flag directly. The second way is through a
|
|
1863
|
+
// call back to a 'terminator' if it is non-zero, which however is costly.
|
|
1864
|
+
//
|
|
1865
|
+
if (termination_forced) {
|
|
1866
|
+
LOG ("termination asynchronously forced");
|
|
1867
|
+
return true;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
// This is only for testing and debugging asynchronous termination calls.
|
|
1871
|
+
// In production code this could be removed but then should not be costly
|
|
1872
|
+
// and keeping it will allow to test correctness of asynchronous
|
|
1873
|
+
// termination on the production platform too. After this triggers we
|
|
1874
|
+
// have to set the 'termination_forced' flag, such that subsequent calls
|
|
1875
|
+
// to this function do not check this again.
|
|
1876
|
+
//
|
|
1877
|
+
if (lim.terminate.forced) {
|
|
1878
|
+
assert (lim.terminate.forced > 0);
|
|
1879
|
+
if (lim.terminate.forced-- == 1) {
|
|
1880
|
+
LOG ("internally forcing termination");
|
|
1881
|
+
termination_forced = true;
|
|
1882
|
+
return true;
|
|
1883
|
+
}
|
|
1884
|
+
LOG ("decremented internal forced termination limit to %d",
|
|
1885
|
+
lim.terminate.forced);
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
// The second way of asynchronous termination is through registering and
|
|
1889
|
+
// calling an external 'Terminator' object. This is of course more costly
|
|
1890
|
+
// than just checking a (volatile though) boolean flag, particularly in
|
|
1891
|
+
// tight loops. To avoid this cost we only call the terminator in
|
|
1892
|
+
// intervals of 'opts.terminateint', which in addition can be scaled up by
|
|
1893
|
+
// the argument 'factor'. If the terminator returns 'true' we set the
|
|
1894
|
+
// 'termination_forced' flag to 'true' in order to remember the
|
|
1895
|
+
// termination status and to avoid the terminator again. Setting this
|
|
1896
|
+
// flag leads to the first test above to succeed in subsequent calls.
|
|
1897
|
+
//
|
|
1898
|
+
if (external->terminator && !lim.terminate.check--) {
|
|
1899
|
+
assert (factor > 0);
|
|
1900
|
+
assert (INT_MAX / factor > opts.terminateint);
|
|
1901
|
+
lim.terminate.check = factor * opts.terminateint;
|
|
1902
|
+
if (external->terminator->terminate ()) {
|
|
1903
|
+
termination_forced = true; // Cache it.
|
|
1904
|
+
LOG ("connected terminator forces termination");
|
|
1905
|
+
return true;
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
return false;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
/*------------------------------------------------------------------------*/
|
|
1913
|
+
|
|
1914
|
+
inline bool Internal::search_limits_hit () {
|
|
1915
|
+
assert (!preprocessing);
|
|
1916
|
+
assert (!localsearching);
|
|
1917
|
+
|
|
1918
|
+
if (lim.conflicts >= 0 && stats.conflicts >= lim.conflicts) {
|
|
1919
|
+
LOG ("conflict limit %" PRId64 " reached", lim.conflicts);
|
|
1920
|
+
return true;
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
if (lim.decisions >= 0 && stats.decisions >= lim.decisions) {
|
|
1924
|
+
LOG ("decision limit %" PRId64 " reached", lim.decisions);
|
|
1925
|
+
return true;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
if (lim.ticks >= 0 &&
|
|
1929
|
+
stats.ticks.search[0] + stats.ticks.search[1] >= lim.ticks) {
|
|
1930
|
+
LOG ("ticks limit %" PRId64 " reached", lim.ticks);
|
|
1931
|
+
return true;
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
return false;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
/*------------------------------------------------------------------------*/
|
|
1938
|
+
|
|
1939
|
+
} // namespace CaDiCaL
|
|
1940
|
+
|
|
1941
|
+
#endif
|