Merge lp:~ragusaen/verifypn/verifypn into lp:verifypn
- verifypn
- Merge into new-trunk
Proposed by
Rasmus Tollund
Status: | Merged |
---|---|
Merged at revision: | 253 |
Proposed branch: | lp:~ragusaen/verifypn/verifypn |
Merge into: | lp:verifypn |
Diff against target: |
2104 lines (+1036/-165) (has conflicts) 10 files modified
include/PetriEngine/PQL/BinaryPrinter.h (+71/-0) include/PetriEngine/PQL/Expressions.h (+15/-62) include/PetriEngine/PQL/PQL.h (+0/-4) include/PetriEngine/PQL/Visitor.h (+118/-90) include/PetriEngine/PQL/XMLPrinter.h (+119/-0) src/PetriEngine/PQL/BinaryPrinter.cpp (+173/-0) src/PetriEngine/PQL/CMakeLists.txt (+1/-1) src/PetriEngine/PQL/Expressions.cpp (+132/-5) src/PetriEngine/PQL/XMLPrinter.cpp (+399/-0) src/VerifyPN.cpp (+8/-3) Text conflict in src/PetriEngine/PQL/Expressions.cpp |
To merge this branch: | bzr merge lp:~ragusaen/verifypn/verifypn |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Peter Gjøl Jensen | Needs Fixing | ||
Review via email: mp+409484@code.launchpad.net |
Commit message
Description of the change
Changed XML printer for queries to use visitor pattern.
To post a comment you must log in.
Revision history for this message
Peter Gjøl Jensen (peter-gjoel) : | # |
review:
Needs Fixing
lp:~ragusaen/verifypn/verifypn
updated
- 253. By Rasmus Tollund
-
Added options for tab size and printing new lines
- 254. By Rasmus Tollund
-
Added a binary printer with visitor pattern. I changed the Visitor class to support overriding base class _accepts. This way the classes will default to the base class's _accept definition.
- 255. By Rasmus Tollund
-
Removed toBinary and toXML from expressions.
[h/cpp] . Also added a couple of _accept for functions that were defined in the .h file. - 256. By Rasmus Tollund
-
Removed .h file from add_libraries
- 257. By Rasmus Tollund
-
Fixed bug with until condition
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'include/PetriEngine/PQL/BinaryPrinter.h' | |||
2 | --- include/PetriEngine/PQL/BinaryPrinter.h 1970-01-01 00:00:00 +0000 | |||
3 | +++ include/PetriEngine/PQL/BinaryPrinter.h 2021-10-18 11:40:53 +0000 | |||
4 | @@ -0,0 +1,71 @@ | |||
5 | 1 | /* Copyright (C) 2011 Jonas Finnemann Jensen <jopsen@gmail.com>, | ||
6 | 2 | * Thomas Søndersø Nielsen <primogens@gmail.com>, | ||
7 | 3 | * Lars Kærlund Østergaard <larsko@gmail.com>, | ||
8 | 4 | * Peter Gjøl Jensen <root@petergjoel.dk>, | ||
9 | 5 | * Rasmus Tollund <rtollu18@student.aau.dk> | ||
10 | 6 | * | ||
11 | 7 | * This program is free software: you can redistribute it and/or modify | ||
12 | 8 | * it under the terms of the GNU General Public License as published by | ||
13 | 9 | * the Free Software Foundation, either version 3 of the License, or | ||
14 | 10 | * (at your option) any later version. | ||
15 | 11 | * | ||
16 | 12 | * This program is distributed in the hope that it will be useful, | ||
17 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | 15 | * GNU General Public License for more details. | ||
20 | 16 | * | ||
21 | 17 | * You should have received a copy of the GNU General Public License | ||
22 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
23 | 19 | */ | ||
24 | 20 | |||
25 | 21 | #ifndef VERIFYPN_BINARYPRINTER_H | ||
26 | 22 | #define VERIFYPN_BINARYPRINTER_H | ||
27 | 23 | |||
28 | 24 | #include "Visitor.h" | ||
29 | 25 | |||
30 | 26 | namespace PetriEngine::PQL { | ||
31 | 27 | class BinaryPrinter : public Visitor { | ||
32 | 28 | public: | ||
33 | 29 | explicit BinaryPrinter(std::ostream& os) : | ||
34 | 30 | os(os) {} | ||
35 | 31 | |||
36 | 32 | protected: | ||
37 | 33 | std::ostream& os; | ||
38 | 34 | |||
39 | 35 | void _accept(const NotCondition *element) override; | ||
40 | 36 | |||
41 | 37 | void _accept(const DeadlockCondition *element) override; | ||
42 | 38 | |||
43 | 39 | void _accept(const CompareConjunction *element) override; | ||
44 | 40 | |||
45 | 41 | void _accept(const UnfoldedUpperBoundsCondition *element) override; | ||
46 | 42 | |||
47 | 43 | void _accept(const UntilCondition *condition) override; | ||
48 | 44 | |||
49 | 45 | void _accept(const BooleanCondition *element) override; | ||
50 | 46 | |||
51 | 47 | void _accept(const UnfoldedIdentifierExpr *element) override; | ||
52 | 48 | |||
53 | 49 | void _accept(const LiteralExpr *element) override; | ||
54 | 50 | |||
55 | 51 | void _accept(const MinusExpr *element) override; | ||
56 | 52 | |||
57 | 53 | void _accept(const SubtractExpr *element) override; | ||
58 | 54 | |||
59 | 55 | void _accept(const CommutativeExpr *element) override; | ||
60 | 56 | |||
61 | 57 | void _accept(const SimpleQuantifierCondition *condition) override; | ||
62 | 58 | |||
63 | 59 | void _accept(const LogicalCondition *condition) override; | ||
64 | 60 | |||
65 | 61 | void _accept(const CompareCondition *condition) override; | ||
66 | 62 | |||
67 | 63 | void _accept(const IdentifierExpr *condition) override; | ||
68 | 64 | |||
69 | 65 | void _accept(const ShallowCondition *condition) override; | ||
70 | 66 | |||
71 | 67 | }; | ||
72 | 68 | } | ||
73 | 69 | |||
74 | 70 | |||
75 | 71 | #endif //VERIFYPN_BINARYPRINTER_H | ||
76 | 0 | 72 | ||
77 | === modified file 'include/PetriEngine/PQL/Expressions.h' | |||
78 | --- include/PetriEngine/PQL/Expressions.h 2021-08-12 12:35:54 +0000 | |||
79 | +++ include/PetriEngine/PQL/Expressions.h 2021-10-18 11:40:53 +0000 | |||
80 | @@ -62,9 +62,10 @@ | |||
81 | 62 | const Expr_ptr &operator[](size_t i) const { | 62 | const Expr_ptr &operator[](size_t i) const { |
82 | 63 | return _exprs[i]; | 63 | return _exprs[i]; |
83 | 64 | } | 64 | } |
84 | 65 | virtual std::string op() const = 0; | ||
85 | 66 | |||
86 | 65 | protected: | 67 | protected: |
87 | 66 | virtual int apply(int v1, int v2) const = 0; | 68 | virtual int apply(int v1, int v2) const = 0; |
88 | 67 | virtual std::string op() const = 0; | ||
89 | 68 | std::vector<Expr_ptr> _exprs; | 69 | std::vector<Expr_ptr> _exprs; |
90 | 69 | virtual int32_t preOp(const EvaluationContext& context) const; | 70 | virtual int32_t preOp(const EvaluationContext& context) const; |
91 | 70 | }; | 71 | }; |
92 | @@ -78,7 +79,7 @@ | |||
93 | 78 | friend CompareCondition; | 79 | friend CompareCondition; |
94 | 79 | virtual void analyze(AnalysisContext& context) override; | 80 | virtual void analyze(AnalysisContext& context) override; |
95 | 80 | int evaluate(const EvaluationContext& context) override; | 81 | int evaluate(const EvaluationContext& context) override; |
97 | 81 | void toBinary(std::ostream&) const override; | 82 | void visit(Visitor&) const override; |
98 | 82 | int formulaSize() const override{ | 83 | int formulaSize() const override{ |
99 | 83 | size_t sum = _ids.size(); | 84 | size_t sum = _ids.size(); |
100 | 84 | for(auto& e : _exprs) sum += e->formulaSize(); | 85 | for(auto& e : _exprs) sum += e->formulaSize(); |
101 | @@ -87,6 +88,7 @@ | |||
102 | 87 | bool placeFree() const override; | 88 | bool placeFree() const override; |
103 | 88 | auto constant() const { return _constant; } | 89 | auto constant() const { return _constant; } |
104 | 89 | auto& places() const { return _ids; } | 90 | auto& places() const { return _ids; } |
105 | 91 | |||
106 | 90 | protected: | 92 | protected: |
107 | 91 | CommutativeExpr(int constant): _constant(constant) {}; | 93 | CommutativeExpr(int constant): _constant(constant) {}; |
108 | 92 | void init(std::vector<Expr_ptr>&& exprs); | 94 | void init(std::vector<Expr_ptr>&& exprs); |
109 | @@ -104,7 +106,6 @@ | |||
110 | 104 | 106 | ||
111 | 105 | Expr::Types type() const override; | 107 | Expr::Types type() const override; |
112 | 106 | Member constraint(SimplificationContext& context) const override; | 108 | Member constraint(SimplificationContext& context) const override; |
113 | 107 | void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override; | ||
114 | 108 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; | 109 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; |
115 | 109 | bool tk = false; | 110 | bool tk = false; |
116 | 110 | 111 | ||
117 | @@ -125,11 +126,9 @@ | |||
118 | 125 | } | 126 | } |
119 | 126 | Expr::Types type() const override; | 127 | Expr::Types type() const override; |
120 | 127 | Member constraint(SimplificationContext& context) const override; | 128 | Member constraint(SimplificationContext& context) const override; |
121 | 128 | void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override; | ||
122 | 129 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; | 129 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; |
123 | 130 | 130 | ||
124 | 131 | 131 | ||
125 | 132 | void toBinary(std::ostream&) const override; | ||
126 | 133 | void visit(Visitor& visitor) const override; | 132 | void visit(Visitor& visitor) const override; |
127 | 134 | protected: | 133 | protected: |
128 | 135 | int apply(int v1, int v2) const override; | 134 | int apply(int v1, int v2) const override; |
129 | @@ -144,7 +143,6 @@ | |||
130 | 144 | MultiplyExpr(std::vector<Expr_ptr>&& exprs); | 143 | MultiplyExpr(std::vector<Expr_ptr>&& exprs); |
131 | 145 | Expr::Types type() const override; | 144 | Expr::Types type() const override; |
132 | 146 | Member constraint(SimplificationContext& context) const override; | 145 | Member constraint(SimplificationContext& context) const override; |
133 | 147 | void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override; | ||
134 | 148 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; | 146 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; |
135 | 149 | 147 | ||
136 | 150 | 148 | ||
137 | @@ -166,9 +164,7 @@ | |||
138 | 166 | int evaluate(const EvaluationContext& context) override; | 164 | int evaluate(const EvaluationContext& context) override; |
139 | 167 | Expr::Types type() const override; | 165 | Expr::Types type() const override; |
140 | 168 | Member constraint(SimplificationContext& context) const override; | 166 | Member constraint(SimplificationContext& context) const override; |
141 | 169 | void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override; | ||
142 | 170 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; | 167 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; |
143 | 171 | void toBinary(std::ostream&) const override; | ||
144 | 172 | 168 | ||
145 | 173 | void visit(Visitor& visitor) const override; | 169 | void visit(Visitor& visitor) const override; |
146 | 174 | int formulaSize() const override{ | 170 | int formulaSize() const override{ |
147 | @@ -190,9 +186,7 @@ | |||
148 | 190 | void analyze(AnalysisContext& context) override; | 186 | void analyze(AnalysisContext& context) override; |
149 | 191 | int evaluate(const EvaluationContext& context) override; | 187 | int evaluate(const EvaluationContext& context) override; |
150 | 192 | Expr::Types type() const override; | 188 | Expr::Types type() const override; |
151 | 193 | void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override; | ||
152 | 194 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; | 189 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; |
153 | 195 | void toBinary(std::ostream&) const override; | ||
154 | 196 | 190 | ||
155 | 197 | void visit(Visitor& visitor) const override; | 191 | void visit(Visitor& visitor) const override; |
156 | 198 | int formulaSize() const override{ | 192 | int formulaSize() const override{ |
157 | @@ -220,9 +214,6 @@ | |||
158 | 220 | if(_compiled) return _compiled->type(); | 214 | if(_compiled) return _compiled->type(); |
159 | 221 | return Expr::IdentifierExpr; | 215 | return Expr::IdentifierExpr; |
160 | 222 | } | 216 | } |
161 | 223 | void toXML(std::ostream& os, uint32_t tabs, bool tokencount = false) const override { | ||
162 | 224 | _compiled->toXML(os, tabs, tokencount); | ||
163 | 225 | } | ||
164 | 226 | void toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; | 217 | void toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; |
165 | 227 | 218 | ||
166 | 228 | int formulaSize() const override { | 219 | int formulaSize() const override { |
167 | @@ -238,15 +229,12 @@ | |||
168 | 238 | return _compiled->constraint(context); | 229 | return _compiled->constraint(context); |
169 | 239 | } | 230 | } |
170 | 240 | 231 | ||
171 | 241 | void toBinary(std::ostream& s) const override { | ||
172 | 242 | _compiled->toBinary(s); | ||
173 | 243 | } | ||
174 | 244 | void visit(Visitor& visitor) const override; | 232 | void visit(Visitor& visitor) const override; |
175 | 245 | 233 | ||
176 | 246 | [[nodiscard]] const std::string &name() const { | 234 | [[nodiscard]] const std::string &name() const { |
177 | 247 | return _name; | 235 | return _name; |
178 | 248 | } | 236 | } |
180 | 249 | 237 | ||
181 | 250 | [[nodiscard]] const Expr_ptr &compiled() const { | 238 | [[nodiscard]] const Expr_ptr &compiled() const { |
182 | 251 | return _compiled; | 239 | return _compiled; |
183 | 252 | } | 240 | } |
184 | @@ -265,15 +253,13 @@ | |||
185 | 265 | 253 | ||
186 | 266 | UnfoldedIdentifierExpr(const std::string& name) : UnfoldedIdentifierExpr(name, -1) { | 254 | UnfoldedIdentifierExpr(const std::string& name) : UnfoldedIdentifierExpr(name, -1) { |
187 | 267 | } | 255 | } |
189 | 268 | 256 | ||
190 | 269 | UnfoldedIdentifierExpr(const UnfoldedIdentifierExpr&) = default; | 257 | UnfoldedIdentifierExpr(const UnfoldedIdentifierExpr&) = default; |
191 | 270 | 258 | ||
192 | 271 | void analyze(AnalysisContext& context) override; | 259 | void analyze(AnalysisContext& context) override; |
193 | 272 | int evaluate(const EvaluationContext& context) override; | 260 | int evaluate(const EvaluationContext& context) override; |
194 | 273 | Expr::Types type() const override; | 261 | Expr::Types type() const override; |
195 | 274 | void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override; | ||
196 | 275 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; | 262 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override; |
197 | 276 | void toBinary(std::ostream&) const override; | ||
198 | 277 | int formulaSize() const override{ | 263 | int formulaSize() const override{ |
199 | 278 | return 1; | 264 | return 1; |
200 | 279 | } | 265 | } |
201 | @@ -305,17 +291,12 @@ | |||
202 | 305 | { return _compiled->distance(context); } | 291 | { return _compiled->distance(context); } |
203 | 306 | void toTAPAALQuery(std::ostream& out,TAPAALConditionExportContext& context) const override | 292 | void toTAPAALQuery(std::ostream& out,TAPAALConditionExportContext& context) const override |
204 | 307 | { _compiled->toTAPAALQuery(out, context); } | 293 | { _compiled->toTAPAALQuery(out, context); } |
205 | 308 | void toBinary(std::ostream& out) const override | ||
206 | 309 | { return _compiled->toBinary(out); } | ||
207 | 310 | Retval simplify(SimplificationContext& context) const override | 294 | Retval simplify(SimplificationContext& context) const override |
208 | 311 | { return _compiled->simplify(context); } | 295 | { return _compiled->simplify(context); } |
209 | 312 | Condition_ptr prepareForReachability(bool negated) const override | 296 | Condition_ptr prepareForReachability(bool negated) const override |
210 | 313 | { return _compiled->prepareForReachability(negated); } | 297 | { return _compiled->prepareForReachability(negated); } |
211 | 314 | bool isReachability(uint32_t depth) const override | 298 | bool isReachability(uint32_t depth) const override |
212 | 315 | { return _compiled->isReachability(depth); } | 299 | { return _compiled->isReachability(depth); } |
213 | 316 | |||
214 | 317 | void toXML(std::ostream& out, uint32_t tabs) const override | ||
215 | 318 | { _compiled->toXML(out, tabs); } | ||
216 | 319 | void toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const override{ | 300 | void toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const override{ |
217 | 320 | } | 301 | } |
218 | 321 | 302 | ||
219 | @@ -383,8 +364,6 @@ | |||
220 | 383 | bool isReachability(uint32_t depth) const override; | 364 | bool isReachability(uint32_t depth) const override; |
221 | 384 | Condition_ptr prepareForReachability(bool negated) const override; | 365 | Condition_ptr prepareForReachability(bool negated) const override; |
222 | 385 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 366 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
223 | 386 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
224 | 387 | void toBinary(std::ostream&) const override; | ||
225 | 388 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 367 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
226 | 389 | 368 | ||
227 | 390 | 369 | ||
228 | @@ -427,7 +406,7 @@ | |||
229 | 427 | Result evaluate(const EvaluationContext& context) override; | 406 | Result evaluate(const EvaluationContext& context) override; |
230 | 428 | Result evalAndSet(const EvaluationContext& context) override; | 407 | Result evalAndSet(const EvaluationContext& context) override; |
231 | 429 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; | 408 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; |
233 | 430 | void toBinary(std::ostream& out) const override; | 409 | void visit(Visitor&) const override; |
234 | 431 | 410 | ||
235 | 432 | 411 | ||
236 | 433 | virtual const Condition_ptr& operator[] (size_t i) const override { return _cond;} | 412 | virtual const Condition_ptr& operator[] (size_t i) const override { return _cond;} |
237 | @@ -452,7 +431,6 @@ | |||
238 | 452 | bool isReachability(uint32_t depth) const override; | 431 | bool isReachability(uint32_t depth) const override; |
239 | 453 | Condition_ptr prepareForReachability(bool negated) const override; | 432 | Condition_ptr prepareForReachability(bool negated) const override; |
240 | 454 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 433 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
241 | 455 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
242 | 456 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 434 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
243 | 457 | Quantifier getQuantifier() const override { return Quantifier::E; } | 435 | Quantifier getQuantifier() const override { return Quantifier::E; } |
244 | 458 | Path getPath() const override { return Path::pError; } | 436 | Path getPath() const override { return Path::pError; } |
245 | @@ -481,7 +459,6 @@ | |||
246 | 481 | bool isReachability(uint32_t depth) const override; | 459 | bool isReachability(uint32_t depth) const override; |
247 | 482 | Condition_ptr prepareForReachability(bool negated) const override; | 460 | Condition_ptr prepareForReachability(bool negated) const override; |
248 | 483 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 461 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
249 | 484 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
250 | 485 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 462 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
251 | 486 | Quantifier getQuantifier() const override { return Quantifier::A; } | 463 | Quantifier getQuantifier() const override { return Quantifier::A; } |
252 | 487 | Path getPath() const override { return Path::pError; } | 464 | Path getPath() const override { return Path::pError; } |
253 | @@ -521,7 +498,6 @@ | |||
254 | 521 | 498 | ||
255 | 522 | Retval simplify(SimplificationContext &context) const override; | 499 | Retval simplify(SimplificationContext &context) const override; |
256 | 523 | 500 | ||
257 | 524 | void toXML(std::ostream &, uint32_t tabs) const override; | ||
258 | 525 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 501 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
259 | 526 | 502 | ||
260 | 527 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } | 503 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } |
261 | @@ -563,7 +539,6 @@ | |||
262 | 563 | assert(false); std::cerr << "TODO implement" << std::endl; exit(0); | 539 | assert(false); std::cerr << "TODO implement" << std::endl; exit(0); |
263 | 564 | } | 540 | } |
264 | 565 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 541 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
265 | 566 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
266 | 567 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 542 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
267 | 568 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } | 543 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } |
268 | 569 | Path getPath() const override { return Path::F; } | 544 | Path getPath() const override { return Path::F; } |
269 | @@ -591,7 +566,6 @@ | |||
270 | 591 | } | 566 | } |
271 | 592 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 567 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
272 | 593 | Retval simplify(SimplificationContext& context) const override; | 568 | Retval simplify(SimplificationContext& context) const override; |
273 | 594 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
274 | 595 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 569 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
275 | 596 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } | 570 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } |
276 | 597 | Path getPath() const override { return Path::X; } | 571 | Path getPath() const override { return Path::X; } |
277 | @@ -613,7 +587,6 @@ | |||
278 | 613 | bool isReachability(uint32_t depth) const override; | 587 | bool isReachability(uint32_t depth) const override; |
279 | 614 | Condition_ptr prepareForReachability(bool negated) const override; | 588 | Condition_ptr prepareForReachability(bool negated) const override; |
280 | 615 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 589 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
281 | 616 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
282 | 617 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 590 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
283 | 618 | Quantifier getQuantifier() const override { return Quantifier::E; } | 591 | Quantifier getQuantifier() const override { return Quantifier::E; } |
284 | 619 | Path getPath() const override { return Path::X; } | 592 | Path getPath() const override { return Path::X; } |
285 | @@ -634,7 +607,6 @@ | |||
286 | 634 | bool isReachability(uint32_t depth) const override; | 607 | bool isReachability(uint32_t depth) const override; |
287 | 635 | Condition_ptr prepareForReachability(bool negated) const override; | 608 | Condition_ptr prepareForReachability(bool negated) const override; |
288 | 636 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 609 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
289 | 637 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
290 | 638 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 610 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
291 | 639 | Quantifier getQuantifier() const override { return Quantifier::E; } | 611 | Quantifier getQuantifier() const override { return Quantifier::E; } |
292 | 640 | Path getPath() const override { return Path::G; } | 612 | Path getPath() const override { return Path::G; } |
293 | @@ -656,7 +628,6 @@ | |||
294 | 656 | bool isReachability(uint32_t depth) const override; | 628 | bool isReachability(uint32_t depth) const override; |
295 | 657 | Condition_ptr prepareForReachability(bool negated) const override; | 629 | Condition_ptr prepareForReachability(bool negated) const override; |
296 | 658 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 630 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
297 | 659 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
298 | 660 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 631 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
299 | 661 | Quantifier getQuantifier() const override { return Quantifier::E; } | 632 | Quantifier getQuantifier() const override { return Quantifier::E; } |
300 | 662 | Path getPath() const override { return Path::F; } | 633 | Path getPath() const override { return Path::F; } |
301 | @@ -676,7 +647,6 @@ | |||
302 | 676 | bool isReachability(uint32_t depth) const override; | 647 | bool isReachability(uint32_t depth) const override; |
303 | 677 | Condition_ptr prepareForReachability(bool negated) const override; | 648 | Condition_ptr prepareForReachability(bool negated) const override; |
304 | 678 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 649 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
305 | 679 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
306 | 680 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 650 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
307 | 681 | Quantifier getQuantifier() const override { return Quantifier::A; } | 651 | Quantifier getQuantifier() const override { return Quantifier::A; } |
308 | 682 | Path getPath() const override { return Path::X; } | 652 | Path getPath() const override { return Path::X; } |
309 | @@ -696,7 +666,6 @@ | |||
310 | 696 | bool isReachability(uint32_t depth) const override; | 666 | bool isReachability(uint32_t depth) const override; |
311 | 697 | Condition_ptr prepareForReachability(bool negated) const override; | 667 | Condition_ptr prepareForReachability(bool negated) const override; |
312 | 698 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 668 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
313 | 699 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
314 | 700 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 669 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
315 | 701 | Quantifier getQuantifier() const override { return Quantifier::A; } | 670 | Quantifier getQuantifier() const override { return Quantifier::A; } |
316 | 702 | Path getPath() const override { return Path::G; } | 671 | Path getPath() const override { return Path::G; } |
317 | @@ -716,7 +685,6 @@ | |||
318 | 716 | bool isReachability(uint32_t depth) const override; | 685 | bool isReachability(uint32_t depth) const override; |
319 | 717 | Condition_ptr prepareForReachability(bool negated) const override; | 686 | Condition_ptr prepareForReachability(bool negated) const override; |
320 | 718 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 687 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
321 | 719 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
322 | 720 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 688 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
323 | 721 | Quantifier getQuantifier() const override { return Quantifier::A; } | 689 | Quantifier getQuantifier() const override { return Quantifier::A; } |
324 | 722 | Path getPath() const override { return Path::F; } | 690 | Path getPath() const override { return Path::F; } |
325 | @@ -744,7 +712,6 @@ | |||
326 | 744 | void analyze(AnalysisContext& context) override; | 712 | void analyze(AnalysisContext& context) override; |
327 | 745 | Result evaluate(const EvaluationContext& context) override; | 713 | Result evaluate(const EvaluationContext& context) override; |
328 | 746 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; | 714 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; |
329 | 747 | void toBinary(std::ostream& out) const override; | ||
330 | 748 | bool isReachability(uint32_t depth) const override; | 715 | bool isReachability(uint32_t depth) const override; |
331 | 749 | Condition_ptr prepareForReachability(bool negated) const override; | 716 | Condition_ptr prepareForReachability(bool negated) const override; |
332 | 750 | 717 | ||
333 | @@ -758,12 +725,11 @@ | |||
334 | 758 | 725 | ||
335 | 759 | [[nodiscard]] const Condition_ptr& getCond1() const { return (*this)[0]; } | 726 | [[nodiscard]] const Condition_ptr& getCond1() const { return (*this)[0]; } |
336 | 760 | [[nodiscard]] const Condition_ptr& getCond2() const { return (*this)[1]; } | 727 | [[nodiscard]] const Condition_ptr& getCond2() const { return (*this)[1]; } |
338 | 761 | 728 | ||
339 | 762 | Retval simplify(SimplificationContext& context) const override; | 729 | Retval simplify(SimplificationContext& context) const override; |
340 | 763 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 730 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
341 | 764 | void visit(Visitor&) const override; | 731 | void visit(Visitor&) const override; |
342 | 765 | void visit(MutatingVisitor&) override; | 732 | void visit(MutatingVisitor&) override; |
343 | 766 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
344 | 767 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 733 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
345 | 768 | uint32_t distance(DistanceContext& context) const override { return (*this)[1]->distance(context); } | 734 | uint32_t distance(DistanceContext& context) const override { return (*this)[1]->distance(context); } |
346 | 769 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } | 735 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } |
347 | @@ -785,7 +751,6 @@ | |||
348 | 785 | void visit(MutatingVisitor&) override; | 751 | void visit(MutatingVisitor&) override; |
349 | 786 | uint32_t distance(DistanceContext& context) const override; | 752 | uint32_t distance(DistanceContext& context) const override; |
350 | 787 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 753 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
351 | 788 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
352 | 789 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 754 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
353 | 790 | 755 | ||
354 | 791 | private: | 756 | private: |
355 | @@ -800,7 +765,6 @@ | |||
356 | 800 | void visit(Visitor&) const override; | 765 | void visit(Visitor&) const override; |
357 | 801 | void visit(MutatingVisitor&) override; | 766 | void visit(MutatingVisitor&) override; |
358 | 802 | uint32_t distance(DistanceContext& context) const override; | 767 | uint32_t distance(DistanceContext& context) const override; |
359 | 803 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
360 | 804 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 768 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
361 | 805 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 769 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
362 | 806 | virtual bool isLoopSensitive() const override { return true; } | 770 | virtual bool isLoopSensitive() const override { return true; } |
363 | @@ -819,7 +783,6 @@ | |||
364 | 819 | std::string getName() const { | 783 | std::string getName() const { |
365 | 820 | return _name; | 784 | return _name; |
366 | 821 | } | 785 | } |
367 | 822 | void toXML(std::ostream& out, uint32_t tabs) const override; | ||
368 | 823 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 786 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
369 | 824 | protected: | 787 | protected: |
370 | 825 | void _analyze(AnalysisContext& context) override; | 788 | void _analyze(AnalysisContext& context) override; |
371 | @@ -859,7 +822,7 @@ | |||
372 | 859 | 822 | ||
373 | 860 | void analyze(AnalysisContext& context) override; | 823 | void analyze(AnalysisContext& context) override; |
374 | 861 | 824 | ||
376 | 862 | void toBinary(std::ostream& out) const override; | 825 | void visit(Visitor&) const override; |
377 | 863 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; | 826 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; |
378 | 864 | bool isReachability(uint32_t depth) const override; | 827 | bool isReachability(uint32_t depth) const override; |
379 | 865 | Condition_ptr prepareForReachability(bool negated) const override; | 828 | Condition_ptr prepareForReachability(bool negated) const override; |
380 | @@ -916,7 +879,6 @@ | |||
381 | 916 | Result evalAndSet(const EvaluationContext& context) override; | 879 | Result evalAndSet(const EvaluationContext& context) override; |
382 | 917 | void visit(Visitor&) const override; | 880 | void visit(Visitor&) const override; |
383 | 918 | void visit(MutatingVisitor&) override; | 881 | void visit(MutatingVisitor&) override; |
384 | 919 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
385 | 920 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 882 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
386 | 921 | Quantifier getQuantifier() const override { return Quantifier::AND; } | 883 | Quantifier getQuantifier() const override { return Quantifier::AND; } |
387 | 922 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 884 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
388 | @@ -941,7 +903,6 @@ | |||
389 | 941 | Result evalAndSet(const EvaluationContext& context) override; | 903 | Result evalAndSet(const EvaluationContext& context) override; |
390 | 942 | void visit(Visitor&) const override; | 904 | void visit(Visitor&) const override; |
391 | 943 | void visit(MutatingVisitor&) override; | 905 | void visit(MutatingVisitor&) override; |
392 | 944 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
393 | 945 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 906 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
394 | 946 | 907 | ||
395 | 947 | Quantifier getQuantifier() const override { return Quantifier::OR; } | 908 | Quantifier getQuantifier() const override { return Quantifier::OR; } |
396 | @@ -1024,12 +985,10 @@ | |||
397 | 1024 | void analyze(AnalysisContext& context) override; | 985 | void analyze(AnalysisContext& context) override; |
398 | 1025 | uint32_t distance(DistanceContext& context) const override; | 986 | uint32_t distance(DistanceContext& context) const override; |
399 | 1026 | void toTAPAALQuery(std::ostream& stream,TAPAALConditionExportContext& context) const override; | 987 | void toTAPAALQuery(std::ostream& stream,TAPAALConditionExportContext& context) const override; |
400 | 1027 | void toBinary(std::ostream& out) const override; | ||
401 | 1028 | bool isReachability(uint32_t depth) const override { return depth > 0; }; | 988 | bool isReachability(uint32_t depth) const override { return depth > 0; }; |
402 | 1029 | Condition_ptr prepareForReachability(bool negated) const override; | 989 | Condition_ptr prepareForReachability(bool negated) const override; |
403 | 1030 | CTLType getQueryType() const override { return CTLType::LOPERATOR; } | 990 | CTLType getQueryType() const override { return CTLType::LOPERATOR; } |
404 | 1031 | Path getPath() const override { return Path::pError; } | 991 | Path getPath() const override { return Path::pError; } |
405 | 1032 | virtual void toXML(std::ostream& stream, uint32_t tabs) const override; | ||
406 | 1033 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 992 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
407 | 1034 | Retval simplify(SimplificationContext& context) const override; | 993 | Retval simplify(SimplificationContext& context) const override; |
408 | 1035 | Result evaluate(const EvaluationContext& context) override; | 994 | Result evaluate(const EvaluationContext& context) override; |
409 | @@ -1071,7 +1030,7 @@ | |||
410 | 1071 | Result evaluate(const EvaluationContext& context) override; | 1030 | Result evaluate(const EvaluationContext& context) override; |
411 | 1072 | Result evalAndSet(const EvaluationContext& context) override; | 1031 | Result evalAndSet(const EvaluationContext& context) override; |
412 | 1073 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; | 1032 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; |
414 | 1074 | void toBinary(std::ostream& out) const override; | 1033 | void visit(Visitor&) const override; |
415 | 1075 | bool isReachability(uint32_t depth) const override; | 1034 | bool isReachability(uint32_t depth) const override; |
416 | 1076 | Condition_ptr prepareForReachability(bool negated) const override; | 1035 | Condition_ptr prepareForReachability(bool negated) const override; |
417 | 1077 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } | 1036 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } |
418 | @@ -1090,6 +1049,8 @@ | |||
419 | 1090 | 1049 | ||
420 | 1091 | [[nodiscard]] const Expr_ptr &getExpr2() const { return _expr2; } | 1050 | [[nodiscard]] const Expr_ptr &getExpr2() const { return _expr2; } |
421 | 1092 | 1051 | ||
422 | 1052 | virtual std::string op() const = 0; | ||
423 | 1053 | |||
424 | 1093 | protected: | 1054 | protected: |
425 | 1094 | uint32_t _distance(DistanceContext& c, | 1055 | uint32_t _distance(DistanceContext& c, |
426 | 1095 | std::function<uint32_t(uint32_t, uint32_t, bool)> d) const | 1056 | std::function<uint32_t(uint32_t, uint32_t, bool)> d) const |
427 | @@ -1098,7 +1059,6 @@ | |||
428 | 1098 | } | 1059 | } |
429 | 1099 | private: | 1060 | private: |
430 | 1100 | virtual bool apply(int v1, int v2) const = 0; | 1061 | virtual bool apply(int v1, int v2) const = 0; |
431 | 1101 | virtual std::string op() const = 0; | ||
432 | 1102 | /** Operator when exported to TAPAAL */ | 1062 | /** Operator when exported to TAPAAL */ |
433 | 1103 | virtual std::string opTAPAAL() const = 0; | 1063 | virtual std::string opTAPAAL() const = 0; |
434 | 1104 | /** Swapped operator when exported to TAPAAL, e.g. operator when operands are swapped */ | 1064 | /** Swapped operator when exported to TAPAAL, e.g. operator when operands are swapped */ |
435 | @@ -1119,7 +1079,6 @@ | |||
436 | 1119 | 1079 | ||
437 | 1120 | using CompareCondition::CompareCondition; | 1080 | using CompareCondition::CompareCondition; |
438 | 1121 | Retval simplify(SimplificationContext& context) const override; | 1081 | Retval simplify(SimplificationContext& context) const override; |
439 | 1122 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
440 | 1123 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 1082 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
441 | 1124 | 1083 | ||
442 | 1125 | uint32_t distance(DistanceContext& context) const override; | 1084 | uint32_t distance(DistanceContext& context) const override; |
443 | @@ -1140,7 +1099,6 @@ | |||
444 | 1140 | using CompareCondition::CompareCondition; | 1099 | using CompareCondition::CompareCondition; |
445 | 1141 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; | 1100 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; |
446 | 1142 | Retval simplify(SimplificationContext& context) const override; | 1101 | Retval simplify(SimplificationContext& context) const override; |
447 | 1143 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
448 | 1144 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 1102 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
449 | 1145 | 1103 | ||
450 | 1146 | 1104 | ||
451 | @@ -1161,7 +1119,6 @@ | |||
452 | 1161 | 1119 | ||
453 | 1162 | using CompareCondition::CompareCondition; | 1120 | using CompareCondition::CompareCondition; |
454 | 1163 | Retval simplify(SimplificationContext& context) const override; | 1121 | Retval simplify(SimplificationContext& context) const override; |
455 | 1164 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
456 | 1165 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 1122 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
457 | 1166 | 1123 | ||
458 | 1167 | uint32_t distance(DistanceContext& context) const override; | 1124 | uint32_t distance(DistanceContext& context) const override; |
459 | @@ -1181,7 +1138,6 @@ | |||
460 | 1181 | 1138 | ||
461 | 1182 | using CompareCondition::CompareCondition; | 1139 | using CompareCondition::CompareCondition; |
462 | 1183 | Retval simplify(SimplificationContext& context) const override; | 1140 | Retval simplify(SimplificationContext& context) const override; |
463 | 1184 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
464 | 1185 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 1141 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
465 | 1186 | 1142 | ||
466 | 1187 | uint32_t distance(DistanceContext& context) const override; | 1143 | uint32_t distance(DistanceContext& context) const override; |
467 | @@ -1223,8 +1179,6 @@ | |||
468 | 1223 | bool isReachability(uint32_t depth) const override; | 1179 | bool isReachability(uint32_t depth) const override; |
469 | 1224 | Condition_ptr prepareForReachability(bool negated) const override; | 1180 | Condition_ptr prepareForReachability(bool negated) const override; |
470 | 1225 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 1181 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
471 | 1226 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
472 | 1227 | void toBinary(std::ostream&) const override; | ||
473 | 1228 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 1182 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
474 | 1229 | 1183 | ||
475 | 1230 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } | 1184 | Quantifier getQuantifier() const override { return Quantifier::EMPTY; } |
476 | @@ -1256,8 +1210,6 @@ | |||
477 | 1256 | bool isReachability(uint32_t depth) const override; | 1210 | bool isReachability(uint32_t depth) const override; |
478 | 1257 | Condition_ptr prepareForReachability(bool negated) const override; | 1211 | Condition_ptr prepareForReachability(bool negated) const override; |
479 | 1258 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 1212 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
480 | 1259 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
481 | 1260 | void toBinary(std::ostream&) const override; | ||
482 | 1261 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 1213 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
483 | 1262 | 1214 | ||
484 | 1263 | static Condition_ptr DEADLOCK; | 1215 | static Condition_ptr DEADLOCK; |
485 | @@ -1385,12 +1337,10 @@ | |||
486 | 1385 | void visit(MutatingVisitor&) override; | 1337 | void visit(MutatingVisitor&) override; |
487 | 1386 | uint32_t distance(DistanceContext& context) const override; | 1338 | uint32_t distance(DistanceContext& context) const override; |
488 | 1387 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; | 1339 | void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override; |
489 | 1388 | void toBinary(std::ostream&) const override; | ||
490 | 1389 | Retval simplify(SimplificationContext& context) const override; | 1340 | Retval simplify(SimplificationContext& context) const override; |
491 | 1390 | bool isReachability(uint32_t depth) const override; | 1341 | bool isReachability(uint32_t depth) const override; |
492 | 1391 | Condition_ptr prepareForReachability(bool negated) const override; | 1342 | Condition_ptr prepareForReachability(bool negated) const override; |
493 | 1392 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; | 1343 | Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override; |
494 | 1393 | void toXML(std::ostream&, uint32_t tabs) const override; | ||
495 | 1394 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; | 1344 | void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override; |
496 | 1395 | 1345 | ||
497 | 1396 | Quantifier getQuantifier() const override { return Quantifier::UPPERBOUNDS; } | 1346 | Quantifier getQuantifier() const override { return Quantifier::UPPERBOUNDS; } |
498 | @@ -1410,6 +1360,9 @@ | |||
499 | 1410 | 1360 | ||
500 | 1411 | const std::vector<place_t>& places() const { return _places; } | 1361 | const std::vector<place_t>& places() const { return _places; } |
501 | 1412 | 1362 | ||
502 | 1363 | double getMax() const { return _max; } | ||
503 | 1364 | double getOffset() const { return _offset; } | ||
504 | 1365 | |||
505 | 1413 | private: | 1366 | private: |
506 | 1414 | std::vector<place_t> _places; | 1367 | std::vector<place_t> _places; |
507 | 1415 | size_t _bound = 0; | 1368 | size_t _bound = 0; |
508 | 1416 | 1369 | ||
509 | === modified file 'include/PetriEngine/PQL/PQL.h' | |||
510 | --- include/PetriEngine/PQL/PQL.h 2021-06-01 08:40:18 +0000 | |||
511 | +++ include/PetriEngine/PQL/PQL.h 2021-10-18 11:40:53 +0000 | |||
512 | @@ -118,8 +118,6 @@ | |||
513 | 118 | /** Construct left/right side of equations used in query simplification */ | 118 | /** Construct left/right side of equations used in query simplification */ |
514 | 119 | virtual Simplification::Member constraint(SimplificationContext& context) const = 0; | 119 | virtual Simplification::Member constraint(SimplificationContext& context) const = 0; |
515 | 120 | /** Output the expression as it currently is to a file in XML */ | 120 | /** Output the expression as it currently is to a file in XML */ |
516 | 121 | virtual void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const = 0; | ||
517 | 122 | virtual void toBinary(std::ostream&) const = 0; | ||
518 | 123 | virtual void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const = 0; | 121 | virtual void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const = 0; |
519 | 124 | 122 | ||
520 | 125 | /** Count size of the entire formula in number of nodes */ | 123 | /** Count size of the entire formula in number of nodes */ |
521 | @@ -231,9 +229,7 @@ | |||
522 | 231 | [[nodiscard]] virtual std::shared_ptr<Condition> pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated = false, bool initrw = true) = 0; | 229 | [[nodiscard]] virtual std::shared_ptr<Condition> pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated = false, bool initrw = true) = 0; |
523 | 232 | 230 | ||
524 | 233 | /** Output the condition as it currently is to a file in XML */ | 231 | /** Output the condition as it currently is to a file in XML */ |
525 | 234 | virtual void toXML(std::ostream&, uint32_t tabs) const = 0; | ||
526 | 235 | virtual void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const = 0; | 232 | virtual void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const = 0; |
527 | 236 | virtual void toBinary(std::ostream& out) const = 0; | ||
528 | 237 | 233 | ||
529 | 238 | /** Checks if the condition is trivially true */ | 234 | /** Checks if the condition is trivially true */ |
530 | 239 | [[nodiscard]] bool isTriviallyTrue(); | 235 | [[nodiscard]] bool isTriviallyTrue(); |
531 | 240 | 236 | ||
532 | === modified file 'include/PetriEngine/PQL/Visitor.h' | |||
533 | --- include/PetriEngine/PQL/Visitor.h 2021-04-29 07:47:52 +0000 | |||
534 | +++ include/PetriEngine/PQL/Visitor.h 2021-10-18 11:40:53 +0000 | |||
535 | @@ -30,101 +30,119 @@ | |||
536 | 30 | 30 | ||
537 | 31 | protected: | 31 | protected: |
538 | 32 | virtual void _accept(const NotCondition* element) = 0; | 32 | virtual void _accept(const NotCondition* element) = 0; |
545 | 33 | virtual void _accept(const AndCondition* element) = 0; | 33 | |
546 | 34 | virtual void _accept(const OrCondition* element) = 0; | 34 | virtual void _accept(const AndCondition* element) { |
547 | 35 | virtual void _accept(const LessThanCondition* element) = 0; | 35 | element->LogicalCondition::visit(*this); |
548 | 36 | virtual void _accept(const LessThanOrEqualCondition* element) = 0; | 36 | } |
549 | 37 | virtual void _accept(const EqualCondition* element) = 0; | 37 | |
550 | 38 | virtual void _accept(const NotEqualCondition* element) = 0; | 38 | virtual void _accept(const OrCondition* element) { |
551 | 39 | element->LogicalCondition::visit(*this); | ||
552 | 40 | } | ||
553 | 41 | |||
554 | 42 | virtual void _accept(const LessThanCondition* element) { | ||
555 | 43 | element->CompareCondition::visit(*this); | ||
556 | 44 | } | ||
557 | 45 | |||
558 | 46 | virtual void _accept(const LessThanOrEqualCondition* element) { | ||
559 | 47 | element->CompareCondition::visit(*this); | ||
560 | 48 | } | ||
561 | 49 | |||
562 | 50 | virtual void _accept(const EqualCondition* element) { | ||
563 | 51 | element->CompareCondition::visit(*this); | ||
564 | 52 | } | ||
565 | 53 | |||
566 | 54 | virtual void _accept(const NotEqualCondition* element) { | ||
567 | 55 | element->CompareCondition::visit(*this); | ||
568 | 56 | } | ||
569 | 39 | 57 | ||
570 | 40 | virtual void _accept(const DeadlockCondition* element) = 0; | 58 | virtual void _accept(const DeadlockCondition* element) = 0; |
571 | 41 | virtual void _accept(const CompareConjunction* element) = 0; | 59 | virtual void _accept(const CompareConjunction* element) = 0; |
572 | 42 | virtual void _accept(const UnfoldedUpperBoundsCondition* element) = 0; | 60 | virtual void _accept(const UnfoldedUpperBoundsCondition* element) = 0; |
573 | 43 | 61 | ||
574 | 62 | // Super classes, the default implementation of subclasses is to call these | ||
575 | 63 | virtual void _accept(const CommutativeExpr *element) { | ||
576 | 64 | assert(false); | ||
577 | 65 | std::cerr << "No accept for CommutativeExpr (may be called from subclass)" << std::endl; | ||
578 | 66 | exit(0); | ||
579 | 67 | } | ||
580 | 68 | |||
581 | 69 | virtual void _accept(const SimpleQuantifierCondition *element) { | ||
582 | 70 | assert(false); | ||
583 | 71 | std::cerr << "No accept for SimpleQuantifierCondition (may be called from subclass)" << std::endl; | ||
584 | 72 | exit(0); | ||
585 | 73 | } | ||
586 | 74 | |||
587 | 75 | virtual void _accept(const LogicalCondition *element) { | ||
588 | 76 | assert(false); | ||
589 | 77 | std::cerr << "No accept for LogicalCondition (may be called from subclass)" << std::endl; | ||
590 | 78 | exit(0); | ||
591 | 79 | } | ||
592 | 80 | |||
593 | 81 | virtual void _accept(const CompareCondition *element) { | ||
594 | 82 | assert(false); | ||
595 | 83 | std::cerr << "No accept for CompareCondition (may be called from subclass)" << std::endl; | ||
596 | 84 | exit(0); | ||
597 | 85 | } | ||
598 | 86 | |||
599 | 87 | virtual void _accept(const UntilCondition *element) { | ||
600 | 88 | assert(false); | ||
601 | 89 | std::cerr << "No accept for UntilCondition (may be called from subclass)" << std::endl; | ||
602 | 90 | exit(0); | ||
603 | 91 | } | ||
604 | 92 | |||
605 | 93 | |||
606 | 44 | // Quantifiers, most uses of the visitor will not use the quantifiers - so we give a default implementation. | 94 | // Quantifiers, most uses of the visitor will not use the quantifiers - so we give a default implementation. |
607 | 45 | // default behaviour is error | 95 | // default behaviour is error |
690 | 46 | virtual void _accept(const EFCondition *) { | 96 | virtual void _accept(const EFCondition *condition) { |
691 | 47 | assert(false); | 97 | condition->SimpleQuantifierCondition::visit(*this); |
692 | 48 | std::cerr << "No accept for EFCondition" << std::endl; | 98 | }; |
693 | 49 | exit(0); | 99 | |
694 | 50 | }; | 100 | virtual void _accept(const EGCondition *condition) { |
695 | 51 | 101 | condition->SimpleQuantifierCondition::visit(*this); | |
696 | 52 | virtual void _accept(const EGCondition *) { | 102 | }; |
697 | 53 | assert(false); | 103 | |
698 | 54 | std::cerr << "No accept for EGCondition" << std::endl; | 104 | virtual void _accept(const AGCondition *condition) { |
699 | 55 | exit(0); | 105 | condition->SimpleQuantifierCondition::visit(*this); |
700 | 56 | }; | 106 | }; |
701 | 57 | 107 | ||
702 | 58 | virtual void _accept(const AGCondition *) { | 108 | virtual void _accept(const AFCondition *condition) { |
703 | 59 | assert(false); | 109 | condition->SimpleQuantifierCondition::visit(*this); |
704 | 60 | std::cerr << "No accept for AGCondition" << std::endl; | 110 | }; |
705 | 61 | exit(0); | 111 | |
706 | 62 | }; | 112 | virtual void _accept(const EXCondition *condition) { |
707 | 63 | 113 | condition->SimpleQuantifierCondition::visit(*this); | |
708 | 64 | virtual void _accept(const AFCondition *) { | 114 | }; |
709 | 65 | assert(false); | 115 | |
710 | 66 | std::cerr << "No accept for AFCondition" << std::endl; | 116 | virtual void _accept(const AXCondition *condition) { |
711 | 67 | exit(0); | 117 | condition->SimpleQuantifierCondition::visit(*this); |
712 | 68 | }; | 118 | }; |
713 | 69 | 119 | ||
714 | 70 | virtual void _accept(const EXCondition *) { | 120 | virtual void _accept(const EUCondition *condition) { |
715 | 71 | assert(false); | 121 | condition->UntilCondition::visit(*this); |
716 | 72 | std::cerr << "No accept for EXCondition" << std::endl; | 122 | }; |
717 | 73 | exit(0); | 123 | |
718 | 74 | }; | 124 | virtual void _accept(const AUCondition *condition) { |
719 | 75 | 125 | condition->UntilCondition::visit(*this); | |
720 | 76 | virtual void _accept(const AXCondition *) { | 126 | }; |
721 | 77 | assert(false); | 127 | |
722 | 78 | std::cerr << "No accept for AXCondition" << std::endl; | 128 | virtual void _accept(const ACondition *condition) { |
723 | 79 | exit(0); | 129 | condition->SimpleQuantifierCondition::visit(*this); |
724 | 80 | }; | 130 | }; |
725 | 81 | 131 | ||
726 | 82 | virtual void _accept(const EUCondition *) { | 132 | virtual void _accept(const ECondition *condition) { |
727 | 83 | assert(false); | 133 | condition->SimpleQuantifierCondition::visit(*this); |
728 | 84 | std::cerr << "No accept for EUCondition" << std::endl; | 134 | }; |
729 | 85 | exit(0); | 135 | |
730 | 86 | }; | 136 | virtual void _accept(const GCondition *condition) { |
731 | 87 | 137 | condition->SimpleQuantifierCondition::visit(*this); | |
732 | 88 | virtual void _accept(const AUCondition *) { | 138 | }; |
733 | 89 | assert(false); | 139 | |
734 | 90 | std::cerr << "No accept for AUCondition" << std::endl; | 140 | virtual void _accept(const FCondition *condition) { |
735 | 91 | exit(0); | 141 | condition->SimpleQuantifierCondition::visit(*this); |
736 | 92 | }; | 142 | }; |
737 | 93 | 143 | ||
738 | 94 | virtual void _accept(const ACondition *) { | 144 | virtual void _accept(const XCondition *condition) { |
739 | 95 | assert(false); | 145 | condition->SimpleQuantifierCondition::visit(*this); |
658 | 96 | std::cerr << "No accept for ACondition" << std::endl; | ||
659 | 97 | exit(0); | ||
660 | 98 | }; | ||
661 | 99 | |||
662 | 100 | virtual void _accept(const ECondition *) { | ||
663 | 101 | assert(false); | ||
664 | 102 | std::cerr << "No accept for ECondition" << std::endl; | ||
665 | 103 | exit(0); | ||
666 | 104 | }; | ||
667 | 105 | |||
668 | 106 | virtual void _accept(const GCondition *) { | ||
669 | 107 | assert(false); | ||
670 | 108 | std::cerr << "No accept for GCondition" << std::endl; | ||
671 | 109 | exit(0); | ||
672 | 110 | }; | ||
673 | 111 | |||
674 | 112 | virtual void _accept(const FCondition *) { | ||
675 | 113 | assert(false); | ||
676 | 114 | std::cerr << "No accept for FCondition" << std::endl; | ||
677 | 115 | exit(0); | ||
678 | 116 | }; | ||
679 | 117 | |||
680 | 118 | virtual void _accept(const XCondition *) { | ||
681 | 119 | assert(false); | ||
682 | 120 | std::cerr << "No accept for XCondition" << std::endl; | ||
683 | 121 | exit(0); | ||
684 | 122 | }; | ||
685 | 123 | |||
686 | 124 | virtual void _accept(const UntilCondition *) { | ||
687 | 125 | assert(false); | ||
688 | 126 | std::cerr << "No accept for UntilCondition" << std::endl; | ||
689 | 127 | exit(0); | ||
740 | 128 | }; | 146 | }; |
741 | 129 | 147 | ||
742 | 130 | // shallow elements, neither of these should exist in a compiled expression | 148 | // shallow elements, neither of these should exist in a compiled expression |
743 | @@ -176,14 +194,24 @@ | |||
744 | 176 | exit(0); | 194 | exit(0); |
745 | 177 | }; | 195 | }; |
746 | 178 | 196 | ||
747 | 197 | virtual void _accept(const ShallowCondition *element) { | ||
748 | 198 | assert(false); | ||
749 | 199 | std::cerr << "No accept for BooleanCondition" << std::endl; | ||
750 | 200 | exit(0); | ||
751 | 201 | } | ||
752 | 202 | |||
753 | 179 | // Expression | 203 | // Expression |
754 | 180 | virtual void _accept(const UnfoldedIdentifierExpr *element) = 0; | 204 | virtual void _accept(const UnfoldedIdentifierExpr *element) = 0; |
755 | 181 | 205 | ||
756 | 182 | virtual void _accept(const LiteralExpr *element) = 0; | 206 | virtual void _accept(const LiteralExpr *element) = 0; |
757 | 183 | 207 | ||
759 | 184 | virtual void _accept(const PlusExpr *element) = 0; | 208 | virtual void _accept(const PlusExpr *element) { |
760 | 209 | element->CommutativeExpr::visit(*this); | ||
761 | 210 | }; | ||
762 | 185 | 211 | ||
764 | 186 | virtual void _accept(const MultiplyExpr *element) = 0; | 212 | virtual void _accept(const MultiplyExpr *element) { |
765 | 213 | element->CommutativeExpr::visit(*this); | ||
766 | 214 | }; | ||
767 | 187 | 215 | ||
768 | 188 | virtual void _accept(const MinusExpr *element) = 0; | 216 | virtual void _accept(const MinusExpr *element) = 0; |
769 | 189 | 217 | ||
770 | 190 | 218 | ||
771 | === added file 'include/PetriEngine/PQL/XMLPrinter.h' | |||
772 | --- include/PetriEngine/PQL/XMLPrinter.h 1970-01-01 00:00:00 +0000 | |||
773 | +++ include/PetriEngine/PQL/XMLPrinter.h 2021-10-18 11:40:53 +0000 | |||
774 | @@ -0,0 +1,119 @@ | |||
775 | 1 | /* Copyright (C) 2011 Jonas Finnemann Jensen <jopsen@gmail.com>, | ||
776 | 2 | * Thomas Søndersø Nielsen <primogens@gmail.com>, | ||
777 | 3 | * Lars Kærlund Østergaard <larsko@gmail.com>, | ||
778 | 4 | * Peter Gjøl Jensen <root@petergjoel.dk>, | ||
779 | 5 | * Rasmus Tollund <rtollu18@student.aau.dk> | ||
780 | 6 | * | ||
781 | 7 | * This program is free software: you can redistribute it and/or modify | ||
782 | 8 | * it under the terms of the GNU General Public License as published by | ||
783 | 9 | * the Free Software Foundation, either version 3 of the License, or | ||
784 | 10 | * (at your option) any later version. | ||
785 | 11 | * | ||
786 | 12 | * This program is distributed in the hope that it will be useful, | ||
787 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
788 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
789 | 15 | * GNU General Public License for more details. | ||
790 | 16 | * | ||
791 | 17 | * You should have received a copy of the GNU General Public License | ||
792 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
793 | 19 | */ | ||
794 | 20 | #ifndef VERIFYPN_XMLPRINTER_H | ||
795 | 21 | #define VERIFYPN_XMLPRINTER_H | ||
796 | 22 | |||
797 | 23 | #include <iostream> | ||
798 | 24 | #include "Visitor.h" | ||
799 | 25 | |||
800 | 26 | namespace PetriEngine { | ||
801 | 27 | namespace PQL { | ||
802 | 28 | class XMLPrinter : public Visitor { | ||
803 | 29 | public: | ||
804 | 30 | XMLPrinter(std::ostream& os, uint32_t init_tabs = 0, uint32_t tab_size = 2, bool print_newlines = true, bool token_count = false) : | ||
805 | 31 | os(os), tabs(init_tabs), tab_size(tab_size), single_tab(std::string(tab_size, ' ')), print_newlines(print_newlines), token_count(token_count) {} | ||
806 | 32 | |||
807 | 33 | protected: | ||
808 | 34 | std::ostream& os; | ||
809 | 35 | const bool token_count; | ||
810 | 36 | uint32_t tabs; | ||
811 | 37 | const uint32_t tab_size; | ||
812 | 38 | const std::string single_tab; | ||
813 | 39 | const bool print_newlines; | ||
814 | 40 | |||
815 | 41 | std::ostream & generateTabs(); | ||
816 | 42 | |||
817 | 43 | void openXmlTag(const std::string& tag); | ||
818 | 44 | void closeXmlTag(const std::string &tag); | ||
819 | 45 | void outputLine(const std::string &line); | ||
820 | 46 | |||
821 | 47 | void _accept(const NotCondition *element) override; | ||
822 | 48 | |||
823 | 49 | void _accept(const AndCondition *element) override; | ||
824 | 50 | |||
825 | 51 | void _accept(const OrCondition *element) override; | ||
826 | 52 | |||
827 | 53 | void _accept(const LessThanCondition *element) override; | ||
828 | 54 | |||
829 | 55 | void _accept(const LessThanOrEqualCondition *element) override; | ||
830 | 56 | |||
831 | 57 | void _accept(const EqualCondition *element) override; | ||
832 | 58 | |||
833 | 59 | void _accept(const NotEqualCondition *element) override; | ||
834 | 60 | |||
835 | 61 | void _accept(const DeadlockCondition *element) override; | ||
836 | 62 | |||
837 | 63 | void _accept(const CompareConjunction *element) override; | ||
838 | 64 | |||
839 | 65 | void _accept(const UnfoldedUpperBoundsCondition *element) override; | ||
840 | 66 | |||
841 | 67 | void _accept(const EFCondition *condition) override; | ||
842 | 68 | |||
843 | 69 | void _accept(const EGCondition *condition) override; | ||
844 | 70 | |||
845 | 71 | void _accept(const AGCondition *condition) override; | ||
846 | 72 | |||
847 | 73 | void _accept(const AFCondition *condition) override; | ||
848 | 74 | |||
849 | 75 | void _accept(const EXCondition *condition) override; | ||
850 | 76 | |||
851 | 77 | void _accept(const AXCondition *condition) override; | ||
852 | 78 | |||
853 | 79 | void _accept(const EUCondition *condition) override; | ||
854 | 80 | |||
855 | 81 | void _accept(const AUCondition *condition) override; | ||
856 | 82 | |||
857 | 83 | void _accept(const ACondition *condition) override; | ||
858 | 84 | |||
859 | 85 | void _accept(const ECondition *condition) override; | ||
860 | 86 | |||
861 | 87 | void _accept(const GCondition *condition) override; | ||
862 | 88 | |||
863 | 89 | void _accept(const FCondition *condition) override; | ||
864 | 90 | |||
865 | 91 | void _accept(const XCondition *condition) override; | ||
866 | 92 | |||
867 | 93 | void _accept(const UntilCondition *condition) override; | ||
868 | 94 | |||
869 | 95 | void _accept(const UnfoldedFireableCondition *element) override; | ||
870 | 96 | |||
871 | 97 | void _accept(const BooleanCondition *element) override; | ||
872 | 98 | |||
873 | 99 | void _accept(const ShallowCondition *element) override; | ||
874 | 100 | |||
875 | 101 | void _accept(const UnfoldedIdentifierExpr *element) override; | ||
876 | 102 | |||
877 | 103 | void _accept(const LiteralExpr *element) override; | ||
878 | 104 | |||
879 | 105 | void _accept(const PlusExpr *element) override; | ||
880 | 106 | |||
881 | 107 | void _accept(const MultiplyExpr *element) override; | ||
882 | 108 | |||
883 | 109 | void _accept(const MinusExpr *element) override; | ||
884 | 110 | |||
885 | 111 | void _accept(const SubtractExpr *element) override; | ||
886 | 112 | |||
887 | 113 | void _accept(const IdentifierExpr *element) override; | ||
888 | 114 | |||
889 | 115 | }; | ||
890 | 116 | } | ||
891 | 117 | } | ||
892 | 118 | |||
893 | 119 | #endif //VERIFYPN_XMLPRINTER_H | ||
894 | 0 | 120 | ||
895 | === added file 'src/PetriEngine/PQL/BinaryPrinter.cpp' | |||
896 | --- src/PetriEngine/PQL/BinaryPrinter.cpp 1970-01-01 00:00:00 +0000 | |||
897 | +++ src/PetriEngine/PQL/BinaryPrinter.cpp 2021-10-18 11:40:53 +0000 | |||
898 | @@ -0,0 +1,173 @@ | |||
899 | 1 | /* Copyright (C) 2011 Jonas Finnemann Jensen <jopsen@gmail.com>, | ||
900 | 2 | * Thomas Søndersø Nielsen <primogens@gmail.com>, | ||
901 | 3 | * Lars Kærlund Østergaard <larsko@gmail.com>, | ||
902 | 4 | * Peter Gjøl Jensen <root@petergjoel.dk>, | ||
903 | 5 | * Rasmus Tollund <rtollu18@student.aau.dk> | ||
904 | 6 | * | ||
905 | 7 | * This program is free software: you can redistribute it and/or modify | ||
906 | 8 | * it under the terms of the GNU General Public License as published by | ||
907 | 9 | * the Free Software Foundation, either version 3 of the License, or | ||
908 | 10 | * (at your option) any later version. | ||
909 | 11 | * | ||
910 | 12 | * This program is distributed in the hope that it will be useful, | ||
911 | 13 | * but WITHos ANY WARRANTY; withos even the implied warranty of | ||
912 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
913 | 15 | * GNU General Public License for more details. | ||
914 | 16 | * | ||
915 | 17 | * You should have received a copy of the GNU General Public License | ||
916 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
917 | 19 | */ | ||
918 | 20 | #include "PetriEngine/PQL/BinaryPrinter.h" | ||
919 | 21 | |||
920 | 22 | namespace PetriEngine::PQL { | ||
921 | 23 | void BinaryPrinter::_accept(const LiteralExpr *element){ | ||
922 | 24 | os.write("l", sizeof(char)); | ||
923 | 25 | int temp = element->value(); | ||
924 | 26 | os.write(reinterpret_cast<const char*>(&temp), sizeof(int)); | ||
925 | 27 | } | ||
926 | 28 | |||
927 | 29 | void BinaryPrinter::_accept(const UnfoldedIdentifierExpr *element){ | ||
928 | 30 | os.write("i", sizeof(char)); | ||
929 | 31 | int temp = element->offset(); | ||
930 | 32 | os.write(reinterpret_cast<const char*>(&temp), sizeof(int)); | ||
931 | 33 | } | ||
932 | 34 | |||
933 | 35 | void BinaryPrinter::_accept(const MinusExpr *element){ | ||
934 | 36 | auto e1 = std::make_shared<PQL::LiteralExpr>(0); | ||
935 | 37 | std::vector<Expr_ptr> exprs; | ||
936 | 38 | exprs.push_back(e1); | ||
937 | 39 | exprs.push_back((*element)[0]); | ||
938 | 40 | PQL::SubtractExpr(std::move(exprs)).visit(*this); | ||
939 | 41 | } | ||
940 | 42 | |||
941 | 43 | void BinaryPrinter::_accept(const SubtractExpr *element){ | ||
942 | 44 | os.write("-", sizeof(char)); | ||
943 | 45 | uint32_t size = element->expressions().size(); | ||
944 | 46 | os.write(reinterpret_cast<const char*>(&size), sizeof(uint32_t)); | ||
945 | 47 | for(auto& e : element->expressions()) | ||
946 | 48 | e->visit(*this); | ||
947 | 49 | } | ||
948 | 50 | |||
949 | 51 | void BinaryPrinter::_accept(const CommutativeExpr *element){ | ||
950 | 52 | auto sop = element->op(); | ||
951 | 53 | os.write(&sop[0], sizeof(char)); | ||
952 | 54 | int32_t temp_constant = element->constant(); | ||
953 | 55 | os.write(reinterpret_cast<const char*>(&temp_constant), sizeof(int32_t)); | ||
954 | 56 | uint32_t size = element->places().size(); | ||
955 | 57 | os.write(reinterpret_cast<const char*>(&size), sizeof(uint32_t)); | ||
956 | 58 | size = element->expressions().size(); | ||
957 | 59 | os.write(reinterpret_cast<const char*>(&size), sizeof(uint32_t)); | ||
958 | 60 | for(auto& id : element->places()) | ||
959 | 61 | os.write(reinterpret_cast<const char*>(&id.first), sizeof(uint32_t)); | ||
960 | 62 | for(auto& e : element->expressions()) | ||
961 | 63 | e->visit(*this); | ||
962 | 64 | } | ||
963 | 65 | |||
964 | 66 | void BinaryPrinter::_accept(const SimpleQuantifierCondition *condition){ | ||
965 | 67 | auto path = condition->getPath(); | ||
966 | 68 | auto quant = condition->getQuantifier(); | ||
967 | 69 | os.write(reinterpret_cast<const char*>(&path), sizeof(Path)); | ||
968 | 70 | os.write(reinterpret_cast<const char*>(&quant), sizeof(Quantifier)); | ||
969 | 71 | condition->getCond()->visit(*this); | ||
970 | 72 | } | ||
971 | 73 | |||
972 | 74 | void BinaryPrinter::_accept(const UntilCondition *condition){ | ||
973 | 75 | auto path = condition->getPath(); | ||
974 | 76 | auto quant = condition->getQuantifier(); | ||
975 | 77 | os.write(reinterpret_cast<const char*>(&path), sizeof(Path)); | ||
976 | 78 | os.write(reinterpret_cast<const char*>(&quant), sizeof(Quantifier)); | ||
977 | 79 | (*condition)[0]->visit(*this); | ||
978 | 80 | (*condition)[1]->visit(*this); | ||
979 | 81 | } | ||
980 | 82 | |||
981 | 83 | void BinaryPrinter::_accept(const LogicalCondition *condition){ | ||
982 | 84 | auto path = condition->getPath(); | ||
983 | 85 | auto quant = condition->getQuantifier(); | ||
984 | 86 | os.write(reinterpret_cast<const char*>(&path), sizeof(Path)); | ||
985 | 87 | os.write(reinterpret_cast<const char*>(&quant), sizeof(Quantifier)); | ||
986 | 88 | uint32_t size = condition->operands(); | ||
987 | 89 | os.write(reinterpret_cast<const char*>(&size), sizeof(uint32_t)); | ||
988 | 90 | for(auto& c : *condition) | ||
989 | 91 | c->visit(*this); | ||
990 | 92 | } | ||
991 | 93 | |||
992 | 94 | void BinaryPrinter::_accept(const CompareConjunction *element){ | ||
993 | 95 | auto path = element->getPath(); | ||
994 | 96 | auto quant = Quantifier::COMPCONJ; | ||
995 | 97 | os.write(reinterpret_cast<const char*>(&path), sizeof(Path)); | ||
996 | 98 | os.write(reinterpret_cast<const char*>(&quant), sizeof(Quantifier)); | ||
997 | 99 | bool temp = element->isNegated(); | ||
998 | 100 | os.write(reinterpret_cast<const char*>(&temp), sizeof(bool)); | ||
999 | 101 | uint32_t size = element->constraints().size(); | ||
1000 | 102 | os.write(reinterpret_cast<const char*>(&size), sizeof(uint32_t)); | ||
1001 | 103 | for(auto& c : element->constraints()) | ||
1002 | 104 | { | ||
1003 | 105 | os.write(reinterpret_cast<const char*>(&c._place), sizeof(int32_t)); | ||
1004 | 106 | os.write(reinterpret_cast<const char*>(&c._lower), sizeof(uint32_t)); | ||
1005 | 107 | os.write(reinterpret_cast<const char*>(&c._upper), sizeof(uint32_t)); | ||
1006 | 108 | } | ||
1007 | 109 | } | ||
1008 | 110 | |||
1009 | 111 | void BinaryPrinter::_accept(const CompareCondition *condition){ | ||
1010 | 112 | auto path = condition->getPath(); | ||
1011 | 113 | auto quant = condition->getQuantifier(); | ||
1012 | 114 | os.write(reinterpret_cast<const char*>(&path), sizeof(Path)); | ||
1013 | 115 | os.write(reinterpret_cast<const char*>(&quant), sizeof(Quantifier)); | ||
1014 | 116 | std::string sop = condition->op(); | ||
1015 | 117 | os.write(sop.data(), sop.size()); | ||
1016 | 118 | os.write("\0", sizeof(char)); | ||
1017 | 119 | (*condition)[0]->visit(*this); | ||
1018 | 120 | (*condition)[1]->visit(*this); | ||
1019 | 121 | } | ||
1020 | 122 | |||
1021 | 123 | void BinaryPrinter::_accept(const DeadlockCondition *condition){ | ||
1022 | 124 | auto path = condition->getPath(); | ||
1023 | 125 | auto quant = Quantifier::DEADLOCK; | ||
1024 | 126 | os.write(reinterpret_cast<const char*>(&path), sizeof(Path)); | ||
1025 | 127 | os.write(reinterpret_cast<const char*>(&quant), sizeof(Quantifier)); | ||
1026 | 128 | } | ||
1027 | 129 | |||
1028 | 130 | void BinaryPrinter::_accept(const BooleanCondition *condition){ | ||
1029 | 131 | auto path = condition->getPath(); | ||
1030 | 132 | auto quant = Quantifier::PN_BOOLEAN; | ||
1031 | 133 | os.write(reinterpret_cast<const char*>(&path), sizeof(Path)); | ||
1032 | 134 | os.write(reinterpret_cast<const char*>(&quant), sizeof(Quantifier)); | ||
1033 | 135 | os.write(reinterpret_cast<const char*>(&condition->value), sizeof(bool)); | ||
1034 | 136 | } | ||
1035 | 137 | |||
1036 | 138 | void BinaryPrinter::_accept(const UnfoldedUpperBoundsCondition *condition){ | ||
1037 | 139 | auto path = condition->getPath(); | ||
1038 | 140 | auto quant = Quantifier::UPPERBOUNDS; | ||
1039 | 141 | os.write(reinterpret_cast<const char*>(&path), sizeof(Path)); | ||
1040 | 142 | os.write(reinterpret_cast<const char*>(&quant), sizeof(Quantifier)); | ||
1041 | 143 | uint32_t size = condition->places().size(); | ||
1042 | 144 | os.write(reinterpret_cast<const char*>(&size), sizeof(uint32_t)); | ||
1043 | 145 | double temp_max = condition->getMax(); | ||
1044 | 146 | os.write(reinterpret_cast<const char*>(&temp_max), sizeof(double)); | ||
1045 | 147 | double temp_offset = condition->getOffset(); | ||
1046 | 148 | os.write(reinterpret_cast<const char*>(&temp_offset), sizeof(double)); | ||
1047 | 149 | for(auto& b : condition->places()) | ||
1048 | 150 | { | ||
1049 | 151 | os.write(reinterpret_cast<const char*>(&b._place), sizeof(uint32_t)); | ||
1050 | 152 | os.write(reinterpret_cast<const char*>(&b._max), sizeof(double)); | ||
1051 | 153 | } | ||
1052 | 154 | } | ||
1053 | 155 | |||
1054 | 156 | void BinaryPrinter::_accept(const NotCondition *condition){ | ||
1055 | 157 | auto path = condition->getPath(); | ||
1056 | 158 | auto quant = condition->getQuantifier(); | ||
1057 | 159 | os.write(reinterpret_cast<const char*>(&path), sizeof(Path)); | ||
1058 | 160 | os.write(reinterpret_cast<const char*>(&quant), sizeof(Quantifier)); | ||
1059 | 161 | condition->getCond()->visit(*this); | ||
1060 | 162 | } | ||
1061 | 163 | |||
1062 | 164 | void BinaryPrinter::_accept(const IdentifierExpr *condition) { | ||
1063 | 165 | condition->compiled()->visit(*this); | ||
1064 | 166 | } | ||
1065 | 167 | |||
1066 | 168 | void BinaryPrinter::_accept(const ShallowCondition *condition) { | ||
1067 | 169 | condition->getCompiled()->visit(*this); | ||
1068 | 170 | } | ||
1069 | 171 | |||
1070 | 172 | |||
1071 | 173 | } | ||
1072 | 0 | 174 | ||
1073 | === modified file 'src/PetriEngine/PQL/CMakeLists.txt' | |||
1074 | --- src/PetriEngine/PQL/CMakeLists.txt 2021-08-11 09:06:51 +0000 | |||
1075 | +++ src/PetriEngine/PQL/CMakeLists.txt 2021-10-18 11:40:53 +0000 | |||
1076 | @@ -8,7 +8,7 @@ | |||
1077 | 8 | 8 | ||
1078 | 9 | add_flex_bison_dependency(pql_lexer pql_parser) | 9 | add_flex_bison_dependency(pql_lexer pql_parser) |
1079 | 10 | 10 | ||
1081 | 11 | add_library(PQL ${BISON_pql_parser_OUTPUTS} ${FLEX_pql_lexer_OUTPUTS} Expressions.cpp PQL.cpp Contexts.cpp QueryPrinter.cpp CTLVisitor.cpp) | 11 | add_library(PQL ${BISON_pql_parser_OUTPUTS} ${FLEX_pql_lexer_OUTPUTS} Expressions.cpp PQL.cpp Contexts.cpp QueryPrinter.cpp CTLVisitor.cpp XMLPrinter.cpp BinaryPrinter.cpp) |
1082 | 12 | add_dependencies(PQL glpk-ext) | 12 | add_dependencies(PQL glpk-ext) |
1083 | 13 | target_link_libraries(PQL Simplification Reachability glpk PetriEngine) | 13 | target_link_libraries(PQL Simplification Reachability glpk PetriEngine) |
1084 | 14 | 14 | ||
1085 | 15 | 15 | ||
1086 | === modified file 'src/PetriEngine/PQL/Expressions.cpp' | |||
1087 | --- src/PetriEngine/PQL/Expressions.cpp 2021-10-03 14:50:33 +0000 | |||
1088 | +++ src/PetriEngine/PQL/Expressions.cpp 2021-10-18 11:40:53 +0000 | |||
1089 | @@ -976,6 +976,10 @@ | |||
1090 | 976 | 976 | ||
1091 | 977 | /******************** Range Contexts ********************/ | 977 | /******************** Range Contexts ********************/ |
1092 | 978 | 978 | ||
1093 | 979 | void SimpleQuantifierCondition::visit(Visitor& ctx) const { | ||
1094 | 980 | ctx.accept<decltype(this)>(this); | ||
1095 | 981 | } | ||
1096 | 982 | |||
1097 | 979 | void UntilCondition::visit(Visitor &ctx) const | 983 | void UntilCondition::visit(Visitor &ctx) const |
1098 | 980 | { | 984 | { |
1099 | 981 | ctx.accept<decltype(this)>(this); | 985 | ctx.accept<decltype(this)>(this); |
1100 | @@ -1046,6 +1050,10 @@ | |||
1101 | 1046 | ctx.accept<decltype(this)>(this); | 1050 | ctx.accept<decltype(this)>(this); |
1102 | 1047 | } | 1051 | } |
1103 | 1048 | 1052 | ||
1104 | 1053 | void LogicalCondition::visit(Visitor& ctx) const { | ||
1105 | 1054 | ctx.accept<decltype(this)>(this); | ||
1106 | 1055 | } | ||
1107 | 1056 | |||
1108 | 1049 | void AndCondition::visit(Visitor& ctx) const | 1057 | void AndCondition::visit(Visitor& ctx) const |
1109 | 1050 | { | 1058 | { |
1110 | 1051 | ctx.accept<decltype(this)>(this); | 1059 | ctx.accept<decltype(this)>(this); |
1111 | @@ -1060,7 +1068,15 @@ | |||
1112 | 1060 | { | 1068 | { |
1113 | 1061 | ctx.accept<decltype(this)>(this); | 1069 | ctx.accept<decltype(this)>(this); |
1114 | 1062 | } | 1070 | } |
1116 | 1063 | 1071 | <<<<<<< TREE | |
1117 | 1072 | |||
1118 | 1073 | ======= | ||
1119 | 1074 | |||
1120 | 1075 | void CompareCondition::visit(Visitor& ctx) const { | ||
1121 | 1076 | ctx.accept<decltype(this)>(this); | ||
1122 | 1077 | } | ||
1123 | 1078 | |||
1124 | 1079 | >>>>>>> MERGE-SOURCE | ||
1125 | 1064 | void EqualCondition::visit(Visitor& ctx) const | 1080 | void EqualCondition::visit(Visitor& ctx) const |
1126 | 1065 | { | 1081 | { |
1127 | 1066 | ctx.accept<decltype(this)>(this); | 1082 | ctx.accept<decltype(this)>(this); |
1128 | @@ -1176,6 +1192,10 @@ | |||
1129 | 1176 | ctx.accept<decltype(this)>(this); | 1192 | ctx.accept<decltype(this)>(this); |
1130 | 1177 | } | 1193 | } |
1131 | 1178 | 1194 | ||
1132 | 1195 | void CommutativeExpr::visit(Visitor& ctx) const { | ||
1133 | 1196 | ctx.accept<decltype(this)>(this); | ||
1134 | 1197 | } | ||
1135 | 1198 | |||
1136 | 1179 | void MinusExpr::visit(Visitor& ctx) const | 1199 | void MinusExpr::visit(Visitor& ctx) const |
1137 | 1180 | { | 1200 | { |
1138 | 1181 | ctx.accept<decltype(this)>(this); | 1201 | ctx.accept<decltype(this)>(this); |
1139 | @@ -1757,6 +1777,7 @@ | |||
1140 | 1757 | } | 1777 | } |
1141 | 1758 | 1778 | ||
1142 | 1759 | /******************** BIN output ********************/ | 1779 | /******************** BIN output ********************/ |
1143 | 1780 | <<<<<<< TREE | ||
1144 | 1760 | 1781 | ||
1145 | 1761 | void LiteralExpr::toBinary(std::ostream& out) const { | 1782 | void LiteralExpr::toBinary(std::ostream& out) const { |
1146 | 1762 | out.write("l", sizeof(char)); | 1783 | out.write("l", sizeof(char)); |
1147 | @@ -1908,15 +1929,16 @@ | |||
1148 | 1908 | void LiteralExpr::toXML(std::ostream& out,uint32_t tabs, bool tokencount) const { | 1929 | void LiteralExpr::toXML(std::ostream& out,uint32_t tabs, bool tokencount) const { |
1149 | 1909 | generateTabs(out,tabs) << "<integer-constant>" + std::to_string(_value) + "</integer-constant>\n"; | 1930 | generateTabs(out,tabs) << "<integer-constant>" + std::to_string(_value) + "</integer-constant>\n"; |
1150 | 1910 | } | 1931 | } |
1151 | 1932 | ======= | ||
1152 | 1933 | |||
1153 | 1934 | |||
1154 | 1935 | /******************** CTL Output ********************/ | ||
1155 | 1936 | >>>>>>> MERGE-SOURCE | ||
1156 | 1911 | 1937 | ||
1157 | 1912 | void LiteralExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ | 1938 | void LiteralExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ |
1158 | 1913 | out << "<integer-constant>" + std::to_string(_value) + "</integer-constant>\n"; | 1939 | out << "<integer-constant>" + std::to_string(_value) + "</integer-constant>\n"; |
1159 | 1914 | } | 1940 | } |
1160 | 1915 | 1941 | ||
1161 | 1916 | void UnfoldedFireableCondition::toXML(std::ostream& out, uint32_t tabs) const{ | ||
1162 | 1917 | generateTabs(out, tabs) << "<is-fireable><transition>" + _name << "</transition></is-fireable>\n"; | ||
1163 | 1918 | } | ||
1164 | 1919 | |||
1165 | 1920 | void UnfoldedFireableCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 1942 | void UnfoldedFireableCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1166 | 1921 | out << "<is-fireable><transition>" + _name << "</transition></is-fireable>\n"; | 1943 | out << "<is-fireable><transition>" + _name << "</transition></is-fireable>\n"; |
1167 | 1922 | } | 1944 | } |
1168 | @@ -1944,6 +1966,7 @@ | |||
1169 | 1944 | out << "</is-fireable>"; | 1966 | out << "</is-fireable>"; |
1170 | 1945 | } | 1967 | } |
1171 | 1946 | } | 1968 | } |
1172 | 1969 | <<<<<<< TREE | ||
1173 | 1947 | 1970 | ||
1174 | 1948 | void UnfoldedIdentifierExpr::toXML(std::ostream& out,uint32_t tabs, bool tokencount) const { | 1971 | void UnfoldedIdentifierExpr::toXML(std::ostream& out,uint32_t tabs, bool tokencount) const { |
1175 | 1949 | if (tokencount) { | 1972 | if (tokencount) { |
1176 | @@ -1956,6 +1979,8 @@ | |||
1177 | 1956 | generateTabs(out,tabs) << "</tokens-count>\n"; | 1979 | generateTabs(out,tabs) << "</tokens-count>\n"; |
1178 | 1957 | } | 1980 | } |
1179 | 1958 | } | 1981 | } |
1180 | 1982 | ======= | ||
1181 | 1983 | >>>>>>> MERGE-SOURCE | ||
1182 | 1959 | 1984 | ||
1183 | 1960 | void UnfoldedIdentifierExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ | 1985 | void UnfoldedIdentifierExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ |
1184 | 1961 | if (tokencount) { | 1986 | if (tokencount) { |
1185 | @@ -1997,6 +2022,7 @@ | |||
1186 | 1997 | } | 2022 | } |
1187 | 1998 | } | 2023 | } |
1188 | 1999 | } | 2024 | } |
1189 | 2025 | <<<<<<< TREE | ||
1190 | 2000 | 2026 | ||
1191 | 2001 | void PlusExpr::toXML(std::ostream& ss,uint32_t tabs, bool tokencount) const { | 2027 | void PlusExpr::toXML(std::ostream& ss,uint32_t tabs, bool tokencount) const { |
1192 | 2002 | if (tokencount) { | 2028 | if (tokencount) { |
1193 | @@ -2022,6 +2048,8 @@ | |||
1194 | 2022 | for(auto& e : _exprs) e->toXML(ss,tabs+1, tokencount); | 2048 | for(auto& e : _exprs) e->toXML(ss,tabs+1, tokencount); |
1195 | 2023 | generateTabs(ss,tabs) << "</integer-sum>\n"; | 2049 | generateTabs(ss,tabs) << "</integer-sum>\n"; |
1196 | 2024 | } | 2050 | } |
1197 | 2051 | ======= | ||
1198 | 2052 | >>>>>>> MERGE-SOURCE | ||
1199 | 2025 | 2053 | ||
1200 | 2026 | void PlusExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ | 2054 | void PlusExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ |
1201 | 2027 | if (tokencount) { | 2055 | if (tokencount) { |
1202 | @@ -2047,30 +2075,37 @@ | |||
1203 | 2047 | for(auto& e : _exprs) e->toCompactXML(out,tabs, context, tokencount); | 2075 | for(auto& e : _exprs) e->toCompactXML(out,tabs, context, tokencount); |
1204 | 2048 | out << "</integer-sum>\n"; | 2076 | out << "</integer-sum>\n"; |
1205 | 2049 | } | 2077 | } |
1206 | 2078 | <<<<<<< TREE | ||
1207 | 2050 | 2079 | ||
1208 | 2051 | void SubtractExpr::toXML(std::ostream& ss,uint32_t tabs, bool tokencount) const { | 2080 | void SubtractExpr::toXML(std::ostream& ss,uint32_t tabs, bool tokencount) const { |
1209 | 2052 | generateTabs(ss,tabs) << "<integer-difference>\n"; | 2081 | generateTabs(ss,tabs) << "<integer-difference>\n"; |
1210 | 2053 | for(auto& e : _exprs) e->toXML(ss,tabs+1); | 2082 | for(auto& e : _exprs) e->toXML(ss,tabs+1); |
1211 | 2054 | generateTabs(ss,tabs) << "</integer-difference>\n"; | 2083 | generateTabs(ss,tabs) << "</integer-difference>\n"; |
1212 | 2055 | } | 2084 | } |
1213 | 2085 | ======= | ||
1214 | 2086 | >>>>>>> MERGE-SOURCE | ||
1215 | 2056 | 2087 | ||
1216 | 2057 | void SubtractExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ | 2088 | void SubtractExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ |
1217 | 2058 | out << "<integer-difference>\n"; | 2089 | out << "<integer-difference>\n"; |
1218 | 2059 | for(auto& e : _exprs) e->toCompactXML(out,tabs, context); | 2090 | for(auto& e : _exprs) e->toCompactXML(out,tabs, context); |
1219 | 2060 | out << "</integer-difference>\n"; | 2091 | out << "</integer-difference>\n"; |
1220 | 2061 | } | 2092 | } |
1221 | 2093 | <<<<<<< TREE | ||
1222 | 2062 | 2094 | ||
1223 | 2063 | void MultiplyExpr::toXML(std::ostream& ss,uint32_t tabs, bool tokencount) const { | 2095 | void MultiplyExpr::toXML(std::ostream& ss,uint32_t tabs, bool tokencount) const { |
1224 | 2064 | generateTabs(ss,tabs) << "<integer-product>\n"; | 2096 | generateTabs(ss,tabs) << "<integer-product>\n"; |
1225 | 2065 | for(auto& e : _exprs) e->toXML(ss,tabs+1); | 2097 | for(auto& e : _exprs) e->toXML(ss,tabs+1); |
1226 | 2066 | generateTabs(ss,tabs) << "</integer-product>\n"; | 2098 | generateTabs(ss,tabs) << "</integer-product>\n"; |
1227 | 2067 | } | 2099 | } |
1228 | 2100 | ======= | ||
1229 | 2101 | >>>>>>> MERGE-SOURCE | ||
1230 | 2068 | 2102 | ||
1231 | 2069 | void MultiplyExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ | 2103 | void MultiplyExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ |
1232 | 2070 | out << "<integer-product>\n"; | 2104 | out << "<integer-product>\n"; |
1233 | 2071 | for(auto& e : _exprs) e->toCompactXML(out,tabs, context); | 2105 | for(auto& e : _exprs) e->toCompactXML(out,tabs, context); |
1234 | 2072 | out << "</integer-product>\n"; | 2106 | out << "</integer-product>\n"; |
1235 | 2073 | } | 2107 | } |
1236 | 2108 | <<<<<<< TREE | ||
1237 | 2074 | 2109 | ||
1238 | 2075 | void MinusExpr::toXML(std::ostream& out,uint32_t tabs, bool tokencount) const { | 2110 | void MinusExpr::toXML(std::ostream& out,uint32_t tabs, bool tokencount) const { |
1239 | 2076 | 2111 | ||
1240 | @@ -2081,6 +2116,8 @@ | |||
1241 | 2081 | "<integer-constant>1</integer-constant>\n" ; generateTabs(out,tabs+1) << | 2116 | "<integer-constant>1</integer-constant>\n" ; generateTabs(out,tabs+1) << |
1242 | 2082 | "</integer-difference>\n" ; generateTabs(out,tabs) << "</integer-product>\n"; | 2117 | "</integer-difference>\n" ; generateTabs(out,tabs) << "</integer-product>\n"; |
1243 | 2083 | } | 2118 | } |
1244 | 2119 | ======= | ||
1245 | 2120 | >>>>>>> MERGE-SOURCE | ||
1246 | 2084 | 2121 | ||
1247 | 2085 | void MinusExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ | 2122 | void MinusExpr::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount) const{ |
1248 | 2086 | out << "<integer-product>\n"; | 2123 | out << "<integer-product>\n"; |
1249 | @@ -2090,12 +2127,15 @@ | |||
1250 | 2090 | "<integer-constant>1</integer-constant>\n" ; out << | 2127 | "<integer-constant>1</integer-constant>\n" ; out << |
1251 | 2091 | "</integer-difference>\n" ; out << "</integer-product>\n"; | 2128 | "</integer-difference>\n" ; out << "</integer-product>\n"; |
1252 | 2092 | } | 2129 | } |
1253 | 2130 | <<<<<<< TREE | ||
1254 | 2093 | 2131 | ||
1255 | 2094 | void EXCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2132 | void EXCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1256 | 2095 | generateTabs(out,tabs) << "<exists-path>\n" ; generateTabs(out,tabs+1) << "<next>\n"; | 2133 | generateTabs(out,tabs) << "<exists-path>\n" ; generateTabs(out,tabs+1) << "<next>\n"; |
1257 | 2096 | _cond->toXML(out,tabs+2); | 2134 | _cond->toXML(out,tabs+2); |
1258 | 2097 | generateTabs(out,tabs+1) << "</next>\n" ; generateTabs(out,tabs) << "</exists-path>\n"; | 2135 | generateTabs(out,tabs+1) << "</next>\n" ; generateTabs(out,tabs) << "</exists-path>\n"; |
1259 | 2098 | } | 2136 | } |
1260 | 2137 | ======= | ||
1261 | 2138 | >>>>>>> MERGE-SOURCE | ||
1262 | 2099 | 2139 | ||
1263 | 2100 | void EXCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2140 | void EXCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1264 | 2101 | out << "<exists-path>\n" ; out << "<next>\n"; | 2141 | out << "<exists-path>\n" ; out << "<next>\n"; |
1265 | @@ -2103,6 +2143,7 @@ | |||
1266 | 2103 | out << "</next>\n" ; out << "</exists-path>\n"; | 2143 | out << "</next>\n" ; out << "</exists-path>\n"; |
1267 | 2104 | } | 2144 | } |
1268 | 2105 | 2145 | ||
1269 | 2146 | <<<<<<< TREE | ||
1270 | 2106 | void AXCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2147 | void AXCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1271 | 2107 | generateTabs(out,tabs) << "<all-paths>\n"; generateTabs(out,tabs+1) << "<next>\n"; | 2148 | generateTabs(out,tabs) << "<all-paths>\n"; generateTabs(out,tabs+1) << "<next>\n"; |
1272 | 2108 | _cond->toXML(out,tabs+2); | 2149 | _cond->toXML(out,tabs+2); |
1273 | @@ -2110,58 +2151,74 @@ | |||
1274 | 2110 | } | 2151 | } |
1275 | 2111 | 2152 | ||
1276 | 2112 | void AXCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2153 | void AXCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1277 | 2154 | ======= | ||
1278 | 2155 | void AXCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | ||
1279 | 2156 | >>>>>>> MERGE-SOURCE | ||
1280 | 2113 | out << "<all-paths>\n" ;out << "<next>\n"; | 2157 | out << "<all-paths>\n" ;out << "<next>\n"; |
1281 | 2114 | _cond->toCompactXML(out,tabs+2, context); | 2158 | _cond->toCompactXML(out,tabs+2, context); |
1282 | 2115 | out << "</next>\n" ; out << "</all-paths>\n"; | 2159 | out << "</next>\n" ; out << "</all-paths>\n"; |
1283 | 2116 | } | 2160 | } |
1284 | 2161 | <<<<<<< TREE | ||
1285 | 2117 | 2162 | ||
1286 | 2118 | void EFCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2163 | void EFCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1287 | 2119 | generateTabs(out,tabs) << "<exists-path>\n" ; generateTabs(out,tabs+1) << "<finally>\n"; | 2164 | generateTabs(out,tabs) << "<exists-path>\n" ; generateTabs(out,tabs+1) << "<finally>\n"; |
1288 | 2120 | _cond->toXML(out,tabs+2); | 2165 | _cond->toXML(out,tabs+2); |
1289 | 2121 | generateTabs(out,tabs+1) << "</finally>\n" ; generateTabs(out,tabs) << "</exists-path>\n"; | 2166 | generateTabs(out,tabs+1) << "</finally>\n" ; generateTabs(out,tabs) << "</exists-path>\n"; |
1290 | 2122 | } | 2167 | } |
1291 | 2168 | ======= | ||
1292 | 2169 | >>>>>>> MERGE-SOURCE | ||
1293 | 2123 | 2170 | ||
1294 | 2124 | void EFCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2171 | void EFCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1295 | 2125 | out << "<exists-path>\n" ;out << "<finally>\n"; | 2172 | out << "<exists-path>\n" ;out << "<finally>\n"; |
1296 | 2126 | _cond->toCompactXML(out,tabs+2, context); | 2173 | _cond->toCompactXML(out,tabs+2, context); |
1297 | 2127 | out << "</finally>\n" ; out << "</exists-path>\n"; | 2174 | out << "</finally>\n" ; out << "</exists-path>\n"; |
1298 | 2128 | } | 2175 | } |
1299 | 2176 | <<<<<<< TREE | ||
1300 | 2129 | 2177 | ||
1301 | 2130 | void AFCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2178 | void AFCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1302 | 2131 | generateTabs(out,tabs) << "<all-paths>\n" ; generateTabs(out,tabs+1) << "<finally>\n"; | 2179 | generateTabs(out,tabs) << "<all-paths>\n" ; generateTabs(out,tabs+1) << "<finally>\n"; |
1303 | 2132 | _cond->toXML(out,tabs+2); | 2180 | _cond->toXML(out,tabs+2); |
1304 | 2133 | generateTabs(out,tabs+1) << "</finally>\n" ; generateTabs(out,tabs) << "</all-paths>\n"; | 2181 | generateTabs(out,tabs+1) << "</finally>\n" ; generateTabs(out,tabs) << "</all-paths>\n"; |
1305 | 2134 | } | 2182 | } |
1306 | 2183 | ======= | ||
1307 | 2184 | >>>>>>> MERGE-SOURCE | ||
1308 | 2135 | 2185 | ||
1309 | 2136 | void AFCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2186 | void AFCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1310 | 2137 | out << "<all-paths>\n" ;out << "<finally>\n"; | 2187 | out << "<all-paths>\n" ;out << "<finally>\n"; |
1311 | 2138 | _cond->toCompactXML(out,tabs+2, context); | 2188 | _cond->toCompactXML(out,tabs+2, context); |
1312 | 2139 | out << "</finally>\n" ; out << "</all-paths>\n"; | 2189 | out << "</finally>\n" ; out << "</all-paths>\n"; |
1313 | 2140 | } | 2190 | } |
1314 | 2191 | <<<<<<< TREE | ||
1315 | 2141 | 2192 | ||
1316 | 2142 | void EGCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2193 | void EGCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1317 | 2143 | generateTabs(out,tabs) << "<exists-path>\n" ; generateTabs(out,tabs+1) << "<globally>\n"; | 2194 | generateTabs(out,tabs) << "<exists-path>\n" ; generateTabs(out,tabs+1) << "<globally>\n"; |
1318 | 2144 | _cond->toXML(out,tabs+2); | 2195 | _cond->toXML(out,tabs+2); |
1319 | 2145 | generateTabs(out,tabs+1) << "</globally>\n" ; generateTabs(out,tabs) << "</exists-path>\n"; | 2196 | generateTabs(out,tabs+1) << "</globally>\n" ; generateTabs(out,tabs) << "</exists-path>\n"; |
1320 | 2146 | } | 2197 | } |
1321 | 2198 | ======= | ||
1322 | 2199 | >>>>>>> MERGE-SOURCE | ||
1323 | 2147 | 2200 | ||
1324 | 2148 | void EGCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2201 | void EGCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1325 | 2149 | out << "<exists-path>\n" ;out << "<globally>\n"; | 2202 | out << "<exists-path>\n" ;out << "<globally>\n"; |
1326 | 2150 | _cond->toCompactXML(out,tabs+2, context); | 2203 | _cond->toCompactXML(out,tabs+2, context); |
1327 | 2151 | out << "</globally>\n" ; out << "</exists-path>\n"; | 2204 | out << "</globally>\n" ; out << "</exists-path>\n"; |
1328 | 2152 | } | 2205 | } |
1329 | 2206 | <<<<<<< TREE | ||
1330 | 2153 | 2207 | ||
1331 | 2154 | void AGCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2208 | void AGCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1332 | 2155 | generateTabs(out,tabs) << "<all-paths>\n" ; generateTabs(out,tabs+1) << "<globally>\n"; | 2209 | generateTabs(out,tabs) << "<all-paths>\n" ; generateTabs(out,tabs+1) << "<globally>\n"; |
1333 | 2156 | _cond->toXML(out,tabs+2); | 2210 | _cond->toXML(out,tabs+2); |
1334 | 2157 | generateTabs(out,tabs+1) << "</globally>\n" ; generateTabs(out,tabs) << "</all-paths>\n"; | 2211 | generateTabs(out,tabs+1) << "</globally>\n" ; generateTabs(out,tabs) << "</all-paths>\n"; |
1335 | 2158 | } | 2212 | } |
1336 | 2213 | ======= | ||
1337 | 2214 | >>>>>>> MERGE-SOURCE | ||
1338 | 2159 | 2215 | ||
1339 | 2160 | void AGCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2216 | void AGCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1340 | 2161 | out << "<all-paths>\n" ;out << "<globally>\n"; | 2217 | out << "<all-paths>\n" ;out << "<globally>\n"; |
1341 | 2162 | _cond->toCompactXML(out,tabs+2, context); | 2218 | _cond->toCompactXML(out,tabs+2, context); |
1342 | 2163 | out << "</globally>\n" ; out << "</all-paths>\n"; | 2219 | out << "</globally>\n" ; out << "</all-paths>\n"; |
1343 | 2164 | } | 2220 | } |
1344 | 2221 | <<<<<<< TREE | ||
1345 | 2165 | 2222 | ||
1346 | 2166 | void EUCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2223 | void EUCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1347 | 2167 | generateTabs(out,tabs) << "<exists-path>\n" ; generateTabs(out,tabs+1) << "<until>\n" ; generateTabs(out,tabs+2) << "<before>\n"; | 2224 | generateTabs(out,tabs) << "<exists-path>\n" ; generateTabs(out,tabs+1) << "<until>\n" ; generateTabs(out,tabs+2) << "<before>\n"; |
1348 | @@ -2170,6 +2227,8 @@ | |||
1349 | 2170 | _cond2->toXML(out,tabs+3); | 2227 | _cond2->toXML(out,tabs+3); |
1350 | 2171 | generateTabs(out,tabs+2) << "</reach>\n" ; generateTabs(out,tabs+1) << "</until>\n" ; generateTabs(out,tabs) << "</exists-path>\n"; | 2228 | generateTabs(out,tabs+2) << "</reach>\n" ; generateTabs(out,tabs+1) << "</until>\n" ; generateTabs(out,tabs) << "</exists-path>\n"; |
1351 | 2172 | } | 2229 | } |
1352 | 2230 | ======= | ||
1353 | 2231 | >>>>>>> MERGE-SOURCE | ||
1354 | 2173 | 2232 | ||
1355 | 2174 | void EUCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2233 | void EUCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1356 | 2175 | out << "<exists-path>\n" ; out << "<until>\n" ; out << "<before>\n"; | 2234 | out << "<exists-path>\n" ; out << "<until>\n" ; out << "<before>\n"; |
1357 | @@ -2178,6 +2237,7 @@ | |||
1358 | 2178 | _cond2->toCompactXML(out,tabs+2, context); | 2237 | _cond2->toCompactXML(out,tabs+2, context); |
1359 | 2179 | out << "</reach>\n" ; out << "</until>\n" ; out << "</exists-path>\n"; | 2238 | out << "</reach>\n" ; out << "</until>\n" ; out << "</exists-path>\n"; |
1360 | 2180 | } | 2239 | } |
1361 | 2240 | <<<<<<< TREE | ||
1362 | 2181 | 2241 | ||
1363 | 2182 | void AUCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2242 | void AUCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1364 | 2183 | generateTabs(out,tabs) << "<all-paths>\n" ; generateTabs(out,tabs+1) << "<until>\n" ; generateTabs(out,tabs+2) << "<before>\n"; | 2243 | generateTabs(out,tabs) << "<all-paths>\n" ; generateTabs(out,tabs+1) << "<until>\n" ; generateTabs(out,tabs+2) << "<before>\n"; |
1365 | @@ -2186,6 +2246,8 @@ | |||
1366 | 2186 | _cond2->toXML(out,tabs+3); | 2246 | _cond2->toXML(out,tabs+3); |
1367 | 2187 | generateTabs(out,tabs+2) << "</reach>\n" ; generateTabs(out,tabs+1) << "</until>\n" ; generateTabs(out,tabs) << "</all-paths>\n"; | 2247 | generateTabs(out,tabs+2) << "</reach>\n" ; generateTabs(out,tabs+1) << "</until>\n" ; generateTabs(out,tabs) << "</all-paths>\n"; |
1368 | 2188 | } | 2248 | } |
1369 | 2249 | ======= | ||
1370 | 2250 | >>>>>>> MERGE-SOURCE | ||
1371 | 2189 | 2251 | ||
1372 | 2190 | void AUCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2252 | void AUCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1373 | 2191 | out << "<all-paths>\n" ; out << "<until>\n" ; out << "<before>\n"; | 2253 | out << "<all-paths>\n" ; out << "<until>\n" ; out << "<before>\n"; |
1374 | @@ -2195,6 +2257,7 @@ | |||
1375 | 2195 | out << "</reach>\n" ; out << "</until>\n" ; out << "</all-paths>\n"; | 2257 | out << "</reach>\n" ; out << "</until>\n" ; out << "</all-paths>\n"; |
1376 | 2196 | } | 2258 | } |
1377 | 2197 | 2259 | ||
1378 | 2260 | <<<<<<< TREE | ||
1379 | 2198 | void ACondition::toXML(std::ostream& out, uint32_t tabs) const { | 2261 | void ACondition::toXML(std::ostream& out, uint32_t tabs) const { |
1380 | 2199 | generateTabs(out, tabs) << "<all-paths>\n"; | 2262 | generateTabs(out, tabs) << "<all-paths>\n"; |
1381 | 2200 | _cond->toXML(out, tabs+1); | 2263 | _cond->toXML(out, tabs+1); |
1382 | @@ -2202,11 +2265,15 @@ | |||
1383 | 2202 | } | 2265 | } |
1384 | 2203 | 2266 | ||
1385 | 2204 | void ACondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2267 | void ACondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1386 | 2268 | ======= | ||
1387 | 2269 | void ACondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | ||
1388 | 2270 | >>>>>>> MERGE-SOURCE | ||
1389 | 2205 | out << "<all-paths>\n" ; | 2271 | out << "<all-paths>\n" ; |
1390 | 2206 | _cond->toCompactXML(out,tabs+2, context); | 2272 | _cond->toCompactXML(out,tabs+2, context); |
1391 | 2207 | out << "</all-paths>\n"; | 2273 | out << "</all-paths>\n"; |
1392 | 2208 | } | 2274 | } |
1393 | 2209 | 2275 | ||
1394 | 2276 | <<<<<<< TREE | ||
1395 | 2210 | void ECondition::toXML(std::ostream& out, uint32_t tabs) const { | 2277 | void ECondition::toXML(std::ostream& out, uint32_t tabs) const { |
1396 | 2211 | generateTabs(out, tabs) << "<exists-path>\n"; | 2278 | generateTabs(out, tabs) << "<exists-path>\n"; |
1397 | 2212 | _cond->toXML(out, tabs+1); | 2279 | _cond->toXML(out, tabs+1); |
1398 | @@ -2214,11 +2281,15 @@ | |||
1399 | 2214 | } | 2281 | } |
1400 | 2215 | 2282 | ||
1401 | 2216 | void ECondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2283 | void ECondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1402 | 2284 | ======= | ||
1403 | 2285 | void ECondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | ||
1404 | 2286 | >>>>>>> MERGE-SOURCE | ||
1405 | 2217 | out << "<exists-path>\n" ; | 2287 | out << "<exists-path>\n" ; |
1406 | 2218 | _cond->toCompactXML(out,tabs+2, context); | 2288 | _cond->toCompactXML(out,tabs+2, context); |
1407 | 2219 | out << "</exists-path>\n"; | 2289 | out << "</exists-path>\n"; |
1408 | 2220 | } | 2290 | } |
1409 | 2221 | 2291 | ||
1410 | 2292 | <<<<<<< TREE | ||
1411 | 2222 | void FCondition::toXML(std::ostream& out, uint32_t tabs) const { | 2293 | void FCondition::toXML(std::ostream& out, uint32_t tabs) const { |
1412 | 2223 | generateTabs(out, tabs) << "<finally>\n"; | 2294 | generateTabs(out, tabs) << "<finally>\n"; |
1413 | 2224 | _cond->toXML(out, tabs+1); | 2295 | _cond->toXML(out, tabs+1); |
1414 | @@ -2226,11 +2297,15 @@ | |||
1415 | 2226 | } | 2297 | } |
1416 | 2227 | 2298 | ||
1417 | 2228 | void FCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2299 | void FCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1418 | 2300 | ======= | ||
1419 | 2301 | void FCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | ||
1420 | 2302 | >>>>>>> MERGE-SOURCE | ||
1421 | 2229 | out << "<finally>\n" ; | 2303 | out << "<finally>\n" ; |
1422 | 2230 | _cond->toCompactXML(out,tabs+2, context); | 2304 | _cond->toCompactXML(out,tabs+2, context); |
1423 | 2231 | out << "</finally>\n"; | 2305 | out << "</finally>\n"; |
1424 | 2232 | } | 2306 | } |
1425 | 2233 | 2307 | ||
1426 | 2308 | <<<<<<< TREE | ||
1427 | 2234 | void GCondition::toXML(std::ostream& out, uint32_t tabs) const { | 2309 | void GCondition::toXML(std::ostream& out, uint32_t tabs) const { |
1428 | 2235 | generateTabs(out, tabs) << "<globally>\n"; | 2310 | generateTabs(out, tabs) << "<globally>\n"; |
1429 | 2236 | _cond->toXML(out, tabs+1); | 2311 | _cond->toXML(out, tabs+1); |
1430 | @@ -2238,11 +2313,15 @@ | |||
1431 | 2238 | } | 2313 | } |
1432 | 2239 | 2314 | ||
1433 | 2240 | void GCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2315 | void GCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1434 | 2316 | ======= | ||
1435 | 2317 | void GCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | ||
1436 | 2318 | >>>>>>> MERGE-SOURCE | ||
1437 | 2241 | out << "<globally>\n" ; | 2319 | out << "<globally>\n" ; |
1438 | 2242 | _cond->toCompactXML(out,tabs+2, context); | 2320 | _cond->toCompactXML(out,tabs+2, context); |
1439 | 2243 | out << "</globally>\n"; | 2321 | out << "</globally>\n"; |
1440 | 2244 | } | 2322 | } |
1441 | 2245 | 2323 | ||
1442 | 2324 | <<<<<<< TREE | ||
1443 | 2246 | void XCondition::toXML(std::ostream& out, uint32_t tabs) const { | 2325 | void XCondition::toXML(std::ostream& out, uint32_t tabs) const { |
1444 | 2247 | generateTabs(out, tabs) << "<next>\n"; | 2326 | generateTabs(out, tabs) << "<next>\n"; |
1445 | 2248 | _cond->toXML(out, tabs+1); | 2327 | _cond->toXML(out, tabs+1); |
1446 | @@ -2250,11 +2329,15 @@ | |||
1447 | 2250 | } | 2329 | } |
1448 | 2251 | 2330 | ||
1449 | 2252 | void XCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2331 | void XCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1450 | 2332 | ======= | ||
1451 | 2333 | void XCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | ||
1452 | 2334 | >>>>>>> MERGE-SOURCE | ||
1453 | 2253 | out << "<next>\n" ; | 2335 | out << "<next>\n" ; |
1454 | 2254 | _cond->toCompactXML(out,tabs+2, context); | 2336 | _cond->toCompactXML(out,tabs+2, context); |
1455 | 2255 | out << "</next>\n"; | 2337 | out << "</next>\n"; |
1456 | 2256 | } | 2338 | } |
1457 | 2257 | 2339 | ||
1458 | 2340 | <<<<<<< TREE | ||
1459 | 2258 | void UntilCondition::toXML(std::ostream& out, uint32_t tabs) const { | 2341 | void UntilCondition::toXML(std::ostream& out, uint32_t tabs) const { |
1460 | 2259 | generateTabs(out,tabs) << "<until>\n" ; generateTabs(out,tabs+1) << "<before>\n"; | 2342 | generateTabs(out,tabs) << "<until>\n" ; generateTabs(out,tabs+1) << "<before>\n"; |
1461 | 2260 | _cond1->toXML(out,tabs+2); | 2343 | _cond1->toXML(out,tabs+2); |
1462 | @@ -2264,6 +2347,9 @@ | |||
1463 | 2264 | } | 2347 | } |
1464 | 2265 | 2348 | ||
1465 | 2266 | void UntilCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2349 | void UntilCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1466 | 2350 | ======= | ||
1467 | 2351 | void UntilCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | ||
1468 | 2352 | >>>>>>> MERGE-SOURCE | ||
1469 | 2267 | out << "<until>\n" ; out << "<before>\n"; | 2353 | out << "<until>\n" ; out << "<before>\n"; |
1470 | 2268 | _cond1->toCompactXML(out,tabs+2, context); | 2354 | _cond1->toCompactXML(out,tabs+2, context); |
1471 | 2269 | out << "</before>\n" ; out << "<reach>\n"; | 2355 | out << "</before>\n" ; out << "<reach>\n"; |
1472 | @@ -2271,6 +2357,7 @@ | |||
1473 | 2271 | out << "</reach>\n"; out << "</until>\n" ; | 2357 | out << "</reach>\n"; out << "</until>\n" ; |
1474 | 2272 | } | 2358 | } |
1475 | 2273 | 2359 | ||
1476 | 2360 | <<<<<<< TREE | ||
1477 | 2274 | void AndCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2361 | void AndCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1478 | 2275 | if(_conds.size() == 0) | 2362 | if(_conds.size() == 0) |
1479 | 2276 | { | 2363 | { |
1480 | @@ -2304,6 +2391,9 @@ | |||
1481 | 2304 | } | 2391 | } |
1482 | 2305 | 2392 | ||
1483 | 2306 | void AndCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2393 | void AndCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1484 | 2394 | ======= | ||
1485 | 2395 | void AndCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | ||
1486 | 2396 | >>>>>>> MERGE-SOURCE | ||
1487 | 2307 | if(_conds.size() == 0) | 2397 | if(_conds.size() == 0) |
1488 | 2308 | { | 2398 | { |
1489 | 2309 | BooleanCondition::TRUE_CONSTANT->toCompactXML(out,tabs, context); | 2399 | BooleanCondition::TRUE_CONSTANT->toCompactXML(out,tabs, context); |
1490 | @@ -2334,6 +2424,7 @@ | |||
1491 | 2334 | } | 2424 | } |
1492 | 2335 | out << "</conjunction>\n"; | 2425 | out << "</conjunction>\n"; |
1493 | 2336 | } | 2426 | } |
1494 | 2427 | <<<<<<< TREE | ||
1495 | 2337 | 2428 | ||
1496 | 2338 | void OrCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2429 | void OrCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1497 | 2339 | if(_conds.size() == 0) | 2430 | if(_conds.size() == 0) |
1498 | @@ -2366,6 +2457,8 @@ | |||
1499 | 2366 | } | 2457 | } |
1500 | 2367 | generateTabs(out,tabs) << "</disjunction>\n"; | 2458 | generateTabs(out,tabs) << "</disjunction>\n"; |
1501 | 2368 | } | 2459 | } |
1502 | 2460 | ======= | ||
1503 | 2461 | >>>>>>> MERGE-SOURCE | ||
1504 | 2369 | 2462 | ||
1505 | 2370 | void OrCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2463 | void OrCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1506 | 2371 | if(_conds.size() == 0) | 2464 | if(_conds.size() == 0) |
1507 | @@ -2399,6 +2492,7 @@ | |||
1508 | 2399 | out << "</disjunction>\n"; | 2492 | out << "</disjunction>\n"; |
1509 | 2400 | } | 2493 | } |
1510 | 2401 | 2494 | ||
1511 | 2495 | <<<<<<< TREE | ||
1512 | 2402 | void CompareConjunction::toXML(std::ostream& out, uint32_t tabs) const | 2496 | void CompareConjunction::toXML(std::ostream& out, uint32_t tabs) const |
1513 | 2403 | { | 2497 | { |
1514 | 2404 | if(_negated) generateTabs(out,tabs++) << "<negation>"; | 2498 | if(_negated) generateTabs(out,tabs++) << "<negation>"; |
1515 | @@ -2438,6 +2532,9 @@ | |||
1516 | 2438 | } | 2532 | } |
1517 | 2439 | 2533 | ||
1518 | 2440 | void CompareConjunction::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2534 | void CompareConjunction::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1519 | 2535 | ======= | ||
1520 | 2536 | void CompareConjunction::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | ||
1521 | 2537 | >>>>>>> MERGE-SOURCE | ||
1522 | 2441 | if(_negated) out << "<negation>"; | 2538 | if(_negated) out << "<negation>"; |
1523 | 2442 | if(_constraints.size() == 0) BooleanCondition::TRUE_CONSTANT->toCompactXML(out,tabs, context); | 2539 | if(_constraints.size() == 0) BooleanCondition::TRUE_CONSTANT->toCompactXML(out,tabs, context); |
1524 | 2443 | else | 2540 | else |
1525 | @@ -2474,6 +2571,7 @@ | |||
1526 | 2474 | if(_negated) out << "</negation>"; | 2571 | if(_negated) out << "</negation>"; |
1527 | 2475 | } | 2572 | } |
1528 | 2476 | 2573 | ||
1529 | 2574 | <<<<<<< TREE | ||
1530 | 2477 | void EqualCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2575 | void EqualCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1531 | 2478 | generateTabs(out,tabs) << "<integer-eq>\n"; | 2576 | generateTabs(out,tabs) << "<integer-eq>\n"; |
1532 | 2479 | _expr1->toXML(out,tabs+1); | 2577 | _expr1->toXML(out,tabs+1); |
1533 | @@ -2482,11 +2580,15 @@ | |||
1534 | 2482 | } | 2580 | } |
1535 | 2483 | 2581 | ||
1536 | 2484 | void EqualCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2582 | void EqualCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1537 | 2583 | ======= | ||
1538 | 2584 | void EqualCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | ||
1539 | 2585 | >>>>>>> MERGE-SOURCE | ||
1540 | 2485 | out << "<integer-eq>\n"; | 2586 | out << "<integer-eq>\n"; |
1541 | 2486 | _expr1->toCompactXML(out,tabs, context); | 2587 | _expr1->toCompactXML(out,tabs, context); |
1542 | 2487 | _expr2->toCompactXML(out,tabs, context); | 2588 | _expr2->toCompactXML(out,tabs, context); |
1543 | 2488 | out << "</integer-eq>\n"; | 2589 | out << "</integer-eq>\n"; |
1544 | 2489 | } | 2590 | } |
1545 | 2591 | <<<<<<< TREE | ||
1546 | 2490 | 2592 | ||
1547 | 2491 | void NotEqualCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2593 | void NotEqualCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1548 | 2492 | generateTabs(out,tabs) << "<integer-ne>\n"; | 2594 | generateTabs(out,tabs) << "<integer-ne>\n"; |
1549 | @@ -2494,6 +2596,8 @@ | |||
1550 | 2494 | _expr2->toXML(out,tabs+1); | 2596 | _expr2->toXML(out,tabs+1); |
1551 | 2495 | generateTabs(out,tabs) << "</integer-ne>\n"; | 2597 | generateTabs(out,tabs) << "</integer-ne>\n"; |
1552 | 2496 | } | 2598 | } |
1553 | 2599 | ======= | ||
1554 | 2600 | >>>>>>> MERGE-SOURCE | ||
1555 | 2497 | 2601 | ||
1556 | 2498 | void NotEqualCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2602 | void NotEqualCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1557 | 2499 | out << "<integer-ne>\n"; | 2603 | out << "<integer-ne>\n"; |
1558 | @@ -2501,6 +2605,7 @@ | |||
1559 | 2501 | _expr2->toCompactXML(out,tabs, context); | 2605 | _expr2->toCompactXML(out,tabs, context); |
1560 | 2502 | out << "</integer-ne>\n"; | 2606 | out << "</integer-ne>\n"; |
1561 | 2503 | } | 2607 | } |
1562 | 2608 | <<<<<<< TREE | ||
1563 | 2504 | 2609 | ||
1564 | 2505 | void LessThanCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2610 | void LessThanCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1565 | 2506 | generateTabs(out,tabs) << "<integer-lt>\n"; | 2611 | generateTabs(out,tabs) << "<integer-lt>\n"; |
1566 | @@ -2508,6 +2613,8 @@ | |||
1567 | 2508 | _expr2->toXML(out,tabs+1); | 2613 | _expr2->toXML(out,tabs+1); |
1568 | 2509 | generateTabs(out,tabs) << "</integer-lt>\n"; | 2614 | generateTabs(out,tabs) << "</integer-lt>\n"; |
1569 | 2510 | } | 2615 | } |
1570 | 2616 | ======= | ||
1571 | 2617 | >>>>>>> MERGE-SOURCE | ||
1572 | 2511 | 2618 | ||
1573 | 2512 | void LessThanCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2619 | void LessThanCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1574 | 2513 | out << "<integer-lt>\n"; | 2620 | out << "<integer-lt>\n"; |
1575 | @@ -2515,6 +2622,7 @@ | |||
1576 | 2515 | _expr2->toCompactXML(out,tabs, context); | 2622 | _expr2->toCompactXML(out,tabs, context); |
1577 | 2516 | out << "</integer-lt>\n"; | 2623 | out << "</integer-lt>\n"; |
1578 | 2517 | } | 2624 | } |
1579 | 2625 | <<<<<<< TREE | ||
1580 | 2518 | 2626 | ||
1581 | 2519 | void LessThanOrEqualCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2627 | void LessThanOrEqualCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1582 | 2520 | generateTabs(out,tabs) << "<integer-le>\n"; | 2628 | generateTabs(out,tabs) << "<integer-le>\n"; |
1583 | @@ -2522,6 +2630,8 @@ | |||
1584 | 2522 | _expr2->toXML(out,tabs+1); | 2630 | _expr2->toXML(out,tabs+1); |
1585 | 2523 | generateTabs(out,tabs) << "</integer-le>\n"; | 2631 | generateTabs(out,tabs) << "</integer-le>\n"; |
1586 | 2524 | } | 2632 | } |
1587 | 2633 | ======= | ||
1588 | 2634 | >>>>>>> MERGE-SOURCE | ||
1589 | 2525 | 2635 | ||
1590 | 2526 | void LessThanOrEqualCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2636 | void LessThanOrEqualCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1591 | 2527 | out << "<integer-le>\n"; | 2637 | out << "<integer-le>\n"; |
1592 | @@ -2529,6 +2639,7 @@ | |||
1593 | 2529 | _expr2->toCompactXML(out,tabs, context); | 2639 | _expr2->toCompactXML(out,tabs, context); |
1594 | 2530 | out << "</integer-le>\n"; | 2640 | out << "</integer-le>\n"; |
1595 | 2531 | } | 2641 | } |
1596 | 2642 | <<<<<<< TREE | ||
1597 | 2532 | 2643 | ||
1598 | 2533 | void NotCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2644 | void NotCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1599 | 2534 | 2645 | ||
1600 | @@ -2536,12 +2647,15 @@ | |||
1601 | 2536 | _cond->toXML(out,tabs+1); | 2647 | _cond->toXML(out,tabs+1); |
1602 | 2537 | generateTabs(out,tabs) << "</negation>\n"; | 2648 | generateTabs(out,tabs) << "</negation>\n"; |
1603 | 2538 | } | 2649 | } |
1604 | 2650 | ======= | ||
1605 | 2651 | >>>>>>> MERGE-SOURCE | ||
1606 | 2539 | 2652 | ||
1607 | 2540 | void NotCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2653 | void NotCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1608 | 2541 | out << "<negation>\n"; | 2654 | out << "<negation>\n"; |
1609 | 2542 | _cond->toCompactXML(out,tabs, context); | 2655 | _cond->toCompactXML(out,tabs, context); |
1610 | 2543 | out << "</negation>\n"; | 2656 | out << "</negation>\n"; |
1611 | 2544 | } | 2657 | } |
1612 | 2658 | <<<<<<< TREE | ||
1613 | 2545 | 2659 | ||
1614 | 2546 | void BooleanCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2660 | void BooleanCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1615 | 2547 | generateTabs(out,tabs) << "<" << | 2661 | generateTabs(out,tabs) << "<" << |
1616 | @@ -2558,10 +2672,19 @@ | |||
1617 | 2558 | void DeadlockCondition::toXML(std::ostream& out,uint32_t tabs) const { | 2672 | void DeadlockCondition::toXML(std::ostream& out,uint32_t tabs) const { |
1618 | 2559 | generateTabs(out,tabs) << "<deadlock/>\n"; | 2673 | generateTabs(out,tabs) << "<deadlock/>\n"; |
1619 | 2560 | } | 2674 | } |
1620 | 2675 | ======= | ||
1621 | 2676 | |||
1622 | 2677 | void BooleanCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | ||
1623 | 2678 | out << "<" << | ||
1624 | 2679 | (value ? "true" : "false") | ||
1625 | 2680 | << "/>\n"; | ||
1626 | 2681 | } | ||
1627 | 2682 | >>>>>>> MERGE-SOURCE | ||
1628 | 2561 | 2683 | ||
1629 | 2562 | void DeadlockCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2684 | void DeadlockCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1630 | 2563 | out << "<deadlock/>\n"; | 2685 | out << "<deadlock/>\n"; |
1631 | 2564 | } | 2686 | } |
1632 | 2687 | <<<<<<< TREE | ||
1633 | 2565 | 2688 | ||
1634 | 2566 | void UnfoldedUpperBoundsCondition::toXML(std::ostream& out, uint32_t tabs) const { | 2689 | void UnfoldedUpperBoundsCondition::toXML(std::ostream& out, uint32_t tabs) const { |
1635 | 2567 | generateTabs(out, tabs) << "<place-bound>\n"; | 2690 | generateTabs(out, tabs) << "<place-bound>\n"; |
1636 | @@ -2569,6 +2692,8 @@ | |||
1637 | 2569 | generateTabs(out, tabs + 1) << "<place>" << p._name << "</place>\n"; | 2692 | generateTabs(out, tabs + 1) << "<place>" << p._name << "</place>\n"; |
1638 | 2570 | generateTabs(out, tabs) << "</place-bound>\n"; | 2693 | generateTabs(out, tabs) << "</place-bound>\n"; |
1639 | 2571 | } | 2694 | } |
1640 | 2695 | ======= | ||
1641 | 2696 | >>>>>>> MERGE-SOURCE | ||
1642 | 2572 | 2697 | ||
1643 | 2573 | void UnfoldedUpperBoundsCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ | 2698 | void UnfoldedUpperBoundsCondition::toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const{ |
1644 | 2574 | out << "<place-bound>\n"; | 2699 | out << "<place-bound>\n"; |
1645 | @@ -4462,6 +4587,8 @@ | |||
1646 | 4462 | return false; | 4587 | return false; |
1647 | 4463 | } | 4588 | } |
1648 | 4464 | 4589 | ||
1649 | 4590 | |||
1650 | 4591 | |||
1651 | 4465 | } // PQL | 4592 | } // PQL |
1652 | 4466 | } // PetriEngine | 4593 | } // PetriEngine |
1653 | 4467 | 4594 | ||
1654 | 4468 | 4595 | ||
1655 | === added file 'src/PetriEngine/PQL/XMLPrinter.cpp' | |||
1656 | --- src/PetriEngine/PQL/XMLPrinter.cpp 1970-01-01 00:00:00 +0000 | |||
1657 | +++ src/PetriEngine/PQL/XMLPrinter.cpp 2021-10-18 11:40:53 +0000 | |||
1658 | @@ -0,0 +1,399 @@ | |||
1659 | 1 | /* Copyright (C) 2011 Jonas Finnemann Jensen <jopsen@gmail.com>, | ||
1660 | 2 | * Thomas Søndersø Nielsen <primogens@gmail.com>, | ||
1661 | 3 | * Lars Kærlund Østergaard <larsko@gmail.com>, | ||
1662 | 4 | * Peter Gjøl Jensen <root@petergjoel.dk>, | ||
1663 | 5 | * Rasmus Tollund <rtollu18@student.aau.dk> | ||
1664 | 6 | * | ||
1665 | 7 | * This program is free software: you can redistribute it and/or modify | ||
1666 | 8 | * it under the terms of the GNU General Public License as published by | ||
1667 | 9 | * the Free Software Foundation, either version 3 of the License, or | ||
1668 | 10 | * (at your option) any later version. | ||
1669 | 11 | * | ||
1670 | 12 | * This program is distributed in the hope that it will be useful, | ||
1671 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1672 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1673 | 15 | * GNU General Public License for more details. | ||
1674 | 16 | * | ||
1675 | 17 | * You should have received a copy of the GNU General Public License | ||
1676 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1677 | 19 | */ | ||
1678 | 20 | #include "PetriEngine/PQL/XMLPrinter.h" | ||
1679 | 21 | namespace PetriEngine { | ||
1680 | 22 | namespace PQL { | ||
1681 | 23 | std::ostream& XMLPrinter::generateTabs() { | ||
1682 | 24 | for(uint32_t i = 0; i < tabs; i++) { | ||
1683 | 25 | os << single_tab; | ||
1684 | 26 | } | ||
1685 | 27 | return os; | ||
1686 | 28 | } | ||
1687 | 29 | |||
1688 | 30 | void XMLPrinter::openXmlTag(const std::string &tag) { | ||
1689 | 31 | generateTabs() << "<" << tag << (print_newlines? ">\n": ">"); | ||
1690 | 32 | tabs++; | ||
1691 | 33 | } | ||
1692 | 34 | |||
1693 | 35 | void XMLPrinter::closeXmlTag(const std::string &tag) { | ||
1694 | 36 | tabs--; | ||
1695 | 37 | generateTabs() << "</" << tag << (print_newlines? ">\n": ">"); | ||
1696 | 38 | } | ||
1697 | 39 | |||
1698 | 40 | void XMLPrinter::outputLine(const std::string &line) { | ||
1699 | 41 | generateTabs() << line << (print_newlines? "\n": ""); | ||
1700 | 42 | |||
1701 | 43 | } | ||
1702 | 44 | |||
1703 | 45 | void XMLPrinter::_accept(const NotCondition *element) { | ||
1704 | 46 | openXmlTag("negation"); | ||
1705 | 47 | element->getCond()->visit(*this); | ||
1706 | 48 | closeXmlTag("negation"); | ||
1707 | 49 | } | ||
1708 | 50 | |||
1709 | 51 | void XMLPrinter::_accept(const AndCondition *element) { | ||
1710 | 52 | if(element->empty()) | ||
1711 | 53 | { | ||
1712 | 54 | BooleanCondition::TRUE_CONSTANT->visit(*this); | ||
1713 | 55 | return; | ||
1714 | 56 | } | ||
1715 | 57 | if(element->size() == 1) | ||
1716 | 58 | { | ||
1717 | 59 | (*element)[0]->visit(*this); | ||
1718 | 60 | return; | ||
1719 | 61 | } | ||
1720 | 62 | openXmlTag("conjunction"); | ||
1721 | 63 | (*element)[0]->visit(*this); | ||
1722 | 64 | for(size_t i = 1; i < element->size(); ++i) | ||
1723 | 65 | { | ||
1724 | 66 | if(i + 1 == element->size()) | ||
1725 | 67 | { | ||
1726 | 68 | (*element)[i]->visit(*this); | ||
1727 | 69 | } | ||
1728 | 70 | else | ||
1729 | 71 | { | ||
1730 | 72 | openXmlTag("conjunction"); | ||
1731 | 73 | (*element)[i]->visit(*this); | ||
1732 | 74 | } | ||
1733 | 75 | } | ||
1734 | 76 | for(size_t i = element->size() - 1; i > 1; --i) | ||
1735 | 77 | { | ||
1736 | 78 | closeXmlTag("conjunction"); | ||
1737 | 79 | } | ||
1738 | 80 | closeXmlTag("conjunction"); | ||
1739 | 81 | } | ||
1740 | 82 | |||
1741 | 83 | void XMLPrinter::_accept(const OrCondition *element) { | ||
1742 | 84 | if(element->empty()) | ||
1743 | 85 | { | ||
1744 | 86 | BooleanCondition::FALSE_CONSTANT->visit(*this); | ||
1745 | 87 | return; | ||
1746 | 88 | } | ||
1747 | 89 | if(element->size() == 1) | ||
1748 | 90 | { | ||
1749 | 91 | (*element)[0]->visit(*this); | ||
1750 | 92 | return; | ||
1751 | 93 | } | ||
1752 | 94 | openXmlTag("disjunction"); | ||
1753 | 95 | (*element)[0]->visit(*this); | ||
1754 | 96 | for(size_t i = 1; i < element->size(); ++i) | ||
1755 | 97 | { | ||
1756 | 98 | if(i + 1 == element->size()) | ||
1757 | 99 | { | ||
1758 | 100 | (*element)[i]->visit(*this); | ||
1759 | 101 | } | ||
1760 | 102 | else | ||
1761 | 103 | { | ||
1762 | 104 | openXmlTag("disjunction"); | ||
1763 | 105 | (*element)[i]->visit(*this); | ||
1764 | 106 | } | ||
1765 | 107 | } | ||
1766 | 108 | for(size_t i = element->size() - 1; i > 1; --i) | ||
1767 | 109 | { | ||
1768 | 110 | closeXmlTag("disjunction"); | ||
1769 | 111 | } | ||
1770 | 112 | closeXmlTag("disjunction"); | ||
1771 | 113 | } | ||
1772 | 114 | |||
1773 | 115 | void XMLPrinter::_accept(const LessThanCondition *element) { | ||
1774 | 116 | openXmlTag("integer-lt"); | ||
1775 | 117 | (*element)[0]->visit(*this); | ||
1776 | 118 | (*element)[1]->visit(*this); | ||
1777 | 119 | closeXmlTag("integer-lt"); | ||
1778 | 120 | } | ||
1779 | 121 | |||
1780 | 122 | void XMLPrinter::_accept(const LessThanOrEqualCondition *element) { | ||
1781 | 123 | openXmlTag("integer-le"); | ||
1782 | 124 | (*element)[0]->visit(*this); | ||
1783 | 125 | (*element)[1]->visit(*this); | ||
1784 | 126 | closeXmlTag("integer-le"); | ||
1785 | 127 | } | ||
1786 | 128 | |||
1787 | 129 | void XMLPrinter::_accept(const EqualCondition *element) { | ||
1788 | 130 | openXmlTag("integer-eq"); | ||
1789 | 131 | (*element)[0]->visit(*this); | ||
1790 | 132 | (*element)[1]->visit(*this); | ||
1791 | 133 | closeXmlTag("integer-eq"); | ||
1792 | 134 | } | ||
1793 | 135 | |||
1794 | 136 | void XMLPrinter::_accept(const NotEqualCondition *element) { | ||
1795 | 137 | openXmlTag("integer-ne"); | ||
1796 | 138 | (*element)[0]->visit(*this); | ||
1797 | 139 | (*element)[1]->visit(*this); | ||
1798 | 140 | closeXmlTag("integer-ne"); | ||
1799 | 141 | } | ||
1800 | 142 | |||
1801 | 143 | void XMLPrinter::_accept(const DeadlockCondition *element) { | ||
1802 | 144 | outputLine("<deadlock/>"); | ||
1803 | 145 | } | ||
1804 | 146 | |||
1805 | 147 | void XMLPrinter::_accept(const CompareConjunction *element) { | ||
1806 | 148 | if(element->isNegated()) { | ||
1807 | 149 | generateTabs() << "<negation>"; | ||
1808 | 150 | } | ||
1809 | 151 | |||
1810 | 152 | if(element->constraints().empty()) BooleanCondition::TRUE_CONSTANT->visit(*this); | ||
1811 | 153 | else | ||
1812 | 154 | { | ||
1813 | 155 | bool single = element->constraints().size() == 1 && | ||
1814 | 156 | (element->constraints()[0]._lower == 0 || | ||
1815 | 157 | element->constraints()[0]._upper == std::numeric_limits<uint32_t>::max()); | ||
1816 | 158 | if(!single) | ||
1817 | 159 | openXmlTag("conjunction"); | ||
1818 | 160 | for(auto& c : element->constraints()) | ||
1819 | 161 | { | ||
1820 | 162 | if(c._lower != 0) | ||
1821 | 163 | { | ||
1822 | 164 | openXmlTag("integer-ge"); | ||
1823 | 165 | openXmlTag("tokens-count"); | ||
1824 | 166 | outputLine("<place>" + c._name + "</place>"); | ||
1825 | 167 | closeXmlTag("tokens-count"); | ||
1826 | 168 | outputLine("<integer-constant>" + std::to_string(c._lower) + "</integer-constant>"); | ||
1827 | 169 | closeXmlTag("integer-ge"); | ||
1828 | 170 | } | ||
1829 | 171 | if(c._upper != std::numeric_limits<uint32_t>::max()) | ||
1830 | 172 | { | ||
1831 | 173 | openXmlTag("integer-le"); | ||
1832 | 174 | openXmlTag("tokens-count"); | ||
1833 | 175 | outputLine("<place>" + c._name + "</place>"); | ||
1834 | 176 | closeXmlTag("tokens-count"); | ||
1835 | 177 | outputLine("<integer-constant>" + std::to_string(c._upper) + "</integer-constant>"); | ||
1836 | 178 | closeXmlTag("integer-le"); | ||
1837 | 179 | } | ||
1838 | 180 | } | ||
1839 | 181 | if(!single) | ||
1840 | 182 | closeXmlTag("conjunction"); | ||
1841 | 183 | } | ||
1842 | 184 | if(element->isNegated()) { | ||
1843 | 185 | generateTabs() << "</negation>"; | ||
1844 | 186 | } | ||
1845 | 187 | } | ||
1846 | 188 | |||
1847 | 189 | void XMLPrinter::_accept(const UnfoldedUpperBoundsCondition *element) { | ||
1848 | 190 | openXmlTag("place-bound"); | ||
1849 | 191 | for(auto& p : element->places()) { | ||
1850 | 192 | outputLine("<place>" + p._name + "</place>"); | ||
1851 | 193 | } | ||
1852 | 194 | closeXmlTag("place-bound"); | ||
1853 | 195 | } | ||
1854 | 196 | |||
1855 | 197 | void XMLPrinter::_accept(const EFCondition *condition) { | ||
1856 | 198 | openXmlTag("exists-path"); | ||
1857 | 199 | openXmlTag("finally"); | ||
1858 | 200 | condition->getCond()->visit(*this); | ||
1859 | 201 | closeXmlTag("finally"); | ||
1860 | 202 | closeXmlTag("exists-path"); | ||
1861 | 203 | } | ||
1862 | 204 | |||
1863 | 205 | void XMLPrinter::_accept(const EGCondition *condition) { | ||
1864 | 206 | openXmlTag("exists-path"); | ||
1865 | 207 | openXmlTag("globally"); | ||
1866 | 208 | condition->getCond()->visit(*this); | ||
1867 | 209 | closeXmlTag("globally"); | ||
1868 | 210 | closeXmlTag("exists-path"); | ||
1869 | 211 | } | ||
1870 | 212 | |||
1871 | 213 | void XMLPrinter::_accept(const AGCondition *condition) { | ||
1872 | 214 | openXmlTag("all-paths"); | ||
1873 | 215 | openXmlTag("globally"); | ||
1874 | 216 | condition->getCond()->visit(*this); | ||
1875 | 217 | closeXmlTag("globally"); | ||
1876 | 218 | closeXmlTag("all-paths"); | ||
1877 | 219 | } | ||
1878 | 220 | |||
1879 | 221 | void XMLPrinter::_accept(const AFCondition *condition) { | ||
1880 | 222 | openXmlTag("all-paths"); | ||
1881 | 223 | openXmlTag("finally"); | ||
1882 | 224 | condition->getCond()->visit(*this); | ||
1883 | 225 | closeXmlTag("finally"); | ||
1884 | 226 | closeXmlTag("all-paths"); | ||
1885 | 227 | } | ||
1886 | 228 | |||
1887 | 229 | void XMLPrinter::_accept(const EXCondition *condition) { | ||
1888 | 230 | openXmlTag("exists-path"); | ||
1889 | 231 | openXmlTag("next"); | ||
1890 | 232 | condition->getCond()->visit(*this); | ||
1891 | 233 | closeXmlTag("next"); | ||
1892 | 234 | closeXmlTag("exists-path"); | ||
1893 | 235 | } | ||
1894 | 236 | |||
1895 | 237 | void XMLPrinter::_accept(const AXCondition *condition) { | ||
1896 | 238 | openXmlTag("all-paths"); | ||
1897 | 239 | openXmlTag("next"); | ||
1898 | 240 | condition->getCond()->visit(*this); | ||
1899 | 241 | closeXmlTag("next"); | ||
1900 | 242 | closeXmlTag("all-paths"); | ||
1901 | 243 | } | ||
1902 | 244 | |||
1903 | 245 | void XMLPrinter::_accept(const EUCondition *condition) { | ||
1904 | 246 | openXmlTag("exists-path"); | ||
1905 | 247 | openXmlTag("until"); | ||
1906 | 248 | openXmlTag("before"); | ||
1907 | 249 | (*condition)[0]->visit(*this); | ||
1908 | 250 | closeXmlTag("before"); | ||
1909 | 251 | openXmlTag("reach"); | ||
1910 | 252 | (*condition)[1]->visit(*this); | ||
1911 | 253 | closeXmlTag("reach"); | ||
1912 | 254 | closeXmlTag("until"); | ||
1913 | 255 | closeXmlTag("exists-path"); | ||
1914 | 256 | } | ||
1915 | 257 | |||
1916 | 258 | void XMLPrinter::_accept(const AUCondition *condition) { | ||
1917 | 259 | openXmlTag("all-paths"); | ||
1918 | 260 | openXmlTag("until"); | ||
1919 | 261 | openXmlTag("before"); | ||
1920 | 262 | (*condition)[0]->visit(*this); | ||
1921 | 263 | closeXmlTag("before"); | ||
1922 | 264 | openXmlTag("reach"); | ||
1923 | 265 | (*condition)[1]->visit(*this); | ||
1924 | 266 | closeXmlTag("reach"); | ||
1925 | 267 | closeXmlTag("until"); | ||
1926 | 268 | closeXmlTag("all-paths"); | ||
1927 | 269 | |||
1928 | 270 | } | ||
1929 | 271 | |||
1930 | 272 | void XMLPrinter::_accept(const ACondition *condition) { | ||
1931 | 273 | openXmlTag("all-paths"); | ||
1932 | 274 | condition->getCond()->visit(*this); | ||
1933 | 275 | closeXmlTag("all-paths"); | ||
1934 | 276 | } | ||
1935 | 277 | |||
1936 | 278 | void XMLPrinter::_accept(const ECondition *condition) { | ||
1937 | 279 | openXmlTag("exists-path"); | ||
1938 | 280 | condition->getCond()->visit(*this); | ||
1939 | 281 | closeXmlTag("exists-path"); | ||
1940 | 282 | } | ||
1941 | 283 | |||
1942 | 284 | void XMLPrinter::_accept(const GCondition *condition) { | ||
1943 | 285 | openXmlTag("globally"); | ||
1944 | 286 | condition->getCond()->visit(*this); | ||
1945 | 287 | closeXmlTag("globally"); | ||
1946 | 288 | } | ||
1947 | 289 | |||
1948 | 290 | void XMLPrinter::_accept(const FCondition *condition) { | ||
1949 | 291 | openXmlTag("finally"); | ||
1950 | 292 | condition->getCond()->visit(*this); | ||
1951 | 293 | closeXmlTag("finally"); | ||
1952 | 294 | } | ||
1953 | 295 | |||
1954 | 296 | void XMLPrinter::_accept(const XCondition *condition) { | ||
1955 | 297 | openXmlTag("next"); | ||
1956 | 298 | condition->getCond()->visit(*this); | ||
1957 | 299 | closeXmlTag("next"); | ||
1958 | 300 | } | ||
1959 | 301 | |||
1960 | 302 | void XMLPrinter::_accept(const UntilCondition *condition) { | ||
1961 | 303 | openXmlTag("until") ; | ||
1962 | 304 | openXmlTag("before"); | ||
1963 | 305 | (*condition)[0]->visit(*this); | ||
1964 | 306 | closeXmlTag("before") ; | ||
1965 | 307 | openXmlTag("reach"); | ||
1966 | 308 | (*condition)[1]->visit(*this); | ||
1967 | 309 | closeXmlTag("reach") ; | ||
1968 | 310 | closeXmlTag("until") ; | ||
1969 | 311 | } | ||
1970 | 312 | |||
1971 | 313 | void XMLPrinter::_accept(const UnfoldedFireableCondition *element) { | ||
1972 | 314 | outputLine("<is-fireable><transition>" + element->getName() + "</transition></is-fireable>"); | ||
1973 | 315 | } | ||
1974 | 316 | |||
1975 | 317 | void XMLPrinter::_accept(const BooleanCondition *element) { | ||
1976 | 318 | outputLine(element->value? "<true/>": "<false/>"); | ||
1977 | 319 | } | ||
1978 | 320 | |||
1979 | 321 | void XMLPrinter::_accept(const UnfoldedIdentifierExpr *element) { | ||
1980 | 322 | if (token_count) { | ||
1981 | 323 | outputLine("<place>" + element->name() + "</place>"); | ||
1982 | 324 | } | ||
1983 | 325 | else | ||
1984 | 326 | { | ||
1985 | 327 | openXmlTag("tokens-count"); | ||
1986 | 328 | outputLine("<place>" + element->name() + "</place>"); | ||
1987 | 329 | closeXmlTag("tokens-count"); | ||
1988 | 330 | } | ||
1989 | 331 | } | ||
1990 | 332 | |||
1991 | 333 | void XMLPrinter::_accept(const LiteralExpr *element) { | ||
1992 | 334 | outputLine("<integer-constant>" + std::to_string(element->value()) + "</integer-constant>"); | ||
1993 | 335 | } | ||
1994 | 336 | |||
1995 | 337 | void XMLPrinter::_accept(const PlusExpr *element) { | ||
1996 | 338 | if (token_count) { | ||
1997 | 339 | for(auto& e : element->expressions()) | ||
1998 | 340 | e->visit(*this); | ||
1999 | 341 | return; | ||
2000 | 342 | } | ||
2001 | 343 | |||
2002 | 344 | if(element->tk) { | ||
2003 | 345 | openXmlTag("tokens-count"); | ||
2004 | 346 | for(auto& e : element->places()) | ||
2005 | 347 | outputLine("<place>" + e.second + "</place>"); | ||
2006 | 348 | for(auto& e : element->expressions()) | ||
2007 | 349 | e->visit(*this); | ||
2008 | 350 | closeXmlTag("tokens-count"); | ||
2009 | 351 | return; | ||
2010 | 352 | } | ||
2011 | 353 | openXmlTag("integer-sum"); | ||
2012 | 354 | outputLine("<integer-constant>" + std::to_string(element->constant()) + "</integer-constant>"); | ||
2013 | 355 | for(auto& i : element->places()) | ||
2014 | 356 | { | ||
2015 | 357 | openXmlTag("tokens-count"); | ||
2016 | 358 | outputLine("<place>" + i.second + "</place>"); | ||
2017 | 359 | closeXmlTag("tokens-count"); | ||
2018 | 360 | } | ||
2019 | 361 | for(auto& e : element->expressions()) | ||
2020 | 362 | e->visit(*this); | ||
2021 | 363 | closeXmlTag("integer-sum"); | ||
2022 | 364 | } | ||
2023 | 365 | |||
2024 | 366 | void XMLPrinter::_accept(const MultiplyExpr *element) { | ||
2025 | 367 | openXmlTag("integer-product"); | ||
2026 | 368 | for(auto& e : element->expressions()) | ||
2027 | 369 | e->visit(*this); | ||
2028 | 370 | closeXmlTag("integer-product"); | ||
2029 | 371 | } | ||
2030 | 372 | |||
2031 | 373 | void XMLPrinter::_accept(const MinusExpr *element) { | ||
2032 | 374 | openXmlTag("integer-product"); | ||
2033 | 375 | (*element)[0]->visit(*this); | ||
2034 | 376 | openXmlTag("integer-difference"); | ||
2035 | 377 | outputLine("<integer-constant>0</integer-constant>"); | ||
2036 | 378 | outputLine("<integer-constant>1</integer-constant>"); | ||
2037 | 379 | closeXmlTag("integer-difference"); | ||
2038 | 380 | closeXmlTag("integer-product"); | ||
2039 | 381 | } | ||
2040 | 382 | |||
2041 | 383 | void XMLPrinter::_accept(const SubtractExpr *element) { | ||
2042 | 384 | openXmlTag("integer-difference"); | ||
2043 | 385 | for(auto& e : element->expressions()) | ||
2044 | 386 | e->visit(*this); | ||
2045 | 387 | closeXmlTag("integer-difference"); | ||
2046 | 388 | } | ||
2047 | 389 | |||
2048 | 390 | void XMLPrinter::_accept(const IdentifierExpr *element) { | ||
2049 | 391 | element->compiled()->visit(*this); | ||
2050 | 392 | } | ||
2051 | 393 | |||
2052 | 394 | void XMLPrinter::_accept(const ShallowCondition *element) { | ||
2053 | 395 | element->getCompiled()->visit(*this); | ||
2054 | 396 | } | ||
2055 | 397 | } | ||
2056 | 398 | } | ||
2057 | 399 | |||
2058 | 0 | 400 | ||
2059 | === modified file 'src/VerifyPN.cpp' | |||
2060 | --- src/VerifyPN.cpp 2021-10-14 11:37:21 +0000 | |||
2061 | +++ src/VerifyPN.cpp 2021-10-18 11:40:53 +0000 | |||
2062 | @@ -75,6 +75,7 @@ | |||
2063 | 75 | #include "PetriEngine/PetriNetBuilder.h" | 75 | #include "PetriEngine/PetriNetBuilder.h" |
2064 | 76 | #include "PetriEngine/PQL/PQL.h" | 76 | #include "PetriEngine/PQL/PQL.h" |
2065 | 77 | #include "PetriEngine/PQL/CTLVisitor.h" | 77 | #include "PetriEngine/PQL/CTLVisitor.h" |
2066 | 78 | #include <PetriEngine/PQL/XMLPrinter.h> | ||
2067 | 78 | #include "PetriEngine/options.h" | 79 | #include "PetriEngine/options.h" |
2068 | 79 | #include "PetriEngine/errorcodes.h" | 80 | #include "PetriEngine/errorcodes.h" |
2069 | 80 | #include "PetriEngine/STSolver.h" | 81 | #include "PetriEngine/STSolver.h" |
2070 | @@ -90,6 +91,7 @@ | |||
2071 | 90 | #include "LTL/LTLMain.h" | 91 | #include "LTL/LTLMain.h" |
2072 | 91 | 92 | ||
2073 | 92 | #include <atomic> | 93 | #include <atomic> |
2074 | 94 | #include <PetriEngine/PQL/BinaryPrinter.h> | ||
2075 | 93 | 95 | ||
2076 | 94 | using namespace PetriEngine; | 96 | using namespace PetriEngine; |
2077 | 95 | using namespace PetriEngine::PQL; | 97 | using namespace PetriEngine::PQL; |
2078 | @@ -940,7 +942,8 @@ | |||
2079 | 940 | continue; | 942 | continue; |
2080 | 941 | } | 943 | } |
2081 | 942 | ss << " <property>\n <id>" << querynames[i] << "</id>\n <description>Simplified</description>\n <formula>\n"; | 944 | ss << " <property>\n <id>" << querynames[i] << "</id>\n <description>Simplified</description>\n <formula>\n"; |
2083 | 943 | queries[i]->toXML(ss, 3); | 945 | XMLPrinter xml_printer(ss, 3); |
2084 | 946 | queries[i]->visit(xml_printer); | ||
2085 | 944 | ss << " </formula>\n </property>\n"; | 947 | ss << " </formula>\n </property>\n"; |
2086 | 945 | } | 948 | } |
2087 | 946 | 949 | ||
2088 | @@ -985,12 +988,14 @@ | |||
2089 | 985 | { | 988 | { |
2090 | 986 | out.write(querynames[i].data(), querynames[i].size()); | 989 | out.write(querynames[i].data(), querynames[i].size()); |
2091 | 987 | out.write("\0", sizeof(char)); | 990 | out.write("\0", sizeof(char)); |
2093 | 988 | queries[i]->toBinary(out); | 991 | BinaryPrinter binary_printer(out); |
2094 | 992 | queries[i]->visit(binary_printer); | ||
2095 | 989 | } | 993 | } |
2096 | 990 | else | 994 | else |
2097 | 991 | { | 995 | { |
2098 | 992 | out << " <property>\n <id>" << querynames[i] << "</id>\n <description>Simplified</description>\n <formula>\n"; | 996 | out << " <property>\n <id>" << querynames[i] << "</id>\n <description>Simplified</description>\n <formula>\n"; |
2100 | 993 | queries[i]->toXML(out, 3); | 997 | XMLPrinter xml_printer(out, 3); |
2101 | 998 | queries[i]->visit(xml_printer); | ||
2102 | 994 | out << " </formula>\n </property>\n"; | 999 | out << " </formula>\n </property>\n"; |
2103 | 995 | } | 1000 | } |
2104 | 996 | } | 1001 | } |