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
27
28
29
30 package org.sat4j.tools;
31
32 import java.io.PrintStream;
33 import java.io.PrintWriter;
34 import java.util.Map;
35
36 import org.sat4j.specs.ContradictionException;
37 import org.sat4j.specs.IConstr;
38 import org.sat4j.specs.ISolver;
39 import org.sat4j.specs.ISolverService;
40 import org.sat4j.specs.IVec;
41 import org.sat4j.specs.IVecInt;
42 import org.sat4j.specs.SearchListener;
43 import org.sat4j.specs.TimeoutException;
44
45 public abstract class AbstractOutputSolver implements ISolver {
46
47 protected int nbvars;
48
49 protected int nbclauses;
50
51 protected boolean fixedNbClauses = false;
52
53 protected boolean firstConstr = true;
54
55
56
57
58 private static final long serialVersionUID = 1L;
59
60 public boolean removeConstr(IConstr c) {
61 throw new UnsupportedOperationException();
62 }
63
64 public void addAllClauses(IVec<IVecInt> clauses)
65 throws ContradictionException {
66 throw new UnsupportedOperationException();
67 }
68
69 public void setTimeout(int t) {
70
71
72 }
73
74 public void setTimeoutMs(long t) {
75
76 }
77
78 public int getTimeout() {
79 return 0;
80 }
81
82
83
84
85 public long getTimeoutMs() {
86 return 0L;
87 }
88
89 public void expireTimeout() {
90
91
92 }
93
94 public boolean isSatisfiable(IVecInt assumps, boolean global)
95 throws TimeoutException {
96 throw new TimeoutException("There is no real solver behind!");
97 }
98
99 public boolean isSatisfiable(boolean global) throws TimeoutException {
100 throw new TimeoutException("There is no real solver behind!");
101 }
102
103 public void printInfos(PrintWriter output, String prefix) {
104 }
105
106 public void setTimeoutOnConflicts(int count) {
107
108 }
109
110 public boolean isDBSimplificationAllowed() {
111 return false;
112 }
113
114 public void setDBSimplificationAllowed(boolean status) {
115
116 }
117
118 public void printStat(PrintStream output, String prefix) {
119
120 }
121
122 public void printStat(PrintWriter output, String prefix) {
123
124
125 }
126
127 public Map<String, Number> getStat() {
128
129 return null;
130 }
131
132 public void clearLearntClauses() {
133
134
135 }
136
137 public int[] model() {
138 throw new UnsupportedOperationException();
139 }
140
141 public boolean model(int var) {
142 throw new UnsupportedOperationException();
143 }
144
145 public boolean isSatisfiable() throws TimeoutException {
146 throw new TimeoutException("There is no real solver behind!");
147 }
148
149 public boolean isSatisfiable(IVecInt assumps) throws TimeoutException {
150 throw new TimeoutException("There is no real solver behind!");
151 }
152
153 public int[] findModel() throws TimeoutException {
154 throw new UnsupportedOperationException();
155 }
156
157 public int[] findModel(IVecInt assumps) throws TimeoutException {
158 throw new UnsupportedOperationException();
159 }
160
161
162
163
164 public boolean removeSubsumedConstr(IConstr c) {
165 return false;
166 }
167
168
169
170
171 public IConstr addBlockingClause(IVecInt literals)
172 throws ContradictionException {
173 throw new UnsupportedOperationException();
174 }
175
176
177
178
179 public <S extends ISolverService> SearchListener<S> getSearchListener() {
180 throw new UnsupportedOperationException();
181 }
182
183
184
185
186 public <S extends ISolverService> void setSearchListener(
187 SearchListener<S> sl) {
188 }
189
190
191
192
193 public boolean isVerbose() {
194 return true;
195 }
196
197
198
199
200 public void setVerbose(boolean value) {
201
202 }
203
204
205
206
207 public void setLogPrefix(String prefix) {
208
209
210 }
211
212
213
214
215 public String getLogPrefix() {
216 return "";
217 }
218
219
220
221
222 public IVecInt unsatExplanation() {
223 throw new UnsupportedOperationException();
224 }
225
226 public int[] primeImplicant() {
227 throw new UnsupportedOperationException();
228 }
229
230 public int nConstraints() {
231
232 return 0;
233 }
234
235 public int newVar(int howmany) {
236
237 return 0;
238 }
239
240 public int nVars() {
241
242 return 0;
243 }
244
245 public boolean isSolverKeptHot() {
246 return false;
247 }
248
249 public void setKeepSolverHot(boolean value) {
250 }
251 }