1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 package org.sat4j.tools;
27
28 import java.io.PrintStream;
29 import java.io.PrintWriter;
30 import java.io.Serializable;
31 import java.math.BigInteger;
32 import java.util.Map;
33
34 import org.sat4j.specs.ContradictionException;
35 import org.sat4j.specs.IConstr;
36 import org.sat4j.specs.ISolver;
37 import org.sat4j.specs.IVec;
38 import org.sat4j.specs.IVecInt;
39 import org.sat4j.specs.TimeoutException;
40
41
42
43
44
45
46
47
48 public abstract class SolverDecorator implements ISolver, Serializable {
49
50
51
52
53
54
55 public void clearLearntClauses() {
56 solver.clearLearntClauses();
57 }
58
59
60
61
62
63
64 public int[] findModel() throws TimeoutException {
65 return solver.findModel();
66 }
67
68
69
70
71
72
73 public int[] findModel(IVecInt assumps) throws TimeoutException {
74 return solver.findModel(assumps);
75 }
76
77
78
79
80
81
82 public boolean model(int var) {
83 return solver.model(var);
84 }
85
86 public void setExpectedNumberOfClauses(int nb) {
87 solver.setExpectedNumberOfClauses(nb);
88 }
89
90
91
92
93
94
95 public int getTimeout() {
96 return solver.getTimeout();
97 }
98
99
100
101
102
103
104 public String toString(String prefix) {
105 return solver.toString(prefix);
106 }
107
108
109
110
111
112
113
114 @Deprecated
115 public void printStat(PrintStream out, String prefix) {
116 solver.printStat(out, prefix);
117 }
118
119 public void printStat(PrintWriter out, String prefix) {
120 solver.printStat(out, prefix);
121 }
122
123 private final ISolver solver;
124
125
126
127
128 public SolverDecorator(ISolver solver) {
129 this.solver = solver;
130 }
131
132
133
134
135
136
137 public int newVar() {
138 return solver.newVar();
139 }
140
141
142
143
144
145
146 public int newVar(int howmany) {
147 return solver.newVar(howmany);
148 }
149
150
151
152
153
154
155 public IConstr addClause(IVecInt literals) throws ContradictionException {
156 return solver.addClause(literals);
157 }
158
159 public void addAllClauses(IVec<IVecInt> clauses)
160 throws ContradictionException {
161 solver.addAllClauses(clauses);
162 }
163
164
165
166
167
168
169 public IConstr addAtMost(IVecInt literals, int degree)
170 throws ContradictionException {
171 return solver.addAtMost(literals, degree);
172 }
173
174
175
176
177
178
179 public IConstr addAtLeast(IVecInt literals, int degree)
180 throws ContradictionException {
181 return solver.addAtLeast(literals, degree);
182 }
183
184 public IConstr addPseudoBoolean(IVecInt literals, IVec<BigInteger> coeffs,
185 boolean moreThan, BigInteger degree) throws ContradictionException {
186 return solver.addPseudoBoolean(literals, coeffs, moreThan, degree);
187 }
188
189
190
191
192
193
194 public int[] model() {
195 return solver.model();
196 }
197
198
199
200
201
202
203 public boolean isSatisfiable() throws TimeoutException {
204 return solver.isSatisfiable();
205 }
206
207
208
209
210
211
212 public boolean isSatisfiable(IVecInt assumps) throws TimeoutException {
213 return solver.isSatisfiable(assumps);
214 }
215
216
217
218
219
220
221 public void setTimeout(int t) {
222 solver.setTimeout(t);
223 }
224
225
226
227
228
229
230 public void setTimeoutMs(long t) {
231 solver.setTimeoutMs(t);
232 }
233
234
235
236
237
238
239 public int nConstraints() {
240 return solver.nConstraints();
241 }
242
243
244
245
246
247
248 public int nVars() {
249 return solver.nVars();
250 }
251
252
253
254
255
256
257 public void reset() {
258 solver.reset();
259 }
260
261 public ISolver decorated() {
262 return solver;
263 }
264
265
266
267
268
269
270 public boolean removeConstr(IConstr c) {
271 return solver.removeConstr(c);
272 }
273
274
275
276
277
278
279 public Map<String, Number> getStat() {
280 return solver.getStat();
281 }
282 }