libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
astPcodeRepresentation.cpp
Go to the documentation of this file.
1
2/*
3** Copyright (C) - Triton
4**
5** This program is under the terms of the Apache License 2.0.
6*/
7
12
13
14
15namespace triton {
16 namespace ast {
17 namespace representations {
18
21
22
23 /* Representation dispatcher from an abstract node */
24 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::AbstractNode* node) {
25 switch (node->getType()) {
26 case ARRAY_NODE: return this->print(stream, reinterpret_cast<triton::ast::ArrayNode*>(node)); break;
27 case ASSERT_NODE: return this->print(stream, reinterpret_cast<triton::ast::AssertNode*>(node)); break;
28 case BSWAP_NODE: return this->print(stream, reinterpret_cast<triton::ast::BswapNode*>(node)); break;
29 case BVADD_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvaddNode*>(node)); break;
30 case BVAND_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvandNode*>(node)); break;
31 case BVASHR_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvashrNode*>(node)); break;
32 case BVLSHR_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvlshrNode*>(node)); break;
33 case BVMUL_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvmulNode*>(node)); break;
34 case BVNAND_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvnandNode*>(node)); break;
35 case BVNEG_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvnegNode*>(node)); break;
36 case BVNOR_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvnorNode*>(node)); break;
37 case BVNOT_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvnotNode*>(node)); break;
38 case BVOR_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvorNode*>(node)); break;
39 case BVROL_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvrolNode*>(node)); break;
40 case BVROR_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvrorNode*>(node)); break;
41 case BVSDIV_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvsdivNode*>(node)); break;
42 case BVSGE_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvsgeNode*>(node)); break;
43 case BVSGT_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvsgtNode*>(node)); break;
44 case BVSHL_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvshlNode*>(node)); break;
45 case BVSLE_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvsleNode*>(node)); break;
46 case BVSLT_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvsltNode*>(node)); break;
47 case BVSMOD_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvsmodNode*>(node)); break;
48 case BVSREM_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvsremNode*>(node)); break;
49 case BVSUB_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvsubNode*>(node)); break;
50 case BVUDIV_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvudivNode*>(node)); break;
51 case BVUGE_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvugeNode*>(node)); break;
52 case BVUGT_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvugtNode*>(node)); break;
53 case BVULE_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvuleNode*>(node)); break;
54 case BVULT_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvultNode*>(node)); break;
55 case BVUREM_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvuremNode*>(node)); break;
56 case BVXNOR_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvxnorNode*>(node)); break;
57 case BVXOR_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvxorNode*>(node)); break;
58 case BV_NODE: return this->print(stream, reinterpret_cast<triton::ast::BvNode*>(node)); break;
59 case COMPOUND_NODE: return this->print(stream, reinterpret_cast<triton::ast::CompoundNode*>(node)); break;
60 case CONCAT_NODE: return this->print(stream, reinterpret_cast<triton::ast::ConcatNode*>(node)); break;
61 case DECLARE_NODE: return this->print(stream, reinterpret_cast<triton::ast::DeclareNode*>(node)); break;
62 case DISTINCT_NODE: return this->print(stream, reinterpret_cast<triton::ast::DistinctNode*>(node)); break;
63 case EQUAL_NODE: return this->print(stream, reinterpret_cast<triton::ast::EqualNode*>(node)); break;
64 case EXTRACT_NODE: return this->print(stream, reinterpret_cast<triton::ast::ExtractNode*>(node)); break;
65 case FORALL_NODE: return this->print(stream, reinterpret_cast<triton::ast::ForallNode*>(node)); break;
66 case IFF_NODE: return this->print(stream, reinterpret_cast<triton::ast::IffNode*>(node)); break;
67 case INTEGER_NODE: return this->print(stream, reinterpret_cast<triton::ast::IntegerNode*>(node)); break;
68 case ITE_NODE: return this->print(stream, reinterpret_cast<triton::ast::IteNode*>(node)); break;
69 case LAND_NODE: return this->print(stream, reinterpret_cast<triton::ast::LandNode*>(node)); break;
70 case LET_NODE: return this->print(stream, reinterpret_cast<triton::ast::LetNode*>(node)); break;
71 case LNOT_NODE: return this->print(stream, reinterpret_cast<triton::ast::LnotNode*>(node)); break;
72 case LOR_NODE: return this->print(stream, reinterpret_cast<triton::ast::LorNode*>(node)); break;
73 case LXOR_NODE: return this->print(stream, reinterpret_cast<triton::ast::LxorNode*>(node)); break;
74 case REFERENCE_NODE: return this->print(stream, reinterpret_cast<triton::ast::ReferenceNode*>(node)); break;
75 case SELECT_NODE: return this->print(stream, reinterpret_cast<triton::ast::SelectNode*>(node)); break;
76 case STORE_NODE: return this->print(stream, reinterpret_cast<triton::ast::StoreNode*>(node)); break;
77 case STRING_NODE: return this->print(stream, reinterpret_cast<triton::ast::StringNode*>(node)); break;
78 case SX_NODE: return this->print(stream, reinterpret_cast<triton::ast::SxNode*>(node)); break;
79 case VARIABLE_NODE: return this->print(stream, reinterpret_cast<triton::ast::VariableNode*>(node)); break;
80 case ZX_NODE: return this->print(stream, reinterpret_cast<triton::ast::ZxNode*>(node)); break;
81 default:
82 throw triton::exceptions::AstRepresentation("AstPcodeRepresentation::print(AbstractNode): Invalid kind node.");
83 }
84 return stream;
85 }
86
87
88 /* array representation */
89 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::ArrayNode* node) {
90 stream << "Memory";
91 return stream;
92 }
93
94
95 /* assert representation */
96 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::AssertNode* node) {
97 stream << "assert(" << node->getChildren()[0] << ")";
98 return stream;
99 }
100
101
102 /* bswap representation */
103 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BswapNode* node) {
104 stream << "bswap(" << node->getChildren()[0] << ", " << node->getBitvectorSize() << ")";
105 return stream;
106 }
107
108
109 /* bvadd representation */
110 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvaddNode* node) {
111 stream << "(" << node->getChildren()[0] << " + " << node->getChildren()[1] << ")";
112 return stream;
113 }
114
115
116 /* bvand representation */
117 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvandNode* node) {
118 stream << "(" << node->getChildren()[0] << " & " << node->getChildren()[1] << ")";
119 return stream;
120 }
121
122
123 /* bvashr representation */
124 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvashrNode* node) {
125 stream << "(" << node->getChildren()[0] << " >> " << node->getChildren()[1] << ")";
126 return stream;
127 }
128
129
130 /* bvlshr representation */
131 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvlshrNode* node) {
132 stream << "(" << node->getChildren()[0] << " >> " << node->getChildren()[1] << ")";
133 return stream;
134 }
135
136
137 /* bvmul representation */
138 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvmulNode* node) {
139 stream << "(" << node->getChildren()[0] << " * " << node->getChildren()[1] << ")";
140 return stream;
141 }
142
143
144 /* bvnand representation */
145 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvnandNode* node) {
146 stream << "~(" << node->getChildren()[0] << " & " << node->getChildren()[1] << ")";
147 return stream;
148 }
149
150
151 /* bvneg representation */
152 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvnegNode* node) {
153 stream << "-(" << node->getChildren()[0] << ")";
154 return stream;
155 }
156
157
158 /* bvnor representation */
159 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvnorNode* node) {
160 stream << "~(" << node->getChildren()[0] << " | " << node->getChildren()[1] << ")";
161 return stream;
162 }
163
164
165 /* bvnot representation */
166 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvnotNode* node) {
167 stream << "~(" << node->getChildren()[0] << ")";
168 return stream;
169 }
170
171
172 /* bvor representation */
173 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvorNode* node) {
174 stream << "(" << node->getChildren()[0] << " | " << node->getChildren()[1] << ")";
175 return stream;
176 }
177
178
179 /* bvrol representation */
180 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvrolNode* node) {
181 stream << "rol(" << node->getChildren()[0] << ", " << node->getChildren()[1] << ", " << node->getBitvectorSize() << ")";
182 return stream;
183 }
184
185
186 /* bvror representation */
187 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvrorNode* node) {
188 stream << "ror(" << node->getChildren()[0] << ", " << node->getChildren()[1] << ", " << node->getBitvectorSize() << ")";
189 return stream;
190 }
191
192
193 /* bvsdiv representation */
194 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvsdivNode* node) {
195 stream << "(" << node->getChildren()[0] << " / " << node->getChildren()[1] << ")";
196 return stream;
197 }
198
199
200 /* bvsge representation */
201 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvsgeNode* node) {
202 stream << "(" << node->getChildren()[0] << " >= " << node->getChildren()[1] << ")";
203 return stream;
204 }
205
206
207 /* bvsgt representation */
208 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvsgtNode* node) {
209 stream << "(" << node->getChildren()[0] << " > " << node->getChildren()[1] << ")";
210 return stream;
211 }
212
213
214 /* bvshl representation */
215 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvshlNode* node) {
216 stream << "(" << node->getChildren()[0] << " << " << node->getChildren()[1] << ")";
217 return stream;
218 }
219
220
221 /* bvsle representation */
222 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvsleNode* node) {
223 stream << "(" << node->getChildren()[0] << " <= " << node->getChildren()[1] << ")";
224 return stream;
225 }
226
227
228 /* bvslt representation */
229 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvsltNode* node) {
230 stream << "(" << node->getChildren()[0] << " < " << node->getChildren()[1] << ")";
231 return stream;
232 }
233
234
235 /* bvsmod representation */
236 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvsmodNode* node) {
237 stream << "(" << node->getChildren()[0] << " % " << node->getChildren()[1] << ")";
238 return stream;
239 }
240
241
242 /* bvsrem representation */
243 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvsremNode* node) {
244 stream << "(" << node->getChildren()[0] << " % " << node->getChildren()[1] << ")";
245 return stream;
246 }
247
248
249 /* bvsub representation */
250 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvsubNode* node) {
251 stream << "(" << node->getChildren()[0] << " - " << node->getChildren()[1] << ")";
252 return stream;
253 }
254
255
256 /* bvudiv representation */
257 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvudivNode* node) {
258 stream << "(" << node->getChildren()[0] << " / " << node->getChildren()[1] << ")";
259 return stream;
260 }
261
262
263 /* bvuge representation */
264 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvugeNode* node) {
265 stream << "(" << node->getChildren()[0] << " >= " << node->getChildren()[1] << ")";
266 return stream;
267 }
268
269
270 /* bvugt representation */
271 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvugtNode* node) {
272 stream << "(" << node->getChildren()[0] << " > " << node->getChildren()[1] << ")";
273 return stream;
274 }
275
276
277 /* bvule representation */
278 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvuleNode* node) {
279 stream << "(" << node->getChildren()[0] << " <= " << node->getChildren()[1] << ")";
280 return stream;
281 }
282
283
284 /* bvult representation */
285 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvultNode* node) {
286 stream << "(" << node->getChildren()[0] << " < " << node->getChildren()[1] << ")";
287 return stream;
288 }
289
290
291 /* bvurem representation */
292 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvuremNode* node) {
293 stream << "(" << node->getChildren()[0] << " % " << node->getChildren()[1] << ")";
294 return stream;
295 }
296
297
298 /* bvxnor representation */
299 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvxnorNode* node) {
300 stream << "~(" << node->getChildren()[0] << " ^ " << node->getChildren()[1] << ")";
301 return stream;
302 }
303
304
305 /* bvxor representation */
306 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvxorNode* node) {
307 stream << "(" << node->getChildren()[0] << " ^ " << node->getChildren()[1] << ")";
308 return stream;
309 }
310
311
312 /* bv representation */
313 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::BvNode* node) {
314 stream << node->getChildren()[0];
315 return stream;
316 }
317
318
319 /* compound representation */
320 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::CompoundNode* node) {
321 std::vector<triton::ast::SharedAbstractNode> children = node->getChildren();
322 triton::usize size = children.size();
323
324 for (triton::usize index = 0; index < size-1; index++)
325 stream << children[index] << std::endl;
326 stream << children[size-1];
327
328 return stream;
329 }
330
331
332 /* concat representation */
333 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::ConcatNode* node) {
334 std::vector<triton::ast::SharedAbstractNode> children = node->getChildren();
335 triton::usize size = children.size();
336
337 if (size < 2)
338 throw triton::exceptions::AstRepresentation("AstPcodeRepresentation::print(ConcatNode): Exprs must contain at least two expressions.");
339
340 stream << "concat(";
341 for (triton::usize index = 0; index < size; index++) {
342 stream << children[index];
343 if (index+1 < size) {
344 stream << ", ";
345 }
346 }
347 stream << ")";
348
349 return stream;
350 }
351
352
353 /* declare representation */
354 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::DeclareNode* node) {
355 if (node->getChildren()[0]->getType() == VARIABLE_NODE) {
356 const triton::engines::symbolic::SharedSymbolicVariable& var = reinterpret_cast<triton::ast::VariableNode*>(node->getChildren()[0].get())->getSymbolicVariable();
357 if (var->getAlias().empty())
358 stream << var->getName() << " = " << "input()";
359 else
360 stream << var->getAlias() << " = " << "input()";
361 }
362
363 else if (node->getChildren()[0]->getType() == ARRAY_NODE) {
364 stream << node->getChildren()[0] << " = memory()";
365 }
366
367 else {
368 throw triton::exceptions::AstRepresentation("AstPcodeRepresentation::print(DeclareNode): Invalid sort.");
369 }
370
371 return stream;
372 }
373
374
375 /* distinct representation */
376 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::DistinctNode* node) {
377 stream << "(" << node->getChildren()[0] << " != " << node->getChildren()[1] << ")";
378 return stream;
379 }
380
381
382 /* equal representation */
383 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::EqualNode* node) {
384 stream << "(" << node->getChildren()[0] << " == " << node->getChildren()[1] << ")";
385 return stream;
386 }
387
388
389 /* extract representation */
390 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::ExtractNode* node) {
391 triton::uint32 high = triton::ast::getInteger<triton::uint32>(node->getChildren()[0]);
392 triton::uint32 low = triton::ast::getInteger<triton::uint32>(node->getChildren()[1]);
393
394 stream << std::dec << "extract(" << high << ", " << low << ", " << node->getChildren()[2] << ")";
395
396 return stream;
397 }
398
399
400 /* forall representation */
401 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::ForallNode* node) {
402 triton::usize size = node->getChildren().size() - 1;
403
404 stream << "forall([";
405 for (triton::uint32 i = 0; i != size; i++) {
406 const auto& var = reinterpret_cast<triton::ast::VariableNode*>(node->getChildren()[i].get())->getSymbolicVariable();
407 if (var->getAlias().empty()) stream << var->getName();
408 else stream << var->getAlias();
409 if (i + 1 != size) stream << ", ";
410 }
411 stream << "], " << node->getChildren()[size] << ")";
412
413 return stream;
414 }
415
416
417 /* iff representation */
418 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::IffNode* node) {
419 stream << "(" << node->getChildren()[0] << " and " << node->getChildren()[1] << ") or (not " << node->getChildren()[0] << " and not " << node->getChildren()[1] << ")";
420 return stream;
421 }
422
423
424 /* integer representation */
425 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::IntegerNode* node) {
426 stream << std::hex << "0x" << node->getInteger() << std::dec;
427 return stream;
428 }
429
430
431 /* ite representation */
432 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::IteNode* node) {
433 stream << "(" << node->getChildren()[1] << " if " << node->getChildren()[0] << " else " << node->getChildren()[2] << ")";
434 return stream;
435 }
436
437
438 /* land representation */
439 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::LandNode* node) {
440 triton::usize size = node->getChildren().size();
441
442 stream << "(" << node->getChildren()[0];
443 for (triton::usize index = 1; index < size; index++)
444 stream << " and " << node->getChildren()[index];
445 stream << ")";
446
447 return stream;
448 }
449
450
451 /* let representation */
452 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::LetNode* node) {
453 stream << node->getChildren()[2];
454 return stream;
455 }
456
457
458 /* lnot representation */
459 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::LnotNode* node) {
460 stream << "not " << node->getChildren()[0];
461 return stream;
462 }
463
464
465 /* lor representation */
466 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::LorNode* node) {
467 triton::usize size = node->getChildren().size();
468
469 stream << "(" << node->getChildren()[0];
470 for (triton::usize index = 1; index < size; index++)
471 stream << " or " << node->getChildren()[index];
472 stream << ")";
473
474 return stream;
475 }
476
477 /* lxor representation */
478 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::LxorNode* node) {
479 triton::usize size = node->getChildren().size();
480
481 stream << "(bool(" << node->getChildren()[0];
482 for (triton::usize index = 1; index < size; index++)
483 stream << ") != bool(" << node->getChildren()[index];
484 stream << "))";
485
486 return stream;
487 }
488
489 /* reference representation */
490 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::ReferenceNode* node) {
491 if (node->isArray()) {
492 stream << "Memory";
493 }
494 else {
495 stream << node->getSymbolicExpression()->getFormattedId();
496 }
497 return stream;
498 }
499
500
501 /* select representation */
502 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::SelectNode* node) {
503 stream << "select(" << node->getChildren()[0] << ", " << node->getChildren()[1] << ")";
504 return stream;
505 }
506
507
508 /* store representation */
509 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::StoreNode* node) {
510 stream << "store(" << node->getChildren()[0] << ", " << node->getChildren()[1] << ", " << node->getChildren()[2] << ")";
511 return stream;
512 }
513
514
515 /* string representation */
516 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::StringNode* node) {
517 stream << node->getString();
518 return stream;
519 }
520
521
522 /* sx representation */
523 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::SxNode* node) {
524 triton::uint32 extend = triton::ast::getInteger<triton::uint32>(node->getChildren()[0]);
525
526 if (extend)
527 stream << "sx(" << node->getChildren()[0] << ", " << node->getChildren()[1] << ")";
528 else
529 stream << node->getChildren()[1];
530
531 return stream;
532 }
533
534
535 /* variable representation */
536 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::VariableNode* node) {
537 if (node->getSymbolicVariable()->getAlias().empty())
538 stream << node->getSymbolicVariable()->getName();
539 else
540 stream << node->getSymbolicVariable()->getAlias();
541 return stream;
542 }
543
544
545 /* zx representation */
546 std::ostream& AstPcodeRepresentation::print(std::ostream& stream, triton::ast::ZxNode* node) {
547 stream << node->getChildren()[1];
548 return stream;
549 }
550
551 };
552 };
553};
Abstract node.
Definition ast.hpp:68
TRITON_EXPORT bool isArray(void) const
Returns true if it's an array node.
Definition ast.cpp:116
TRITON_EXPORT triton::uint32 getBitvectorSize(void) const
Returns the size of the node.
Definition ast.cpp:60
TRITON_EXPORT std::vector< SharedAbstractNode > & getChildren(void)
Returns the children of the node.
Definition ast.cpp:182
TRITON_EXPORT triton::ast::ast_e getType(void) const
Returns the type of the node.
Definition ast.cpp:55
(Array (_ BitVec indexSize) (_ BitVec 8)) node
Definition ast.hpp:193
(assert <expr>) node
Definition ast.hpp:231
(bswap <expr>) node
Definition ast.hpp:242
(_ bv<value> <size>) node
Definition ast.hpp:574
(bvadd <expr1> <expr2>) node
Definition ast.hpp:253
(bvand <expr1> <expr2>) node
Definition ast.hpp:264
(bvashr <expr1> <expr2>) node
Definition ast.hpp:275
(bvlshr <expr1> <expr2>) node
Definition ast.hpp:286
(bvmul <expr1> <expr2>) node
Definition ast.hpp:297
(bvnand <expr1> <expr2>) node
Definition ast.hpp:308
(bvneg <expr>) node
Definition ast.hpp:319
(bvnor <expr1> <expr2>) node
Definition ast.hpp:330
(bvnot <expr>) node
Definition ast.hpp:341
(bvor <expr1> <expr2>) node
Definition ast.hpp:352
((_ rotate_left rot) <expr>) node
Definition ast.hpp:363
((_ rotate_right rot) <expr>) node
Definition ast.hpp:375
(bvsdiv <expr1> <expr2>) node
Definition ast.hpp:387
(bvsge <expr1> <expr2>) node
Definition ast.hpp:398
(bvsgt <expr1> <expr2>) node
Definition ast.hpp:409
(bvshl <expr1> <expr2>) node
Definition ast.hpp:420
(bvsle <expr1> <expr2>) node
Definition ast.hpp:431
(bvslt <expr1> <expr2>) node
Definition ast.hpp:442
(bvsmod <expr1> <expr2>) node
Definition ast.hpp:453
(bvsrem <expr1> <expr2>) node
Definition ast.hpp:464
(bvsub <expr1> <expr2>) node
Definition ast.hpp:475
(bvudiv <expr1> <expr2>) node
Definition ast.hpp:486
(bvuge <expr1> <expr2>) node
Definition ast.hpp:497
(bvugt <expr1> <expr2>) node
Definition ast.hpp:508
(bvule <expr1> <expr2>) node
Definition ast.hpp:519
(bvult <expr1> <expr2>) node
Definition ast.hpp:530
(bvurem <expr1> <expr2>) node
Definition ast.hpp:541
(bvxnor <expr1> <expr2>) node
Definition ast.hpp:552
(bvxor <expr1> <expr2>) node
Definition ast.hpp:563
[<expr1> <expr2> <expr3> ...] node
Definition ast.hpp:585
(concat <expr1> <expr2> ...) node
Definition ast.hpp:601
(declare-fun <var_name> () (_ BitVec <var_size>)) node
Definition ast.hpp:618
(distinct <expr1> <expr2> ...) node
Definition ast.hpp:629
(= <expr1> <expr2> ...) node
Definition ast.hpp:640
((_ extract <high> <low>) <expr>) node
Definition ast.hpp:651
(forall ((x (_ BitVec <size>)), ...) body)
Definition ast.hpp:662
(iff <expr1> <expr2>)
Definition ast.hpp:679
Integer node.
Definition ast.hpp:690
(ite <ifExpr> <thenExpr> <elseExpr>)
Definition ast.hpp:705
(and <expr1> <expr2>)
Definition ast.hpp:716
(let ((<alias> <expr2>)) <expr3>)
Definition ast.hpp:733
(lnot <expr>)
Definition ast.hpp:744
(or <expr1> <expr2>)
Definition ast.hpp:755
(xor <expr1> <expr2>)
Definition ast.hpp:772
Reference node.
Definition ast.hpp:789
(select array index)
Definition ast.hpp:804
(store array index expr)
Definition ast.hpp:816
String node.
Definition ast.hpp:852
((_ sign_extend sizeExt) <expr>) node
Definition ast.hpp:867
Variable node.
Definition ast.hpp:878
((_ zero_extend sizeExt) <expr>) node
Definition ast.hpp:893
TRITON_EXPORT std::ostream & print(std::ostream &stream, triton::ast::AbstractNode *node)
Displays the node according to the representation mode.
The exception class used by all AST node representations.
std::shared_ptr< triton::engines::symbolic::SymbolicVariable > SharedSymbolicVariable
Shared Symbolic variable.
Definition ast.hpp:43
std::size_t usize
unsigned MAX_INT 32 or 64 bits according to the CPU.
std::uint32_t uint32
unisgned 32-bits
The Triton namespace.