ilang  1.1.4
ILAng: A Modeling and Verification Platform for SoCs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros
expr_const.h
Go to the documentation of this file.
1 
4 #ifndef ILANG_ILA_AST_EXPR_CONST_H__
5 #define ILANG_ILA_AST_EXPR_CONST_H__
6 
7 #include <ilang/ila/ast/expr.h>
9 
11 namespace ilang {
12 
15 class ExprConst : public Expr {
16 public:
17  // ------------------------- CONSTRUCTOR/DESTRUCTOR ----------------------- //
19  ExprConst(const BoolVal& bool_val);
21  ExprConst(const BvVal& bv_val, const int& bit_width);
23  ExprConst(const MemVal& mem_val, const int& addr_width,
24  const int& data_width);
26  ~ExprConst();
27 
28  // ------------------------- ACCESSORS/MUTATORS --------------------------- //
30  bool is_const() const { return true; }
31 
32  // ------------------------- METHODS -------------------------------------- //
34  z3::expr GetZ3Expr(z3::context& z3_ctx, const Z3ExprVec& z3expr_vec,
35  const std::string& suffix = "") const;
36 
38  std::ostream& Print(std::ostream& out) const;
39 
41  BoolValPtr val_bool() const;
43  BvValPtr val_bv() const;
45  MemValPtr val_mem() const;
46 
47 private:
48  // ------------------------- MEMBERS -------------------------------------- //
50  ValPtr val_;
51 
52 }; // class ExprConst
53 
54 } // namespace ilang
55 
56 #endif // ILANG_ILA_AST_EXPR_CONST_H__
~ExprConst()
Default destructor.
ExprConst(const BoolVal &bool_val)
Constructor for Boolean constant.
MemValPtr val_mem() const
Return the Memory value.
Value::ValPtr ValPtr
Pointer type for all use of Value.
Definition: sort_value.h:27
The class for expression, which is the basic type for variables, constraints, state update expression...
Definition: expr.h:25
MemVal::MemValPtr MemValPtr
Pointer type for all use of MemVal.
Definition: sort_value.h:153
The container for representing Boolean values.
Definition: sort_value.h:30
std::vector< z3::expr > Z3ExprVec
Vector type for z3 expression.
Definition: defines.h:19
BoolVal::BoolValPtr BoolValPtr
Pointer type for all use of BoolVal.
Definition: sort_value.h:65
BvValPtr val_bv() const
Return the Bitvector value.
BvVal::BvValPtr BvValPtr
Pointer type for all use of BvVal.
Definition: sort_value.h:105
std::ostream & Print(std::ostream &out) const
Output to stream.
The container for representing memory (array) values.
Definition: sort_value.h:111
BoolValPtr val_bool() const
Return the Boolean value.
Expression for constant values (bool, bv, or memory). Constant should be terminating nodes in the AST...
Definition: expr_const.h:15
The container for representing Bitvector values.
Definition: sort_value.h:68
z3::expr GetZ3Expr(z3::context &z3_ctx, const Z3ExprVec &z3expr_vec, const std::string &suffix="") const
Return the z3 expression for the node.
bool is_const() const
Return true since this is a constant.
Definition: expr_const.h:30