1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.kernel.bo.logic.wf; |
17 |
|
|
18 |
|
|
19 |
|
import org.qedeq.base.trace.Trace; |
20 |
|
import org.qedeq.kernel.bo.logic.common.ExistenceChecker; |
21 |
|
import org.qedeq.kernel.bo.logic.common.FunctionKey; |
22 |
|
import org.qedeq.kernel.bo.logic.common.PredicateKey; |
23 |
|
import org.qedeq.kernel.bo.test.QedeqBoTestCase; |
24 |
|
import org.qedeq.kernel.se.common.RuleKey; |
25 |
|
|
26 |
|
|
27 |
|
@link |
28 |
|
|
29 |
|
@author |
30 |
|
|
|
|
| 69.4% |
Uncovered Elements: 38 (124) |
Complexity: 58 |
Complexity Density: 0.88 |
|
31 |
|
public abstract class AbstractFormulaChecker extends QedeqBoTestCase { |
32 |
|
|
33 |
|
|
34 |
|
private static final Class CLASS = AbstractFormulaChecker.class; |
35 |
|
|
36 |
|
|
37 |
|
private ExistenceChecker checker = new ExistenceChecker() { |
38 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (19) |
Complexity: 9 |
Complexity Density: 0.82 |
|
39 |
163
|
public boolean predicateExists(final String name, final int arguments) {... |
40 |
163
|
Trace.param(CLASS, this, "predicateExists(String, int)", "name", name); |
41 |
163
|
Trace.param(CLASS, this, "predicateExists(String, int)", "arguments", arguments); |
42 |
163
|
if ("in".equals(name) && arguments == 2) { |
43 |
24
|
return true; |
44 |
139
|
} else if ("isSet".equals(name) && arguments == 1) { |
45 |
3
|
return true; |
46 |
136
|
} else if ("equal".equals(name) && arguments == 2) { |
47 |
132
|
return true; |
48 |
4
|
} else if ("true".equals(name) && arguments == 0) { |
49 |
2
|
return true; |
50 |
|
} |
51 |
2
|
return false; |
52 |
|
} |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
0
|
public boolean predicateExists(final PredicateKey predicate) {... |
55 |
0
|
return predicateExists(predicate.getName(), Integer.parseInt(predicate.getArguments())); |
56 |
|
} |
57 |
|
|
|
|
| 89.5% |
Uncovered Elements: 2 (19) |
Complexity: 9 |
Complexity Density: 0.82 |
|
58 |
10
|
public boolean functionExists(final String name, final int arguments) {... |
59 |
10
|
Trace.param(CLASS, this, "functionExists(String, int)", "name", name); |
60 |
10
|
Trace.param(CLASS, this, "functionExists(String, int)", "arguments", arguments); |
61 |
10
|
if ("power".equals(name) && arguments == 1) { |
62 |
3
|
return true; |
63 |
7
|
} else if ("union".equals(name) && arguments == 2) { |
64 |
4
|
return true; |
65 |
3
|
} else if ("intersection".equals(name) && arguments == 2) { |
66 |
0
|
return true; |
67 |
3
|
} else if ("empty".equals(name) && arguments == 0) { |
68 |
1
|
return true; |
69 |
|
} |
70 |
2
|
return false; |
71 |
|
} |
72 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
73 |
0
|
public boolean functionExists(FunctionKey function) {... |
74 |
0
|
return functionExists(function.getName(), Integer.parseInt(function.getArguments())); |
75 |
|
} |
76 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
77 |
38
|
public boolean classOperatorExists() {... |
78 |
38
|
return true; |
79 |
|
} |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
138
|
public boolean identityOperatorExists() {... |
82 |
138
|
return true; |
83 |
|
} |
84 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
85 |
125
|
public String getIdentityOperator() {... |
86 |
125
|
return "equal"; |
87 |
|
} |
88 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
89 |
0
|
public boolean isInitialPredicate(PredicateKey predicate) {... |
90 |
0
|
if ("in".equals(predicate.getName()) && predicate.getArguments() == "2") { |
91 |
0
|
return true; |
92 |
|
} |
93 |
0
|
return false; |
94 |
|
} |
95 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
0
|
public boolean isInitialFunction(FunctionKey function) {... |
97 |
0
|
return false; |
98 |
|
} |
99 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
0
|
public boolean ruleExists(RuleKey ruleKey) {... |
101 |
0
|
return false; |
102 |
|
} |
103 |
|
|
104 |
|
}; |
105 |
|
|
106 |
|
private ExistenceChecker checkerWithoutClass = new ExistenceChecker() { |
107 |
|
|
|
|
| 89.5% |
Uncovered Elements: 2 (19) |
Complexity: 9 |
Complexity Density: 0.82 |
|
108 |
53
|
public boolean predicateExists(String name, int arguments) {... |
109 |
53
|
Trace.param(CLASS, this, "predicateExists(String, int)", "name", name); |
110 |
53
|
Trace.param(CLASS, this, "predicateExists(String, int)", "arguments", arguments); |
111 |
53
|
if ("in".equals(name) && arguments == 2) { |
112 |
15
|
return true; |
113 |
38
|
} else if ("isSet".equals(name) && arguments == 1) { |
114 |
3
|
return true; |
115 |
35
|
} else if ("equal".equals(name) && arguments == 2) { |
116 |
33
|
return true; |
117 |
2
|
} else if ("true".equals(name) && arguments == 0) { |
118 |
2
|
return true; |
119 |
|
} |
120 |
0
|
return false; |
121 |
|
} |
122 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
123 |
0
|
public boolean predicateExists(PredicateKey predicate) {... |
124 |
0
|
return predicateExists(predicate.getName(), Integer.parseInt(predicate.getArguments())); |
125 |
|
} |
126 |
|
|
|
|
| 68.4% |
Uncovered Elements: 6 (19) |
Complexity: 9 |
Complexity Density: 0.82 |
|
127 |
2
|
public boolean functionExists(String name, int arguments) {... |
128 |
2
|
Trace.param(CLASS, this, "functionExists(String, int)", "name", name); |
129 |
2
|
Trace.param(CLASS, this, "functionExists(String, int)", "arguments", arguments); |
130 |
2
|
if ("power".equals(name) && arguments == 1) { |
131 |
1
|
return true; |
132 |
1
|
} else if ("union".equals(name) && arguments == 2) { |
133 |
0
|
return true; |
134 |
1
|
} else if ("intersection".equals(name) && arguments == 2) { |
135 |
0
|
return true; |
136 |
1
|
} else if ("empty".equals(name) && arguments == 0) { |
137 |
1
|
return true; |
138 |
|
} |
139 |
0
|
return false; |
140 |
|
} |
141 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
142 |
0
|
public boolean functionExists(FunctionKey function) {... |
143 |
0
|
return functionExists(function.getName(), Integer.parseInt(function.getArguments())); |
144 |
|
} |
145 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
146 |
2
|
public boolean classOperatorExists() {... |
147 |
2
|
return false; |
148 |
|
} |
149 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
150 |
31
|
public boolean identityOperatorExists() {... |
151 |
31
|
return true; |
152 |
|
} |
153 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
154 |
29
|
public String getIdentityOperator() {... |
155 |
29
|
return "equal"; |
156 |
|
} |
157 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
158 |
0
|
public boolean isInitialPredicate(PredicateKey predicate) {... |
159 |
0
|
if ("in".equals(predicate.getName()) && predicate.getArguments() == "2") { |
160 |
0
|
return true; |
161 |
|
} |
162 |
0
|
return false; |
163 |
|
} |
164 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
165 |
0
|
public boolean isInitialFunction(FunctionKey function) {... |
166 |
0
|
return false; |
167 |
|
} |
168 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
169 |
0
|
public boolean ruleExists(RuleKey ruleKey) {... |
170 |
0
|
return false; |
171 |
|
} |
172 |
|
|
173 |
|
}; |
174 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
175 |
125
|
protected ExistenceChecker getChecker() {... |
176 |
125
|
return checker; |
177 |
|
} |
178 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
179 |
29
|
protected ExistenceChecker getCheckerWithoutClass() {... |
180 |
29
|
return checkerWithoutClass; |
181 |
|
} |
182 |
|
|
183 |
|
|
184 |
|
} |