1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.kernel.bo.logic.proof.finder; |
17 |
|
|
18 |
|
import java.util.ArrayList; |
19 |
|
import java.util.Iterator; |
20 |
|
import java.util.List; |
21 |
|
import java.util.SortedSet; |
22 |
|
import java.util.TreeSet; |
23 |
|
|
24 |
|
import org.qedeq.base.io.Parameters; |
25 |
|
import org.qedeq.base.utility.StringUtility; |
26 |
|
import org.qedeq.kernel.bo.common.Element2Utf8; |
27 |
|
import org.qedeq.kernel.bo.log.ModuleLogListener; |
28 |
|
import org.qedeq.kernel.bo.logic.common.FormulaUtility; |
29 |
|
import org.qedeq.kernel.bo.logic.common.Operators; |
30 |
|
import org.qedeq.kernel.bo.logic.proof.common.ProofException; |
31 |
|
import org.qedeq.kernel.bo.logic.proof.common.ProofFinder; |
32 |
|
import org.qedeq.kernel.bo.logic.proof.common.ProofFoundException; |
33 |
|
import org.qedeq.kernel.bo.logic.proof.common.ProofNotFoundException; |
34 |
|
import org.qedeq.kernel.se.base.list.Element; |
35 |
|
import org.qedeq.kernel.se.base.list.ElementList; |
36 |
|
import org.qedeq.kernel.se.base.module.Add; |
37 |
|
import org.qedeq.kernel.se.base.module.FormalProofLineList; |
38 |
|
import org.qedeq.kernel.se.base.module.ModusPonens; |
39 |
|
import org.qedeq.kernel.se.base.module.Reason; |
40 |
|
import org.qedeq.kernel.se.common.ModuleContext; |
41 |
|
import org.qedeq.kernel.se.dto.list.DefaultElementList; |
42 |
|
import org.qedeq.kernel.se.dto.list.ElementSet; |
43 |
|
import org.qedeq.kernel.se.visitor.InterruptException; |
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
@author |
50 |
|
|
|
|
| 71.5% |
Uncovered Elements: 85 (298) |
Complexity: 65 |
Complexity Density: 0.34 |
|
51 |
|
public class ProofFinderImpl implements ProofFinder { |
52 |
|
|
53 |
|
|
54 |
|
private List lines; |
55 |
|
|
56 |
|
|
57 |
|
private List reasons; |
58 |
|
|
59 |
|
|
60 |
|
private ElementSet allPredVars; |
61 |
|
|
62 |
|
|
63 |
|
private ElementSet partGoalFormulas; |
64 |
|
|
65 |
|
|
66 |
|
private int mpLast; |
67 |
|
|
68 |
|
|
69 |
|
private Element goalFormula; |
70 |
|
|
71 |
|
|
72 |
|
private int extraVars; |
73 |
|
|
74 |
|
|
75 |
|
private String skipFormulas; |
76 |
|
|
77 |
|
|
78 |
|
private int logFrequence; |
79 |
|
|
80 |
|
@link |
81 |
|
private SortedSet substitutionMethods; |
82 |
|
|
83 |
|
|
84 |
|
private int maxProofLines; |
85 |
|
|
86 |
|
|
87 |
|
private ModuleContext context; |
88 |
|
|
89 |
|
|
90 |
|
private ModuleLogListener log; |
91 |
|
|
92 |
|
|
93 |
|
private Element2Utf8 trans; |
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
98 |
9
|
public ProofFinderImpl() {... |
99 |
|
|
100 |
|
} |
101 |
|
|
|
|
| 76.2% |
Uncovered Elements: 20 (84) |
Complexity: 14 |
Complexity Density: 0.24 |
|
102 |
9
|
public void findProof(final Element formula,... |
103 |
|
final FormalProofLineList proof, final ModuleContext context, |
104 |
|
final Parameters parameters, final ModuleLogListener log, final Element2Utf8 trans) |
105 |
|
throws ProofException, InterruptException { |
106 |
9
|
this.goalFormula = formula; |
107 |
9
|
this.context = new ModuleContext(context); |
108 |
9
|
this.log = log; |
109 |
9
|
this.trans = trans; |
110 |
9
|
substitutionMethods = new TreeSet(); |
111 |
9
|
extraVars = parameters.getInt("extraVars"); |
112 |
9
|
maxProofLines = parameters.getInt("maximumProofLines"); |
113 |
9
|
skipFormulas = parameters.getString("skipFormulas").trim(); |
114 |
9
|
if (skipFormulas.length() > 0) { |
115 |
0
|
log.logMessageState("skipping the following formula numbers: " + skipFormulas); |
116 |
0
|
skipFormulas = "," + StringUtility.replace(skipFormulas, " ", "") + ","; |
117 |
|
} |
118 |
|
|
119 |
9
|
System.out.println("maximumProofLines = " + maxProofLines); |
120 |
9
|
int weight = 0; |
121 |
9
|
weight = parameters.getInt("propositionVariableWeight"); |
122 |
9
|
if (weight > 0) { |
123 |
9
|
substitutionMethods.add(new SubstituteBase(weight, parameters.getInt("propositionVariableOrder")) { |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
124 |
3676
|
public void substitute(final int i) throws ProofException {... |
125 |
3676
|
substituteByPropositionVariables(i); |
126 |
|
} |
127 |
|
}); |
128 |
|
} |
129 |
9
|
weight = parameters.getInt("partFormulaWeight"); |
130 |
9
|
if (weight > 0) { |
131 |
2
|
substitutionMethods.add(new SubstituteBase(weight, parameters.getInt("partFormulaOrder")) { |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
132 |
344
|
public void substitute(final int i) throws ProofException {... |
133 |
344
|
substitutePartGoalFormulas(i); |
134 |
|
} |
135 |
|
}); |
136 |
|
} |
137 |
9
|
weight = parameters.getInt("disjunctionWeight"); |
138 |
9
|
if (weight > 0) { |
139 |
9
|
substitutionMethods.add(new SubstituteBase(weight, parameters.getInt("disjunctionOrder")) { |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
140 |
3680
|
public void substitute(final int i) throws ProofException {... |
141 |
3680
|
substituteDisjunction(i); |
142 |
|
} |
143 |
|
}); |
144 |
|
} |
145 |
9
|
weight = parameters.getInt("implicationWeight"); |
146 |
9
|
if (weight > 0) { |
147 |
0
|
substitutionMethods.add(new SubstituteBase(weight, parameters.getInt("implicationOrder")) { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
148 |
0
|
public void substitute(final int i) throws ProofException {... |
149 |
0
|
substituteImplication(i); |
150 |
|
} |
151 |
|
}); |
152 |
|
} |
153 |
9
|
weight = parameters.getInt("negationWeight"); |
154 |
9
|
if (weight > 0) { |
155 |
0
|
substitutionMethods.add(new SubstituteBase(weight, parameters.getInt("negationOrder")) { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
156 |
0
|
public void substitute(final int i) throws ProofException {... |
157 |
0
|
substituteNegation(i); |
158 |
|
} |
159 |
|
}); |
160 |
|
} |
161 |
9
|
weight = parameters.getInt("conjunctionWeight"); |
162 |
9
|
if (weight > 0) { |
163 |
0
|
substitutionMethods.add(new SubstituteBase(weight, parameters.getInt("conjunctionOrder")) { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
164 |
0
|
public void substitute(final int i) throws ProofException {... |
165 |
0
|
substituteConjunction(i); |
166 |
|
} |
167 |
|
}); |
168 |
|
} |
169 |
9
|
weight = parameters.getInt("equivalenceWeight"); |
170 |
9
|
if (weight > 0) { |
171 |
0
|
substitutionMethods.add(new SubstituteBase(weight, parameters.getInt("equivalenceOrder")) { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
172 |
0
|
public void substitute(final int i) throws ProofException {... |
173 |
0
|
substituteEquivalence(i); |
174 |
|
} |
175 |
|
}); |
176 |
|
} |
177 |
9
|
logFrequence = parameters.getInt("logFrequence"); |
178 |
|
|
179 |
9
|
lines = new ArrayList(); |
180 |
9
|
reasons = new ArrayList(); |
181 |
9
|
setAllPredVars(proof); |
182 |
9
|
partGoalFormulas = FormulaUtility.getPartFormulas(goalFormula); |
183 |
9
|
log.logMessageState("our goal: " + trans.getUtf8(formula)); |
184 |
9
|
int size2 = 0; |
185 |
9
|
while (true) { |
186 |
|
|
187 |
1229
|
if (Thread.interrupted()) { |
188 |
0
|
throw new InterruptException(this.context); |
189 |
|
} |
190 |
1229
|
int size1 = lines.size(); |
191 |
1229
|
tryModusPonensAll(); |
192 |
1227
|
final Iterator iter = substitutionMethods.iterator(); |
193 |
4017
|
while (iter.hasNext()) { |
194 |
2797
|
final Substitute method = (Substitute) iter.next(); |
195 |
|
|
196 |
10490
|
for (int j = 0; j < method.getWeight(); j++) { |
197 |
7700
|
if (method.nextLine() >= lines.size()) { |
198 |
0
|
break; |
199 |
|
} |
200 |
7700
|
method.substitute(); |
201 |
7699
|
tryModusPonensAll(); |
202 |
|
} |
203 |
|
} |
204 |
|
|
205 |
1220
|
if (size2 == lines.size()) { |
206 |
|
|
207 |
0
|
log.logMessageState(FinderErrors.PROOF_NOT_FOUND_TEXT + size2); |
208 |
0
|
throw new ProofNotFoundException(FinderErrors.PROOF_NOT_FOUND_CODE, |
209 |
|
FinderErrors.PROOF_NOT_FOUND_TEXT + size2, context); |
210 |
|
} |
211 |
1220
|
size2 = size1; |
212 |
|
} |
213 |
|
} |
214 |
|
|
|
|
| 83.8% |
Uncovered Elements: 6 (37) |
Complexity: 7 |
Complexity Density: 0.28 |
|
215 |
9
|
private void setAllPredVars(final FormalProofLineList proof) {... |
216 |
9
|
log.logMessageState("using the following formulas:"); |
217 |
9
|
allPredVars = new ElementSet(); |
218 |
|
|
219 |
48
|
for (int i = 0; i < proof.size(); i++) { |
220 |
|
|
221 |
39
|
if (skipFormulas.indexOf("," + (i + 1) + ",") >= 0) { |
222 |
0
|
continue; |
223 |
|
} |
224 |
39
|
final Reason reason = proof.get(i).getReason(); |
225 |
39
|
if (!(reason instanceof Add)) { |
226 |
2
|
continue; |
227 |
|
} |
228 |
37
|
final Element formula = proof.get(i).getFormula().getElement(); |
229 |
37
|
lines.add(formula); |
230 |
37
|
reasons.add(reason); |
231 |
37
|
log.logMessageState(ProofFinderUtility.getUtf8Line(formula, reason, i, trans)); |
232 |
37
|
allPredVars.union(FormulaUtility.getPropositionVariables( |
233 |
|
formula)); |
234 |
|
} |
235 |
9
|
String max = "A"; |
236 |
9
|
final Iterator iter = allPredVars.iterator(); |
237 |
36
|
while (iter.hasNext()) { |
238 |
27
|
final ElementList v = (ElementList) iter.next(); |
239 |
27
|
final String name = v.getElement(0).getAtom().getString(); |
240 |
27
|
if (-1 == max.compareTo(name)) { |
241 |
18
|
max = name; |
242 |
|
} |
243 |
|
} |
244 |
9
|
System.out.println("Adding extra variables:"); |
245 |
9
|
for (int i = 1; i <= extraVars; i++) { |
246 |
0
|
max = (char) (max.charAt(0) + i) + ""; |
247 |
0
|
System.out.println("\t" + max); |
248 |
|
|
249 |
0
|
allPredVars.add(FormulaUtility.createPredicateVariable(max)); |
250 |
|
} |
251 |
|
} |
252 |
|
|
253 |
|
|
254 |
|
|
255 |
|
|
256 |
|
@throws |
257 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (20) |
Complexity: 6 |
Complexity Density: 0.6 |
|
258 |
8928
|
private void tryModusPonensAll() throws ProofException {... |
259 |
8928
|
int until = lines.size(); |
260 |
25560839
|
for (int i = 0; i < until; i++) { |
261 |
25551919
|
final Element first = (Element) lines.get(i); |
262 |
25551919
|
if (!FormulaUtility.isImplication(first)) { |
263 |
11317
|
continue; |
264 |
|
} |
265 |
289873976
|
for (int j = (i < mpLast ? mpLast : 0); j < until; j++) { |
266 |
264333382
|
if (first.getList().getElement(0).equals( |
267 |
|
lines.get(j))) { |
268 |
809
|
final ModusPonens mp = new ModusPonensBo(i, j); |
269 |
809
|
addFormula(first.getList().getElement(1), mp); |
270 |
|
} |
271 |
|
} |
272 |
|
} |
273 |
8920
|
mpLast = until; |
274 |
|
} |
275 |
|
|
276 |
|
|
277 |
|
|
278 |
|
|
279 |
|
@param |
280 |
|
@throws |
281 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (18) |
Complexity: 4 |
Complexity Density: 0.33 |
|
282 |
3676
|
private void substituteByPropositionVariables(final int i) throws ProofException {... |
283 |
3676
|
final Element f = (Element) lines.get(i); |
284 |
3676
|
final ElementSet vars = FormulaUtility.getPropositionVariables(f); |
285 |
3676
|
final Iterator iter = vars.iterator(); |
286 |
12865
|
while (iter.hasNext()) { |
287 |
9189
|
final ElementList var = (ElementList) iter.next(); |
288 |
9189
|
final Iterator all = allPredVars.iterator(); |
289 |
36756
|
while (all.hasNext()) { |
290 |
27567
|
final ElementList subst = (ElementList) all.next(); |
291 |
27567
|
if (var.equals(subst)) { |
292 |
9189
|
continue; |
293 |
|
} |
294 |
18378
|
final Element created = FormulaUtility.replaceOperatorVariable( |
295 |
|
f, var, subst); |
296 |
18378
|
addFormula(created, new SubstPredBo(i, var, subst)); |
297 |
|
} |
298 |
|
} |
299 |
|
} |
300 |
|
|
301 |
|
|
302 |
|
|
303 |
|
|
304 |
|
@param |
305 |
|
@throws |
306 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (18) |
Complexity: 4 |
Complexity Density: 0.33 |
|
307 |
344
|
private void substitutePartGoalFormulas(final int i) throws ProofException {... |
308 |
344
|
final Element f = (Element) lines.get(i); |
309 |
344
|
final ElementSet vars = FormulaUtility.getPropositionVariables(f); |
310 |
344
|
final Iterator iter = vars.iterator(); |
311 |
1147
|
while (iter.hasNext()) { |
312 |
803
|
final ElementList var = (ElementList) iter.next(); |
313 |
|
{ |
314 |
803
|
final Iterator all = partGoalFormulas.iterator(); |
315 |
3305
|
while (all.hasNext()) { |
316 |
2502
|
final ElementList subst = (ElementList) all.next(); |
317 |
2502
|
if (var.equals(subst)) { |
318 |
471
|
continue; |
319 |
|
} |
320 |
2031
|
final Element created = FormulaUtility.replaceOperatorVariable( |
321 |
|
f, var, subst); |
322 |
2031
|
addFormula(created, new SubstPredBo(i, var, subst)); |
323 |
|
} |
324 |
|
} |
325 |
|
} |
326 |
|
} |
327 |
|
|
328 |
|
|
329 |
|
|
330 |
|
|
331 |
|
@param |
332 |
|
@throws |
333 |
|
|
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 3 |
Complexity Density: 0.25 |
|
334 |
0
|
private void substituteNegation(final int i) throws ProofException {... |
335 |
0
|
final Element f = (Element) lines.get(i); |
336 |
0
|
final ElementSet vars = FormulaUtility.getPropositionVariables(f); |
337 |
0
|
final Iterator iter = vars.iterator(); |
338 |
0
|
while (iter.hasNext()) { |
339 |
0
|
final ElementList var = (ElementList) iter.next(); |
340 |
0
|
final Iterator all = allPredVars.iterator(); |
341 |
0
|
while (all.hasNext()) { |
342 |
0
|
final ElementList var2 = (ElementList) all.next(); |
343 |
0
|
final ElementList subst = new DefaultElementList(Operators.NEGATION_OPERATOR); |
344 |
0
|
subst.add(var2); |
345 |
0
|
final Element created = FormulaUtility.replaceOperatorVariable( |
346 |
|
f, var, subst); |
347 |
0
|
addFormula(created, new SubstPredBo(i, var, subst)); |
348 |
|
} |
349 |
|
} |
350 |
|
} |
351 |
|
|
352 |
|
|
353 |
|
|
354 |
|
|
355 |
|
@param |
356 |
|
@throws |
357 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
358 |
0
|
private void substituteConjunction(final int i) throws ProofException {... |
359 |
0
|
final Element f = (Element) lines.get(i); |
360 |
0
|
final ElementSet vars = FormulaUtility.getPropositionVariables(f); |
361 |
0
|
final Iterator iter = vars.iterator(); |
362 |
0
|
while (iter.hasNext()) { |
363 |
0
|
final ElementList var = (ElementList) iter.next(); |
364 |
0
|
createReplacement(i, f, var, Operators.CONJUNCTION_OPERATOR, true); |
365 |
0
|
createReplacement(i, f, var, Operators.CONJUNCTION_OPERATOR, false); |
366 |
|
} |
367 |
|
} |
368 |
|
|
369 |
|
|
370 |
|
|
371 |
|
|
372 |
|
@param |
373 |
|
@throws |
374 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
375 |
3680
|
private void substituteDisjunction(final int i) throws ProofException {... |
376 |
3680
|
final Element f = (Element) lines.get(i); |
377 |
3680
|
final ElementSet vars = FormulaUtility.getPropositionVariables(f); |
378 |
3680
|
final Iterator iter = vars.iterator(); |
379 |
12875
|
while (iter.hasNext()) { |
380 |
9196
|
final ElementList var = (ElementList) iter.next(); |
381 |
9196
|
createReplacement(i, f, var, Operators.DISJUNCTION_OPERATOR, true); |
382 |
9195
|
createReplacement(i, f, var, Operators.DISJUNCTION_OPERATOR, false); |
383 |
|
} |
384 |
|
} |
385 |
|
|
386 |
|
|
387 |
|
|
388 |
|
|
389 |
|
@param |
390 |
|
@throws |
391 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
392 |
0
|
private void substituteImplication(final int i) throws ProofException {... |
393 |
0
|
final Element f = (Element) lines.get(i); |
394 |
0
|
final ElementSet vars = FormulaUtility.getPropositionVariables(f); |
395 |
0
|
final Iterator iter = vars.iterator(); |
396 |
0
|
while (iter.hasNext()) { |
397 |
0
|
final ElementList var = (ElementList) iter.next(); |
398 |
0
|
createReplacement(i, f, var, Operators.IMPLICATION_OPERATOR, true); |
399 |
0
|
createReplacement(i, f, var, Operators.IMPLICATION_OPERATOR, false); |
400 |
|
} |
401 |
|
} |
402 |
|
|
403 |
|
|
404 |
|
|
405 |
|
|
406 |
|
@param |
407 |
|
@throws |
408 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
409 |
0
|
private void substituteEquivalence(final int i) throws ProofException {... |
410 |
0
|
final Element f = (Element) lines.get(i); |
411 |
0
|
final ElementSet vars = FormulaUtility.getPropositionVariables(f); |
412 |
0
|
final Iterator iter = vars.iterator(); |
413 |
0
|
while (iter.hasNext()) { |
414 |
0
|
final ElementList var = (ElementList) iter.next(); |
415 |
0
|
createReplacement(i, f, var, Operators.EQUIVALENCE_OPERATOR, true); |
416 |
0
|
createReplacement(i, f, var, Operators.EQUIVALENCE_OPERATOR, false); |
417 |
|
} |
418 |
|
} |
419 |
|
|
420 |
|
|
421 |
|
|
422 |
|
|
423 |
|
|
424 |
|
@param |
425 |
|
@param |
426 |
|
@param |
427 |
|
@param |
428 |
|
@param |
429 |
|
@throws |
430 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 3 |
Complexity Density: 0.27 |
|
431 |
18391
|
private void createReplacement(final int i, final Element f,... |
432 |
|
final ElementList var, final String operator, final boolean left) throws ProofException { |
433 |
18391
|
final Iterator a = allPredVars.iterator(); |
434 |
73562
|
while (a.hasNext()) { |
435 |
55172
|
final ElementList var2 = (ElementList) a.next(); |
436 |
55172
|
final ElementList subst = new DefaultElementList(operator); |
437 |
55172
|
if (left) { |
438 |
27587
|
subst.add(var); |
439 |
27587
|
subst.add(var2); |
440 |
|
} else { |
441 |
27585
|
subst.add(var2); |
442 |
27585
|
subst.add(var); |
443 |
|
} |
444 |
55172
|
final Element created = FormulaUtility.replaceOperatorVariable( |
445 |
|
f, var, subst); |
446 |
55172
|
addFormula(created, new SubstPredBo(i, var, subst)); |
447 |
|
} |
448 |
|
} |
449 |
|
|
|
|
| 92% |
Uncovered Elements: 2 (25) |
Complexity: 7 |
Complexity Density: 0.47 |
|
450 |
76390
|
private void addFormula(final Element formula, final Reason reason) throws ProofException {... |
451 |
76390
|
if (!lines.contains(formula)) { |
452 |
45074
|
lines.add(formula); |
453 |
45074
|
reasons.add(reason); |
454 |
|
|
455 |
45074
|
if (goalFormula.equals(formula)) { |
456 |
8
|
final int size = lines.size(); |
457 |
8
|
log.logMessageState(FinderErrors.PROOF_FOUND_TEXT + size); |
458 |
8
|
throw new ProofFoundException(FinderErrors.PROOF_FOUND_CODE, |
459 |
|
FinderErrors.PROOF_FOUND_TEXT + size, |
460 |
|
ProofFinderUtility.shortenProof(lines, reasons, log, trans), context); |
461 |
|
} |
462 |
|
|
463 |
45066
|
if (lines.size() >= maxProofLines) { |
464 |
1
|
final int size = lines.size(); |
465 |
1
|
if (logFrequence > 0) { |
466 |
0
|
log.logMessageState(ProofFinderUtility.getUtf8Line(lines, reasons, lines.size() - 1, |
467 |
|
trans)); |
468 |
|
} |
469 |
1
|
log.logMessageState(FinderErrors.PROOF_NOT_FOUND_TEXT + size); |
470 |
1
|
throw new ProofNotFoundException(FinderErrors.PROOF_NOT_FOUND_CODE, |
471 |
|
FinderErrors.PROOF_NOT_FOUND_TEXT + size, context); |
472 |
|
} |
473 |
45065
|
if (logFrequence > 0 && (lines.size() - 1) % logFrequence == 0) { |
474 |
33
|
log.logMessageState(ProofFinderUtility.getUtf8Line(lines, reasons, lines.size() - 1, |
475 |
|
trans)); |
476 |
|
} |
477 |
|
} |
478 |
|
} |
479 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
480 |
0
|
public String getExecutionActionDescription() {... |
481 |
0
|
return ProofFinderUtility.getUtf8Line(lines, reasons, lines.size() - 1, trans); |
482 |
|
} |
483 |
|
|
484 |
|
|
485 |
|
|
486 |
|
|
|
|
| 85.2% |
Uncovered Elements: 4 (27) |
Complexity: 9 |
Complexity Density: 0.6 |
|
487 |
|
private abstract class SubstituteBase implements Substitute { |
488 |
|
|
489 |
|
|
490 |
|
private int next = 0; |
491 |
|
|
492 |
|
|
493 |
|
private final int weight; |
494 |
|
|
495 |
|
|
496 |
|
private final int order; |
497 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
498 |
20
|
SubstituteBase(final int weight, final int order) {... |
499 |
20
|
this.weight = weight; |
500 |
20
|
this.order = order; |
501 |
|
} |
502 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
503 |
10490
|
public int getWeight() {... |
504 |
10490
|
return weight; |
505 |
|
} |
506 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
507 |
24
|
public int getOrder() {... |
508 |
24
|
return order; |
509 |
|
} |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
510 |
7700
|
public int nextLine() {... |
511 |
7700
|
return next; |
512 |
|
} |
513 |
|
|
|
|
| 71.4% |
Uncovered Elements: 4 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
514 |
13
|
public int compareTo(final Object obj) {... |
515 |
13
|
if (obj instanceof Substitute) { |
516 |
13
|
Substitute sub = (Substitute) obj; |
517 |
|
|
518 |
|
|
519 |
13
|
if (order == sub.getOrder()) { |
520 |
2
|
return -1; |
521 |
|
} |
522 |
11
|
if (order < sub.getOrder()) { |
523 |
11
|
return -1; |
524 |
|
} |
525 |
0
|
return 1; |
526 |
|
} |
527 |
0
|
return -1; |
528 |
|
} |
529 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
530 |
7700
|
public void substitute() throws ProofException {... |
531 |
7700
|
substitute(next); |
532 |
7699
|
next++; |
533 |
|
} |
534 |
|
|
535 |
|
public abstract void substitute(int i) throws ProofException; |
536 |
|
|
537 |
|
} |
538 |
|
|
539 |
|
|
540 |
|
|
541 |
|
|
542 |
|
|
543 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
544 |
|
interface Substitute extends Comparable { |
545 |
|
|
546 |
|
|
547 |
|
|
548 |
|
|
549 |
|
@return |
550 |
|
|
551 |
|
public int nextLine(); |
552 |
|
|
553 |
|
|
554 |
|
|
555 |
|
|
556 |
|
@throws |
557 |
|
|
558 |
|
public void substitute() throws ProofException; |
559 |
|
|
560 |
|
|
561 |
|
|
562 |
|
|
563 |
|
|
564 |
|
@return |
565 |
|
|
566 |
|
public int getWeight(); |
567 |
|
|
568 |
|
|
569 |
|
|
570 |
|
|
571 |
|
|
572 |
|
@return |
573 |
|
|
574 |
|
public int getOrder(); |
575 |
|
|
576 |
|
} |
577 |
|
|
578 |
|
} |