Clover Coverage Report
Coverage timestamp: Fri Feb 14 2014 07:28:57 UTC
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
835   1,417   299   12.28
354   1,238   0.36   68
68     4.4  
1    
 
  QedeqNotNullTraverser       Line # 91 835 299 97.7% 0.9769292
 
  (124)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2014, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.kernel.se.visitor;
17   
18    import java.util.HashMap;
19    import java.util.Map;
20    import java.util.Stack;
21   
22    import org.qedeq.kernel.se.base.list.Atom;
23    import org.qedeq.kernel.se.base.list.Element;
24    import org.qedeq.kernel.se.base.list.ElementList;
25    import org.qedeq.kernel.se.base.module.Add;
26    import org.qedeq.kernel.se.base.module.Author;
27    import org.qedeq.kernel.se.base.module.AuthorList;
28    import org.qedeq.kernel.se.base.module.Axiom;
29    import org.qedeq.kernel.se.base.module.ChangedRule;
30    import org.qedeq.kernel.se.base.module.ChangedRuleList;
31    import org.qedeq.kernel.se.base.module.Chapter;
32    import org.qedeq.kernel.se.base.module.ChapterList;
33    import org.qedeq.kernel.se.base.module.Conclusion;
34    import org.qedeq.kernel.se.base.module.ConditionalProof;
35    import org.qedeq.kernel.se.base.module.Existential;
36    import org.qedeq.kernel.se.base.module.FormalProof;
37    import org.qedeq.kernel.se.base.module.FormalProofLine;
38    import org.qedeq.kernel.se.base.module.FormalProofLineList;
39    import org.qedeq.kernel.se.base.module.FormalProofList;
40    import org.qedeq.kernel.se.base.module.Formula;
41    import org.qedeq.kernel.se.base.module.FunctionDefinition;
42    import org.qedeq.kernel.se.base.module.Header;
43    import org.qedeq.kernel.se.base.module.Hypothesis;
44    import org.qedeq.kernel.se.base.module.Import;
45    import org.qedeq.kernel.se.base.module.ImportList;
46    import org.qedeq.kernel.se.base.module.InitialFunctionDefinition;
47    import org.qedeq.kernel.se.base.module.InitialPredicateDefinition;
48    import org.qedeq.kernel.se.base.module.Latex;
49    import org.qedeq.kernel.se.base.module.LatexList;
50    import org.qedeq.kernel.se.base.module.LinkList;
51    import org.qedeq.kernel.se.base.module.LiteratureItem;
52    import org.qedeq.kernel.se.base.module.LiteratureItemList;
53    import org.qedeq.kernel.se.base.module.Location;
54    import org.qedeq.kernel.se.base.module.LocationList;
55    import org.qedeq.kernel.se.base.module.ModusPonens;
56    import org.qedeq.kernel.se.base.module.Node;
57    import org.qedeq.kernel.se.base.module.PredicateDefinition;
58    import org.qedeq.kernel.se.base.module.Proof;
59    import org.qedeq.kernel.se.base.module.ProofList;
60    import org.qedeq.kernel.se.base.module.Proposition;
61    import org.qedeq.kernel.se.base.module.Qedeq;
62    import org.qedeq.kernel.se.base.module.Reason;
63    import org.qedeq.kernel.se.base.module.Rename;
64    import org.qedeq.kernel.se.base.module.Rule;
65    import org.qedeq.kernel.se.base.module.Section;
66    import org.qedeq.kernel.se.base.module.SectionList;
67    import org.qedeq.kernel.se.base.module.Specification;
68    import org.qedeq.kernel.se.base.module.Subsection;
69    import org.qedeq.kernel.se.base.module.SubsectionList;
70    import org.qedeq.kernel.se.base.module.SubstFree;
71    import org.qedeq.kernel.se.base.module.SubstFunc;
72    import org.qedeq.kernel.se.base.module.SubstPred;
73    import org.qedeq.kernel.se.base.module.Term;
74    import org.qedeq.kernel.se.base.module.Universal;
75    import org.qedeq.kernel.se.base.module.UsedByList;
76    import org.qedeq.kernel.se.common.ModuleAddress;
77    import org.qedeq.kernel.se.common.ModuleContext;
78    import org.qedeq.kernel.se.common.ModuleDataException;
79    import org.qedeq.kernel.se.common.RuleKey;
80    import org.qedeq.kernel.se.common.ServiceCompleteness;
81    import org.qedeq.kernel.se.dto.module.FormulaVo;
82    import org.qedeq.kernel.se.dto.module.TermVo;
83   
84   
85    /**
86    * Traverse QEDEQ module. Calls visitors of {@link org.qedeq.kernel.se.visitor.QedeqVisitor}
87    * for non <code>null</code> arguments.
88    *
89    * @author Michael Meyling
90    */
 
