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.reader; |
27 |
|
|
28 |
|
import java.io.IOException; |
29 |
|
import java.io.LineNumberReader; |
30 |
|
import java.io.PrintWriter; |
31 |
|
import java.util.HashMap; |
32 |
|
import java.util.LinkedHashMap; |
33 |
|
import java.util.Map; |
34 |
|
import java.util.Scanner; |
35 |
|
|
36 |
|
import org.sat4j.core.Vec; |
37 |
|
import org.sat4j.reader.csp.AllDiff; |
38 |
|
import org.sat4j.reader.csp.Clausifiable; |
39 |
|
import org.sat4j.reader.csp.Constant; |
40 |
|
import org.sat4j.reader.csp.Domain; |
41 |
|
import org.sat4j.reader.csp.EnumeratedDomain; |
42 |
|
import org.sat4j.reader.csp.Evaluable; |
43 |
|
import org.sat4j.reader.csp.Nogoods; |
44 |
|
import org.sat4j.reader.csp.Predicate; |
45 |
|
import org.sat4j.reader.csp.RangeDomain; |
46 |
|
import org.sat4j.reader.csp.Relation; |
47 |
|
import org.sat4j.reader.csp.Var; |
48 |
|
import org.sat4j.reader.csp.WalshSupports; |
49 |
|
import org.sat4j.specs.ContradictionException; |
50 |
|
import org.sat4j.specs.IProblem; |
51 |
|
import org.sat4j.specs.ISolver; |
52 |
|
import org.sat4j.specs.IVec; |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
@author |
64 |
|
|
65 |
|
|
|
|
| 0% |
Uncovered Elements: 260 (260) |
Complexity: 33 |
Complexity Density: 0,5 |
|
66 |
|
public class CSPReader extends Reader implements org.sat4j.csp.xml.ICSPCallback { |
67 |
|
|
68 |
|
private final ISolver solver; |
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
protected Relation[] relations; |
73 |
|
|
74 |
|
private int valueindex; |
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
private int relindex; |
79 |
|
|
80 |
|
private int[] currentdomain; |
81 |
|
|
82 |
|
private Domain rangedomain; |
83 |
|
|
84 |
|
private String currentdomainid; |
85 |
|
|
86 |
|
private int currentdomainsize; |
87 |
|
|
88 |
|
private final Map<String, Domain> domainmapping = new HashMap<String, Domain>(); |
89 |
|
|
90 |
|
private final Map<String, Var> varmapping = new LinkedHashMap<String, Var>(); |
91 |
|
|
92 |
|
private final Map<String, Integer> relmapping = new HashMap<String, Integer>(); |
93 |
|
|
94 |
|
private final Map<String, Clausifiable> predmapping = new HashMap<String, Clausifiable>(); |
95 |
|
|
96 |
|
private int nbvarstocreate; |
97 |
|
|
98 |
|
private int tupleindex; |
99 |
|
|
100 |
|
private Clausifiable currentclausifiable; |
101 |
|
|
102 |
|
private Predicate currentpredicate; |
103 |
|
|
104 |
|
private final IVec<Evaluable> variables = new Vec<Evaluable>(); |
105 |
|
|
106 |
|
private final IVec<Var> scope = new Vec<Var>(); |
107 |
|
|
108 |
|
private int nbvars; |
109 |
|
|
110 |
|
private int nbconstraints; |
111 |
|
|
112 |
|
private int currentconstraint; |
113 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
114 |
0
|
public CSPReader(ISolver solver) {... |
115 |
0
|
this.solver = solver; |
116 |
0
|
predmapping.put("global:allDifferent", new AllDiff()); |
117 |
|
} |
118 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
119 |
0
|
@Override... |
120 |
|
public final IProblem parseInstance(final java.io.Reader in) |
121 |
|
throws ParseFormatException, ContradictionException, IOException { |
122 |
0
|
return parseInstance(new LineNumberReader(in)); |
123 |
|
|
124 |
|
} |
125 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0,4 |
|
126 |
0
|
private IProblem parseInstance(LineNumberReader in)... |
127 |
|
throws ParseFormatException, ContradictionException { |
128 |
0
|
solver.reset(); |
129 |
0
|
try { |
130 |
0
|
readProblem(in); |
131 |
0
|
return solver; |
132 |
|
} catch (NumberFormatException e) { |
133 |
0
|
throw new ParseFormatException("integer value expected on line " |
134 |
|
+ in.getLineNumber(), e); |
135 |
|
} |
136 |
|
} |
137 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0,67 |
|
138 |
0
|
@Override... |
139 |
|
public void decode(int[] model, PrintWriter out) { |
140 |
|
|
141 |
0
|
for (Var v : varmapping.values()) { |
142 |
0
|
out.print(v.findValue(model)); |
143 |
0
|
out.print(" "); |
144 |
|
} |
145 |
|
} |
146 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0,4 |
|
147 |
0
|
@Override... |
148 |
|
public String decode(int[] model) { |
149 |
0
|
StringBuilder stb = new StringBuilder(); |
150 |
|
|
151 |
0
|
for (Var v : varmapping.values()) { |
152 |
0
|
stb.append(v.findValue(model)); |
153 |
0
|
stb.append(" "); |
154 |
|
} |
155 |
0
|
return stb.toString(); |
156 |
|
} |
157 |
|
|
|
|
| 0% |
Uncovered Elements: 64 (64) |
Complexity: 8 |
Complexity Density: 0,18 |
|
158 |
0
|
private void readProblem(LineNumberReader in) throws ContradictionException {... |
159 |
0
|
Scanner input = new Scanner(in); |
160 |
|
|
161 |
0
|
beginInstance(input.nextLine()); |
162 |
|
|
163 |
|
|
164 |
0
|
int nbdomain = input.nextInt(); |
165 |
0
|
beginDomainsSection(nbdomain); |
166 |
|
|
167 |
0
|
for (int i = 0; i < nbdomain; i++) { |
168 |
|
|
169 |
0
|
int dnum = input.nextInt(); |
170 |
0
|
assert dnum == i; |
171 |
|
|
172 |
0
|
int[] domain = readArrayOfInt(input); |
173 |
0
|
beginDomain("" + dnum, domain.length); |
174 |
0
|
for (int j = 0; j < domain.length; j++) { |
175 |
0
|
addDomainValue(domain[j]); |
176 |
|
} |
177 |
0
|
endDomain(); |
178 |
|
} |
179 |
0
|
endDomainsSection(); |
180 |
0
|
int nbvar = input.nextInt(); |
181 |
0
|
beginVariablesSection(nbvar); |
182 |
0
|
for (int i = 0; i < nbvar; i++) { |
183 |
|
|
184 |
0
|
int varnum = input.nextInt(); |
185 |
0
|
assert varnum == i; |
186 |
|
|
187 |
0
|
int vardom = input.nextInt(); |
188 |
0
|
addVariable("" + varnum, "" + vardom); |
189 |
|
} |
190 |
0
|
endVariablesSection(); |
191 |
|
|
192 |
|
|
193 |
|
|
194 |
0
|
int nbrel = input.nextInt(); |
195 |
0
|
beginRelationsSection(nbrel); |
196 |
0
|
for (int i = 0; i < nbrel; i++) { |
197 |
|
|
198 |
|
|
199 |
0
|
int relnum = input.nextInt(); |
200 |
0
|
assert relnum == i; |
201 |
|
|
202 |
0
|
boolean forbidden = input.nextInt() == 1 ? false : true; |
203 |
0
|
int[] rdomains = readArrayOfInt(input); |
204 |
|
|
205 |
0
|
int nbtuples = input.nextInt(); |
206 |
|
|
207 |
0
|
beginRelation("" + relnum, rdomains.length, nbtuples, !forbidden); |
208 |
|
|
209 |
0
|
for (int j = 0; j < nbtuples; j++) { |
210 |
0
|
int[] tuple = readArrayOfInt(input, relations[relnum].arity()); |
211 |
|
|
212 |
0
|
addRelationTuple(tuple); |
213 |
|
} |
214 |
|
|
215 |
0
|
endRelation(); |
216 |
|
} |
217 |
0
|
endRelationsSection(); |
218 |
0
|
int nbconstr = input.nextInt(); |
219 |
0
|
beginConstraintsSection(nbconstr); |
220 |
|
|
221 |
0
|
for (int i = 0; i < nbconstr; i++) { |
222 |
0
|
int[] variables = readArrayOfInt(input); |
223 |
0
|
beginConstraint("" + i, variables.length); |
224 |
0
|
int relnum = input.nextInt(); |
225 |
|
|
226 |
0
|
constraintReference("" + relnum); |
227 |
0
|
for (int v : variables) { |
228 |
0
|
addEffectiveParameter("" + v); |
229 |
|
} |
230 |
0
|
endConstraint(); |
231 |
|
} |
232 |
0
|
endConstraintsSection(); |
233 |
0
|
endInstance(); |
234 |
|
} |
235 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
236 |
0
|
protected void manageAllowedTuples(int relnum, int arity, int nbtuples) {... |
237 |
0
|
relations[relnum] = new WalshSupports(arity, nbtuples); |
238 |
|
} |
239 |
|
|
240 |
|
|
241 |
|
|
242 |
|
|
243 |
|
|
244 |
|
|
245 |
|
|
246 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
247 |
0
|
private int[] readArrayOfInt(Scanner input) {... |
248 |
0
|
int size = input.nextInt(); |
249 |
0
|
return readArrayOfInt(input, size); |
250 |
|
} |
251 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0,5 |
|
252 |
0
|
private int[] readArrayOfInt(Scanner input, int size) {... |
253 |
0
|
int[] tab = new int[size]; |
254 |
0
|
for (int i = 0; i < size; i++) |
255 |
0
|
tab[i] = input.nextInt(); |
256 |
0
|
return tab; |
257 |
|
} |
258 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
259 |
0
|
public void beginInstance(String arg0) {... |
260 |
0
|
System.out.println("c reading problem named " + arg0); |
261 |
|
} |
262 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
263 |
0
|
public void beginDomainsSection(int nbdomain) {... |
264 |
0
|
System.out.print("c reading domains"); |
265 |
|
} |
266 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0,2 |
|
267 |
0
|
public void beginDomain(String id, int size) {... |
268 |
0
|
currentdomainsize = size; |
269 |
0
|
currentdomain = null; |
270 |
0
|
valueindex = -1; |
271 |
0
|
currentdomainid = id; |
272 |
0
|
rangedomain = null; |
273 |
|
} |
274 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 4 |
Complexity Density: 0,57 |
|
275 |
0
|
public void addDomainValue(int arg0) {... |
276 |
0
|
if (currentdomain == null) { |
277 |
0
|
currentdomain = new int[currentdomainsize]; |
278 |
|
} |
279 |
0
|
if (rangedomain != null) { |
280 |
0
|
for (int i = 0; i < rangedomain.size(); i++) |
281 |
0
|
currentdomain[++valueindex] = rangedomain.get(i); |
282 |
0
|
rangedomain = null; |
283 |
|
} |
284 |
0
|
currentdomain[++valueindex] = arg0; |
285 |
|
} |
286 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 4 |
Complexity Density: 0,67 |
|
287 |
0
|
public void addDomainValue(int begin, int end) {... |
288 |
0
|
if (currentdomainsize == end - begin + 1) |
289 |
0
|
rangedomain = new RangeDomain(begin, end); |
290 |
|
else { |
291 |
0
|
if (currentdomain == null) { |
292 |
0
|
currentdomain = new int[currentdomainsize]; |
293 |
|
} |
294 |
0
|
for (int v = begin; v <= end; v++) |
295 |
0
|
currentdomain[++valueindex] = v; |
296 |
|
} |
297 |
|
} |
298 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 3 |
Complexity Density: 1 |
|
299 |
0
|
public void endDomain() {... |
300 |
0
|
assert rangedomain != null || valueindex == currentdomain.length - 1; |
301 |
0
|
if (rangedomain == null) |
302 |
0
|
domainmapping.put(currentdomainid, new EnumeratedDomain( |
303 |
|
currentdomain)); |
304 |
|
else |
305 |
0
|
domainmapping.put(currentdomainid, rangedomain); |
306 |
|
} |
307 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
308 |
0
|
public void endDomainsSection() {... |
309 |
0
|
System.out.println(" done."); |
310 |
|
} |
311 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
|
312 |
0
|
public void beginVariablesSection(int nbvars) {... |
313 |
0
|
System.out.print("c reading variables"); |
314 |
0
|
nbvarstocreate = 0; |
315 |
0
|
this.nbvars = nbvars; |
316 |
|
} |
317 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0,4 |
|
318 |
0
|
public void addVariable(String idvar, String iddomain) {... |
319 |
0
|
Domain vardom = domainmapping.get(iddomain); |
320 |
0
|
varmapping.put(idvar, new Var(idvar, vardom, nbvarstocreate)); |
321 |
0
|
nbvarstocreate += vardom.size(); |
322 |
0
|
if (isVerbose()) |
323 |
0
|
System.out.print("\rc reading variables " + varmapping.size() + "/" |
324 |
|
+ nbvars); |
325 |
|
|
326 |
|
} |
327 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 4 |
Complexity Density: 0,57 |
|
328 |
0
|
public void endVariablesSection() {... |
329 |
0
|
if (isVerbose()) |
330 |
0
|
System.out.println("\rc reading variables (" + nbvars + ") done."); |
331 |
|
else |
332 |
0
|
System.out.println(" done."); |
333 |
0
|
solver.newVar(nbvarstocreate); |
334 |
0
|
try { |
335 |
0
|
for (Evaluable v : varmapping.values()) { |
336 |
0
|
v.toClause(solver); |
337 |
|
} |
338 |
|
} catch (ContradictionException ce) { |
339 |
|
assert false; |
340 |
|
} |
341 |
|
|
342 |
|
} |
343 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
|
344 |
0
|
public void beginRelationsSection(int nbrel) {... |
345 |
0
|
System.out.print("c reading relations"); |
346 |
0
|
relations = new Relation[nbrel]; |
347 |
0
|
relindex = -1; |
348 |
|
} |
349 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0,43 |
|
350 |
0
|
public void beginRelation(String name, int arity, int nbTuples,... |
351 |
|
boolean isSupport) { |
352 |
0
|
relmapping.put(name, ++relindex); |
353 |
0
|
if (isVerbose()) |
354 |
0
|
System.out.print("\rc reading relations " + relindex + "/" |
355 |
|
+ relations.length); |
356 |
0
|
if (isSupport) { |
357 |
0
|
manageAllowedTuples(relindex, arity, nbTuples); |
358 |
|
} else { |
359 |
0
|
relations[relindex] = new Nogoods(arity, nbTuples); |
360 |
|
} |
361 |
0
|
tupleindex = -1; |
362 |
|
} |
363 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
364 |
0
|
public void addRelationTuple(int[] tuple) {... |
365 |
0
|
relations[relindex].addTuple(++tupleindex, tuple); |
366 |
|
} |
367 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
368 |
0
|
public void endRelation() {... |
369 |
|
} |
370 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0,67 |
|
371 |
0
|
public void endRelationsSection() {... |
372 |
0
|
if (isVerbose()) |
373 |
0
|
System.out.println("\rc reading relations (" + relations.length |
374 |
|
+ ") done."); |
375 |
|
else |
376 |
0
|
System.out.println(" done."); |
377 |
|
} |
378 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
379 |
0
|
public void beginPredicatesSection(int arg0) {... |
380 |
0
|
System.out.print("c reading predicates "); |
381 |
|
} |
382 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0,5 |
|
383 |
0
|
public void beginPredicate(String name) {... |
384 |
0
|
currentpredicate = new Predicate(); |
385 |
0
|
predmapping.put(name, currentpredicate); |
386 |
0
|
if (isVerbose()) |
387 |
0
|
System.out.print("\rc reading predicate " + predmapping.size()); |
388 |
|
} |
389 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
390 |
0
|
public void addFormalParameter(String name, String type) {... |
391 |
0
|
currentpredicate.addVariable(name); |
392 |
|
|
393 |
|
} |
394 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
395 |
0
|
public void predicateExpression(String expr) {... |
396 |
0
|
currentpredicate.setExpression(expr); |
397 |
|
} |
398 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
399 |
0
|
public void endPredicate() {... |
400 |
|
|
401 |
|
} |
402 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0,67 |
|
403 |
0
|
public void endPredicatesSection() {... |
404 |
0
|
if (isVerbose()) |
405 |
0
|
System.out.println("\rc reading relations (" + predmapping.size() |
406 |
|
+ ") done."); |
407 |
|
else |
408 |
0
|
System.out.println(" done."); |
409 |
|
} |
410 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
|
411 |
0
|
public void beginConstraintsSection(int arg0) {... |
412 |
0
|
System.out.println("c reading constraints"); |
413 |
0
|
nbconstraints = arg0; |
414 |
0
|
currentconstraint = 0; |
415 |
|
} |
416 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0,33 |
|
417 |
0
|
public void beginConstraint(String name, int arity) {... |
418 |
0
|
variables.clear(); |
419 |
0
|
variables.ensure(arity); |
420 |
0
|
scope.clear(); |
421 |
0
|
scope.ensure(arity); |
422 |
0
|
if (isVerbose()) |
423 |
0
|
System.out.print("\rc grounding constraint " + name + "(" |
424 |
|
+ (++currentconstraint * 100 / nbconstraints) + "%)"); |
425 |
|
} |
426 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0,5 |
|
427 |
0
|
public void constraintReference(String ref) {... |
428 |
0
|
Integer id = relmapping.get(ref); |
429 |
0
|
if (id == null) { |
430 |
0
|
currentclausifiable = predmapping.get(ref); |
431 |
|
} else { |
432 |
0
|
currentclausifiable = relations[id]; |
433 |
|
} |
434 |
|
} |
435 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
436 |
0
|
public void addVariableToConstraint(String arg0) {... |
437 |
0
|
scope.push(varmapping.get(arg0)); |
438 |
|
} |
439 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
440 |
0
|
public void addEffectiveParameter(String arg0) {... |
441 |
0
|
variables.push(varmapping.get(arg0)); |
442 |
|
} |
443 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
444 |
0
|
public void addEffectiveParameter(int arg0) {... |
445 |
0
|
variables.push(new Constant(arg0)); |
446 |
|
} |
447 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
448 |
0
|
public void beginParameterList() {... |
449 |
0
|
throw new UnsupportedOperationException( |
450 |
|
"I do not handle parameter list yet!"); |
451 |
|
|
452 |
|
} |
453 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
454 |
0
|
public void addIntegerItem(int arg0) {... |
455 |
|
|
456 |
|
|
457 |
|
} |
458 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
459 |
0
|
public void addVariableItem(String arg0) {... |
460 |
|
|
461 |
|
|
462 |
|
} |
463 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
464 |
0
|
public void endParamaterList() {... |
465 |
|
|
466 |
|
|
467 |
|
} |
468 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
469 |
0
|
public void addConstantParameter(String arg0, int arg1) {... |
470 |
0
|
throw new UnsupportedOperationException( |
471 |
|
"I do not handle constant parameter yet!"); |
472 |
|
} |
473 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
474 |
0
|
public void constraintExpression(String arg0) {... |
475 |
0
|
throw new UnsupportedOperationException( |
476 |
|
"I do not handle constraint expression yet!"); |
477 |
|
} |
478 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0,67 |
|
479 |
0
|
public void endConstraint() {... |
480 |
0
|
try { |
481 |
0
|
currentclausifiable.toClause(solver, scope, variables); |
482 |
|
} catch (ContradictionException e) { |
483 |
0
|
System.err.println("c INSTANCE TRIVIALLY UNSAT"); |
484 |
|
} |
485 |
|
} |
486 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0,67 |
|
487 |
0
|
public void endConstraintsSection() {... |
488 |
0
|
if (isVerbose()) |
489 |
0
|
System.out.println("\rc reading constraints done."); |
490 |
|
else |
491 |
0
|
System.out.println("c done with constraints."); |
492 |
|
} |
493 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
494 |
0
|
public void endInstance() {... |
495 |
|
|
496 |
|
} |
497 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
498 |
0
|
IProblem getProblem() {... |
499 |
0
|
return solver; |
500 |
|
} |
501 |
|
} |