1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.kernel.bo.logic.proof.checker; |
17 |
|
|
18 |
|
import java.util.HashMap; |
19 |
|
import java.util.Map; |
20 |
|
|
21 |
|
import org.qedeq.base.io.Version; |
22 |
|
import org.qedeq.base.utility.Enumerator; |
23 |
|
import org.qedeq.base.utility.EqualsUtility; |
24 |
|
import org.qedeq.base.utility.StringUtility; |
25 |
|
import org.qedeq.kernel.bo.logic.common.FormulaUtility; |
26 |
|
import org.qedeq.kernel.bo.logic.common.LogicalCheckExceptionList; |
27 |
|
import org.qedeq.kernel.bo.logic.common.Operators; |
28 |
|
import org.qedeq.kernel.bo.logic.common.ReferenceResolver; |
29 |
|
import org.qedeq.kernel.bo.logic.proof.common.ProofChecker; |
30 |
|
import org.qedeq.kernel.bo.logic.proof.common.RuleChecker; |
31 |
|
import org.qedeq.kernel.se.base.list.Element; |
32 |
|
import org.qedeq.kernel.se.base.list.ElementList; |
33 |
|
import org.qedeq.kernel.se.base.module.Add; |
34 |
|
import org.qedeq.kernel.se.base.module.Existential; |
35 |
|
import org.qedeq.kernel.se.base.module.FormalProofLine; |
36 |
|
import org.qedeq.kernel.se.base.module.FormalProofLineList; |
37 |
|
import org.qedeq.kernel.se.base.module.ModusPonens; |
38 |
|
import org.qedeq.kernel.se.base.module.Reason; |
39 |
|
import org.qedeq.kernel.se.base.module.Rename; |
40 |
|
import org.qedeq.kernel.se.base.module.Rule; |
41 |
|
import org.qedeq.kernel.se.base.module.SubstFree; |
42 |
|
import org.qedeq.kernel.se.base.module.SubstFunc; |
43 |
|
import org.qedeq.kernel.se.base.module.SubstPred; |
44 |
|
import org.qedeq.kernel.se.base.module.Universal; |
45 |
|
import org.qedeq.kernel.se.common.ModuleContext; |
46 |
|
import org.qedeq.kernel.se.common.RuleKey; |
47 |
|
import org.qedeq.kernel.se.dto.list.DefaultElementList; |
48 |
|
import org.qedeq.kernel.se.dto.list.ElementSet; |
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
@author |
55 |
|
|
|
|
| 70.1% |
Uncovered Elements: 163 (545) |
Complexity: 96 |
Complexity Density: 0.25 |
|
56 |
|
public class ProofChecker1Impl implements ProofChecker { |
57 |
|
|
58 |
|
|
59 |
|
private FormalProofLineList proof; |
60 |
|
|
61 |
|
|
62 |
|
private ModuleContext moduleContext; |
63 |
|
|
64 |
|
|
65 |
|
private ModuleContext currentContext; |
66 |
|
|
67 |
|
|
68 |
|
private ReferenceResolver resolver; |
69 |
|
|
70 |
|
|
71 |
|
private LogicalCheckExceptionList exceptions; |
72 |
|
|
73 |
|
|
74 |
|
private boolean[] lineProved; |
75 |
|
|
76 |
|
|
77 |
|
private Map label2line; |
78 |
|
|
79 |
|
|
80 |
|
private final Version ruleVersion; |
81 |
|
|
82 |
|
|
83 |
|
private RuleChecker checker; |
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
89 |
42
|
public ProofChecker1Impl() {... |
90 |
42
|
this.ruleVersion = new Version("0.01.00"); |
91 |
|
} |
92 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
93 |
0
|
public LogicalCheckExceptionList checkRule(final Rule rule,... |
94 |
|
final ModuleContext context, final RuleChecker checker, |
95 |
|
final ReferenceResolver resolver) { |
96 |
0
|
exceptions = new LogicalCheckExceptionList(); |
97 |
0
|
final RuleKey ruleKey = new RuleKey(rule.getName(), rule.getVersion()); |
98 |
0
|
if (rule.getVersion() == null || !ruleVersion.equals(rule.getVersion())) { |
99 |
0
|
final ProofCheckException ex = new ProofCheckException( |
100 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_CODE, |
101 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_TEXT + ruleKey |
102 |
|
+ BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_TEXT2 + "{" + ruleVersion + "}", |
103 |
|
context); |
104 |
0
|
exceptions.add(ex); |
105 |
|
} |
106 |
0
|
return exceptions; |
107 |
|
} |
108 |
|
|
|
|
| 86.5% |
Uncovered Elements: 12 (89) |
Complexity: 20 |
Complexity Density: 0.35 |
|
109 |
43
|
public LogicalCheckExceptionList checkProof(final Element formula,... |
110 |
|
final FormalProofLineList proof, |
111 |
|
final RuleChecker checker, |
112 |
|
final ModuleContext moduleContext, |
113 |
|
final ReferenceResolver resolver) { |
114 |
43
|
this.proof = proof; |
115 |
43
|
this.resolver = resolver; |
116 |
43
|
this.moduleContext = moduleContext; |
117 |
43
|
this.checker = checker; |
118 |
|
|
119 |
43
|
currentContext = new ModuleContext(moduleContext); |
120 |
43
|
exceptions = new LogicalCheckExceptionList(); |
121 |
43
|
final String context = moduleContext.getLocationWithinModule(); |
122 |
43
|
lineProved = new boolean[proof.size()]; |
123 |
43
|
label2line = new HashMap(); |
124 |
450
|
for (int i = 0; i < proof.size(); i++) { |
125 |
407
|
boolean ok = true; |
126 |
407
|
setLocationWithinModule(context + ".get(" + i + ")"); |
127 |
407
|
final FormalProofLine line = proof.get(i); |
128 |
407
|
if (line == null || line.getFormula() == null |
129 |
|
|| line.getFormula().getElement() == null) { |
130 |
0
|
ok = false; |
131 |
0
|
handleProofCheckException( |
132 |
|
BasicProofErrors.PROOF_LINE_MUST_NOT_BE_NULL_CODE, |
133 |
|
BasicProofErrors.PROOF_LINE_MUST_NOT_BE_NULL_TEXT, |
134 |
|
getCurrentContext()); |
135 |
0
|
continue; |
136 |
|
} |
137 |
407
|
setLocationWithinModule(context + ".get(" + i + ").getReason()"); |
138 |
407
|
final Reason reason = line.getReason(); |
139 |
407
|
if (reason == null) { |
140 |
0
|
ok = false; |
141 |
0
|
handleProofCheckException( |
142 |
|
BasicProofErrors.REASON_MUST_NOT_BE_NULL_CODE, |
143 |
|
BasicProofErrors.REASON_MUST_NOT_BE_NULL_TEXT, |
144 |
|
getCurrentContext()); |
145 |
0
|
continue; |
146 |
|
} |
147 |
407
|
if (line.getLabel() != null && line.getLabel().length() > 0) { |
148 |
406
|
final Integer n = (Integer) label2line.get(line.getLabel()); |
149 |
406
|
if (n != null) { |
150 |
8
|
final ModuleContext lc = new ModuleContext(moduleContext.getModuleLocation(), |
151 |
|
moduleContext.getLocationWithinModule() + ".get(" |
152 |
|
+ label2line.get(line.getLabel()) |
153 |
|
+ ").getLabel()"); |
154 |
8
|
setLocationWithinModule(context + ".get(" + i + ").getLabel()"); |
155 |
8
|
handleProofCheckException( |
156 |
|
BasicProofErrors.LOCAL_LABEL_ALREADY_EXISTS_CODE, |
157 |
|
BasicProofErrors.LOCAL_LABEL_ALREADY_EXISTS_TEXT |
158 |
|
+ line.getLabel(), |
159 |
|
getCurrentContext(), |
160 |
|
lc); |
161 |
|
} |
162 |
406
|
label2line.put(line.getLabel(), new Integer(i)); |
163 |
|
} |
164 |
|
|
165 |
|
|
166 |
|
|
167 |
407
|
String getReason = ".get" + StringUtility.getClassName(reason.getClass()); |
168 |
407
|
if (getReason.endsWith("Vo")) { |
169 |
407
|
getReason = getReason.substring(0, getReason.length() - 2) + "()"; |
170 |
407
|
setLocationWithinModule(context + ".get(" + i + ").getReason()" |
171 |
|
+ getReason); |
172 |
|
} |
173 |
407
|
if (reason instanceof Add) { |
174 |
94
|
ok = check((Add) reason, i, line.getFormula().getElement()); |
175 |
313
|
} else if (reason instanceof Rename) { |
176 |
47
|
ok = check((Rename) reason, i, line.getFormula().getElement()); |
177 |
266
|
} else if (reason instanceof ModusPonens) { |
178 |
58
|
ok = check((ModusPonens) reason, i, line.getFormula().getElement()); |
179 |
208
|
} else if (reason instanceof SubstFree) { |
180 |
29
|
ok = check((SubstFree) reason, i, line.getFormula().getElement()); |
181 |
179
|
} else if (reason instanceof SubstPred) { |
182 |
143
|
ok = check((SubstPred) reason, i, line.getFormula().getElement()); |
183 |
36
|
} else if (reason instanceof SubstFunc) { |
184 |
7
|
ok = check((SubstFunc) reason, i, line.getFormula().getElement()); |
185 |
29
|
} else if (reason instanceof Universal) { |
186 |
24
|
ok = check((Universal) reason, i, line.getFormula().getElement()); |
187 |
5
|
} else if (reason instanceof Existential) { |
188 |
5
|
ok = check((Existential) reason, i, line.getFormula().getElement()); |
189 |
|
} else { |
190 |
0
|
ok = false; |
191 |
0
|
handleProofCheckException( |
192 |
|
BasicProofErrors.THIS_IS_NO_ALLOWED_BASIC_REASON_CODE, |
193 |
|
BasicProofErrors.THIS_IS_NO_ALLOWED_BASIC_REASON_TEXT |
194 |
|
+ reason.getName(), |
195 |
|
getCurrentContext()); |
196 |
|
} |
197 |
407
|
lineProved[i] = ok; |
198 |
|
|
199 |
407
|
if (i == proof.size() - 1) { |
200 |
43
|
if (!formula.equals(line.getFormula().getElement())) { |
201 |
3
|
handleProofCheckException( |
202 |
|
BasicProofErrors.LAST_PROOF_LINE_MUST_BE_IDENTICAL_TO_PROPOSITION_CODE, |
203 |
|
BasicProofErrors.LAST_PROOF_LINE_MUST_BE_IDENTICAL_TO_PROPOSITION_TEXT |
204 |
|
+ reason.getName(), |
205 |
|
getModuleContextOfProofLineFormula(i)); |
206 |
|
} |
207 |
|
} |
208 |
|
} |
209 |
43
|
return exceptions; |
210 |
|
} |
211 |
|
|
|
|
| 68.4% |
Uncovered Elements: 12 (38) |
Complexity: 6 |
Complexity Density: 0.21 |
|
212 |
94
|
private boolean check(final Add add, final int i, final Element element) {... |
213 |
94
|
final String context = currentContext.getLocationWithinModule(); |
214 |
94
|
boolean ok = true; |
215 |
94
|
if (add.getReference() == null) { |
216 |
1
|
ok = false; |
217 |
1
|
setLocationWithinModule(context + ".getReference()"); |
218 |
1
|
handleProofCheckException( |
219 |
|
BasicProofErrors.REFERENCE_TO_PROVED_FORMULA_IS_MISSING_CODE, |
220 |
|
BasicProofErrors.REFERENCE_TO_PROVED_FORMULA_IS_MISSING_TEXT, |
221 |
|
getCurrentContext()); |
222 |
1
|
return ok; |
223 |
|
} |
224 |
93
|
if (!resolver.isProvedFormula(add.getReference())) { |
225 |
4
|
ok = false; |
226 |
4
|
setLocationWithinModule(context + ".getReference()"); |
227 |
4
|
handleProofCheckException( |
228 |
|
BasicProofErrors.THIS_IS_NO_REFERENCE_TO_A_PROVED_FORMULA_CODE, |
229 |
|
BasicProofErrors.THIS_IS_NO_REFERENCE_TO_A_PROVED_FORMULA_TEXT |
230 |
|
+ add.getReference(), |
231 |
|
getCurrentContext()); |
232 |
4
|
return ok; |
233 |
|
} |
234 |
89
|
final Element expected = resolver.getNormalizedReferenceFormula(add.getReference()); |
235 |
89
|
final Element current = resolver.getNormalizedFormula(element); |
236 |
89
|
if (!EqualsUtility.equals(expected, current)) { |
237 |
0
|
ok = false; |
238 |
0
|
handleProofCheckException( |
239 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_CODE, |
240 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_TEXT |
241 |
|
+ add.getReference(), |
242 |
|
getDiffModuleContextOfProofLineFormula(i, expected)); |
243 |
0
|
return ok; |
244 |
|
} |
245 |
89
|
final RuleKey defined = checker.getRule(add.getName()); |
246 |
89
|
if (defined == null) { |
247 |
0
|
ok = false; |
248 |
0
|
handleProofCheckException( |
249 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_CODE, |
250 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_TEXT |
251 |
|
+ add.getName(), |
252 |
|
getCurrentContext()); |
253 |
0
|
return ok; |
254 |
89
|
} else if (!ruleVersion.equals(defined.getVersion())) { |
255 |
0
|
ok = false; |
256 |
0
|
handleProofCheckException( |
257 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_CODE, |
258 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_TEXT + defined.getVersion(), |
259 |
|
getCurrentContext()); |
260 |
0
|
return ok; |
261 |
|
} |
262 |
89
|
return ok; |
263 |
|
} |
264 |
|
|
|
|
| 75% |
Uncovered Elements: 8 (32) |
Complexity: 5 |
Complexity Density: 0.21 |
|
265 |
47
|
private boolean check(final Rename rename, final int i, final Element element) {... |
266 |
47
|
final String context = currentContext.getLocationWithinModule(); |
267 |
47
|
boolean ok = true; |
268 |
47
|
final Integer n = (Integer) label2line.get(rename.getReference()); |
269 |
47
|
if (n == null) { |
270 |
3
|
ok = false; |
271 |
3
|
setLocationWithinModule(context + ".getReference()"); |
272 |
3
|
handleProofCheckException( |
273 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_CODE, |
274 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_TEXT |
275 |
|
+ rename.getReference(), |
276 |
|
getCurrentContext()); |
277 |
|
|
278 |
|
|
279 |
|
|
280 |
|
|
281 |
|
|
282 |
|
|
283 |
|
|
284 |
|
|
285 |
|
} else { |
286 |
44
|
final Element f = getNormalizedProofLine(n); |
287 |
44
|
final Element expected = FormulaUtility.replaceSubjectVariableQuantifier( |
288 |
|
rename.getOriginalSubjectVariable(), |
289 |
|
rename.getReplacementSubjectVariable(), f, rename.getOccurrence(), |
290 |
|
new Enumerator()); |
291 |
44
|
final Element current = resolver.getNormalizedFormula(element); |
292 |
44
|
if (!EqualsUtility.equals(expected, current)) { |
293 |
7
|
ok = false; |
294 |
7
|
handleProofCheckException( |
295 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_CODE, |
296 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_TEXT |
297 |
|
+ rename.getReference(), |
298 |
|
getDiffModuleContextOfProofLineFormula(i, expected)); |
299 |
|
} else { |
300 |
37
|
ok = true; |
301 |
|
} |
302 |
|
} |
303 |
47
|
final RuleKey defined = checker.getRule(rename.getName()); |
304 |
47
|
if (defined == null) { |
305 |
0
|
ok = false; |
306 |
0
|
handleProofCheckException( |
307 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_CODE, |
308 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_TEXT |
309 |
|
+ rename.getName(), |
310 |
|
getCurrentContext()); |
311 |
0
|
return ok; |
312 |
47
|
} else if (!ruleVersion.equals(defined.getVersion())) { |
313 |
0
|
ok = false; |
314 |
0
|
handleProofCheckException( |
315 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_CODE, |
316 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_TEXT + defined.getVersion(), |
317 |
|
getCurrentContext()); |
318 |
0
|
return ok; |
319 |
|
} |
320 |
47
|
return ok; |
321 |
|
} |
322 |
|
|
|
|
| 75% |
Uncovered Elements: 8 (32) |
Complexity: 5 |
Complexity Density: 0.21 |
|
323 |
29
|
private boolean check(final SubstFree substFree, final int i, final Element element) {... |
324 |
29
|
final String context = currentContext.getLocationWithinModule(); |
325 |
29
|
boolean ok = true; |
326 |
29
|
final Integer n = (Integer) label2line.get(substFree.getReference()); |
327 |
29
|
if (n == null) { |
328 |
1
|
ok = false; |
329 |
1
|
setLocationWithinModule(context + ".getReference()"); |
330 |
1
|
handleProofCheckException( |
331 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_CODE, |
332 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_TEXT |
333 |
|
+ substFree.getReference(), |
334 |
|
getCurrentContext()); |
335 |
|
|
336 |
|
|
337 |
|
|
338 |
|
|
339 |
|
|
340 |
|
|
341 |
|
|
342 |
|
|
343 |
|
} else { |
344 |
28
|
final Element f = getNormalizedProofLine(n); |
345 |
28
|
final Element current = resolver.getNormalizedFormula(element); |
346 |
28
|
final Element expected = f.replace(substFree.getSubjectVariable(), |
347 |
|
resolver.getNormalizedFormula(substFree.getSubstituteTerm())); |
348 |
28
|
if (!EqualsUtility.equals(current, expected)) { |
349 |
5
|
ok = false; |
350 |
5
|
handleProofCheckException( |
351 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_CODE, |
352 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_TEXT |
353 |
|
+ substFree.getReference(), |
354 |
|
getDiffModuleContextOfProofLineFormula(i, expected)); |
355 |
5
|
return ok; |
356 |
|
} |
357 |
|
} |
358 |
24
|
final RuleKey defined = checker.getRule(substFree.getName()); |
359 |
24
|
if (defined == null) { |
360 |
0
|
ok = false; |
361 |
0
|
handleProofCheckException( |
362 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_CODE, |
363 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_TEXT |
364 |
|
+ substFree.getName(), |
365 |
|
getCurrentContext()); |
366 |
0
|
return ok; |
367 |
24
|
} else if (!ruleVersion.equals(defined.getVersion())) { |
368 |
0
|
ok = false; |
369 |
0
|
handleProofCheckException( |
370 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_CODE, |
371 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_TEXT + defined.getVersion(), |
372 |
|
getCurrentContext()); |
373 |
0
|
return ok; |
374 |
|
} |
375 |
24
|
return ok; |
376 |
|
} |
377 |
|
|
|
|
| 62.7% |
Uncovered Elements: 28 (75) |
Complexity: 11 |
Complexity Density: 0.2 |
|
378 |
143
|
private boolean check(final SubstPred substPred, final int i, final Element element) {... |
379 |
143
|
final String context = currentContext.getLocationWithinModule(); |
380 |
143
|
boolean ok = true; |
381 |
143
|
final Integer n = (Integer) label2line.get(substPred.getReference()); |
382 |
143
|
if (n == null) { |
383 |
10
|
ok = false; |
384 |
10
|
setLocationWithinModule(context + ".getReference()"); |
385 |
10
|
handleProofCheckException( |
386 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_CODE, |
387 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_TEXT |
388 |
|
+ substPred.getReference(), |
389 |
|
getCurrentContext()); |
390 |
|
|
391 |
|
|
392 |
|
|
393 |
|
|
394 |
|
|
395 |
|
|
396 |
|
|
397 |
|
|
398 |
|
} else { |
399 |
133
|
final Element alpha = getNormalizedProofLine(n); |
400 |
133
|
final Element current = resolver.getNormalizedFormula(element); |
401 |
133
|
if (substPred.getSubstituteFormula() == null) { |
402 |
4
|
ok = false; |
403 |
4
|
handleProofCheckException( |
404 |
|
BasicProofErrors.SUBSTITUTION_FORMULA_IS_MISSING_CODE, |
405 |
|
BasicProofErrors.SUBSTITUTION_FORMULA_IS_MISSING_TEXT, |
406 |
|
getCurrentContext()); |
407 |
4
|
return ok; |
408 |
|
} |
409 |
129
|
final Element p = resolver.getNormalizedFormula(substPred.getPredicateVariable()); |
410 |
129
|
final Element beta = resolver.getNormalizedFormula(substPred.getSubstituteFormula()); |
411 |
129
|
final Element expected = FormulaUtility.replaceOperatorVariable(alpha, p, beta); |
412 |
129
|
if (!EqualsUtility.equals(current, expected)) { |
413 |
4
|
ok = false; |
414 |
4
|
handleProofCheckException( |
415 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_CODE, |
416 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_TEXT |
417 |
|
+ substPred.getReference(), |
418 |
|
getDiffModuleContextOfProofLineFormula(i, expected)); |
419 |
4
|
return ok; |
420 |
|
} |
421 |
|
|
422 |
|
|
423 |
125
|
final ElementSet predFree = FormulaUtility.getFreeSubjectVariables(p); |
424 |
125
|
if (predFree.size() != p.getList().size() - 1) { |
425 |
0
|
ok = false; |
426 |
0
|
setLocationWithinModule(context + ".getPredicateVariable()"); |
427 |
0
|
handleProofCheckException( |
428 |
|
BasicProofErrors.ONLY_FREE_SUBJECT_VARIABLES_ALLOWED_CODE, |
429 |
|
BasicProofErrors.ONLY_FREE_SUBJECT_VARIABLES_ALLOWED_TEXT, |
430 |
|
getDiffModuleContextOfProofLineFormula(i, expected)); |
431 |
0
|
return ok; |
432 |
|
} |
433 |
145
|
for (int j = 1; j < p.getList().size(); j++) { |
434 |
20
|
if (!FormulaUtility.isSubjectVariable(p.getList().getElement(j))) { |
435 |
0
|
ok = false; |
436 |
0
|
setLocationWithinModule(context + ".getPredicateVariable()"); |
437 |
0
|
handleProofCheckException( |
438 |
|
BasicProofErrors.ONLY_FREE_SUBJECT_VARIABLES_ALLOWED_CODE, |
439 |
|
BasicProofErrors.ONLY_FREE_SUBJECT_VARIABLES_ALLOWED_TEXT, |
440 |
|
getCurrentContext()); |
441 |
0
|
return ok; |
442 |
|
} |
443 |
|
} |
444 |
|
|
445 |
|
|
446 |
125
|
final ElementSet fBound = FormulaUtility.getBoundSubjectVariables(alpha); |
447 |
125
|
final ElementSet betaFree = FormulaUtility.getFreeSubjectVariables(beta); |
448 |
125
|
if (!fBound.intersection(betaFree.minus(predFree)).isEmpty()) { |
449 |
0
|
ok = false; |
450 |
0
|
setLocationWithinModule(context + ".getSubstituteFormula()"); |
451 |
0
|
handleProofCheckException( |
452 |
|
BasicProofErrors.FREE_SUBJECT_VARIABLES_SHOULD_NOT_GET_BOUND_CODE, |
453 |
|
BasicProofErrors.FREE_SUBJECT_VARIABLES_SHOULD_NOT_GET_BOUND_TEXT, |
454 |
|
getCurrentContext()); |
455 |
0
|
return ok; |
456 |
|
} |
457 |
|
|
458 |
|
|
459 |
125
|
final ElementSet betaBound = FormulaUtility.getBoundSubjectVariables(beta); |
460 |
125
|
if (!FormulaUtility.testOperatorVariable(alpha, p, betaBound)) { |
461 |
0
|
ok = false; |
462 |
0
|
setLocationWithinModule(context + ".getSubstituteFormula()"); |
463 |
0
|
handleProofCheckException( |
464 |
|
BasicProofErrors.SUBSTITUTION_LOCATION_CONTAINS_BOUND_SUBJECT_VARIABLE_CODE, |
465 |
|
BasicProofErrors.SUBSTITUTION_LOCATION_CONTAINS_BOUND_SUBJECT_VARIABLE_TEXT, |
466 |
|
getCurrentContext()); |
467 |
0
|
return ok; |
468 |
|
} |
469 |
|
|
470 |
|
|
471 |
|
} |
472 |
135
|
final RuleKey defined = checker.getRule(substPred.getName()); |
473 |
135
|
if (defined == null) { |
474 |
0
|
ok = false; |
475 |
0
|
handleProofCheckException( |
476 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_CODE, |
477 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_TEXT |
478 |
|
+ substPred.getName(), |
479 |
|
getCurrentContext()); |
480 |
0
|
return ok; |
481 |
135
|
} else if (!ruleVersion.equals(defined.getVersion())) { |
482 |
0
|
ok = false; |
483 |
0
|
handleProofCheckException( |
484 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_CODE, |
485 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_TEXT + defined.getVersion(), |
486 |
|
getCurrentContext()); |
487 |
0
|
return ok; |
488 |
|
} |
489 |
135
|
return ok; |
490 |
|
} |
491 |
|
|
|
|
| 57.3% |
Uncovered Elements: 32 (75) |
Complexity: 11 |
Complexity Density: 0.2 |
|
492 |
7
|
private boolean check(final SubstFunc substFunc, final int i, final Element element) {... |
493 |
7
|
final String context = currentContext.getLocationWithinModule(); |
494 |
7
|
boolean ok = true; |
495 |
7
|
final Integer n = (Integer) label2line.get(substFunc.getReference()); |
496 |
7
|
if (n == null) { |
497 |
1
|
ok = false; |
498 |
1
|
setLocationWithinModule(context + ".getReference()"); |
499 |
1
|
handleProofCheckException( |
500 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_CODE, |
501 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_TEXT |
502 |
|
+ substFunc.getReference(), |
503 |
|
getCurrentContext()); |
504 |
|
|
505 |
|
|
506 |
|
|
507 |
|
|
508 |
|
|
509 |
|
|
510 |
|
|
511 |
|
|
512 |
|
} else { |
513 |
6
|
final Element alpha = getNormalizedProofLine(n); |
514 |
6
|
final Element current = resolver.getNormalizedFormula(element); |
515 |
6
|
if (substFunc.getSubstituteTerm() == null) { |
516 |
0
|
ok = false; |
517 |
0
|
handleProofCheckException( |
518 |
|
BasicProofErrors.SUBSTITUTION_FORMULA_IS_MISSING_CODE, |
519 |
|
BasicProofErrors.SUBSTITUTION_FORMULA_IS_MISSING_TEXT, |
520 |
|
getCurrentContext()); |
521 |
0
|
return ok; |
522 |
|
} |
523 |
6
|
final Element sigma = resolver.getNormalizedFormula(substFunc.getFunctionVariable()); |
524 |
6
|
final Element tau = resolver.getNormalizedFormula(substFunc.getSubstituteTerm()); |
525 |
6
|
final Element expected = FormulaUtility.replaceOperatorVariable(alpha, sigma, tau); |
526 |
6
|
if (!EqualsUtility.equals(current, expected)) { |
527 |
1
|
ok = false; |
528 |
1
|
handleProofCheckException( |
529 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_CODE, |
530 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_TEXT |
531 |
|
+ substFunc.getReference(), |
532 |
|
getDiffModuleContextOfProofLineFormula(i, expected)); |
533 |
1
|
return ok; |
534 |
|
} |
535 |
|
|
536 |
|
|
537 |
5
|
final ElementSet funcFree = FormulaUtility.getFreeSubjectVariables(sigma); |
538 |
5
|
if (funcFree.size() != sigma.getList().size() - 1) { |
539 |
0
|
ok = false; |
540 |
0
|
setLocationWithinModule(context + ".getPredicateVariable()"); |
541 |
0
|
handleProofCheckException( |
542 |
|
BasicProofErrors.ONLY_FREE_SUBJECT_VARIABLES_ALLOWED_CODE, |
543 |
|
BasicProofErrors.ONLY_FREE_SUBJECT_VARIABLES_ALLOWED_TEXT, |
544 |
|
getDiffModuleContextOfProofLineFormula(i, expected)); |
545 |
0
|
return ok; |
546 |
|
} |
547 |
10
|
for (int j = 1; j < sigma.getList().size(); j++) { |
548 |
5
|
if (!FormulaUtility.isSubjectVariable(sigma.getList().getElement(j))) { |
549 |
0
|
ok = false; |
550 |
0
|
setLocationWithinModule(context + ".getPredicateVariable()"); |
551 |
0
|
handleProofCheckException( |
552 |
|
BasicProofErrors.ONLY_FREE_SUBJECT_VARIABLES_ALLOWED_CODE, |
553 |
|
BasicProofErrors.ONLY_FREE_SUBJECT_VARIABLES_ALLOWED_TEXT, |
554 |
|
getCurrentContext()); |
555 |
0
|
return ok; |
556 |
|
} |
557 |
|
} |
558 |
|
|
559 |
|
|
560 |
5
|
final ElementSet fBound = FormulaUtility.getBoundSubjectVariables(alpha); |
561 |
5
|
final ElementSet sigmaFree = FormulaUtility.getFreeSubjectVariables(tau); |
562 |
5
|
if (!fBound.intersection(sigmaFree.minus(funcFree)).isEmpty()) { |
563 |
0
|
ok = false; |
564 |
0
|
setLocationWithinModule(context + ".getSubstituteFormula()"); |
565 |
0
|
handleProofCheckException( |
566 |
|
BasicProofErrors.FREE_SUBJECT_VARIABLES_SHOULD_NOT_GET_BOUND_CODE, |
567 |
|
BasicProofErrors.FREE_SUBJECT_VARIABLES_SHOULD_NOT_GET_BOUND_TEXT, |
568 |
|
getCurrentContext()); |
569 |
0
|
return ok; |
570 |
|
} |
571 |
|
|
572 |
|
|
573 |
5
|
final ElementSet sigmaBound = FormulaUtility.getBoundSubjectVariables(tau); |
574 |
5
|
if (!FormulaUtility.testOperatorVariable(alpha, sigma, sigmaBound)) { |
575 |
0
|
ok = false; |
576 |
0
|
setLocationWithinModule(context + ".getSubstituteFormula()"); |
577 |
0
|
handleProofCheckException( |
578 |
|
BasicProofErrors.SUBSTITUTION_LOCATION_CONTAINS_BOUND_SUBJECT_VARIABLE_CODE, |
579 |
|
BasicProofErrors.SUBSTITUTION_LOCATION_CONTAINS_BOUND_SUBJECT_VARIABLE_TEXT, |
580 |
|
getCurrentContext()); |
581 |
0
|
return ok; |
582 |
|
} |
583 |
|
|
584 |
|
|
585 |
|
} |
586 |
6
|
final RuleKey defined = checker.getRule(substFunc.getName()); |
587 |
6
|
if (defined == null) { |
588 |
0
|
ok = false; |
589 |
0
|
handleProofCheckException( |
590 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_CODE, |
591 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_TEXT |
592 |
|
+ substFunc.getName(), |
593 |
|
getCurrentContext()); |
594 |
0
|
return ok; |
595 |
6
|
} else if (!ruleVersion.equals(defined.getVersion())) { |
596 |
0
|
ok = false; |
597 |
0
|
handleProofCheckException( |
598 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_CODE, |
599 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_TEXT + defined.getVersion(), |
600 |
|
getCurrentContext()); |
601 |
0
|
return ok; |
602 |
|
} |
603 |
6
|
return ok; |
604 |
|
} |
605 |
|
|
|
|
| 70.9% |
Uncovered Elements: 16 (55) |
Complexity: 9 |
Complexity Density: 0.23 |
|
606 |
58
|
private boolean check(final ModusPonens mp, final int i, final Element element) {... |
607 |
58
|
final String context = currentContext.getLocationWithinModule(); |
608 |
58
|
boolean ok = true; |
609 |
58
|
final Integer n1 = (Integer) label2line.get(mp.getReference1()); |
610 |
58
|
if (n1 == null) { |
611 |
6
|
ok = false; |
612 |
6
|
setLocationWithinModule(context + ".getReference1()"); |
613 |
6
|
handleProofCheckException( |
614 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_CODE, |
615 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_TEXT |
616 |
|
+ mp.getReference1(), |
617 |
|
getCurrentContext()); |
618 |
|
|
619 |
|
|
620 |
|
|
621 |
|
|
622 |
|
|
623 |
|
|
624 |
|
|
625 |
|
|
626 |
|
} |
627 |
58
|
final Integer n2 = (Integer) label2line.get(mp.getReference2()); |
628 |
58
|
if (n2 == null) { |
629 |
4
|
ok = false; |
630 |
4
|
setLocationWithinModule(context + ".getReference2()"); |
631 |
4
|
handleProofCheckException( |
632 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_CODE, |
633 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_TEXT |
634 |
|
+ mp.getReference2(), |
635 |
|
getCurrentContext()); |
636 |
|
|
637 |
|
|
638 |
|
|
639 |
|
|
640 |
|
|
641 |
|
|
642 |
|
|
643 |
|
|
644 |
|
} |
645 |
58
|
if (ok) { |
646 |
52
|
final Element f1 = getNormalizedProofLine(n1); |
647 |
52
|
final Element f2 = getNormalizedProofLine(n2); |
648 |
52
|
final Element current = getNormalizedProofLine(i); |
649 |
52
|
if (!FormulaUtility.isImplication(f1)) { |
650 |
0
|
ok = false; |
651 |
0
|
setLocationWithinModule(context + ".getReference1()"); |
652 |
0
|
handleProofCheckException( |
653 |
|
BasicProofErrors.IMPLICATION_EXPECTED_CODE, |
654 |
|
BasicProofErrors.IMPLICATION_EXPECTED_TEXT |
655 |
|
+ mp.getReference1(), |
656 |
|
getCurrentContext()); |
657 |
52
|
} else if (!f2.equals(f1.getList().getElement(0))) { |
658 |
1
|
ok = false; |
659 |
1
|
setLocationWithinModule(context + ".getReference2()"); |
660 |
1
|
handleProofCheckException( |
661 |
|
BasicProofErrors.MUST_BE_HYPOTHESIS_OF_FIRST_REFERENCE_CODE, |
662 |
|
BasicProofErrors.MUST_BE_HYPOTHESIS_OF_FIRST_REFERENCE_TEXT |
663 |
|
+ mp.getReference2(), |
664 |
|
getCurrentContext(), |
665 |
|
getModuleContextOfProofLineFormula(n1.intValue())); |
666 |
51
|
} else if (!current.equals(f1.getList().getElement(1))) { |
667 |
0
|
ok = false; |
668 |
0
|
setLocationWithinModule(context + ".getReference1()"); |
669 |
0
|
handleProofCheckException( |
670 |
|
BasicProofErrors.CURRENT_MUST_BE_CONCLUSION_CODE, |
671 |
|
BasicProofErrors.CURRENT_MUST_BE_CONCLUSION_TEXT |
672 |
|
+ mp.getReference1(), |
673 |
|
getCurrentContext(), |
674 |
|
getModuleContextOfProofLineFormula(n1.intValue())); |
675 |
|
} else { |
676 |
51
|
ok = true; |
677 |
|
} |
678 |
|
} |
679 |
58
|
final RuleKey defined = checker.getRule(mp.getName()); |
680 |
58
|
if (defined == null) { |
681 |
0
|
ok = false; |
682 |
0
|
handleProofCheckException( |
683 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_CODE, |
684 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_TEXT |
685 |
|
+ mp.getName(), |
686 |
|
getCurrentContext()); |
687 |
0
|
return ok; |
688 |
58
|
} else if (!ruleVersion.equals(defined.getVersion())) { |
689 |
0
|
ok = false; |
690 |
0
|
handleProofCheckException( |
691 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_CODE, |
692 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_TEXT + defined.getVersion(), |
693 |
|
getCurrentContext()); |
694 |
0
|
return ok; |
695 |
|
} |
696 |
58
|
return ok; |
697 |
|
} |
698 |
|
|
|
|
| 74.5% |
Uncovered Elements: 13 (51) |
Complexity: 7 |
Complexity Density: 0.18 |
|
699 |
24
|
private boolean check(final Universal universal, final int i, final Element element) {... |
700 |
24
|
final String context = currentContext.getLocationWithinModule(); |
701 |
24
|
boolean ok = true; |
702 |
24
|
final Integer n = (Integer) label2line.get(universal.getReference()); |
703 |
24
|
if (n == null) { |
704 |
1
|
ok = false; |
705 |
1
|
setLocationWithinModule(context + ".getReference()"); |
706 |
1
|
handleProofCheckException( |
707 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_CODE, |
708 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_TEXT |
709 |
|
+ universal.getReference(), |
710 |
|
getCurrentContext()); |
711 |
|
|
712 |
|
|
713 |
|
|
714 |
|
|
715 |
|
|
716 |
|
|
717 |
|
|
718 |
|
|
719 |
|
} else { |
720 |
23
|
final Element f = getNormalizedProofLine(n); |
721 |
23
|
final Element current = resolver.getNormalizedFormula(element); |
722 |
23
|
if (!FormulaUtility.isImplication(f)) { |
723 |
0
|
ok = false; |
724 |
0
|
setLocationWithinModule(context + ".getReference()"); |
725 |
0
|
handleProofCheckException( |
726 |
|
BasicProofErrors.IMPLICATION_EXPECTED_CODE, |
727 |
|
BasicProofErrors.IMPLICATION_EXPECTED_TEXT |
728 |
|
+ universal.getReference(), |
729 |
|
getCurrentContext()); |
730 |
0
|
return ok; |
731 |
|
} |
732 |
23
|
if (!FormulaUtility.isSubjectVariable(universal.getSubjectVariable())) { |
733 |
3
|
ok = false; |
734 |
3
|
setLocationWithinModule(context + ".getSubjectVariable()"); |
735 |
3
|
handleProofCheckException( |
736 |
|
BasicProofErrors.SUBJECT_VARIABLE_IS_MISSING_CODE, |
737 |
|
BasicProofErrors.SUBJECT_VARIABLE_IS_MISSING_TEXT, |
738 |
|
getCurrentContext()); |
739 |
3
|
return ok; |
740 |
|
} |
741 |
20
|
final DefaultElementList expected = new DefaultElementList(Operators.IMPLICATION_OPERATOR); |
742 |
20
|
expected.add((f.getList().getElement(0))); |
743 |
20
|
final ElementList uni = new DefaultElementList(Operators.UNIVERSAL_QUANTIFIER_OPERATOR); |
744 |
20
|
uni.add(universal.getSubjectVariable()); |
745 |
20
|
uni.add(f.getList().getElement(1)); |
746 |
20
|
expected.add(uni); |
747 |
20
|
if (!EqualsUtility.equals(current, expected)) { |
748 |
1
|
ok = false; |
749 |
1
|
handleProofCheckException( |
750 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_CODE, |
751 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_TEXT |
752 |
|
+ universal.getReference(), |
753 |
|
getDiffModuleContextOfProofLineFormula(i, expected)); |
754 |
1
|
return ok; |
755 |
|
} |
756 |
|
} |
757 |
20
|
final RuleKey defined = checker.getRule(universal.getName()); |
758 |
20
|
if (defined == null) { |
759 |
0
|
ok = false; |
760 |
0
|
handleProofCheckException( |
761 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_CODE, |
762 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_TEXT |
763 |
|
+ universal.getName(), |
764 |
|
getCurrentContext()); |
765 |
0
|
return ok; |
766 |
20
|
} else if (!ruleVersion.equals(defined.getVersion())) { |
767 |
0
|
ok = false; |
768 |
0
|
handleProofCheckException( |
769 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_CODE, |
770 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_TEXT + defined.getVersion(), |
771 |
|
getCurrentContext()); |
772 |
0
|
return ok; |
773 |
|
} |
774 |
20
|
return ok; |
775 |
|
} |
776 |
|
|
|
|
| 58.8% |
Uncovered Elements: 21 (51) |
Complexity: 7 |
Complexity Density: 0.18 |
|
777 |
5
|
private boolean check(final Existential existential, final int i, final Element element) {... |
778 |
5
|
final String context = currentContext.getLocationWithinModule(); |
779 |
5
|
boolean ok = true; |
780 |
5
|
final Integer n = (Integer) label2line.get(existential.getReference()); |
781 |
5
|
if (n == null) { |
782 |
0
|
ok = false; |
783 |
0
|
setLocationWithinModule(context + ".getReference()"); |
784 |
0
|
handleProofCheckException( |
785 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_CODE, |
786 |
|
BasicProofErrors.SUCH_A_LOCAL_LABEL_DOESNT_EXIST_TEXT |
787 |
|
+ existential.getReference(), |
788 |
|
getCurrentContext()); |
789 |
|
|
790 |
|
|
791 |
|
|
792 |
|
|
793 |
|
|
794 |
|
|
795 |
|
|
796 |
|
|
797 |
|
} else { |
798 |
5
|
final Element f = getNormalizedProofLine(n); |
799 |
5
|
final Element current = resolver.getNormalizedFormula(element); |
800 |
5
|
if (!FormulaUtility.isImplication(f)) { |
801 |
0
|
ok = false; |
802 |
0
|
setLocationWithinModule(context + ".getReference()"); |
803 |
0
|
handleProofCheckException( |
804 |
|
BasicProofErrors.IMPLICATION_EXPECTED_CODE, |
805 |
|
BasicProofErrors.IMPLICATION_EXPECTED_TEXT |
806 |
|
+ existential.getReference(), |
807 |
|
getCurrentContext()); |
808 |
0
|
return ok; |
809 |
|
} |
810 |
5
|
if (!FormulaUtility.isSubjectVariable(existential.getSubjectVariable())) { |
811 |
1
|
ok = false; |
812 |
1
|
setLocationWithinModule(context + ".getSubjectVariable()"); |
813 |
1
|
handleProofCheckException( |
814 |
|
BasicProofErrors.SUBJECT_VARIABLE_IS_MISSING_CODE, |
815 |
|
BasicProofErrors.SUBJECT_VARIABLE_IS_MISSING_TEXT, |
816 |
|
getCurrentContext()); |
817 |
1
|
return ok; |
818 |
|
} |
819 |
4
|
final DefaultElementList expected = new DefaultElementList(f.getList().getOperator()); |
820 |
4
|
final ElementList exi = new DefaultElementList( |
821 |
|
Operators.EXISTENTIAL_QUANTIFIER_OPERATOR); |
822 |
4
|
exi.add(existential.getSubjectVariable()); |
823 |
4
|
exi.add(f.getList().getElement(0)); |
824 |
4
|
expected.add(exi); |
825 |
4
|
expected.add((f.getList().getElement(1))); |
826 |
4
|
if (!EqualsUtility.equals(current, expected)) { |
827 |
0
|
ok = false; |
828 |
0
|
handleProofCheckException( |
829 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_CODE, |
830 |
|
BasicProofErrors.EXPECTED_FORMULA_DIFFERS_TEXT |
831 |
|
+ existential.getReference(), |
832 |
|
getDiffModuleContextOfProofLineFormula(i, expected)); |
833 |
0
|
return ok; |
834 |
|
} |
835 |
|
} |
836 |
4
|
final RuleKey defined = checker.getRule(existential.getName()); |
837 |
4
|
if (defined == null) { |
838 |
0
|
ok = false; |
839 |
0
|
handleProofCheckException( |
840 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_CODE, |
841 |
|
BasicProofErrors.PROOF_METHOD_WAS_NOT_DEFINED_YET_TEXT |
842 |
|
+ existential.getName(), |
843 |
|
getCurrentContext()); |
844 |
0
|
return ok; |
845 |
4
|
} else if (!ruleVersion.equals(defined.getVersion())) { |
846 |
0
|
ok = false; |
847 |
0
|
handleProofCheckException( |
848 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_CODE, |
849 |
|
BasicProofErrors.PROOF_METHOD_IS_NOT_SUPPORTED_TEXT + defined.getVersion(), |
850 |
|
getCurrentContext()); |
851 |
0
|
return ok; |
852 |
|
} |
853 |
4
|
return ok; |
854 |
|
} |
855 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
856 |
4
|
private ModuleContext getModuleContextOfProofLineFormula(final int i) {... |
857 |
4
|
return new ModuleContext(moduleContext.getModuleLocation(), |
858 |
|
moduleContext.getLocationWithinModule() + ".get(" + i |
859 |
|
+ ").getFormula().getElement()"); |
860 |
|
} |
861 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
862 |
18
|
private ModuleContext getDiffModuleContextOfProofLineFormula(final int i,... |
863 |
|
final Element expected) { |
864 |
18
|
final String diff = FormulaUtility.getDifferenceLocation( |
865 |
|
proof.get(i).getFormula().getElement(), expected); |
866 |
18
|
return new ModuleContext(moduleContext.getModuleLocation(), |
867 |
|
moduleContext.getLocationWithinModule() + ".get(" + i |
868 |
|
+ ").getFormula().getElement()" + diff); |
869 |
|
} |
870 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
871 |
343
|
private Element getNormalizedProofLine(final Integer n) {... |
872 |
343
|
if (n == null) { |
873 |
0
|
return null; |
874 |
|
} |
875 |
343
|
return getNormalizedProofLine(n.intValue()); |
876 |
|
} |
877 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
878 |
395
|
private Element getNormalizedProofLine(final int i) {... |
879 |
395
|
if (i < 0 || i >= proof.size()) { |
880 |
0
|
return null; |
881 |
|
} |
882 |
395
|
return resolver.getNormalizedFormula(proof.get(i).getFormula().getElement()); |
883 |
|
} |
884 |
|
|
885 |
|
|
886 |
|
@link |
887 |
|
|
888 |
|
@param |
889 |
|
@param |
890 |
|
@param |
891 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
892 |
60
|
private void handleProofCheckException(final int code, final String msg,... |
893 |
|
final ModuleContext context) { |
894 |
|
|
895 |
|
|
896 |
60
|
final ProofCheckException ex = new ProofCheckException(code, msg, context); |
897 |
60
|
exceptions.add(ex); |
898 |
|
} |
899 |
|
|
900 |
|
|
901 |
|
@link |
902 |
|
|
903 |
|
@param |
904 |
|
@param |
905 |
|
@param |
906 |
|
@param |
907 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
908 |
9
|
private void handleProofCheckException(final int code, final String msg,... |
909 |
|
final ModuleContext context, final ModuleContext referenceContext) { |
910 |
|
|
911 |
|
|
912 |
9
|
final ProofCheckException ex = new ProofCheckException(code, msg, null, context, |
913 |
|
referenceContext); |
914 |
9
|
exceptions.add(ex); |
915 |
|
} |
916 |
|
|
917 |
|
|
918 |
|
|
919 |
|
|
920 |
|
@param |
921 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
922 |
144
|
protected void setLocationWithinModule(final String locationWithinModule) {... |
923 |
144
|
getCurrentContext().setLocationWithinModule(locationWithinModule); |
924 |
|
} |
925 |
|
|
926 |
|
|
927 |
|
|
928 |
|
|
929 |
|
@return |
930 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
931 |
3555
|
protected final ModuleContext getCurrentContext() {... |
932 |
3555
|
return currentContext; |
933 |
|
} |
934 |
|
|
935 |
|
|
936 |
|
} |