91    public class QedeqNotNullTraverser implements QedeqTraverser, ServiceCompleteness {
92   
93    /** Current context during creation. */
94    private final ModuleContext currentContext;
95   
96    /** Readable traverse location info. */
97    private final Stack location = new Stack();
98   
99    /** Herein are various counters for the current node. */
100    private QedeqNumbers data = new QedeqNumbers(0, 0);
101   
102    /** Converts chapter and other titles into text. */
103    private final LatexList2Text transform = new LatexList2Text();
104   
105    /**
106    * These methods are called if a node is visited. To start the whole process just call
107    * {@link #accept(Qedeq)}.
108    */
109    private QedeqVisitor visitor;
110   
111    /** Is sub node traverse currently blocked? */
112    private boolean blocked;
113   
114    /** Currently visited node element of QEDEQ module. Might be <code>null</code>. */
115    private Node node;
116   
117    /** Maps local {@link ruleName}s to local {@link RuleKey}s. */
118    private Map ruleExistence;
119   
120    /**
121    * Constructor.
122    *
123    * @param globalContext Module location information.
124    * @param visitor These methods are called if a node is visited.
125    */
 
126  68977 toggle public QedeqNotNullTraverser(final ModuleAddress globalContext, final QedeqVisitor visitor) {
127  68977 currentContext = globalContext.createModuleContext();
128  68977 this.visitor = visitor;
129    }
130   
131    /**
132    * Constructor.
133    *
134    * @param globalContext Module location information.
135    */
 
136  1 toggle public QedeqNotNullTraverser(final ModuleAddress globalContext) {
137  1 currentContext = globalContext.createModuleContext();
138    }
139   
140    /**
141    * Set visitor.
142    *
143    * @param visitor These methods are called if a node is visited.
144    */
 
145  1 toggle public void setVisitor(final QedeqVisitor visitor) {
146  1 this.visitor = visitor;
147    }
148   
 
149  68759 toggle public void accept(final Qedeq qedeq) throws ModuleDataException {
150  68759 ruleExistence = new HashMap();
151  68759 setLocation("started");
152  68759 if (qedeq == null) {
153  1 throw new NullPointerException("null QEDEQ module");
154    }
155  68758 data = new QedeqNumbers(
156  68758 (qedeq.getHeader() != null && qedeq.getHeader().getImportList() != null
157    ? qedeq.getHeader().getImportList().size() : 0),
158  68758 (qedeq.getChapterList() != null ? qedeq.getChapterList().size() : 0)
159    );
160  68758 getCurrentContext().setLocationWithinModule("");
161  68758 checkForInterrupt();
162  68758 blocked = false;
163  68758 final String context = getCurrentContext().getLocationWithinModule();
164  68758 visitor.visitEnter(qedeq);
165  68755 if (qedeq.getHeader() != null) {
166  68623 getCurrentContext().setLocationWithinModule(context + "getHeader()");
167  68623 accept(qedeq.getHeader());
168    }
169  68012 if (qedeq.getChapterList() != null) {
170  67987 getCurrentContext().setLocationWithinModule(context + "getChapterList()");
171  67987 accept(qedeq.getChapterList());
172    }
173  2107 if (qedeq.getLiteratureItemList() != null) {
174  888 getCurrentContext().setLocationWithinModule(context + "getLiteratureItemList()");
175  888 accept(qedeq.getLiteratureItemList());
176    }
177  1907 setLocationWithinModule(context);
178  1907 visitor.visitLeave(qedeq);
179  1907 setLocationWithinModule(context);
180  1907 setLocation("finished");
181  1907 data.setFinished(true);
182    }
183   
184    /**
185    * Check if current thread is interrupted.
186    *
187    * @throws InterruptException We were interrupted.
188    */
 
189  7131801 toggle private void checkForInterrupt() throws InterruptException {
190  7131801 if (Thread.interrupted()) {
191  53 throw new InterruptException(getCurrentContext());
192    }
193    }
194   
 
195  68625 toggle public void accept(final Header header) throws ModuleDataException {
196  68625 checkForInterrupt();
197  68624 if (blocked || header == null) {
198  1 return;
199    }
200  68623 setLocation("analyzing header");
201  68623 final String context = getCurrentContext().getLocationWithinModule();
202  68623 visitor.visitEnter(header);
203  68584 if (header.getSpecification() != null) {
204  68567 setLocationWithinModule(context + ".getSpecification()");
205  68567 accept(header.getSpecification());
206    }
207  68416 if (header.getTitle() != null) {
208  68398 setLocationWithinModule(context + ".getTitle()");
209  68398 accept(header.getTitle());
210    }
211  68347 if (header.getSummary() != null) {
212  68329 setLocationWithinModule(context + ".getSummary()");
213  68329 accept(header.getSummary());
214    }
215  68278 if (header.getAuthorList() != null) {
216  68261 setLocationWithinModule(context + ".getAuthorList()");
217  68261 accept(header.getAuthorList());
218    }
219  68164 if (header.getImportList() != null) {
220  26599 setLocationWithinModule(context + ".getImportList()");
221  26599 accept(header.getImportList());
222    }
223  67946 if (header.getUsedByList() != null) {
224  27563 setLocationWithinModule(context + ".getUsedByList()");
225  27563 accept(header.getUsedByList());
226    }
227  67880 setLocationWithinModule(context);
228  67880 visitor.visitLeave(header);
229  67880 setLocationWithinModule(context);
230    }
231   
 
232  27565 toggle public void accept(final UsedByList usedByList) throws ModuleDataException {
233  27565 checkForInterrupt();
234  27564 if (blocked || usedByList == null) {
235  27054 return;
236    }
237  510 location.push("working on used by list");
238  510 final String context = getCurrentContext().getLocationWithinModule();
239  510 visitor.visitEnter(usedByList);
240  941 for (int i = 0; i < usedByList.size(); i++) {
241  497 setLocationWithinModule(context + ".get(" + i + ")");
242  497 accept(usedByList.get(i));
243    }
244  444 setLocationWithinModule(context);
245  444 visitor.visitLeave(usedByList);
246  444 setLocationWithinModule(context);
247  444 location.pop();
248    }
249   
 
250  26601 toggle public void accept(final ImportList importList) throws ModuleDataException {
251  26601 checkForInterrupt();
252  26600 if (blocked || importList == null) {
253  25432 return;
254    }
255  1168 location.push("working on import list");
256  1168 final String context = getCurrentContext().getLocationWithinModule();
257  1168 visitor.visitEnter(importList);
258  2472 for (int i = 0; i < importList.size(); i++) {
259  1522 setLocationWithinModule(context + ".get(" + i + ")");
260  1522 accept(importList.get(i));
261    }
262  950 setLocationWithinModule(context);
263  950 visitor.visitLeave(importList);
264  950 setLocationWithinModule(context);
265  950 location.pop();
266    }
267   
 
268  1524 toggle public void accept(final Import imp) throws ModuleDataException {
269  1524 data.increaseImportNumber();
270  1524 checkForInterrupt();
271  1523 if (blocked || imp == null) {
272  45 return;
273    }
274  1478 location.push("import " + data.getImportNumber() + ": " + imp.getLabel());
275  1478 final String context = getCurrentContext().getLocationWithinModule();
276  1478 visitor.visitEnter(imp);
277  1410 if (imp.getSpecification() != null) {
278  1409 setLocationWithinModule(context + ".getSpecification()");
279  1409 accept(imp.getSpecification());
280    }
281  1276 setLocationWithinModule(context);
282  1276 visitor.visitLeave(imp);
283  1276 setLocationWithinModule(context);
284  1276 location.pop();
285    }
286   
 
287  70475 toggle public void accept(final Specification specification) throws ModuleDataException {
288  70475 checkForInterrupt();
289  70474 if (blocked || specification == null) {
290  66171 return;
291    }
292  4303 final String context = getCurrentContext().getLocationWithinModule();
293  4303 visitor.visitEnter(specification);
294  4163 if (specification.getLocationList() != null) {
295  4160 setLocationWithinModule(context + ".getLocationList()");
296  4160 accept(specification.getLocationList());
297    }
298  3947 setLocationWithinModule(context);
299  3947 visitor.visitLeave(specification);
300  3947 setLocationWithinModule(context);
301    }
302   
 
303  4162 toggle public void accept(final LocationList locationList) throws ModuleDataException {
304  4162 checkForInterrupt();
305  4161 if (blocked || locationList == null) {
306  537 return;
307    }
308  3624 final String context = getCurrentContext().getLocationWithinModule();
309  3624 visitor.visitEnter(locationList);
310  7867 for (int i = 0; i < locationList.size(); i++) {
311  4459 setLocationWithinModule(context + ".get(" + i + ")");
312  4459 accept(locationList.get(i));
313    }
314  3408 setLocationWithinModule(context);
315  3408 visitor.visitLeave(locationList);
316  3408 setLocationWithinModule(context);
317    }
318   
 
319  4461 toggle public void accept(final Location location) throws ModuleDataException {
320  4461 checkForInterrupt();
321  4460 if (blocked || location == null) {
322  1 return;
323    }
324  4459 final String context = getCurrentContext().getLocationWithinModule();
325  4459 visitor.visitEnter(location);
326  4315 setLocationWithinModule(context);
327  4315 visitor.visitLeave(location);
328  4315 setLocationWithinModule(context);
329    }
330   
 
331  68263 toggle public void accept(final AuthorList authorList) throws ModuleDataException {
332  68263 checkForInterrupt();
333  68262 if (blocked || authorList == null) {
334  66099 return;
335    }
336  2163 final String context = getCurrentContext().getLocationWithinModule();
337  2163 visitor.visitEnter(authorList);
338  4173 for (int i = 0; i < authorList.size(); i++) {
339  2124 setLocationWithinModule(context + ".get(" + i + ")");
340  2124 accept(authorList.get(i));
341    }
342  2049 setLocationWithinModule(context);
343  2049 visitor.visitLeave(authorList);
344  2049 setLocationWithinModule(context);
345    }
346   
 
347  2126 toggle public void accept(final Author author) throws ModuleDataException {
348  2126 checkForInterrupt();
349  2125 if (blocked || author == null) {
350  285 return;
351    }
352  1840 final String context = getCurrentContext().getLocationWithinModule();
353  1840 visitor.visitEnter(author);
354  1784 if (author.getName() != null) {
355  1783 setLocationWithinModule(context + ".getName()");
356  1783 accept(author.getName());
357    }
358  1764 setLocationWithinModule(context);
359  1764 visitor.visitLeave(author);
360  1764 setLocationWithinModule(context);
361    }
362   
 
363  67989 toggle public void accept(final ChapterList chapterList) throws ModuleDataException {
364  67989 checkForInterrupt();
365  67988 if (blocked || chapterList == null) {
366  209 return;
367    }
368  67779 final String context = getCurrentContext().getLocationWithinModule();
369  67779 visitor.visitEnter(chapterList);
370  245516 for (int i = 0; i < chapterList.size(); i++) {
371  243642 setLocationWithinModule(context + ".get(" + i + ")");
372  243642 accept(chapterList.get(i));
373    }
374  1874 setLocationWithinModule(context);
375  1874 visitor.visitLeave(chapterList);
376  1874 setLocationWithinModule(context);
377    }
378   
 
379  243644 toggle public void accept(final Chapter chapter) throws ModuleDataException {
380  243644 checkForInterrupt();
381  243643 if (blocked || chapter == null) {
382  1378 return;
383    }
384  242265 data.increaseChapterNumber(
385  242265 (chapter.getSectionList() != null ? chapter.getSectionList().size() : 0),
386    chapter.getNoNumber() == null || !chapter.getNoNumber().booleanValue()
387    );
388  242265 if (data.isChapterNumbering()) {
389  149843 setLocation("Chapter " + data.getChapterNumber() + " "
390    + transform.transform(chapter.getTitle()));
391    } else {
392  92422 setLocation(transform.transform(chapter.getTitle()));
393    }
394  242265 final String context = getCurrentContext().getLocationWithinModule();
395  242265 visitor.visitEnter(chapter);
396  242088 if (chapter.getTitle() != null) {
397  241964 setLocationWithinModule(context + ".getTitle()");
398  241964 accept(chapter.getTitle());
399    }
400  241789 if (chapter.getIntroduction() != null) {
401  241264 setLocationWithinModule(context + ".getIntroduction()");
402  241264 accept(chapter.getIntroduction());
403    }
404  241485 if (chapter.getSectionList() != null) {
405  148598 setLocationWithinModule(context + ".getSectionList()");
406  148598 accept(chapter.getSectionList());
407    }
408  176380 setLocationWithinModule(context);
409  176380 visitor.visitLeave(chapter);
410  176380 setLocationWithinModule(context);
411    }
412   
 
413  890 toggle public void accept(final LiteratureItemList literatureItemList)
414    throws ModuleDataException {
415  890 checkForInterrupt();
416  889 if (blocked || literatureItemList == null) {
417  75 return;
418    }
419  814 setLocation("working on literature list");
420  814 final String context = getCurrentContext().getLocationWithinModule();
421  814 visitor.visitEnter(literatureItemList);
422  4142 for (int i = 0; i < literatureItemList.size(); i++) {
423  3528 setLocationWithinModule(context + ".get(" + i + ")");
424  3528 accept(literatureItemList.get(i));
425    }
426  614 setLocationWithinModule(context);
427  614 visitor.visitLeave(literatureItemList);
428  614 setLocationWithinModule(context);
429    }
430   
 
431  3530 toggle public void accept(final LiteratureItem item) throws ModuleDataException {
432  3530 checkForInterrupt();
433  3529 if (blocked || item == null) {
434  1 return;
435    }
436  3528 final String context = getCurrentContext().getLocationWithinModule();
437  3528 visitor.visitEnter(item);
438  3450 if (item.getItem() != null) {
439  3449 setLocationWithinModule(context + ".getItem()");
440  3449 accept(item.getItem());
441    }
442  3336 setLocationWithinModule(context);
443  3336 visitor.visitLeave(item);
444  3336 setLocationWithinModule(context);
445    }
446   
 
447  148600 toggle public void accept(final SectionList sectionList) throws ModuleDataException {
448  148600 checkForInterrupt();
449  148599 if (blocked || sectionList == null) {
450  79675 return;
451    }
452  68924 final String context = getCurrentContext().getLocationWithinModule();
453  68924 visitor.visitEnter(sectionList);
454  204295 for (int i = 0; i < sectionList.size(); i++) {
455  200476 setLocationWithinModule(context + ".get(" + i + ")");
456  200476 accept(sectionList.get(i));
457    }
458  3819 setLocationWithinModule(context);
459  3819 visitor.visitLeave(sectionList);
460  3819 setLocationWithinModule(context);
461    }
462   
 
463  200478 toggle public void accept(final Section section) throws ModuleDataException {
464  200478 checkForInterrupt();
465  200477 if (blocked || section == null) {
466  1 return;
467    }
468  200476 data.increaseSectionNumber(
469  200476 (section.getSubsectionList() != null ? section.getSubsectionList().size() : 0),
470    section.getNoNumber() == null || !section.getNoNumber().booleanValue()
471    );
472  200476 String title = "";
473  200476 if (data.isChapterNumbering()) {
474  200476 title += data.getChapterNumber();
475    }
476  200476 if (data.isSectionNumbering()) {
477  200476 title += (title.length() > 0 ? "." : "") + data.getSectionNumber();
478    }
479  200476 if (section.getTitle() != null) {
480  200359 title += " " + transform.transform(section.getTitle());
481    }
482  200476 location.push(title);
483  200476 final String context = getCurrentContext().getLocationWithinModule();
484  200476 visitor.visitEnter(section);
485  200148 if (section.getTitle() != null) {
486  200031 setLocationWithinModule(context + ".getTitle()");
487  200031 accept(section.getTitle());
488    }
489  199516 if (section.getIntroduction() != null) {
490  199247 setLocationWithinModule(context + ".getIntroduction()");
491  199247 accept(section.getIntroduction());
492    }
493  198915 if (section.getSubsectionList() != null) {
494  183340 setLocationWithinModule(context + ".getSubsectionList()");
495  183340 accept(section.getSubsectionList());
496    }
497  135481 setLocationWithinModule(context);
498  135481 visitor.visitLeave(section);
499  135481 setLocationWithinModule(context);
500  135481 location.pop();
501    }
502   
 
503  183342 toggle public void accept(final SubsectionList subsectionList) throws ModuleDataException {
504  183342 checkForInterrupt();
505  183341 if (blocked || subsectionList == null) {
506  112756 return;
507    }
508  70585 final String context = getCurrentContext().getLocationWithinModule();
509  70585 visitor.visitEnter(subsectionList);
510  343326 for (int i = 0; i < subsectionList.size(); i++) {
511  336175 setLocationWithinModule(context + ".get(" + i + ")");
512    // TODO 20130131 m31: variation here hard coded
513    // 20050608: here the Subsection context is type dependently specified
514  336175 if (subsectionList.get(i) instanceof Subsection) {
515  8929 setLocationWithinModule(context + ".get(" + i + ").getSubsection()");
516  8929 accept((Subsection) subsectionList.get(i));
517  327246 } else if (subsectionList.get(i) instanceof Node) {
518  327246 setLocationWithinModule(context + ".get(" + i + ").getNode()");
519  327246 accept((Node) subsectionList.get(i));
520  0 } else if (subsectionList.get(i) == null) {
521    // ignore
522    } else {
523  0 throw new IllegalArgumentException("unexpected subsection type: "
524    + subsectionList.get(i).getClass());
525    }
526    }
527  7151 setLocationWithinModule(context);
528  7151 visitor.visitLeave(subsectionList);
529  7151 setLocationWithinModule(context);
530    }
531   
 
532  8931 toggle public void accept(final Subsection subsection) throws ModuleDataException {
533  8931 checkForInterrupt();
534  8930 if (blocked || subsection == null) {
535  1 return;
536    }
537  8929 data.increaseSubsectionNumber();
538  8929 String title = "";
539  8929 if (data.isChapterNumbering()) {
540  8929 title += data.getChapterNumber();
541    }
542  8929 if (data.isSectionNumbering()) {
543  8929 title += (title.length() > 0 ? "." : "") + data.getSectionNumber();
544    }
545  8929 title += (title.length() > 0 ? "." : "") + data.getSubsectionNumber();
546  8929 if (subsection.getTitle() != null) {
547  2748 title += " " + transform.transform(subsection.getTitle());
548    }
549  8929 title = title + " [" + subsection.getId() + "]";
550  8929 location.push(title);
551  8929 final String context = getCurrentContext().getLocationWithinModule();
552  8929 visitor.visitEnter(subsection);
553  8795 if (subsection.getTitle() != null) {
554  2658 setLocationWithinModule(context + ".getTitle()");
555  2658 accept(subsection.getTitle());
556    }
557  8663 if (subsection.getLatex() != null) {
558  8660 setLocationWithinModule(context + ".getLatex()");
559  8660 accept(subsection.getLatex());
560    }
561  8439 setLocationWithinModule(context);
562  8439 visitor.visitLeave(subsection);
563  8439 setLocationWithinModule(context);
564  8439 location.pop();
565    }
566   
 
567  327248 toggle public void accept(final Node node) throws ModuleDataException {
568  327248 checkForInterrupt();
569  327247 data.increaseNodeNumber();
570  327247 if (blocked || node == null) {
571  1 return;
572    }
573  327246 this.node = node;
574  327246 String title = "";
575  327246 if (node.getTitle() != null) {
576  117837 title = transform.transform(node.getTitle());
577    }
578  327246 title = title + " [" + node.getId() + "]";
579  327246 location.push(title);
580  327246 final String context = getCurrentContext().getLocationWithinModule();
581  327246 visitor.visitEnter(node);
582  325330 if (node.getName() != null) {
583  116849 setLocationWithinModule(context + ".getName()");
584  116849 accept(node.getName());
585    }
586  324284 if (node.getTitle() != null) {
587  115795 setLocationWithinModule(context + ".getTitle()");
588  115795 accept(node.getTitle());
589    }
590  323238 if (node.getPrecedingText() != null) {
591  177648 setLocationWithinModule(context + ".getPrecedingText()");
592  177648 accept(node.getPrecedingText());
593    }
594  321768 if (node.getNodeType() != null) {
595  321711 setLocationWithinModule(context + ".getNodeType()");
596  321711 if (node.getNodeType() instanceof Axiom) {
597  41913 setLocationWithinModule(context + ".getNodeType().getAxiom()");
598  41913 accept((Axiom) node.getNodeType());
599  279798 } else if (node.getNodeType() instanceof InitialPredicateDefinition) {
600  6386 setLocationWithinModule(context + ".getNodeType().getInitialPredicateDefinition()");
601  6386 accept((InitialPredicateDefinition) node.getNodeType());
602  273412 } else if (node.getNodeType() instanceof PredicateDefinition) {
603  19932 setLocationWithinModule(context + ".getNodeType().getPredicateDefinition()");
604  19932 accept((PredicateDefinition) node.getNodeType());
605  253480 } else if (node.getNodeType() instanceof InitialFunctionDefinition) {
606  57 setLocationWithinModule(context + ".getNodeType().getInitialFunctionDefinition()");
607  57 accept((InitialFunctionDefinition) node.getNodeType());
608  253423 } else if (node.getNodeType() instanceof FunctionDefinition) {
609  27562 setLocationWithinModule(context + ".getNodeType().getFunctionDefinition()");
610  27562 accept((FunctionDefinition) node.getNodeType());
611  225861 } else if (node.getNodeType() instanceof Proposition) {
612  212286 setLocationWithinModule(context + ".getNodeType().getProposition()");
613  212286 accept((Proposition) node.getNodeType());
614  13575 } else if (node.getNodeType() instanceof Rule) {
615  13575 setLocationWithinModule(context + ".getNodeType().getRule()");
616  13575 accept((Rule) node.getNodeType());
617    } else {
618  0 throw new IllegalArgumentException("unexpected node type: "
619    + node.getNodeType().getClass());
620    }
621    }
622  264830 if (node.getSucceedingText() != null) {
623  46330 setLocationWithinModule(context + ".getSucceedingText()");
624  46330 accept(node.getSucceedingText());
625    }
626  264470 setLocationWithinModule(context);
627  264470 visitor.visitLeave(node);
628  264470 setLocationWithinModule(context);
629  264470 location.pop();
630  264470 this.node = null;
631    }
632   
 
633  41915 toggle public void accept(final Axiom axiom) throws ModuleDataException {
634  41915 checkForInterrupt();
635  41914 if (blocked || axiom == null) {
636  28743 return;
637    }
638  13171 data.increaseAxiomNumber();
639  13171 location.set(location.size() - 1, "Axiom " + data.getAxiomNumber() + " "
640    + (String) location.lastElement());
641  13171 final String context = getCurrentContext().getLocationWithinModule();
642  13171 visitor.visitEnter(axiom);
643  12967 if (axiom.getFormula() != null) {
644  12964 setLocationWithinModule(context + ".getFormula()");
645  12964 accept(axiom.getFormula());
646    }
647  9093 if (axiom.getDescription() != null) {
648  2 setLocationWithinModule(context + ".getDescription()");
649  2 accept(axiom.getDescription());
650    }
651  9093 setLocationWithinModule(context);
652  9093 visitor.visitLeave(axiom);
653  9093 setLocationWithinModule(context);
654    }
655   
 
656  19934 toggle public void accept(final PredicateDefinition definition)
657    throws ModuleDataException {
658  19934 checkForInterrupt();
659  19933 if (blocked || definition == null) {
660  16080 return;
661    }
662  3853 data.increasePredicateDefinitionNumber();
663  3853 location.set(location.size() - 1, "Definition " + (data.getPredicateDefinitionNumber()
664    + data.getFunctionDefinitionNumber()) + " "
665    + (String) location.lastElement());
666  3853 final String context = getCurrentContext().getLocationWithinModule();
667  3853 visitor.visitEnter(definition);
668  3736 if (definition.getFormula() != null) {
669  3733 setLocationWithinModule(context + ".getFormula()");
670  3733 accept(definition.getFormula());
671    }
672  2652 if (definition.getDescription() != null) {
673  2 setLocationWithinModule(context + ".getDescription()");
674  2 accept(definition.getDescription());
675    }
676  2652 setLocationWithinModule(context);
677  2652 visitor.visitLeave(definition);
678  2652 setLocationWithinModule(context);
679    }
680   
 
681  6388 toggle public void accept(final InitialPredicateDefinition definition)
682    throws ModuleDataException {
683  6388 checkForInterrupt();
684  6387 if (blocked || definition == null) {
685  5332 return;
686    }
687  1055 data.increasePredicateDefinitionNumber();
688  1055 location.set(location.size() - 1, "Definition "
689    + (data.getPredicateDefinitionNumber() + data
690    .getFunctionDefinitionNumber()) + " "
691    + (String) location.lastElement());
692  1055 final String context = getCurrentContext().getLocationWithinModule();
693  1055 visitor.visitEnter(definition);
694  1001 if (definition.getPredCon() != null) {
695  998 setLocationWithinModule(context + ".getPredCon()");
696  998 accept(definition.getPredCon());
697    }
698  893 if (definition.getDescription() != null) {
699  2 setLocationWithinModule(context + ".getDescription()");
700  2 accept(definition.getDescription());
701    }
702  893 setLocationWithinModule(context);
703  893 visitor.visitLeave(definition);
704  893 setLocationWithinModule(context);
705    }
706   
 
707  59 toggle public void accept(final InitialFunctionDefinition definition) throws ModuleDataException {
708  59 checkForInterrupt();
709  58 if (blocked || definition == null) {
710  1 return;
711    }
712  57 data.increaseFunctionDefinitionNumber();
713  57 location.set(location.size() - 1, "Definition " + (data.getFunctionDefinitionNumber()
714    + data.getFunctionDefinitionNumber()) + " "
715    + (String) location.lastElement());
716  57 final String context = getCurrentContext().getLocationWithinModule();
717  57 visitor.visitEnter(definition);
718  52 if (definition.getFunCon() != null) {
719  49 setLocationWithinModule(context + ".getFunCon()");
720  49 accept(definition.getFunCon());
721    }
722  40 if (definition.getDescription() != null) {
723  2 setLocationWithinModule(context + ".getDescription()");
724  2 accept(definition.getDescription());
725    }
726  40 setLocationWithinModule(context);
727  40 visitor.visitLeave(definition);
728  40 setLocationWithinModule(context);
729    }
730   
 
731  27564 toggle public void accept(final FunctionDefinition definition) throws ModuleDataException {
732  27564 checkForInterrupt();
733  27563 if (blocked || definition == null) {
734  20981 return;
735    }
736  6582 data.increaseFunctionDefinitionNumber();
737  6582 location.set(location.size() - 1, "Definition " + (data.getFunctionDefinitionNumber()
738    + data.getFunctionDefinitionNumber()) + " "
739    + (String) location.lastElement());
740  6582 final String context = getCurrentContext().getLocationWithinModule();
741  6582 visitor.visitEnter(definition);
742  6382 if (definition.getFormula() != null) {
743  6379 setLocationWithinModule(context + ".getFormula()");
744  6379 accept(definition.getFormula());
745    }
746  4247 if (definition.getDescription() != null) {
747  2 setLocationWithinModule(context + ".getDescription()");
748  2 accept(definition.getDescription());
749    }
750  4247 setLocationWithinModule(context);
751  4247 visitor.visitLeave(definition);
752  4247 setLocationWithinModule(context);
753    }
754   
 
755  212288 toggle public void accept(final Proposition proposition) throws ModuleDataException {
756  212288 checkForInterrupt();
757  212287 if (blocked || proposition == null) {
758  145289 return;
759    }
760  66998 data.increasePropositionNumber();
761  66998 location.set(location.size() - 1, "Proposition " + data.getPropositionNumber() + " "
762    + (String) location.lastElement());
763  66998 final String context = getCurrentContext().getLocationWithinModule();
764  66998 visitor.visitEnter(proposition);
765  66546 if (proposition.getFormula() != null) {
766  66491 setLocationWithinModule(context + ".getFormula()");
767  66491 accept(proposition.getFormula());
768    }
769  46075 if (proposition.getDescription() != null) {
770  322 setLocationWithinModule(context + ".getDescription()");
771  322 accept(proposition.getDescription());
772    }
773  46061 if (proposition.getProofList() != null) {
774  5178 setLocationWithinModule(context + ".getProofList()");
775  5178 accept(proposition.getProofList());
776    }
777  45448 if (proposition.getFormalProofList() != null) {
778  29871 setLocationWithinModule(context + ".getFormalProofList()");
779  29871 accept(proposition.getFormalProofList());
780    }
781  18466 setLocationWithinModule(context);
782  18466 visitor.visitLeave(proposition);
783  18466 setLocationWithinModule(context);
784    }
785   
 
786  13577 toggle public void accept(final Rule rule) throws ModuleDataException {
787  13577 checkForInterrupt();
788  13576 if (blocked || rule == null) {
789  6462 return;
790    }
791  7114 data.increaseRuleNumber();
792  7114 location.set(location.size() - 1, "Rule " + data.getRuleNumber() + " "
793    + (String) location.lastElement());
794  7114 final String context = getCurrentContext().getLocationWithinModule();
795  7114 visitor.visitEnter(rule);
796  6842 if (rule.getLinkList() != null) {
797  501 setLocationWithinModule(context + ".getLinkList()");
798  501 accept(rule.getLinkList());
799    }
800  6830 if (rule.getDescription() != null) {
801  6820 setLocationWithinModule(context + ".getDescription()");
802  6820 accept(rule.getDescription());
803    }
804  6578 if (rule.getChangedRuleList() != null) {
805  138 setLocationWithinModule(context + ".getChangedRuleList()");
806  138 accept(rule.getChangedRuleList());
807    }
808  6512 if (rule.getProofList() != null) {
809  72 setLocationWithinModule(context + ".getProofList()");
810  72 accept(rule.getProofList());
811    }
812  6501 setLocationWithinModule(context);
813  6501 visitor.visitLeave(rule);
814  6501 setLocationWithinModule(context);
815  6501 final RuleKey newRuleKey = new RuleKey(rule.getName(), rule.getVersion());
816  6501 ruleExistence.put(rule.getName(), newRuleKey);
817    }
818   
 
819  140 toggle public void accept(final ChangedRuleList list) throws ModuleDataException {
820  140 checkForInterrupt();
821  139 if (blocked || list == null) {
822  26 return;
823    }
824  113 final String context = getCurrentContext().getLocationWithinModule();
825  113 visitor.visitEnter(list);
826  111 setLocationWithinModule(context);
827  682 for (int i = 0; i < list.size(); i++) {
828  635 setLocationWithinModule(context + ".get(" + i + ")");
829  635 accept(list.get(i));
830    }
831  47 setLocationWithinModule(context);
832  47 visitor.visitLeave(list);
833  47 setLocationWithinModule(context);
834    }
835   
 
836  637 toggle public void accept(final ChangedRule rule) throws ModuleDataException {
837  637 checkForInterrupt();
838  636 if (blocked || rule == null) {
839  89 return;
840    }
841  547 data.increaseRuleNumber();
842  547 location.set(location.size() - 1, "Rule " + data.getRuleNumber() + " "
843    + (String) location.lastElement());
844  547 final String context = getCurrentContext().getLocationWithinModule();
845  547 visitor.visitEnter(rule);
846  515 if (rule.getDescription() != null) {
847  514 setLocationWithinModule(context + ".getDescription()");
848  514 accept(rule.getDescription());
849    }
850  483 setLocationWithinModule(context);
851  483 visitor.visitLeave(rule);
852  483 setLocationWithinModule(context);
853  483 final RuleKey newRuleKey = new RuleKey(rule.getName(), rule.getVersion());
854  483 ruleExistence.put(rule.getName(), newRuleKey);
855    }
856   
 
857  503 toggle public void accept(final LinkList linkList) throws ModuleDataException {
858  503 checkForInterrupt();
859  502 if (blocked || linkList == null) {
860  313 return;
861    }
862  189 final String context = getCurrentContext().getLocationWithinModule();
863  189 visitor.visitEnter(linkList);
864  177 setLocationWithinModule(context);
865  177 visitor.visitLeave(linkList);
866  177 setLocationWithinModule(context);
867    }
868   
 
869  5252 toggle public void accept(final ProofList proofList) throws ModuleDataException {
870  5252 checkForInterrupt();
871  5251 if (blocked || proofList == null) {
872  4138 return;
873    }
874  1113 final String context = getCurrentContext().getLocationWithinModule();
875  1113 visitor.visitEnter(proofList);
876  1539 for (int i = 0; i < proofList.size(); i++) {
877  1050 setLocationWithinModule(context + ".get(" + i + ")");
878  1050 accept(proofList.get(i));
879    }
880  489 setLocationWithinModule(context);
881  489 visitor.visitLeave(proofList);
882  489 setLocationWithinModule(context);
883    }
884   
 
885  1052 toggle public void accept(final Proof proof) throws ModuleDataException {
886  1052 checkForInterrupt();
887  1051 if (blocked || proof == null) {
888  1 return;
889    }
890  1050 final String context = getCurrentContext().getLocationWithinModule();
891  1050 visitor.visitEnter(proof);
892  814 if (proof.getNonFormalProof() != null) {
893  812 setLocationWithinModule(context + ".getNonFormalProof()");
894  812 accept(proof.getNonFormalProof());
895    }
896  536 setLocationWithinModule(context);
897  536 visitor.visitLeave(proof);
898  536 setLocationWithinModule(context);
899    }
900   
 
901  29873 toggle public void accept(final FormalProofList proofList) throws ModuleDataException {
902  29873 checkForInterrupt();
903  29872 if (blocked || proofList == null) {
904  1292 return;
905    }
906  28580 final String context = getCurrentContext().getLocationWithinModule();
907  28580 visitor.visitEnter(proofList);
908  30073 for (int i = 0; i < proofList.size(); i++) {
909  28475 setLocationWithinModule(context + ".get(" + i + ")");
910  28475 accept(proofList.get(i));
911    }
912  1598 setLocationWithinModule(context);
913  1598 visitor.visitLeave(proofList);
914  1598 setLocationWithinModule(context);
915    }
916   
 
917  28477 toggle public void accept(final FormalProof proof) throws ModuleDataException {
918  28477 checkForInterrupt();
919  28476 if (blocked || proof == null) {
920  1 return;
921    }
922  28475 final String context = getCurrentContext().getLocationWithinModule();
923  28475 visitor.visitEnter(proof);
924  28319 if (proof.getPrecedingText() != null) {
925  2 setLocationWithinModule(context + ".getPrecedingText()");
926  2 accept(proof.getFormalProofLineList());
927    }
928  28319 if (proof.getFormalProofLineList() != null) {
929  28314 setLocationWithinModule(context + ".getFormalProofLineList()");
930  28314 accept(proof.getFormalProofLineList());
931    }
932  1597 if (proof.getSucceedingText() != null) {
933  2 setLocationWithinModule(context + ".getSucceedingText()");
934  2 accept(proof.getFormalProofLineList());
935    }
936  1597 setLocationWithinModule(context);
937  1597 visitor.visitLeave(proof);
938  1597 setLocationWithinModule(context);
939    }
940   
 
941  42148 toggle public void accept(final FormalProofLineList proofLineList) throws ModuleDataException {
942  42148 checkForInterrupt();
943  42147 if (blocked || proofLineList == null) {
944  6217 return;
945    }
946  35930 final String context = getCurrentContext().getLocationWithinModule();
947  35930 visitor.visitEnter(proofLineList);
948  242212 for (int i = 0; i < proofLineList.size(); i++) {
949  237358 setLocationWithinModule(context + ".get(" + i + ")");
950  237358 if (proofLineList.get(i) instanceof ConditionalProof) {
951  14907 accept((ConditionalProof) proofLineList.get(i));
952    } else {
953  222451 accept(proofLineList.get(i));
954    }
955    }
956  4854 setLocationWithinModule(context);
957  4854 visitor.visitLeave(proofLineList);
958  4854 setLocationWithinModule(context);
959    }
960   
 
961  222453 toggle public void accept(final FormalProofLine proofLine) throws ModuleDataException {
962  222453 checkForInterrupt();
963  222452 if (blocked || proofLine == null) {
964  3469 return;
965    }
966  218983 final String context = getCurrentContext().getLocationWithinModule();
967  218983 visitor.visitEnter(proofLine);
968  217353 if (proofLine.getFormula() != null) {
969  217324 setLocationWithinModule(context + ".getFormula()");
970  217324 accept(proofLine.getFormula());
971    }
972  196006 if (proofLine.getReason() != null) {
973  196002 setLocationWithinModule(context + ".getReason()");
974  196002 accept(proofLine.getReason());
975    }
976  194327 setLocationWithinModule(context);
977  194327 visitor.visitLeave(proofLine);
978  194327 setLocationWithinModule(context);
979    }
980   
 
981  196004 toggle public void accept(final Reason reason) throws ModuleDataException {
982  196004 checkForInterrupt();
983  196003 if (blocked || reason == null) {
984  178393 return;
985    }
986  17610 final String context = getCurrentContext().getLocationWithinModule();
987  17610 visitor.visitEnter(reason);
988  16536 if (reason instanceof ModusPonens) {
989  4796 setLocationWithinModule(context + ".getModusPonens()");
990  4796 accept(((ModusPonens) reason).getModusPonens());
991  11740 } else if (reason instanceof Add) {
992  3718 setLocationWithinModule(context + ".getAdd()");
993  3718 accept(((Add) reason).getAdd());
994  8022 } else if (reason instanceof Rename) {
995  704 setLocationWithinModule(context + ".getRename()");
996  704 accept(((Rename) reason).getRename());
997  7318 } else if (reason instanceof SubstFree) {
998  416 setLocationWithinModule(context + ".getSubstFree()");
999  416 accept(((SubstFree) reason).getSubstFree());
1000  6902 } else if (reason instanceof SubstFunc) {
1001  128 setLocationWithinModule(context + ".getSubstFunc()");
1002  128 accept(((SubstFunc) reason).getSubstFunc());
1003  6774 } else if (reason instanceof SubstPred) {
1004  6353 setLocationWithinModule(context + ".getSubstPred()");
1005  6353 accept(((SubstPred) reason).getSubstPred());
1006  421 } else if (reason instanceof Existential) {
1007  86 setLocationWithinModule(context + ".getExistential()");
1008  86 accept(((Existential) reason).getExistential());
1009  335 } else if (reason instanceof Universal) {
1010  335 setLocationWithinModule(context + ".getUniversal()");
1011  335 accept(((Universal) reason).getUniversal());
1012  0 } else if (reason instanceof ConditionalProof) {
1013  0 throw new IllegalArgumentException(
1014    "proof line shall not have a conditional proof as a reason, instead the proof line "
1015    + "itself should be the conditional proof!");
1016    } else {
1017  0 throw new IllegalArgumentException("unexpected reason type: "
1018    + reason.getClass());
1019    }
1020  15931 setLocationWithinModule(context);
1021  15931 visitor.visitLeave(reason);
1022  15931 setLocationWithinModule(context);
1023    }
1024   
 
1025  4798 toggle public void accept(final ModusPonens reason) throws ModuleDataException {
1026  4798 checkForInterrupt();
1027  4797 if (blocked || reason == null) {
1028  1 return;
1029    }
1030  4796 final String context = getCurrentContext().getLocationWithinModule();
1031  4796 visitor.visitEnter(reason);
1032  4621 setLocationWithinModule(context);
1033  4621 visitor.visitLeave(reason);
1034  4621 setLocationWithinModule(context);
1035    }
1036   
 
1037  3720 toggle public void accept(final Add reason) throws ModuleDataException {
1038  3720 checkForInterrupt();
1039  3719 if (blocked || reason == null) {
1040  1 return;
1041    }
1042  3718 final String context = getCurrentContext().getLocationWithinModule();
1043  3718 visitor.visitEnter(reason);
1044  3581 setLocationWithinModule(context);
1045  3581 visitor.visitLeave(reason);
1046  3581 setLocationWithinModule(context);
1047    }
1048   
 
1049  706 toggle public void accept(final Rename reason) throws ModuleDataException {
1050  706 checkForInterrupt();
1051  705 if (blocked || reason == null) {
1052  1 return;
1053    }
1054  704 final String context = getCurrentContext().getLocationWithinModule();
1055  704 visitor.visitEnter(reason);
1056  675 if (reason.getOriginalSubjectVariable() != null) {
1057  600 setLocationWithinModule(context + ".getOriginalSubjectVariable()");
1058  600 accept(reason.getOriginalSubjectVariable());
1059    }
1060  675 if (reason.getReplacementSubjectVariable() != null) {
1061  552 setLocationWithinModule(context + ".getReplacementSubjectVariable()");
1062  552 accept(reason.getReplacementSubjectVariable());
1063    }
1064  675 setLocationWithinModule(context);
1065  675 visitor.visitLeave(reason);
1066  675 setLocationWithinModule(context);
1067    }
1068   
 
1069  418 toggle public void accept(final SubstFree reason) throws ModuleDataException {
1070  418 checkForInterrupt();
1071  417 if (blocked || reason == null) {
1072  1 return;
1073    }
1074  416 final String context = getCurrentContext().getLocationWithinModule();
1075  416 visitor.visitEnter(reason);
1076  400 if (reason.getSubjectVariable() != null) {
1077  301 setLocationWithinModule(context + ".getSubjectVariable()");
1078  301 accept(reason.getSubjectVariable());
1079    }
1080  400 if (reason.getSubstituteTerm() != null) {
1081  373 setLocationWithinModule(context + ".getSubstituteTerm()");
1082  373 accept(new TermVo(reason.getSubstituteTerm()));
1083    }
1084  400 setLocationWithinModule(context);
1085  400 visitor.visitLeave(reason);
1086  400 setLocationWithinModule(context);
1087    }
1088   
 
1089  130 toggle public void accept(final SubstFunc reason) throws ModuleDataException {
1090  130 checkForInterrupt();
1091  129 if (blocked || reason == null) {
1092  1 return;
1093    }
1094  128 final String context = getCurrentContext().getLocationWithinModule();
1095  128 visitor.visitEnter(reason);
1096  122 if (reason.getFunctionVariable() != null) {
1097  71 setLocationWithinModule(context + ".getFunctionVariable()");
1098  71 accept(reason.getFunctionVariable());
1099    }
1100  122 if (reason.getSubstituteTerm() != null) {
1101  95 setLocationWithinModule(context + ".getSubstituteTerm()");
1102  95 accept(new TermVo(reason.getSubstituteTerm()));
1103    }
1104  122 setLocationWithinModule(context);
1105  122 visitor.visitLeave(reason);
1106  122 setLocationWithinModule(context);
1107    }
1108   
 
1109  6355 toggle public void accept(final SubstPred reason) throws ModuleDataException {
1110  6355 checkForInterrupt();
1111  6354 if (blocked || reason == null) {
1112  1 return;
1113    }
1114  6353 final String context = getCurrentContext().getLocationWithinModule();
1115  6353 visitor.visitEnter(reason);
1116  6127 if (reason.getPredicateVariable() != null) {
1117  5908 setLocationWithinModule(context + ".getPredicateVariable()");
1118  5908 accept(reason.getPredicateVariable());
1119    }
1120  6127 if (reason.getSubstituteFormula() != null) {
1121  5908 setLocationWithinModule(context + ".getSubstituteFormula()");
1122  5908 accept(new FormulaVo(reason.getSubstituteFormula()));
1123    }
1124  6127 setLocationWithinModule(context);
1125  6127 visitor.visitLeave(reason);
1126  6127 setLocationWithinModule(context);
1127    }
1128   
 
1129  88 toggle public void accept(final Existential reason) throws ModuleDataException {
1130  88 checkForInterrupt();
1131  87 if (blocked || reason == null) {
1132  1 return;
1133    }
1134  86 final String context = getCurrentContext().getLocationWithinModule();
1135  86 visitor.visitEnter(reason);
1136  83 if (reason.getSubjectVariable() != null) {
1137  57 setLocationWithinModule(context + ".getSubjectVariable()");
1138  57 accept(reason.getSubjectVariable());
1139    }
1140  83 setLocationWithinModule(context);
1141  83 visitor.visitLeave(reason);
1142  83 setLocationWithinModule(context);
1143    }
1144   
 
1145  337 toggle public void accept(final Universal reason) throws ModuleDataException {
1146  337 checkForInterrupt();
1147  336 if (blocked || reason == null) {
1148  1 return;
1149    }
1150  335 final String context = getCurrentContext().getLocationWithinModule();
1151  335 visitor.visitEnter(reason);
1152  322 if (reason.getSubjectVariable() != null) {
1153  246 setLocationWithinModule(context + ".getSubjectVariable()");
1154  246 accept(reason.getSubjectVariable());
1155    }
1156  322 setLocationWithinModule(context);
1157  322 visitor.visitLeave(reason);
1158  322 setLocationWithinModule(context);
1159    }
1160   
 
1161  14909 toggle public void accept(final ConditionalProof reason) throws ModuleDataException {
1162  14909 checkForInterrupt();
1163  14908 if (blocked || reason == null) {
1164  921 return;
1165    }
1166  13987 final String context = getCurrentContext().getLocationWithinModule();
1167  13987 visitor.visitEnter(reason);
1168  13887 if (reason.getHypothesis() != null) {
1169  13882 setLocationWithinModule(context + ".getHypothesis()");
1170  13882 accept(reason.getHypothesis());
1171    }
1172  13837 if (reason.getFormalProofLineList() != null) {
1173  13828 setLocationWithinModule(context + ".getFormalProofLineList()");
1174  13828 accept(reason.getFormalProofLineList());
1175    }
1176  9483 if (reason.getConclusion() != null) {
1177  9478 setLocationWithinModule(context + ".getConclusion()");
1178  9478 accept(reason.getConclusion());
1179    }
1180  7771 setLocationWithinModule(context);
1181  7771 visitor.visitLeave(reason);
1182  7771 setLocationWithinModule(context);
1183    }
1184   
 
1185  13884 toggle public void accept(final Hypothesis hypothesis) throws ModuleDataException {
1186  13884 checkForInterrupt();
1187  13883 if (blocked || hypothesis == null) {
1188  6213 return;
1189    }
1190  7670 final String context = getCurrentContext().getLocationWithinModule();
1191  7670 visitor.visitEnter(hypothesis);
1192  7620 if (hypothesis.getFormula() != null) {
1193  7619 setLocationWithinModule(context + ".getFormula()");
1194  7619 accept(hypothesis.getFormula());
1195    }
1196  7620 setLocationWithinModule(context);
1197  7620 visitor.visitLeave(hypothesis);
1198  7620 setLocationWithinModule(context);
1199    }
1200   
 
1201  9480 toggle public void accept(final Conclusion conclusion) throws ModuleDataException {
1202  9480 checkForInterrupt();
1203  9479 if (blocked || conclusion == null) {
1204  6213 return;
1205    }
1206  3266 final String context = getCurrentContext().getLocationWithinModule();
1207  3266 visitor.visitEnter(conclusion);
1208  3166 if (conclusion.getFormula() != null) {
1209  3165 setLocationWithinModule(context + ".getFormula()");
1210  3165 accept(conclusion.getFormula());
1211    }
1212  1554 setLocationWithinModule(context);
1213  1554 visitor.visitLeave(conclusion);
1214  1554 setLocationWithinModule(context);
1215    }
1216   
 
1217  323585 toggle public void accept(final Formula formula) throws ModuleDataException {
1218  323585 checkForInterrupt();
1219  323584 if (blocked || formula == null) {
1220  211478 return;
1221    }
1222  112106 final String context = getCurrentContext().getLocationWithinModule();
1223  112106 visitor.visitEnter(formula);
1224  110116 if (formula.getElement() != null) {
1225  110109 setLocationWithinModule(context + ".getElement()");
1226  110109 accept(formula.getElement());
1227    }
1228  61583 setLocationWithinModule(context);
1229  61583 visitor.visitLeave(formula);
1230  61583 setLocationWithinModule(context);
1231    }
1232   
 
1233  470 toggle public void accept(final Term term) throws ModuleDataException {
1234  470 checkForInterrupt();
1235  469 if (blocked || term == null) {
1236  1 return;
1237    }
1238  468 final String context = getCurrentContext().getLocationWithinModule();
1239  468 visitor.visitEnter(term);
1240  468 if (term.getElement() != null) {
1241  468 setLocationWithinModule(context + ".getElement()");
1242  468 accept(term.getElement());
1243    }
1244  468 setLocationWithinModule(context);
1245  468 visitor.visitLeave(term);
1246  468 setLocationWithinModule(context);
1247    }
1248   
 
1249  1198068 toggle public void accept(final Element element) throws ModuleDataException {
1250  1198068 checkForInterrupt();
1251  1198067 if (blocked || element == null) {
1252  326105 return;
1253    }
1254  871962 final String context = getCurrentContext().getLocationWithinModule();
1255  871962 if (element.isList()) {
1256  641895 setLocationWithinModule(context + ".getList()");
1257  641895 accept(element.getList());
1258  230067 } else if (element.isAtom()) {
1259  230067 setLocationWithinModule(context + ".getAtom()");
1260  230067 accept(element.getAtom());
1261    } else {
1262  0 throw new IllegalArgumentException("unexpected element type: "
1263    + element.toString());
1264    }
1265  705896 setLocationWithinModule(context);
1266    }
1267   
 
1268  230069 toggle public void accept(final Atom atom) throws ModuleDataException {
1269  230069 checkForInterrupt();
1270  230068 if (blocked || atom == null) {
1271  1 return;
1272    }
1273  230067 final String context = getCurrentContext().getLocationWithinModule();
1274  230067 visitor.visitEnter(atom);
1275  230067 setLocationWithinModule(context);
1276  230067 visitor.visitLeave(atom);
1277  230067 setLocationWithinModule(context);
1278    }
1279   
 
1280  641897 toggle public void accept(final ElementList list) throws ModuleDataException {
1281  641897 checkForInterrupt();
1282  641896 if (blocked || list == null) {
1283  1 return;
1284    }
1285  641895 final String context = getCurrentContext().getLocationWithinModule();
1286  641895 visitor.visitEnter(list);
1287  1554534 for (int i = 0; i < list.size(); i++) {
1288  1078705 setLocationWithinModule(context + ".getElement(" + i + ")");
1289  1078705 accept(list.getElement(i));
1290    }
1291  475829 setLocationWithinModule(context);
1292  475829 visitor.visitLeave(list);
1293  475829 setLocationWithinModule(context);
1294    }
1295   
 
1296  1499102 toggle public void accept(final LatexList latexList) throws ModuleDataException {
1297  1499102 checkForInterrupt();
1298  1499101 if (blocked || latexList == null) {
1299  1050731 return;
1300    }
1301  448370 final String context = getCurrentContext().getLocationWithinModule();
1302  448370 visitor.visitEnter(latexList);
1303  1247952 for (int i = 0; i < latexList.size(); i++) {
1304  806524 setLocationWithinModule(context + ".get(" + i + ")");
1305  806524 accept(latexList.get(i));
1306    }
1307  441428 setLocationWithinModule(context);
1308  441428 visitor.visitLeave(latexList);
1309  441428 setLocationWithinModule(context);
1310    }
1311   
 
1312  808309 toggle public void accept(final Latex latex) throws ModuleDataException {
1313  808309 checkForInterrupt();
1314  808308 if (blocked || latex == null) {
1315  579452 return;
1316    }
1317  228856 final String context = getCurrentContext().getLocationWithinModule();
1318  228856 visitor.visitEnter(latex);
1319  225314 setLocationWithinModule(context);
1320  225314 visitor.visitLeave(latex);
1321  225314 setLocationWithinModule(context);
1322    }
1323   
1324    /**
1325    * Get node that is currently parsed. Might be <code>null</code>.
1326    *
1327    * @return QEDEQ node were are currently in.
1328    */
 
1329  45615 toggle public Node getNode() {
1330  45615 return node;
1331    }
1332   
1333    /**
1334    * Set location information where are we within the original module.
1335    *
1336    * @param locationWithinModule Location within module.
1337    */
 
1338  15421652 toggle public void setLocationWithinModule(final String locationWithinModule) {
1339  15421652 getCurrentContext().setLocationWithinModule(locationWithinModule);
1340    }
1341   
 
1342  28279511 toggle public final ModuleContext getCurrentContext() {
1343  28279511 return currentContext;
1344    }
1345   
1346    /**
1347    * Is further traversing blocked?
1348    *
1349    * @return Is further traversing blocked?
1350    */
 
1351  844 toggle public final boolean getBlocked() {
1352  844 return blocked;
1353    }
1354   
1355    /**
1356    * Set if further traverse is blocked.
1357    *
1358    * @param blocked Further transversion?
1359    */
 
1360  2641590 toggle public final void setBlocked(final boolean blocked) {
1361  2641590 this.blocked = blocked;
1362    }
1363   
1364    /**
1365    * Get calculated visit percentage.
1366    *
1367    * @return Value between 0 and 100.
1368    */
 
1369  0 toggle public double getVisitPercentage() {
1370  0 if (data == null) {
1371  0 return 0;
1372    }
1373  0 return data.getVisitPercentage();
1374    }
1375   
1376    /**
1377    * Set absolute location description.
1378    *
1379    * @param text Description.
1380    */
 
1381  382368 toggle private void setLocation(final String text) {
1382  382368 location.setSize(0);
1383  382368 location.push(text);
1384    }
1385   
 
1386  17 toggle public String getLocationDescription() {
1387  17 final StringBuffer buffer = new StringBuffer();
1388  68 for (int i = 0; i < location.size(); i++) {
1389  51 if (i > 0) {
1390  34 buffer.append(" / ");
1391    }
1392  51 buffer.append(location.get(i));
1393    }
1394  17 return buffer.toString();
1395    }
1396   
1397    /**
1398    * Get copy of current counters.
1399    *
1400    * @return Values of various counters.
1401    */
 
1402  22682 toggle public QedeqNumbers getCurrentNumbers() {
1403  22682 return new QedeqNumbers(data);
1404    }
1405   
1406    /**
1407    * Get current (QEDEQ module local) rule version for given rule name.
1408    *
1409    * @param name Rule name
1410    * @return Current (local) rule version. Might be <code>null</code>.
1411    */
 
1412  3102 toggle public RuleKey getLocalRuleKey(final String name) {
1413  3102 return (RuleKey) ruleExistence.get(name);
1414    }
1415   
1416    }
1417