1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.kernel.bo.service.unicode; |
17 |
|
|
18 |
|
import java.io.IOException; |
19 |
|
import java.util.ArrayList; |
20 |
|
import java.util.List; |
21 |
|
|
22 |
|
import org.apache.commons.lang.ArrayUtils; |
23 |
|
import org.qedeq.base.io.AbstractOutput; |
24 |
|
import org.qedeq.base.io.SourcePosition; |
25 |
|
import org.qedeq.base.io.TextOutput; |
26 |
|
import org.qedeq.base.trace.Trace; |
27 |
|
import org.qedeq.base.utility.DateUtility; |
28 |
|
import org.qedeq.base.utility.EqualsUtility; |
29 |
|
import org.qedeq.base.utility.StringUtility; |
30 |
|
import org.qedeq.kernel.bo.module.InternalServiceJob; |
31 |
|
import org.qedeq.kernel.bo.module.KernelNodeBo; |
32 |
|
import org.qedeq.kernel.bo.module.KernelQedeqBo; |
33 |
|
import org.qedeq.kernel.bo.module.Reference; |
34 |
|
import org.qedeq.kernel.bo.service.basis.ControlVisitor; |
35 |
|
import org.qedeq.kernel.se.base.list.Element; |
36 |
|
import org.qedeq.kernel.se.base.list.ElementList; |
37 |
|
import org.qedeq.kernel.se.base.module.Add; |
38 |
|
import org.qedeq.kernel.se.base.module.Author; |
39 |
|
import org.qedeq.kernel.se.base.module.AuthorList; |
40 |
|
import org.qedeq.kernel.se.base.module.Axiom; |
41 |
|
import org.qedeq.kernel.se.base.module.ChangedRule; |
42 |
|
import org.qedeq.kernel.se.base.module.ChangedRuleList; |
43 |
|
import org.qedeq.kernel.se.base.module.Chapter; |
44 |
|
import org.qedeq.kernel.se.base.module.Conclusion; |
45 |
|
import org.qedeq.kernel.se.base.module.ConditionalProof; |
46 |
|
import org.qedeq.kernel.se.base.module.Existential; |
47 |
|
import org.qedeq.kernel.se.base.module.FormalProof; |
48 |
|
import org.qedeq.kernel.se.base.module.FormalProofLine; |
49 |
|
import org.qedeq.kernel.se.base.module.Formula; |
50 |
|
import org.qedeq.kernel.se.base.module.FunctionDefinition; |
51 |
|
import org.qedeq.kernel.se.base.module.Header; |
52 |
|
import org.qedeq.kernel.se.base.module.Hypothesis; |
53 |
|
import org.qedeq.kernel.se.base.module.Import; |
54 |
|
import org.qedeq.kernel.se.base.module.ImportList; |
55 |
|
import org.qedeq.kernel.se.base.module.InitialFunctionDefinition; |
56 |
|
import org.qedeq.kernel.se.base.module.InitialPredicateDefinition; |
57 |
|
import org.qedeq.kernel.se.base.module.Latex; |
58 |
|
import org.qedeq.kernel.se.base.module.LatexList; |
59 |
|
import org.qedeq.kernel.se.base.module.LinkList; |
60 |
|
import org.qedeq.kernel.se.base.module.LiteratureItem; |
61 |
|
import org.qedeq.kernel.se.base.module.LiteratureItemList; |
62 |
|
import org.qedeq.kernel.se.base.module.LocationList; |
63 |
|
import org.qedeq.kernel.se.base.module.ModusPonens; |
64 |
|
import org.qedeq.kernel.se.base.module.Node; |
65 |
|
import org.qedeq.kernel.se.base.module.PredicateDefinition; |
66 |
|
import org.qedeq.kernel.se.base.module.Proof; |
67 |
|
import org.qedeq.kernel.se.base.module.Proposition; |
68 |
|
import org.qedeq.kernel.se.base.module.Qedeq; |
69 |
|
import org.qedeq.kernel.se.base.module.Rename; |
70 |
|
import org.qedeq.kernel.se.base.module.Rule; |
71 |
|
import org.qedeq.kernel.se.base.module.Section; |
72 |
|
import org.qedeq.kernel.se.base.module.SectionList; |
73 |
|
import org.qedeq.kernel.se.base.module.Specification; |
74 |
|
import org.qedeq.kernel.se.base.module.Subsection; |
75 |
|
import org.qedeq.kernel.se.base.module.SubsectionList; |
76 |
|
import org.qedeq.kernel.se.base.module.SubsectionType; |
77 |
|
import org.qedeq.kernel.se.base.module.SubstFree; |
78 |
|
import org.qedeq.kernel.se.base.module.SubstFunc; |
79 |
|
import org.qedeq.kernel.se.base.module.SubstPred; |
80 |
|
import org.qedeq.kernel.se.base.module.Universal; |
81 |
|
import org.qedeq.kernel.se.base.module.UsedByList; |
82 |
|
import org.qedeq.kernel.se.common.ModuleAddress; |
83 |
|
import org.qedeq.kernel.se.common.ModuleContext; |
84 |
|
import org.qedeq.kernel.se.common.ModuleDataException; |
85 |
|
import org.qedeq.kernel.se.common.ModuleService; |
86 |
|
import org.qedeq.kernel.se.common.SourceFileExceptionList; |
87 |
|
import org.qedeq.kernel.se.visitor.QedeqNumbers; |
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
@author |
97 |
|
|
|
|
| 81.5% |
Uncovered Elements: 195 (1,053) |
Complexity: 269 |
Complexity Density: 0.41 |
|
98 |
|
public class Qedeq2UnicodeVisitor extends ControlVisitor implements ReferenceFinder { |
99 |
|
|
100 |
|
|
101 |
|
private static final Class CLASS = Qedeq2UnicodeVisitor.class; |
102 |
|
|
103 |
|
|
104 |
|
private AbstractOutput printer; |
105 |
|
|
106 |
|
|
107 |
|
private String language; |
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
private final boolean info; |
114 |
|
|
115 |
|
|
116 |
|
private String id; |
117 |
|
|
118 |
|
|
119 |
|
private String title; |
120 |
|
|
121 |
|
|
122 |
|
private String subContext = ""; |
123 |
|
|
124 |
|
|
125 |
|
private int maxColumns; |
126 |
|
|
127 |
|
|
128 |
|
private boolean addWarnings; |
129 |
|
|
130 |
|
|
131 |
|
private final boolean brief; |
132 |
|
|
133 |
|
|
134 |
|
private static final String ALPHABET = "abcdefghijklmnopqrstuvwxyz"; |
135 |
|
|
136 |
|
|
137 |
|
private ProofLineData lineData = new ProofLineData(); |
138 |
|
|
139 |
|
|
140 |
|
private int formulaWidth = 60; |
141 |
|
|
142 |
|
|
143 |
|
private int reasonWidth = 35; |
144 |
|
|
145 |
|
|
146 |
|
private String tab = ""; |
147 |
|
|
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
@param |
152 |
|
@param |
153 |
|
@param |
154 |
|
@param |
155 |
|
|
156 |
|
@param |
157 |
|
|
158 |
|
@param |
159 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
160 |
54
|
public Qedeq2UnicodeVisitor(final ModuleService plugin, final KernelQedeqBo prop,... |
161 |
|
final boolean info, final int maximumColumn, final boolean addWarnings, |
162 |
|
final boolean brief) { |
163 |
54
|
super(plugin, prop); |
164 |
54
|
this.info = info; |
165 |
54
|
this.maxColumns = maximumColumn; |
166 |
54
|
this.addWarnings = addWarnings; |
167 |
54
|
this.brief = brief; |
168 |
|
} |
169 |
|
|
170 |
|
|
171 |
|
|
172 |
|
|
173 |
|
@param |
174 |
|
@param |
175 |
|
@param |
176 |
|
@param |
177 |
|
|
178 |
|
@throws |
179 |
|
@throws |
180 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
181 |
54
|
public void generateUtf8(final InternalServiceJob process, final AbstractOutput printer,... |
182 |
|
final String language, final String level) throws SourceFileExceptionList, IOException { |
183 |
54
|
setParameters(printer, language); |
184 |
54
|
try { |
185 |
54
|
traverse(process); |
186 |
|
} finally { |
187 |
54
|
getKernelQedeqBo().addPluginErrorsAndWarnings((ModuleService) getService(), getErrorList(), |
188 |
|
getWarningList()); |
189 |
|
} |
190 |
|
} |
191 |
|
|
192 |
|
|
193 |
|
|
194 |
|
|
195 |
|
@param |
196 |
|
@param |
197 |
|
|
|
|
| 45.2% |
Uncovered Elements: 17 (31) |
Complexity: 6 |
Complexity Density: 0.29 |
|
198 |
54
|
public void setParameters(final AbstractOutput printer,... |
199 |
|
final String language) { |
200 |
54
|
this.printer = printer; |
201 |
54
|
this.printer.setColumns(maxColumns); |
202 |
|
|
203 |
54
|
if (maxColumns <= 0) { |
204 |
0
|
formulaWidth = 80; |
205 |
0
|
reasonWidth = 50; |
206 |
54
|
} else if (maxColumns <= 50) { |
207 |
0
|
this.printer.setColumns(50); |
208 |
0
|
formulaWidth = 21; |
209 |
0
|
reasonWidth = 21; |
210 |
54
|
} else if (maxColumns <= 100) { |
211 |
54
|
formulaWidth = (maxColumns - 8) * 50 / 100; |
212 |
54
|
reasonWidth = (maxColumns - 8) * 50 / 100; |
213 |
0
|
} else if (maxColumns <= 120) { |
214 |
0
|
reasonWidth = 46 + (maxColumns - 100) / 5; |
215 |
0
|
formulaWidth = maxColumns - 8 - reasonWidth; |
216 |
|
} else { |
217 |
0
|
reasonWidth = 50 + (maxColumns - 120) / 10; |
218 |
0
|
formulaWidth = maxColumns - 8 - reasonWidth; |
219 |
|
} |
220 |
|
|
221 |
|
|
222 |
|
|
223 |
54
|
if (language == null) { |
224 |
0
|
this.language = "en"; |
225 |
|
} else { |
226 |
54
|
this.language = language; |
227 |
|
} |
228 |
|
|
229 |
|
|
230 |
|
|
231 |
|
|
232 |
|
|
233 |
|
|
234 |
54
|
init(); |
235 |
|
} |
236 |
|
|
237 |
|
|
238 |
|
@link |
239 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
240 |
54
|
protected void init() {... |
241 |
54
|
id = null; |
242 |
54
|
title = null; |
243 |
54
|
subContext = ""; |
244 |
|
} |
245 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (20) |
Complexity: 2 |
Complexity Density: 0.11 |
|
246 |
54
|
public final void visitEnter(final Qedeq qedeq) {... |
247 |
54
|
if (printer instanceof TextOutput) { |
248 |
18
|
printer.println("================================================================================"); |
249 |
18
|
printer.println("UTF-8-file " + ((TextOutput) printer).getName()); |
250 |
18
|
printer.println("Generated from " + getKernelQedeqBo().getModuleAddress()); |
251 |
18
|
printer.println("Generated at " + DateUtility.getTimestamp()); |
252 |
18
|
printer.println("================================================================================"); |
253 |
18
|
printer.println(); |
254 |
18
|
printer.println("If the characters of this document don't display correctly try opening this"); |
255 |
18
|
printer.println("document within a webbrowser and if necessary change the encoding to"); |
256 |
18
|
printer.println("Unicode (UTF-8)"); |
257 |
18
|
printer.println(); |
258 |
18
|
printer.println("Permission is granted to copy, distribute and/or modify this document"); |
259 |
18
|
printer.println("under the terms of the GNU Free Documentation License, Version 1.2"); |
260 |
18
|
printer.println("or any later version published by the Free Software Foundation;"); |
261 |
18
|
printer.println("with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts."); |
262 |
18
|
printer.println(); |
263 |
18
|
printer.println(); |
264 |
18
|
printer.println(); |
265 |
|
} |
266 |
|
} |
267 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
268 |
54
|
public final void visitLeave(final Qedeq qedeq) {... |
269 |
54
|
printer.println(); |
270 |
|
} |
271 |
|
|
|
|
| 92.3% |
Uncovered Elements: 6 (78) |
Complexity: 15 |
Complexity Density: 0.27 |
|
272 |
54
|
public void visitEnter(final Header header) {... |
273 |
54
|
final LatexList tit = header.getTitle(); |
274 |
54
|
underlineBig(getLatexListEntry("getTitle()", tit)); |
275 |
54
|
printer.println(); |
276 |
54
|
final AuthorList authors = getKernelQedeqBo().getQedeq().getHeader().getAuthorList(); |
277 |
54
|
final StringBuffer authorList = new StringBuffer(); |
278 |
108
|
for (int i = 0; i < authors.size(); i++) { |
279 |
54
|
if (i > 0) { |
280 |
0
|
authorList.append(" \n"); |
281 |
0
|
printer.println(", "); |
282 |
|
} |
283 |
54
|
final Author author = authors.get(i); |
284 |
54
|
final String name = author.getName().getLatex().trim(); |
285 |
54
|
printer.print(name); |
286 |
54
|
authorList.append(" " + name); |
287 |
54
|
String email = author.getEmail(); |
288 |
54
|
if (email != null && email.trim().length() > 0) { |
289 |
54
|
authorList.append(" <" + email + ">"); |
290 |
|
} |
291 |
|
} |
292 |
54
|
printer.println(); |
293 |
54
|
printer.println(); |
294 |
54
|
final String url = getKernelQedeqBo().getUrl(); |
295 |
54
|
if (url != null && url.length() > 0) { |
296 |
54
|
printer.println(); |
297 |
54
|
if ("de".equals(language)) { |
298 |
24
|
printer.println("Die Quelle f\u00FCr dieses Dokument ist hier zu finden:"); |
299 |
|
} else { |
300 |
30
|
if (!"en".equals(language)) { |
301 |
2
|
printer.println("%%% TODO unknown language: " + language); |
302 |
|
} |
303 |
30
|
printer.println("The source for this document can be found here:"); |
304 |
|
} |
305 |
54
|
printer.println(); |
306 |
54
|
printer.println(url); |
307 |
54
|
printer.println(); |
308 |
|
} |
309 |
|
{ |
310 |
54
|
printer.println(); |
311 |
54
|
if ("de".equals(language)) { |
312 |
24
|
printer.println("Die vorliegende Publikation ist urheberrechtlich gesch\u00FCtzt."); |
313 |
|
} else { |
314 |
30
|
if (!"en".equals(language)) { |
315 |
2
|
printer.println("%%% TODO unknown language: " + language); |
316 |
|
} |
317 |
30
|
printer.println("Copyright by the authors. All rights reserved."); |
318 |
|
} |
319 |
|
} |
320 |
54
|
final String email = header.getEmail(); |
321 |
54
|
if (email != null && email.length() > 0) { |
322 |
54
|
printer.println(); |
323 |
54
|
printer.println(); |
324 |
54
|
if ("de".equals(language)) { |
325 |
24
|
printer.println("Bei Fragen, Anregungen oder Bitte um Aufnahme in die Liste der" |
326 |
|
+ " abh\u00E4ngigen Module schicken Sie bitte eine EMail an die Adresse " |
327 |
|
+ email); |
328 |
24
|
printer.println(); |
329 |
24
|
printer.println(); |
330 |
24
|
printer.println("Die Autoren dieses Dokuments sind:"); |
331 |
24
|
printer.println(); |
332 |
24
|
printer.println(authorList); |
333 |
|
} else { |
334 |
30
|
if (!"en".equals(language)) { |
335 |
2
|
printer.println("%%% TODO unknown language: " + language); |
336 |
|
} |
337 |
30
|
printer.println("If you have any questions, suggestions or want to add something" |
338 |
|
+ " to the list of modules that use this one, please send an email to the" |
339 |
|
+ " address " + email); |
340 |
30
|
printer.println(); |
341 |
30
|
printer.println(); |
342 |
30
|
printer.println("The authors of this document are:"); |
343 |
30
|
printer.println(authorList); |
344 |
|
} |
345 |
54
|
printer.println(); |
346 |
|
} |
347 |
54
|
printer.println(); |
348 |
54
|
printer.println(); |
349 |
|
} |
350 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
351 |
18
|
public void visitEnter(final ImportList imports) throws ModuleDataException {... |
352 |
|
|
353 |
|
|
354 |
18
|
printImports(); |
355 |
|
} |
356 |
|
|
357 |
|
|
358 |
|
|
359 |
|
|
360 |
|
@param |
361 |
|
@param |
362 |
|
@return |
363 |
|
|
|
|
| 62.5% |
Uncovered Elements: 3 (8) |
Complexity: 4 |
Complexity Density: 0.67 |
|
364 |
42
|
private String getUrl(final ModuleAddress address, final Specification specification) {... |
365 |
42
|
final LocationList list = specification.getLocationList(); |
366 |
42
|
if (list == null || list.size() <= 0) { |
367 |
0
|
return ""; |
368 |
|
} |
369 |
42
|
try { |
370 |
42
|
return address.getModulePaths(specification)[0].getUrl(); |
371 |
|
} catch (IOException e) { |
372 |
0
|
return ""; |
373 |
|
} |
374 |
|
} |
375 |
|
|
|
|
| 38.6% |
Uncovered Elements: 35 (57) |
Complexity: 14 |
Complexity Density: 0.4 |
|
376 |
216
|
public void visitEnter(final Chapter chapter) {... |
377 |
|
|
378 |
216
|
if (brief) { |
379 |
0
|
boolean hasFormalContent = false; |
380 |
0
|
do { |
381 |
0
|
final SectionList sections = chapter.getSectionList(); |
382 |
0
|
if (sections == null) { |
383 |
0
|
break; |
384 |
|
} |
385 |
0
|
for (int i = 0; i < sections.size() && !hasFormalContent; i++) { |
386 |
0
|
final Section section = sections.get(i); |
387 |
0
|
if (section == null) { |
388 |
0
|
continue; |
389 |
|
} |
390 |
0
|
final SubsectionList subSections = section.getSubsectionList(); |
391 |
0
|
if (subSections == null) { |
392 |
0
|
continue; |
393 |
|
} |
394 |
0
|
for (int j = 0; j < subSections.size(); j++) { |
395 |
0
|
final SubsectionType subSection = subSections.get(j); |
396 |
0
|
if (!(subSection instanceof Subsection)) { |
397 |
0
|
hasFormalContent = true; |
398 |
0
|
break; |
399 |
|
} |
400 |
|
} |
401 |
|
} |
402 |
|
} while (false); |
403 |
0
|
if (!hasFormalContent) { |
404 |
0
|
setBlocked(true); |
405 |
0
|
return; |
406 |
|
} |
407 |
|
} |
408 |
216
|
final QedeqNumbers numbers = getCurrentNumbers(); |
409 |
216
|
if (numbers.isChapterNumbering()) { |
410 |
163
|
if ("de".equals(language)) { |
411 |
66
|
printer.println("Kapitel " + numbers.getChapterNumber() + " "); |
412 |
|
} else { |
413 |
97
|
printer.println("Chapter " + numbers.getChapterNumber() + " "); |
414 |
|
} |
415 |
163
|
printer.println(); |
416 |
163
|
printer.println(); |
417 |
|
} |
418 |
216
|
underlineBig(getLatexListEntry("getTitle()", chapter.getTitle())); |
419 |
216
|
printer.println(); |
420 |
216
|
if (chapter.getIntroduction() != null && !brief) { |
421 |
215
|
printer.append(getLatexListEntry("getIntroduction()", chapter.getIntroduction())); |
422 |
215
|
printer.println(); |
423 |
215
|
printer.println(); |
424 |
215
|
printer.println(); |
425 |
|
} |
426 |
|
} |
427 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
428 |
54
|
public void visitLeave(final Header header) {... |
429 |
54
|
printer.println(); |
430 |
54
|
printer.println("___________________________________________________"); |
431 |
54
|
printer.println(); |
432 |
54
|
printer.println(); |
433 |
|
} |
434 |
|
|
|
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
435 |
216
|
public void visitLeave(final Chapter chapter) {... |
436 |
216
|
if (!getBlocked()) { |
437 |
216
|
printer.println(); |
438 |
216
|
printer.println("___________________________________________________"); |
439 |
216
|
printer.println(); |
440 |
216
|
printer.println(); |
441 |
|
} |
442 |
216
|
setBlocked(false); |
443 |
|
} |
444 |
|
|
|
|
| 50% |
Uncovered Elements: 26 (52) |
Complexity: 13 |
Complexity Density: 0.41 |
|
445 |
432
|
public void visitEnter(final Section section) {... |
446 |
|
|
447 |
432
|
if (brief) { |
448 |
0
|
boolean hasFormalContent = false; |
449 |
0
|
do { |
450 |
0
|
final SubsectionList subSections = section.getSubsectionList(); |
451 |
0
|
if (subSections == null) { |
452 |
0
|
break; |
453 |
|
} |
454 |
0
|
for (int j = 0; j < subSections.size(); j++) { |
455 |
0
|
final SubsectionType subSection = subSections.get(j); |
456 |
0
|
if (!(subSection instanceof Subsection)) { |
457 |
0
|
hasFormalContent = true; |
458 |
0
|
break; |
459 |
|
} |
460 |
|
} |
461 |
|
} while (false); |
462 |
0
|
if (!hasFormalContent) { |
463 |
0
|
setBlocked(true); |
464 |
0
|
return; |
465 |
|
} |
466 |
|
} |
467 |
432
|
final QedeqNumbers numbers = getCurrentNumbers(); |
468 |
432
|
final StringBuffer buffer = new StringBuffer(); |
469 |
432
|
if (numbers.isChapterNumbering()) { |
470 |
432
|
buffer.append(numbers.getChapterNumber()); |
471 |
|
} |
472 |
432
|
if (numbers.isSectionNumbering()) { |
473 |
432
|
if (buffer.length() > 0) { |
474 |
432
|
buffer.append("."); |
475 |
|
} |
476 |
432
|
buffer.append(numbers.getSectionNumber()); |
477 |
|
} |
478 |
432
|
if (buffer.length() > 0 && section.getTitle() != null) { |
479 |
432
|
buffer.append(" "); |
480 |
|
} |
481 |
432
|
buffer.append(getLatexListEntry("getTitle()", section.getTitle())); |
482 |
432
|
underline(buffer.toString()); |
483 |
432
|
printer.println(); |
484 |
432
|
if (section.getIntroduction() != null && !brief) { |
485 |
431
|
printer.append(getLatexListEntry("getIntroduction()", section.getIntroduction())); |
486 |
431
|
printer.println(); |
487 |
431
|
printer.println(); |
488 |
431
|
printer.println(); |
489 |
|
} |
490 |
|
} |
491 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
492 |
432
|
public void visitLeave(final Section section) {... |
493 |
432
|
if (!getBlocked()) { |
494 |
432
|
printer.println(); |
495 |
|
} |
496 |
432
|
setBlocked(false); |
497 |
|
} |
498 |
|
|
|
|
| 86.4% |
Uncovered Elements: 6 (44) |
Complexity: 12 |
Complexity Density: 0.46 |
|
499 |
164
|
public void visitEnter(final Subsection subsection) {... |
500 |
164
|
if (brief) { |
501 |
0
|
return; |
502 |
|
} |
503 |
164
|
final QedeqNumbers numbers = getCurrentNumbers(); |
504 |
164
|
final StringBuffer buffer = new StringBuffer(); |
505 |
164
|
if (numbers.isChapterNumbering()) { |
506 |
164
|
buffer.append(numbers.getChapterNumber()); |
507 |
|
} |
508 |
164
|
if (numbers.isSectionNumbering()) { |
509 |
164
|
if (buffer.length() > 0) { |
510 |
164
|
buffer.append("."); |
511 |
|
} |
512 |
164
|
buffer.append(numbers.getSectionNumber()); |
513 |
|
} |
514 |
164
|
if (buffer.length() > 0) { |
515 |
164
|
buffer.append("."); |
516 |
|
} |
517 |
164
|
buffer.append(numbers.getSubsectionNumber()); |
518 |
164
|
if (buffer.length() > 0 && subsection.getTitle() != null) { |
519 |
110
|
buffer.append(" "); |
520 |
|
} |
521 |
164
|
if (subsection.getTitle() != null) { |
522 |
110
|
printer.print(buffer.toString()); |
523 |
110
|
printer.print(getLatexListEntry("getTitle()", subsection.getTitle())); |
524 |
|
} |
525 |
164
|
if (subsection.getId() != null && info) { |
526 |
2
|
printer.print(" [" + subsection.getId() + "]"); |
527 |
|
} |
528 |
164
|
if (subsection.getTitle() != null) { |
529 |
110
|
printer.println(); |
530 |
110
|
printer.println(); |
531 |
|
} |
532 |
164
|
printer.append(getLatexListEntry("getLatex()", subsection.getLatex())); |
533 |
164
|
printer.println(); |
534 |
164
|
printer.println(); |
535 |
|
} |
536 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 4 |
Complexity Density: 0.5 |
|
537 |
1324
|
public void visitEnter(final Node node) {... |
538 |
1324
|
if (node.getPrecedingText() != null && !brief) { |
539 |
696
|
printer.append(getLatexListEntry("getPrecedingText()", node.getPrecedingText())); |
540 |
696
|
printer.println(); |
541 |
696
|
printer.println(); |
542 |
|
} |
543 |
1324
|
id = node.getId(); |
544 |
1324
|
title = null; |
545 |
1324
|
if (node.getTitle() != null) { |
546 |
712
|
title = getLatexListEntry("getTitle()", node.getTitle()); |
547 |
|
} |
548 |
|
} |
549 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 3 |
Complexity Density: 0.6 |
|
550 |
1324
|
public void visitLeave(final Node node) {... |
551 |
1324
|
if (node.getSucceedingText() != null && !brief) { |
552 |
180
|
printer.append(getLatexListEntry("getSucceedingText()", node.getSucceedingText())); |
553 |
180
|
printer.println(); |
554 |
180
|
printer.println(); |
555 |
|
} |
556 |
1324
|
printer.println(); |
557 |
|
} |
558 |
|
|
|
|
| 78.3% |
Uncovered Elements: 5 (23) |
Complexity: 5 |
Complexity Density: 0.29 |
|
559 |
312
|
public void visitEnter(final Axiom axiom) {... |
560 |
312
|
final QedeqNumbers numbers = getCurrentNumbers(); |
561 |
312
|
printer.print("\u2609 "); |
562 |
312
|
printer.print("Axiom " + numbers.getAxiomNumber()); |
563 |
312
|
printer.print(" "); |
564 |
312
|
if (title != null && title.length() > 0) { |
565 |
312
|
printer.print(" (" + title + ")"); |
566 |
|
} |
567 |
312
|
if (info) { |
568 |
104
|
printer.print(" [" + id + "]"); |
569 |
|
} |
570 |
312
|
printer.println(); |
571 |
312
|
printer.println(); |
572 |
312
|
printer.print(" "); |
573 |
312
|
printFormula(axiom.getFormula().getElement()); |
574 |
312
|
printer.println(); |
575 |
312
|
if (axiom.getDescription() != null) { |
576 |
0
|
printer.append(getLatexListEntry("getDescription()", axiom.getDescription())); |
577 |
0
|
printer.println(); |
578 |
0
|
printer.println(); |
579 |
|
} |
580 |
|
} |
581 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (22) |
Complexity: 5 |
Complexity Density: 0.31 |
|
582 |
618
|
public void visitEnter(final Proposition proposition) {... |
583 |
618
|
final QedeqNumbers numbers = getCurrentNumbers(); |
584 |
618
|
printer.print("\u2609 "); |
585 |
618
|
printer.print("Proposition " + numbers.getPropositionNumber()); |
586 |
618
|
printer.print(" "); |
587 |
618
|
if (title != null && title.length() > 0) { |
588 |
12
|
printer.print(" (" + title + ")"); |
589 |
|
} |
590 |
618
|
if (info) { |
591 |
206
|
printer.print(" [" + id + "]"); |
592 |
|
} |
593 |
618
|
printer.println(); |
594 |
618
|
printer.println(); |
595 |
618
|
printTopFormula(proposition.getFormula().getElement(), id); |
596 |
618
|
printer.println(); |
597 |
618
|
if (proposition.getDescription() != null) { |
598 |
6
|
printer.append(getLatexListEntry("getDescription()", proposition.getDescription())); |
599 |
6
|
printer.println(); |
600 |
6
|
printer.println(); |
601 |
|
} |
602 |
|
} |
603 |
|
|
|
|
| 72.7% |
Uncovered Elements: 3 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
604 |
120
|
public void visitEnter(final Proof proof) {... |
605 |
120
|
if (brief) { |
606 |
0
|
setBlocked(true); |
607 |
0
|
return; |
608 |
|
} |
609 |
120
|
if ("de".equals(language)) { |
610 |
60
|
printer.println("Beweis:"); |
611 |
|
} else { |
612 |
60
|
printer.println("Proof:"); |
613 |
|
} |
614 |
120
|
printer.append(getLatexListEntry("getNonFormalProof()", proof.getNonFormalProof())); |
615 |
|
} |
616 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
617 |
120
|
public void visitLeave(final Proof proof) {... |
618 |
120
|
printer.println(); |
619 |
120
|
printer.println("q.e.d."); |
620 |
120
|
printer.println(); |
621 |
120
|
setBlocked(false); |
622 |
|
} |
623 |
|
|
|
|
| 70% |
Uncovered Elements: 3 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
624 |
246
|
public void visitEnter(final FormalProof proof) {... |
625 |
246
|
if (brief) { |
626 |
0
|
setBlocked(true); |
627 |
0
|
return; |
628 |
|
} |
629 |
246
|
if ("de".equals(language)) { |
630 |
123
|
printer.println("Beweis (formal):"); |
631 |
|
} else { |
632 |
123
|
printer.println("Proof (formal):"); |
633 |
|
} |
634 |
|
} |
635 |
|
|
|
|
| 83.3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
636 |
246
|
public void visitLeave(final FormalProof proof) {... |
637 |
246
|
if (!brief) { |
638 |
246
|
printer.println("q.e.d."); |
639 |
246
|
printer.println(); |
640 |
|
} |
641 |
246
|
setBlocked(false); |
642 |
|
} |
643 |
|
|
644 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
645 |
2508
|
public void visitEnter(final FormalProofLine line) {... |
646 |
2508
|
lineData.init(); |
647 |
2508
|
if (line.getLabel() != null) { |
648 |
2508
|
lineData.setLineLabel(line.getLabel()); |
649 |
|
} |
650 |
2508
|
if (line.getReason() != null) { |
651 |
2508
|
setReason(line.getReason().toString()); |
652 |
|
} |
653 |
2508
|
setFormula(line.getFormula()); |
654 |
|
} |
655 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
656 |
2508
|
public void visitLeave(final FormalProofLine line) {... |
657 |
2508
|
linePrintln(); |
658 |
|
} |
659 |
|
|
660 |
|
|
661 |
|
|
662 |
|
|
|
|
| 91.7% |
Uncovered Elements: 2 (24) |
Complexity: 6 |
Complexity Density: 0.43 |
|
663 |
3408
|
private void linePrintln() {... |
664 |
3408
|
if (!lineData.containsData()) { |
665 |
300
|
return; |
666 |
|
} |
667 |
3108
|
if (lineData.getLineLabel().length() > 0) { |
668 |
3108
|
printer.print(StringUtility.alignRight("(" + lineData.getLineLabel() + ")", 5) + " "); |
669 |
|
} |
670 |
6582
|
for (int i = 0; i < lineData.lines(); i++) { |
671 |
3474
|
printer.skipToColumn(6); |
672 |
3474
|
printer.print(tab); |
673 |
3474
|
if (i < lineData.getFormula().length) { |
674 |
3474
|
printer.print(lineData.getFormula()[i]); |
675 |
|
} |
676 |
3474
|
if (i < lineData.getReason().length) { |
677 |
3120
|
printer.skipToColumn(6 + 2 + formulaWidth); |
678 |
3120
|
printer.print(lineData.getReason()[i]); |
679 |
|
} |
680 |
3474
|
printer.println(); |
681 |
|
} |
682 |
3108
|
lineData.init(); |
683 |
|
} |
684 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
685 |
300
|
public void visitEnter(final ConditionalProof r) throws ModuleDataException {... |
686 |
300
|
lineData.init(); |
687 |
300
|
printer.skipToColumn(6); |
688 |
300
|
printer.print(tab); |
689 |
300
|
printer.println("Conditional Proof"); |
690 |
300
|
tab = tab + " "; |
691 |
|
} |
692 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
693 |
300
|
public void visitLeave(final ConditionalProof proof) {... |
694 |
300
|
tab = StringUtility.substring(tab, 0, tab.length() - 2); |
695 |
|
} |
696 |
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
697 |
300
|
public void visitEnter(final Hypothesis hypothesis) {... |
698 |
300
|
lineData.init(); |
699 |
300
|
if (hypothesis.getLabel() != null) { |
700 |
300
|
lineData.setLineLabel(hypothesis.getLabel()); |
701 |
|
} |
702 |
300
|
setReason("Hypothesis"); |
703 |
300
|
setFormula(hypothesis.getFormula()); |
704 |
|
} |
705 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
706 |
300
|
public void visitLeave(final Hypothesis hypothesis) {... |
707 |
300
|
linePrintln(); |
708 |
|
} |
709 |
|
|
|
|
| 88.9% |
Uncovered Elements: 1 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
710 |
300
|
public void visitEnter(final Conclusion conclusion) {... |
711 |
300
|
tab = StringUtility.substring(tab, 0, tab.length() - 2); |
712 |
300
|
lineData.init(); |
713 |
300
|
if (conclusion.getLabel() != null) { |
714 |
300
|
lineData.setLineLabel(conclusion.getLabel()); |
715 |
|
} |
716 |
300
|
setReason("Conclusion"); |
717 |
300
|
setFormula(conclusion.getFormula()); |
718 |
300
|
linePrintln(); |
719 |
|
} |
720 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
721 |
300
|
public void visitLeave(final Conclusion conclusion) {... |
722 |
300
|
linePrintln(); |
723 |
300
|
tab = tab + " "; |
724 |
|
} |
725 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
726 |
5616
|
private void setReason(final String reasonString) {... |
727 |
5616
|
final List list = new ArrayList(); |
728 |
5616
|
int index = 0; |
729 |
12516
|
while (index < reasonString.length()) { |
730 |
6900
|
list.add(StringUtility.substring(reasonString, index, reasonWidth)); |
731 |
6900
|
index += reasonWidth; |
732 |
|
} |
733 |
5616
|
lineData.setReason((String[]) list.toArray(ArrayUtils.EMPTY_STRING_ARRAY)); |
734 |
|
} |
735 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 3 |
Complexity Density: 1.5 |
|
736 |
3108
|
private void setFormula(final Formula f) {... |
737 |
3108
|
if (f != null && f.getElement() != null) { |
738 |
3108
|
lineData.setFormula(getUtf8(f.getElement(), |
739 |
|
formulaWidth - tab.length())); |
740 |
|
} |
741 |
|
} |
742 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
743 |
1692
|
private String getReference(final String reference) {... |
744 |
1692
|
return getReference(reference, "getReference()"); |
745 |
|
} |
746 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
747 |
3324
|
private String getReference(final String reference, final String subContext) {... |
748 |
3324
|
final String context = getCurrentContext().getLocationWithinModule(); |
749 |
3324
|
try { |
750 |
3324
|
getCurrentContext().setLocationWithinModule(context + "." + subContext); |
751 |
3324
|
return (getReferenceLink(reference, null, null)); |
752 |
|
} finally { |
753 |
3324
|
getCurrentContext().setLocationWithinModule(context); |
754 |
|
} |
755 |
|
} |
756 |
|
|
|
|
| 81.2% |
Uncovered Elements: 3 (16) |
Complexity: 4 |
Complexity Density: 0.4 |
|
757 |
816
|
public void visitEnter(final ModusPonens r) throws ModuleDataException {... |
758 |
816
|
String buffer = r.getName(); |
759 |
816
|
boolean one = false; |
760 |
816
|
if (r.getReference1() != null) { |
761 |
816
|
buffer += " " + getReference(r.getReference1(), "getReference1()"); |
762 |
816
|
one = true; |
763 |
|
} |
764 |
816
|
if (r.getReference1() != null) { |
765 |
816
|
if (one) { |
766 |
816
|
buffer += ","; |
767 |
|
} |
768 |
816
|
buffer += " " + getReference(r.getReference2(), "getReference2()"); |
769 |
|
} |
770 |
816
|
setReason(buffer); |
771 |
|
} |
772 |
|
|
|
|
| 83.3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
773 |
570
|
public void visitEnter(final Add r) throws ModuleDataException {... |
774 |
570
|
String buffer = r.getName(); |
775 |
570
|
if (r.getReference() != null) { |
776 |
570
|
buffer += " " + getReference(r.getReference()); |
777 |
|
} |
778 |
570
|
setReason(buffer); |
779 |
|
} |
780 |
|
|
|
|
| 78.6% |
Uncovered Elements: 3 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
781 |
48
|
public void visitEnter(final Rename r) throws ModuleDataException {... |
782 |
48
|
String buffer = r.getName(); |
783 |
48
|
if (r.getOriginalSubjectVariable() != null) { |
784 |
48
|
buffer += " " + getUtf8(r.getOriginalSubjectVariable()); |
785 |
|
} |
786 |
48
|
if (r.getReplacementSubjectVariable() != null) { |
787 |
48
|
buffer += " by " + getUtf8(r.getReplacementSubjectVariable()); |
788 |
|
} |
789 |
48
|
if (r.getReference() != null) { |
790 |
48
|
buffer += " in " + getReference(r.getReference()); |
791 |
|
} |
792 |
48
|
setReason(buffer); |
793 |
|
} |
794 |
|
|
|
|
| 78.6% |
Uncovered Elements: 3 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
795 |
30
|
public void visitEnter(final SubstFree r) throws ModuleDataException {... |
796 |
30
|
String buffer = r.getName(); |
797 |
30
|
if (r.getSubjectVariable() != null) { |
798 |
30
|
buffer += " " + getUtf8(r.getSubjectVariable()); |
799 |
|
} |
800 |
30
|
if (r.getSubstituteTerm() != null) { |
801 |
30
|
buffer += " by " + getUtf8(r.getSubstituteTerm()); |
802 |
|
} |
803 |
30
|
if (r.getReference() != null) { |
804 |
30
|
buffer += " in " + getReference(r.getReference()); |
805 |
|
} |
806 |
30
|
setReason(buffer); |
807 |
|
} |
808 |
|
|
|
|
| 78.6% |
Uncovered Elements: 3 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
809 |
6
|
public void visitEnter(final SubstFunc r) throws ModuleDataException {... |
810 |
6
|
String buffer = r.getName(); |
811 |
6
|
if (r.getFunctionVariable() != null) { |
812 |
6
|
buffer += " " + getUtf8(r.getFunctionVariable()); |
813 |
|
} |
814 |
6
|
if (r.getSubstituteTerm() != null) { |
815 |
6
|
buffer += " by " + getUtf8(r.getSubstituteTerm()); |
816 |
|
} |
817 |
6
|
if (r.getReference() != null) { |
818 |
6
|
buffer += " in " + getReference(r.getReference()); |
819 |
|
} |
820 |
6
|
setReason(buffer); |
821 |
|
} |
822 |
|
|
|
|
| 78.6% |
Uncovered Elements: 3 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
823 |
1008
|
public void visitEnter(final SubstPred r) throws ModuleDataException {... |
824 |
1008
|
String buffer = r.getName(); |
825 |
1008
|
if (r.getPredicateVariable() != null) { |
826 |
1008
|
buffer += " " + getUtf8(r.getPredicateVariable()); |
827 |
|
} |
828 |
1008
|
if (r.getSubstituteFormula() != null) { |
829 |
1008
|
buffer += " by " + getUtf8(r.getSubstituteFormula()); |
830 |
|
} |
831 |
1008
|
if (r.getReference() != null) { |
832 |
1008
|
buffer += " in " + getReference(r.getReference()); |
833 |
|
} |
834 |
1008
|
setReason(buffer); |
835 |
|
} |
836 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
837 |
6
|
public void visitEnter(final Existential r) throws ModuleDataException {... |
838 |
6
|
String buffer = r.getName(); |
839 |
6
|
if (r.getSubjectVariable() != null) { |
840 |
6
|
buffer += " with " + getUtf8(r.getSubjectVariable()); |
841 |
|
} |
842 |
6
|
if (r.getReference() != null) { |
843 |
6
|
buffer += " in " + getReference(r.getReference()); |
844 |
|
} |
845 |
6
|
setReason(buffer); |
846 |
|
} |
847 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
848 |
24
|
public void visitEnter(final Universal r) throws ModuleDataException {... |
849 |
24
|
String buffer = r.getName(); |
850 |
24
|
if (r.getSubjectVariable() != null) { |
851 |
24
|
buffer += " with " + getKernelQedeqBo().getElement2Utf8().getUtf8( |
852 |
|
r.getSubjectVariable()); |
853 |
|
} |
854 |
24
|
if (r.getReference() != null) { |
855 |
24
|
buffer += " in " + getReference(r.getReference()); |
856 |
|
} |
857 |
24
|
setReason(buffer); |
858 |
|
} |
859 |
|
|
|
|
| 83.3% |
Uncovered Elements: 5 (30) |
Complexity: 6 |
Complexity Density: 0.27 |
|
860 |
19
|
public void visitEnter(final InitialPredicateDefinition definition) {... |
861 |
19
|
final QedeqNumbers numbers = getCurrentNumbers(); |
862 |
19
|
printer.print("\u2609 "); |
863 |
19
|
final StringBuffer buffer = new StringBuffer(); |
864 |
19
|
if ("de".equals(language)) { |
865 |
9
|
buffer.append("initiale "); |
866 |
|
} else { |
867 |
10
|
buffer.append("initial "); |
868 |
|
} |
869 |
19
|
buffer.append("Definition " + (numbers.getPredicateDefinitionNumber() |
870 |
|
+ numbers.getFunctionDefinitionNumber())); |
871 |
19
|
printer.print(buffer.toString()); |
872 |
19
|
printer.print(" "); |
873 |
19
|
if (title != null && title.length() > 0) { |
874 |
19
|
printer.print(" (" + title + ")"); |
875 |
|
} |
876 |
19
|
if (info) { |
877 |
7
|
printer.print(" [" + id + "]"); |
878 |
|
} |
879 |
19
|
printer.println(); |
880 |
19
|
printer.println(); |
881 |
19
|
printer.print(" "); |
882 |
19
|
printer.println(getUtf8(definition.getPredCon())); |
883 |
19
|
printer.println(); |
884 |
19
|
if (definition.getDescription() != null) { |
885 |
0
|
printer.append(getLatexListEntry("getDescription()", definition.getDescription())); |
886 |
0
|
printer.println(); |
887 |
0
|
printer.println(); |
888 |
|
} |
889 |
|
} |
890 |
|
|
|
|
| 80% |
Uncovered Elements: 5 (25) |
Complexity: 5 |
Complexity Density: 0.26 |
|
891 |
60
|
public void visitEnter(final PredicateDefinition definition) {... |
892 |
60
|
final QedeqNumbers numbers = getCurrentNumbers(); |
893 |
60
|
printer.print("\u2609 "); |
894 |
60
|
final StringBuffer buffer = new StringBuffer(); |
895 |
60
|
buffer.append("Definition " + (numbers.getPredicateDefinitionNumber() |
896 |
|
+ numbers.getFunctionDefinitionNumber())); |
897 |
60
|
printer.print(buffer.toString()); |
898 |
60
|
printer.print(" "); |
899 |
60
|
if (title != null && title.length() > 0) { |
900 |
60
|
printer.print(" (" + title + ")"); |
901 |
|
} |
902 |
60
|
if (info) { |
903 |
20
|
printer.print(" [" + id + "]"); |
904 |
|
} |
905 |
60
|
printer.println(); |
906 |
60
|
printer.println(); |
907 |
60
|
printer.print(" "); |
908 |
60
|
printer.println(getUtf8(definition.getFormula().getElement())); |
909 |
60
|
printer.println(); |
910 |
60
|
if (definition.getDescription() != null) { |
911 |
0
|
printer.append(getLatexListEntry("getDescription()", definition.getDescription())); |
912 |
0
|
printer.println(); |
913 |
0
|
printer.println(); |
914 |
|
} |
915 |
|
} |
916 |
|
|
|
|
| 75.9% |
Uncovered Elements: 7 (29) |
Complexity: 6 |
Complexity Density: 0.29 |
|
917 |
1
|
public void visitEnter(final InitialFunctionDefinition definition) {... |
918 |
1
|
final QedeqNumbers numbers = getCurrentNumbers(); |
919 |
1
|
printer.print("\u2609 "); |
920 |
1
|
final StringBuffer buffer = new StringBuffer(); |
921 |
1
|
if ("de".equals(language)) { |
922 |
0
|
buffer.append("initiale "); |
923 |
|
} else { |
924 |
1
|
buffer.append("initial "); |
925 |
|
} |
926 |
1
|
buffer.append("Definition " + (numbers.getPredicateDefinitionNumber() |
927 |
|
+ numbers.getFunctionDefinitionNumber())); |
928 |
1
|
printer.print(buffer.toString()); |
929 |
1
|
printer.print(" "); |
930 |
1
|
if (title != null && title.length() > 0) { |
931 |
1
|
printer.print(" (" + title + ")"); |
932 |
|
} |
933 |
1
|
if (info) { |
934 |
1
|
printer.print(" [" + id + "]"); |
935 |
|
} |
936 |
1
|
printer.println(); |
937 |
1
|
printer.println(); |
938 |
1
|
printer.print(" "); |
939 |
1
|
printer.println(getUtf8(definition.getFunCon())); |
940 |
1
|
printer.println(); |
941 |
1
|
if (definition.getDescription() != null) { |
942 |
0
|
printer.println(getLatexListEntry("getDescription()", definition.getDescription())); |
943 |
0
|
printer.println(); |
944 |
|
} |
945 |
|
} |
946 |
|
|
|
|
| 83.3% |
Uncovered Elements: 4 (24) |
Complexity: 5 |
Complexity Density: 0.28 |
|
947 |
96
|
public void visitEnter(final FunctionDefinition definition) {... |
948 |
96
|
final QedeqNumbers numbers = getCurrentNumbers(); |
949 |
96
|
printer.print("\u2609 "); |
950 |
96
|
final StringBuffer buffer = new StringBuffer(); |
951 |
96
|
buffer.append("Definition " + (numbers.getPredicateDefinitionNumber() |
952 |
|
+ numbers.getFunctionDefinitionNumber())); |
953 |
96
|
printer.print(buffer.toString()); |
954 |
96
|
printer.print(" "); |
955 |
96
|
if (title != null && title.length() > 0) { |
956 |
96
|
printer.print(" (" + title + ")"); |
957 |
|
} |
958 |
96
|
if (info) { |
959 |
32
|
printer.print(" [" + id + "]"); |
960 |
|
} |
961 |
96
|
printer.println(); |
962 |
96
|
printer.println(); |
963 |
96
|
printer.print(" "); |
964 |
96
|
printer.println(getUtf8(definition.getFormula().getElement())); |
965 |
96
|
printer.println(); |
966 |
96
|
if (definition.getDescription() != null) { |
967 |
0
|
printer.println(getLatexListEntry("getDescription()", definition.getDescription())); |
968 |
0
|
printer.println(); |
969 |
|
} |
970 |
|
} |
971 |
|
|
|
|
| 90% |
Uncovered Elements: 3 (30) |
Complexity: 8 |
Complexity Density: 0.44 |
|
972 |
218
|
public void visitEnter(final Rule rule) {... |
973 |
218
|
final QedeqNumbers numbers = getCurrentNumbers(); |
974 |
218
|
printer.print("\u2609 "); |
975 |
218
|
if ("de".equals(language)) { |
976 |
108
|
printer.print("Regel"); |
977 |
|
} else { |
978 |
110
|
printer.print("Rule"); |
979 |
|
} |
980 |
218
|
printer.print(" " + numbers.getRuleNumber()); |
981 |
218
|
printer.print(" "); |
982 |
218
|
if (title != null && title.length() > 0) { |
983 |
212
|
printer.print(" (" + title + ")"); |
984 |
|
} |
985 |
218
|
if (info) { |
986 |
74
|
printer.print(" [" + id + "]"); |
987 |
|
} |
988 |
218
|
printer.println(); |
989 |
218
|
printer.println((rule.getName() != null ? " Name: " + rule.getName() : "") |
990 |
218
|
+ (rule.getVersion() != null ? " - Version: " + rule.getVersion() : "")); |
991 |
218
|
printer.println(); |
992 |
218
|
if (rule.getDescription() != null) { |
993 |
218
|
printer.append(getLatexListEntry("getDescription()", rule.getDescription())); |
994 |
218
|
printer.println(); |
995 |
218
|
printer.println(); |
996 |
|
} |
997 |
|
} |
998 |
|
|
|
|
| 77.3% |
Uncovered Elements: 5 (22) |
Complexity: 6 |
Complexity Density: 0.5 |
|
999 |
12
|
public void visitEnter(final LinkList linkList) {... |
1000 |
12
|
if (linkList.size() <= 0) { |
1001 |
0
|
return; |
1002 |
|
} |
1003 |
12
|
if ("de".equals(language)) { |
1004 |
6
|
printer.println("Basierend auf: "); |
1005 |
|
} else { |
1006 |
6
|
if (!"en".equals(language)) { |
1007 |
0
|
printer.println("%%% TODO unknown language: " + language); |
1008 |
|
} |
1009 |
6
|
printer.println("Based on: "); |
1010 |
|
} |
1011 |
30
|
for (int i = 0; i < linkList.size(); i++) { |
1012 |
18
|
if (linkList.get(i) != null) { |
1013 |
18
|
printer.print(" (" + linkList.get(i) + ")"); |
1014 |
|
} |
1015 |
12
|
}; |
1016 |
12
|
printer.println(); |
1017 |
|
} |
1018 |
|
|
|
|
| 73.3% |
Uncovered Elements: 4 (15) |
Complexity: 4 |
Complexity Density: 0.44 |
|
1019 |
6
|
public void visitEnter(final ChangedRuleList list) {... |
1020 |
6
|
if (list.size() <= 0) { |
1021 |
0
|
return; |
1022 |
|
} |
1023 |
6
|
printer.println(); |
1024 |
6
|
if ("de".equals(language)) { |
1025 |
3
|
printer.println("Die folgenden Regeln m\u00FCssen erweitert werden."); |
1026 |
|
} else { |
1027 |
3
|
if (!"en".equals(language)) { |
1028 |
0
|
printer.println("%%% TODO unknown language: " + language); |
1029 |
|
} |
1030 |
3
|
printer.println("The following rules have to be extended."); |
1031 |
|
} |
1032 |
6
|
printer.println(); |
1033 |
|
} |
1034 |
|
|
|
|
| 75% |
Uncovered Elements: 3 (12) |
Complexity: 4 |
Complexity Density: 0.67 |
|
1035 |
48
|
public void visitEnter(final ChangedRule rule) {... |
1036 |
48
|
printer.println((rule.getName() != null ? " Name: " + rule.getName() : "") |
1037 |
48
|
+ (rule.getVersion() != null ? " - Version: " + rule.getVersion() : "")); |
1038 |
48
|
printer.println(); |
1039 |
48
|
if (rule.getDescription() != null) { |
1040 |
48
|
printer.append(getLatexListEntry("getDescription()", rule.getDescription())); |
1041 |
48
|
printer.println(); |
1042 |
48
|
printer.println(); |
1043 |
|
} |
1044 |
|
|
1045 |
|
} |
1046 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
1047 |
18
|
public void visitEnter(final LiteratureItemList list) {... |
1048 |
18
|
printer.println(); |
1049 |
18
|
printer.println(); |
1050 |
18
|
if ("de".equals(language)) { |
1051 |
9
|
underlineBig("Literaturverzeichnis"); |
1052 |
|
} else { |
1053 |
9
|
underlineBig("Bibliography"); |
1054 |
|
} |
1055 |
18
|
printImports(); |
1056 |
|
} |
1057 |
|
|
1058 |
|
|
1059 |
|
|
1060 |
|
|
|
|
| 96.3% |
Uncovered Elements: 1 (27) |
Complexity: 8 |
Complexity Density: 0.42 |
|
1061 |
36
|
private void printImports() {... |
1062 |
36
|
final ImportList imports = getKernelQedeqBo().getQedeq().getHeader().getImportList(); |
1063 |
36
|
if (imports != null && imports.size() > 0) { |
1064 |
24
|
printer.println(); |
1065 |
24
|
printer.println(); |
1066 |
24
|
if ("de".equals(language)) { |
1067 |
12
|
printer.println("Benutzte andere QEDEQ-Module:"); |
1068 |
|
} else { |
1069 |
12
|
printer.println("Used other QEDEQ modules:"); |
1070 |
|
} |
1071 |
24
|
printer.println(); |
1072 |
54
|
for (int i = 0; i < imports.size(); i++) { |
1073 |
30
|
final Import imp = imports.get(i); |
1074 |
30
|
printer.print("[" + imp.getLabel() + "] "); |
1075 |
30
|
final Specification spec = imp.getSpecification(); |
1076 |
30
|
printer.print(spec.getName()); |
1077 |
30
|
if (spec.getLocationList() != null && spec.getLocationList().size() > 0 |
1078 |
|
&& spec.getLocationList().get(0).getLocation().length() > 0) { |
1079 |
30
|
printer.print(" "); |
1080 |
30
|
printer.print(getUrl(getKernelQedeqBo().getModuleAddress(), spec)); |
1081 |
|
} |
1082 |
30
|
printer.println(); |
1083 |
|
} |
1084 |
24
|
printer.println(); |
1085 |
24
|
printer.println(); |
1086 |
|
} |
1087 |
|
} |
1088 |
|
|
|
|
| 96.2% |
Uncovered Elements: 1 (26) |
Complexity: 7 |
Complexity Density: 0.39 |
|
1089 |
18
|
public void visitLeave(final LiteratureItemList list) {... |
1090 |
18
|
final UsedByList usedby = getKernelQedeqBo().getQedeq().getHeader().getUsedByList(); |
1091 |
18
|
if (usedby != null && usedby.size() > 0) { |
1092 |
12
|
printer.println(); |
1093 |
12
|
printer.println(); |
1094 |
12
|
if ("de".equals(language)) { |
1095 |
6
|
printer.println("QEDEQ-Module, welche dieses hier verwenden:"); |
1096 |
|
} else { |
1097 |
6
|
printer.println("QEDEQ modules that use this one:"); |
1098 |
|
} |
1099 |
24
|
for (int i = 0; i < usedby.size(); i++) { |
1100 |
12
|
final Specification spec = usedby.get(i); |
1101 |
12
|
printer.print(spec.getName()); |
1102 |
12
|
final String url = getUrl(getKernelQedeqBo().getModuleAddress(), spec); |
1103 |
12
|
if (url != null && url.length() > 0) { |
1104 |
12
|
printer.print(" "); |
1105 |
12
|
printer.print(url); |
1106 |
|
} |
1107 |
12
|
printer.println(); |
1108 |
|
} |
1109 |
12
|
printer.println(); |
1110 |
12
|
printer.println(); |
1111 |
|
} |
1112 |
18
|
printer.println(); |
1113 |
|
} |
1114 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
1115 |
84
|
public void visitEnter(final LiteratureItem item) {... |
1116 |
84
|
printer.print("[" + item.getLabel() + "] "); |
1117 |
84
|
printer.println(getLatexListEntry("getItem()", item.getItem())); |
1118 |
84
|
printer.println(); |
1119 |
|
} |
1120 |
|
|
1121 |
|
|
1122 |
|
|
1123 |
|
|
1124 |
|
|
1125 |
|
@param |
1126 |
|
@param |
1127 |
|
|
|
|
| 90.9% |
Uncovered Elements: 2 (22) |
Complexity: 6 |
Complexity Density: 0.43 |
|
1128 |
618
|
private void printTopFormula(final Element element, final String mainLabel) {... |
1129 |
618
|
if (!element.isList() || !element.getList().getOperator().equals("AND")) { |
1130 |
510
|
printer.print(" "); |
1131 |
510
|
printFormula(element); |
1132 |
510
|
return; |
1133 |
|
} |
1134 |
108
|
final ElementList list = element.getList(); |
1135 |
912
|
for (int i = 0; i < list.size(); i++) { |
1136 |
804
|
String label = ""; |
1137 |
804
|
if (list.size() >= ALPHABET.length() * ALPHABET.length()) { |
1138 |
0
|
label = "" + (i + 1); |
1139 |
|
} else { |
1140 |
804
|
if (list.size() > ALPHABET.length()) { |
1141 |
240
|
final int div = (i / ALPHABET.length()); |
1142 |
240
|
label = "" + ALPHABET.charAt(div); |
1143 |
|
} |
1144 |
804
|
label += ALPHABET.charAt(i % ALPHABET.length()); |
1145 |
|
} |
1146 |
804
|
printer.println(" (" + label + ") " + getUtf8(list.getElement(i))); |
1147 |
|
} |
1148 |
|
} |
1149 |
|
|
1150 |
|
|
1151 |
|
|
1152 |
|
|
1153 |
|
@param |
1154 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1155 |
822
|
private void printFormula(final Element element) {... |
1156 |
822
|
printer.println(getUtf8(element)); |
1157 |
|
} |
1158 |
|
|
1159 |
|
|
1160 |
|
|
1161 |
|
|
1162 |
|
|
1163 |
|
@param |
1164 |
|
|
1165 |
|
|
1166 |
|
@param |
1167 |
|
@return |
1168 |
|
|
|
|
| 85.4% |
Uncovered Elements: 7 (48) |
Complexity: 15 |
Complexity Density: 0.62 |
|
1169 |
3686
|
private String getLatexListEntry(final String method, final LatexList list) {... |
1170 |
3686
|
if (list == null) { |
1171 |
0
|
return ""; |
1172 |
|
} |
1173 |
3686
|
if (method.length() > 0) { |
1174 |
3686
|
subContext = method; |
1175 |
|
} |
1176 |
3686
|
try { |
1177 |
5488
|
for (int i = 0; i < list.size(); i++) { |
1178 |
5006
|
if (language.equals(list.get(i).getLanguage())) { |
1179 |
3204
|
if (method.length() > 0) { |
1180 |
3204
|
subContext = method + ".get(" + i + ")"; |
1181 |
|
} |
1182 |
3204
|
return getUtf8(list.get(i)); |
1183 |
|
} |
1184 |
|
} |
1185 |
|
|
1186 |
482
|
final String def = getKernelQedeqBo().getOriginalLanguage(); |
1187 |
512
|
for (int i = 0; i < list.size(); i++) { |
1188 |
482
|
if (EqualsUtility.equals(def, list.get(i).getLanguage())) { |
1189 |
452
|
if (method.length() > 0) { |
1190 |
452
|
subContext = method + ".get(" + i + ")"; |
1191 |
|
} |
1192 |
452
|
return "MISSING! OTHER: " + getUtf8(list.get(i)); |
1193 |
|
} |
1194 |
|
} |
1195 |
|
|
1196 |
33
|
for (int i = 0; i < list.size(); i++) { |
1197 |
30
|
if (method.length() > 0) { |
1198 |
30
|
subContext = method + ".get(" + i + ")"; |
1199 |
|
} |
1200 |
30
|
if (null != list.get(i) && null != list.get(i).getLatex() |
1201 |
|
&& list.get(i).getLatex().trim().length() > 0) { |
1202 |
27
|
return "MISSING! OTHER: " + getUtf8(list.get(i)); |
1203 |
|
} |
1204 |
|
} |
1205 |
3
|
return "MISSING!"; |
1206 |
|
} finally { |
1207 |
3686
|
if (method.length() > 0) { |
1208 |
3686
|
subContext = ""; |
1209 |
|
} |
1210 |
|
} |
1211 |
|
} |
1212 |
|
|
1213 |
|
|
1214 |
|
|
1215 |
|
|
1216 |
|
@param |
1217 |
|
|
1218 |
|
@param |
1219 |
|
|
1220 |
|
@return |
1221 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
1222 |
4044
|
private ModuleContext getCurrentContext(final SourcePosition startDelta,... |
1223 |
|
final SourcePosition endDelta) { |
1224 |
4044
|
if (subContext.length() == 0) { |
1225 |
3324
|
return super.getCurrentContext(); |
1226 |
|
} |
1227 |
720
|
final ModuleContext c = new ModuleContext(super.getCurrentContext().getModuleLocation(), |
1228 |
|
super.getCurrentContext().getLocationWithinModule() + "." + subContext, |
1229 |
|
startDelta, endDelta); |
1230 |
720
|
return c; |
1231 |
|
} |
1232 |
|
|
1233 |
|
|
1234 |
|
|
1235 |
|
|
1236 |
|
@param |
1237 |
|
@param |
1238 |
|
@param |
1239 |
|
|
1240 |
|
@param |
1241 |
|
|
1242 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1243 |
106
|
public void addWarning(final int code, final String msg, final SourcePosition startDelta,... |
1244 |
|
final SourcePosition endDelta) { |
1245 |
106
|
Trace.param(CLASS, this, "addWarning", "msg", msg); |
1246 |
106
|
if (addWarnings) { |
1247 |
30
|
addWarning(new UnicodeException(code, msg, getCurrentContext(startDelta, |
1248 |
|
endDelta))); |
1249 |
|
} |
1250 |
|
} |
1251 |
|
|
1252 |
|
|
1253 |
|
|
1254 |
|
|
1255 |
|
@param |
1256 |
|
@param |
1257 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1258 |
0
|
public void addWarning(final int code, final String msg) {... |
1259 |
0
|
Trace.param(CLASS, this, "addWarning", "msg", msg); |
1260 |
0
|
if (addWarnings) { |
1261 |
0
|
addWarning(new UnicodeException(code, msg, getCurrentContext())); |
1262 |
|
} |
1263 |
|
} |
1264 |
|
|
1265 |
|
|
1266 |
|
|
1267 |
|
|
1268 |
|
@param |
1269 |
|
@param |
1270 |
|
@return |
1271 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1272 |
3108
|
protected String[] getUtf8(final Element element, final int max) {... |
1273 |
3108
|
return getKernelQedeqBo().getElement2Utf8().getUtf8(element, max); |
1274 |
|
} |
1275 |
|
|
1276 |
|
|
1277 |
|
|
1278 |
|
|
1279 |
|
|
1280 |
|
@param |
1281 |
|
@return |
1282 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1283 |
3992
|
protected String getUtf8(final Element element) {... |
1284 |
3992
|
return getUtf8(getKernelQedeqBo().getElement2Latex().getLatex(element)); |
1285 |
|
} |
1286 |
|
|
1287 |
|
|
1288 |
|
|
1289 |
|
|
1290 |
|
@param |
1291 |
|
@return |
1292 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
1293 |
3683
|
private String getUtf8(final Latex latex) {... |
1294 |
3683
|
if (latex == null || latex.getLatex() == null) { |
1295 |
9
|
return ""; |
1296 |
|
} |
1297 |
3674
|
return getUtf8(latex.getLatex()); |
1298 |
|
} |
1299 |
|
|
1300 |
|
|
1301 |
|
|
1302 |
|
|
1303 |
|
@param |
1304 |
|
@return |
1305 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1306 |
7666
|
private String getUtf8(final String latex) {... |
1307 |
7666
|
if (latex == null) { |
1308 |
0
|
return ""; |
1309 |
|
} |
1310 |
7666
|
return Latex2UnicodeParser.transform(this, latex, maxColumns); |
1311 |
|
} |
1312 |
|
|
1313 |
|
|
1314 |
|
|
1315 |
|
|
1316 |
|
@param |
1317 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
1318 |
288
|
private void underlineBig(final String text) {... |
1319 |
288
|
printer.println(text); |
1320 |
6584
|
for (int i = 0; i < text.length(); i++) { |
1321 |
6296
|
printer.print("\u2550"); |
1322 |
|
} |
1323 |
288
|
printer.println(); |
1324 |
|
} |
1325 |
|
|
1326 |
|
|
1327 |
|
|
1328 |
|
|
1329 |
|
@param |
1330 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
1331 |
432
|
private void underline(final String text) {... |
1332 |
432
|
printer.println(text); |
1333 |
11119
|
for (int i = 0; i < text.length(); i++) { |
1334 |
10687
|
printer.print("\u2015"); |
1335 |
|
} |
1336 |
432
|
printer.println(); |
1337 |
|
} |
1338 |
|
|
|
|
| 78.6% |
Uncovered Elements: 6 (28) |
Complexity: 12 |
Complexity Density: 1.2 |
|
1339 |
4014
|
public String getReferenceLink(final String reference, final SourcePosition start,... |
1340 |
|
final SourcePosition end) { |
1341 |
4014
|
final Reference ref = getReference(reference, getCurrentContext(start, end), addWarnings, |
1342 |
|
false); |
1343 |
|
|
1344 |
4014
|
if (ref.isNodeLocalReference() && ref.isSubReference()) { |
1345 |
0
|
return "(" + ref.getSubLabel() + ")"; |
1346 |
|
} |
1347 |
|
|
1348 |
4014
|
if (ref.isNodeLocalReference() && ref.isProofLineReference()) { |
1349 |
2754
|
return "(" + ref.getProofLineLabel() + ")"; |
1350 |
|
} |
1351 |
|
|
1352 |
1260
|
if (!ref.isExternal()) { |
1353 |
1050
|
return getNodeDisplay(ref.getNodeLabel(), ref.getNode()) |
1354 |
1050
|
+ (ref.isSubReference() ? " (" + ref.getSubLabel() + ")" : "") |
1355 |
1050
|
+ (ref.isProofLineReference() ? " (" + ref.getProofLineLabel() + ")" : ""); |
1356 |
|
} |
1357 |
|
|
1358 |
|
|
1359 |
210
|
if (ref.isExternalModuleReference()) { |
1360 |
6
|
return "[" + ref.getExternalQedeqLabel() + "]"; |
1361 |
|
} |
1362 |
|
|
1363 |
204
|
return getNodeDisplay(ref.getNodeLabel(), ref.getNode()) |
1364 |
204
|
+ (ref.isSubReference() ? " (" + ref.getSubLabel() + ")" : "") |
1365 |
204
|
+ (ref.isProofLineReference() ? " (" + ref.getProofLineLabel() + ")" : "") |
1366 |
204
|
+ (ref.isExternal() ? " [" + ref.getExternalQedeqLabel() + "]" : ""); |
1367 |
|
} |
1368 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1369 |
1254
|
private String getNodeDisplay(final String label, final KernelNodeBo kNode) {... |
1370 |
1254
|
return getNodeDisplay(label, kNode, language); |
1371 |
|
} |
1372 |
|
|
1373 |
|
} |