ilang  1.1.4
ILAng: A Modeling and Verification Platform for SoCs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros
expr_op.h
Go to the documentation of this file.
1 
4 #ifndef ILANG_ILA_AST_EXPR_OP_H__
5 #define ILANG_ILA_AST_EXPR_OP_H__
6 
7 #include <ilang/ila/ast/expr.h>
8 
10 namespace ilang {
11 
12 // Add new op to the END of the list to ensure backward compatibility
15  kInvalid = 0,
16  kNegate,
17  kNot,
18  kComplement,
19  kAnd,
20  kOr,
21  kXor,
22  kShiftLeft,
23  kArithShiftRight,
24  kLogicShiftRight,
25  kAdd,
26  kSubtract,
27  kMultiply,
28  kEqual,
29  kLessThan,
30  kGreaterThan,
31  kUnsignedLessThan,
32  kUnsignedGreaterThan,
33  kLoad,
34  kStore,
35  kConcatenate,
36  kExtract,
37  kZeroExtend,
38  kSignedExtend,
39  kApplyFunc,
40  kImply,
41  kIfThenElse,
42  kDivide,
43  kRotateLeft,
44  kRotateRight,
45  kSignedRemainder,
46  kUnsignedRemainder,
47  kSignedModular
48 }; // enum AstUidExprOp
49 
50 // Forward declaration.
51 class Func;
52 
55 class ExprOp : public Expr {
56 public:
57  // ------------------------- CONSTRUCTOR/DESTRUCTOR ----------------------- //
59  ExprOp(const ExprPtr& arg);
61  ExprOp(const ExprPtr& arg0, const ExprPtr& arg1);
63  ExprOp(const ExprPtr& arg0, const ExprPtr& arg1, const ExprPtr& arg2);
65  ExprOp(const ExprPtr& arg0, const int& param1);
67  ExprOp(const ExprPtr& arg0, const int& param1, const int& param2);
69  ExprOp(const ExprPtrVec& args);
70 
72  virtual ~ExprOp();
73 
74  // ------------------------- ACCESSORS/MUTATORS --------------------------- //
76  virtual AstUidExprOp uid() const = 0;
77 
79  std::string op_name() const;
80 
82  bool is_op() const { return true; }
83 
84  // ------------------------- METHODS -------------------------------------- //
86  virtual z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
87  const std::string& suffix) const = 0;
88 
90  std::ostream& Print(std::ostream& out) const;
91 
92 protected:
93  // ------------------------- HELPERS -------------------------------------- //
95  SortPtr GetSortBinaryOperation(const ExprPtr& e0, const ExprPtr& e1);
97  SortPtr GetSortBinaryComparison(const ExprPtr& e0, const ExprPtr& e1);
98 
99 private:
100  // ------------------------- MEMBERS -------------------------------------- //
101  InstrLvlAbsPtr GetHost(const ExprSet& args) const;
102 
103 }; // class ExprOp
104 
105 /******************************************************************************/
106 // Unary
107 /******************************************************************************/
108 
110 class ExprOpNeg : public ExprOp {
111 public:
113  ExprOpNeg(const ExprPtr& arg);
114  AstUidExprOp uid() const { return AstUidExprOp::kNegate; }
115  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
116  const std::string& suffix) const;
117 }; // class ExprOpNeg
118 
120 class ExprOpNot : public ExprOp {
121 public:
123  ExprOpNot(const ExprPtr& arg);
124  AstUidExprOp uid() const { return AstUidExprOp::kNot; }
125  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
126  const std::string& suffix) const;
127 }; // class ExprOpNot
128 
130 class ExprOpCompl : public ExprOp {
131 public:
133  ExprOpCompl(const ExprPtr& arg);
134  AstUidExprOp uid() const { return AstUidExprOp::kComplement; }
135  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
136  const std::string& suffix) const;
137 }; // class ExprOpCompl
138 
139 /******************************************************************************/
140 // Binary operation
141 /******************************************************************************/
142 
144 class ExprOpAnd : public ExprOp {
145 public:
147  ExprOpAnd(const ExprPtr& arg0, const ExprPtr& arg1);
148  AstUidExprOp uid() const { return AstUidExprOp::kAnd; }
149  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
150  const std::string& suffix) const;
151 }; // class ExprOpAnd
152 
154 class ExprOpOr : public ExprOp {
155 public:
157  ExprOpOr(const ExprPtr& arg0, const ExprPtr& arg1);
158  AstUidExprOp uid() const { return AstUidExprOp::kOr; }
159  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
160  const std::string& suffix) const;
161 }; // class ExprOpOr
162 
164 class ExprOpXor : public ExprOp {
165 public:
167  ExprOpXor(const ExprPtr& arg0, const ExprPtr& arg1);
168  AstUidExprOp uid() const { return AstUidExprOp::kXor; }
169  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
170  const std::string& suffix) const;
171 }; // class ExprOpXor
172 
174 class ExprOpShl : public ExprOp {
175 public:
177  ExprOpShl(const ExprPtr& bv, const ExprPtr& n);
178  AstUidExprOp uid() const { return AstUidExprOp::kShiftLeft; }
179  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
180  const std::string& suffix) const;
181 }; // class ExprOpShl
182 
184 class ExprOpAshr : public ExprOp {
185 public:
187  ExprOpAshr(const ExprPtr& bv, const ExprPtr& n);
188  AstUidExprOp uid() const { return AstUidExprOp::kArithShiftRight; }
189  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
190  const std::string& suffix) const;
191 }; // class ExprOpAshr
192 
194 class ExprOpLshr : public ExprOp {
195 public:
197  ExprOpLshr(const ExprPtr& bv, const ExprPtr& n);
198  AstUidExprOp uid() const { return AstUidExprOp::kLogicShiftRight; }
199  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
200  const std::string& suffix) const;
201 }; // class ExprOpLshr
202 
204 class ExprOpAdd : public ExprOp {
205 public:
207  ExprOpAdd(const ExprPtr& arg0, const ExprPtr& arg1);
208  AstUidExprOp uid() const { return AstUidExprOp::kAdd; }
209  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
210  const std::string& suffix) const;
211 }; // class ExprOpAdd
212 
214 class ExprOpSub : public ExprOp {
215 public:
217  ExprOpSub(const ExprPtr& arg0, const ExprPtr& arg1);
218  AstUidExprOp uid() const { return AstUidExprOp::kSubtract; }
219  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
220  const std::string& suffix) const;
221 }; // class ExprOpSub
222 
224 class ExprOpDiv : public ExprOp {
225 public:
227  ExprOpDiv(const ExprPtr& arg0, const ExprPtr& arg1);
228  AstUidExprOp uid() const { return AstUidExprOp::kDivide; }
229  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
230  const std::string& suffix) const;
231 }; // class ExprOpDiv
232 
234 class ExprOpSRem : public ExprOp {
235 public:
237  ExprOpSRem(const ExprPtr& arg0, const ExprPtr& arg1);
238  AstUidExprOp uid() const { return AstUidExprOp::kSignedRemainder; }
239  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
240  const std::string& suffix) const;
241 }; // class ExprOpSRem
242 
244 class ExprOpURem : public ExprOp {
245 public:
247  ExprOpURem(const ExprPtr& arg0, const ExprPtr& arg1);
248  AstUidExprOp uid() const { return AstUidExprOp::kUnsignedRemainder; }
249  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
250  const std::string& suffix) const;
251 }; // class ExprOpURem
252 
254 class ExprOpSMod : public ExprOp {
255 public:
257  ExprOpSMod(const ExprPtr& arg0, const ExprPtr& arg1);
258  AstUidExprOp uid() const { return AstUidExprOp::kSignedModular; }
259  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
260  const std::string& suffix) const;
261 }; // class ExprOpSMod
262 
263 // TODO ExprOpUMod
264 
266 class ExprOpMul : public ExprOp {
267 public:
269  ExprOpMul(const ExprPtr& arg0, const ExprPtr& arg1);
270  AstUidExprOp uid() const { return AstUidExprOp::kMultiply; }
271  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
272  const std::string& suffix) const;
273 }; // class ExprOpMul
274 
275 /******************************************************************************/
276 // Binary comparison
277 /******************************************************************************/
278 
280 class ExprOpEq : public ExprOp {
281 public:
283  ExprOpEq(const ExprPtr& arg0, const ExprPtr& arg1);
284  AstUidExprOp uid() const { return AstUidExprOp::kEqual; }
285  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
286  const std::string& suffix) const;
287 }; // class ExprOpEq
288 
289 // Not equal is implemented in asthub with Eq and Not.
290 
292 class ExprOpLt : public ExprOp {
293 public:
295  ExprOpLt(const ExprPtr& arg0, const ExprPtr& arg1);
296  AstUidExprOp uid() const { return AstUidExprOp::kLessThan; }
297  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
298  const std::string& suffix) const;
299 }; // class ExprOpLt
300 
302 class ExprOpGt : public ExprOp {
303 public:
305  ExprOpGt(const ExprPtr& arg0, const ExprPtr& arg1);
306  AstUidExprOp uid() const { return AstUidExprOp::kGreaterThan; }
307  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
308  const std::string& suffix) const;
309 }; // class ExprOpGt
310 
311 // Signed less than or equal to is implemented in asthub with Eq and Lt.
312 
313 // Signed greater than or equal to is implemented in asthub with Eq and Gt.
314 
316 class ExprOpUlt : public ExprOp {
317 public:
319  ExprOpUlt(const ExprPtr& arg0, const ExprPtr& arg1);
320  AstUidExprOp uid() const { return AstUidExprOp::kUnsignedLessThan; }
321  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
322  const std::string& suffix) const;
323 }; // class ExprOpUlt
324 
326 class ExprOpUgt : public ExprOp {
327 public:
329  ExprOpUgt(const ExprPtr& arg0, const ExprPtr& arg1);
330  AstUidExprOp uid() const { return AstUidExprOp::kUnsignedGreaterThan; }
331  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
332  const std::string& suffix) const;
333 }; // class ExprOpUgt
334 
335 // Unsigned less than or equal to is implemented in asthub with Eq and ULt.
336 
337 // Unsigned greater than or equal to is implemented in asthub with Eq and UGt.
338 
339 /******************************************************************************/
340 // Memory
341 /******************************************************************************/
342 
344 class ExprOpLoad : public ExprOp {
345 public:
347  ExprOpLoad(const ExprPtr& mem, const ExprPtr& addr);
348  AstUidExprOp uid() const { return AstUidExprOp::kLoad; }
349  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
350  const std::string& suffix) const;
351 }; // class ExprOpLoad
352 
354 class ExprOpStore : public ExprOp {
355 public:
357  ExprOpStore(const ExprPtr& mem, const ExprPtr& addr, const ExprPtr& data);
358  AstUidExprOp uid() const { return AstUidExprOp::kStore; }
359  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
360  const std::string& suffix) const;
361 }; // class ExprOpStore
362 
363 /******************************************************************************/
364 // Bit-manipulation
365 /******************************************************************************/
366 
368 class ExprOpConcat : public ExprOp {
369 public:
371  ExprOpConcat(const ExprPtr& hi, const ExprPtr& lo);
372  AstUidExprOp uid() const { return AstUidExprOp::kConcatenate; }
373  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
374  const std::string& suffix) const;
375 }; // class ExprOpConcat
376 
378 class ExprOpExtract : public ExprOp {
379 public:
381  ExprOpExtract(const ExprPtr& bv, const int& hi, const int& lo);
382  AstUidExprOp uid() const { return AstUidExprOp::kExtract; }
383  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
384  const std::string& suffix) const;
385 }; // class ExprOpExtract
386 
388 class ExprOpZExt : public ExprOp {
389 public:
391  ExprOpZExt(const ExprPtr& bv, const int& bit_width);
392  AstUidExprOp uid() const { return AstUidExprOp::kZeroExtend; }
393  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
394  const std::string& suffix) const;
395 }; // class ExprOpZExtend
396 
398 class ExprOpSExt : public ExprOp {
399 public:
401  ExprOpSExt(const ExprPtr& bv, const int& bit_width);
402  AstUidExprOp uid() const { return AstUidExprOp::kSignedExtend; }
403  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
404  const std::string& suffix) const;
405 }; // class ExprOpSExt
406 
408 class ExprOpLRotate : public ExprOp {
409 public:
411  ExprOpLRotate(const ExprPtr& bv, const int& immediate);
412  AstUidExprOp uid() const { return AstUidExprOp::kRotateLeft; }
413  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
414  const std::string& suffix) const;
415 }; // class ExprOpLRotate
416 
418 class ExprOpRRotate : public ExprOp {
419 public:
421  ExprOpRRotate(const ExprPtr& bv, const int& immediate);
422  AstUidExprOp uid() const { return AstUidExprOp::kRotateRight; }
423  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
424  const std::string& suffix) const;
425 }; // class ExprOpRRotate
426 
427 /******************************************************************************/
428 // Function usage
429 /******************************************************************************/
430 
432 class ExprOpAppFunc : public ExprOp {
433 public:
435  typedef std::shared_ptr<Func> FuncPtr;
436 
438  ExprOpAppFunc(const FuncPtr& f, const ExprPtrVec& args);
439  AstUidExprOp uid() const { return AstUidExprOp::kApplyFunc; }
440  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
441  const std::string& suffix) const;
442  inline FuncPtr func() const { return f; }
443 
444 private:
446  FuncPtr f;
447 }; // class ExprOpAppFunc
448 
449 /******************************************************************************/
450 // Others
451 /******************************************************************************/
452 
454 class ExprOpImply : public ExprOp {
455 public:
457  ExprOpImply(const ExprPtr& ante, const ExprPtr& cons);
458  AstUidExprOp uid() const { return AstUidExprOp::kImply; }
459  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
460  const std::string& suffix) const;
461 }; // class ExprOpImply
462 
464 class ExprOpIte : public ExprOp {
465 public:
467  ExprOpIte(const ExprPtr& cnd, const ExprPtr& true_expr,
468  const ExprPtr& false_expr);
469  AstUidExprOp uid() const { return AstUidExprOp::kIfThenElse; }
470  z3::expr GetZ3Expr(z3::context& ctx, const Z3ExprVec& expr_vec,
471  const std::string& suffix) const;
472 }; // class ExprOpIte
473 
474 } // namespace ilang
475 
476 #endif // ILANG_ILA_AST_EXPR_OP_H__
ExprOpExtract(const ExprPtr &bv, const int &hi, const int &lo)
Constructor for bitvector extraction.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
The class wrapper for binary comparison unsigned less than.
Definition: expr_op.h:316
std::shared_ptr< Expr > ExprPtr
Pointer type for normal use of Expr.
Definition: expr.h:28
The class wrapper for logical imply.
Definition: expr_op.h:454
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:330
SortPtr GetSortBinaryOperation(const ExprPtr &e0, const ExprPtr &e1)
Derived the sort for binary operations.
The class wrapper for zero-extend.
Definition: expr_op.h:388
ExprOpXor(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for XOR operation.
ExprOpLRotate(const ExprPtr &bv, const int &immediate)
Constructor for LRotate operation.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:270
The wrapper for unary bit-wise complement &quot;~&quot;. (bv only)
Definition: expr_op.h:130
ExprOpAshr(const ExprPtr &bv, const ExprPtr &n)
Constructor for arithmetic right shifting a bit-vector.
Expr::ExprPtr ExprPtr
Pointer type for normal use of Expr.
Definition: expr.h:138
ExprOpConcat(const ExprPtr &hi, const ExprPtr &lo)
Constructor for bitvector concatenation.
ExprOpGt(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for Gt comparison.
The class for expression, which is the basic type for variables, constraints, state update expression...
Definition: expr.h:25
ExprOpSMod(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for SREM operation.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:412
virtual ~ExprOp()
Default destructor.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
The wrapper for left shifting a bit-vector.
Definition: expr_op.h:174
ExprOpRRotate(const ExprPtr &bv, const int &immediate)
Constructor for LRotate operation.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
AstUidExprOp
Unified ID for ExprOp.
Definition: expr_op.h:14
The wrapper for unsigned addition.
Definition: expr_op.h:204
ExprPtr arg(const size_t &i) const
Return the i-th argument.
Definition: expr.h:51
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
Sort::SortPtr SortPtr
Pointer type for storing/passing Sort.
Definition: sort.h:82
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
The wrapper for unsigned division.
Definition: expr_op.h:224
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
ExprOpSExt(const ExprPtr &bv, const int &bit_width)
Constructor for bitvector sign-extend.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:372
ExprOpIte(const ExprPtr &cnd, const ExprPtr &true_expr, const ExprPtr &false_expr)
Constructor for if-then-else.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:422
ExprOpLt(const ExprPtr &arg0, const ExprPtr &arg1)
Construtor for Lt comparison.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:238
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:198
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:178
ExprOpUgt(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for UGt comparison.
The class wrapper for sign-extend.
Definition: expr_op.h:398
ExprOpNot(const ExprPtr &arg)
Constructor for Not operation.
The wrapper for unary not operation &quot;!&quot;. (bool only)
Definition: expr_op.h:120
ExprOpSub(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for SUB operation.
The wrapper for unary negate operation &quot;-&quot;.
Definition: expr_op.h:110
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
std::vector< z3::expr > Z3ExprVec
Vector type for z3 expression.
Definition: defines.h:19
The class wrapper for apply uninterpreted function.
Definition: expr_op.h:432
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:134
ExprOpZExt(const ExprPtr &bv, const int &bit_width)
Constructor for bitvector zero-extend.
The class wrapper for binary comparison signed less than &quot;&lt;&quot;.
Definition: expr_op.h:292
std::unordered_set< ExprPtr, ExprHash > ExprSet
Type for storing a set of Expr.
Definition: expr.h:153
std::vector< ExprPtr > ExprPtrVec
Type for storing a set of Expr.
Definition: expr.h:30
virtual AstUidExprOp uid() const =0
Return the unified ID of the corresponding operation.
The wrapper for unsigned remainder.
Definition: expr_op.h:244
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:208
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:439
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:320
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:218
The wrapper for logical right shifting a bit-vector.
Definition: expr_op.h:194
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:168
The class wrapper for right-rotate.
Definition: expr_op.h:418
ExprOpAnd(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for AND operation.
ExprOpNeg(const ExprPtr &arg)
Constructor for Negate operation.
The wrapper for binary logical XOR operation &quot;^&quot;.
Definition: expr_op.h:164
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
The class wrapper for if-then-else.
Definition: expr_op.h:464
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:148
The wrapper for binary logical AND operation &quot;&amp;&quot;.
Definition: expr_op.h:144
ExprOpUlt(const ExprPtr &arg0, const ExprPtr &arg1)
Construtor for ULt comparison.
Func::FuncPtr FuncPtr
Pointer type for normal use of Func.
Definition: func.h:83
The class wrapper for binary comparison EQ &quot;==&quot;.
Definition: expr_op.h:280
The class wrapper for memory load.
Definition: expr_op.h:344
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:392
ExprOpMul(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for MUL operation.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
SortPtr GetSortBinaryComparison(const ExprPtr &e0, const ExprPtr &e1)
Derived the sort for binary comparisons.
The class wrapper for bitvector extraction.
Definition: expr_op.h:378
The class wrapper for left-rotate.
Definition: expr_op.h:408
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:458
ExprOpSRem(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for SREM operation.
The wrapper for signed remainder.
Definition: expr_op.h:234
The wrapper for binary logical OR operation &quot;|&quot;.
Definition: expr_op.h:154
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
ExprOpImply(const ExprPtr &ante, const ExprPtr &cons)
Constructor for imply.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:284
ExprOpEq(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for Equal comparison.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:124
std::ostream & Print(std::ostream &out) const
Output to stream.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:306
ExprOpDiv(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for DIV operation.
The class wrapper for binary comparison signed greater than &quot;&gt;&quot;.
Definition: expr_op.h:302
InstrLvlAbs::InstrLvlAbsPtr InstrLvlAbsPtr
Pointer type for normal use of InstrLvlAbs.
Definition: instr_lvl_abs.h:326
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:158
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:248
virtual z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const =0
Return the z3 expression for the node.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
ExprOpAppFunc(const FuncPtr &f, const ExprPtrVec &args)
Constructor for apply uninterpreted function.
std::string op_name() const
Return the name of the operation.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:114
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:188
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
ExprOpLoad(const ExprPtr &mem, const ExprPtr &addr)
Constructor for memory load.
std::shared_ptr< Func > FuncPtr
Type for forware declaring Func.
Definition: expr_op.h:435
Expression for operations, e.g. AND, OR, ADD, etc. Operations are non-terminating nodes in the AST...
Definition: expr_op.h:55
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:469
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:258
ExprOpCompl(const ExprPtr &arg)
Constructor for Complement operation.
ExprOpAdd(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for ADD operation.
ExprOpLshr(const ExprPtr &bv, const ExprPtr &n)
Constructor for logical right shifting a bit-vector.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:358
The wrapper for unsigned subtraction.
Definition: expr_op.h:214
ExprOpShl(const ExprPtr &bv, const ExprPtr &n)
Constructor for left shifting a bit-vector.
ExprOpURem(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for UREM operation.
ExprOpOr(const ExprPtr &arg0, const ExprPtr &arg1)
Constructor for OR operation.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
ExprOpStore(const ExprPtr &mem, const ExprPtr &addr, const ExprPtr &data)
Constructor for memory store.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:348
The wrapper for signed remainder.
Definition: expr_op.h:254
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:382
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
bool is_op() const
Return trus since this is an operation.
Definition: expr_op.h:82
The class wrapper for binary comparison unsigned greater than.
Definition: expr_op.h:326
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:296
The class wrapper for memory store.
Definition: expr_op.h:354
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:402
AstUidExprOp uid() const
Return the unified ID of the corresponding operation.
Definition: expr_op.h:228
ExprOp(const ExprPtr &arg)
Constructor for unary operators.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
The wrapper for unsigned multiplication.
Definition: expr_op.h:266
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
The class wrapper for bitvector concatenation.
Definition: expr_op.h:368
z3::expr GetZ3Expr(z3::context &ctx, const Z3ExprVec &expr_vec, const std::string &suffix) const
Return the z3 expression for the node.
The wrapper for arithmetic right shifting a bit-vector.
Definition: expr_op.h:184