ilang  1.1.4
ILAng: A Modeling and Verification Platform for SoCs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros
expr_var.h
Go to the documentation of this file.
1 
4 #ifndef ILANG_ILA_AST_EXPR_VAR_H__
5 #define ILANG_ILA_AST_EXPR_VAR_H__
6 
7 #include <string>
8 
9 #include <ilang/ila/ast/expr.h>
10 
12 namespace ilang {
13 
16 class ExprVar : public Expr {
17 public:
18  // ------------------------- CONSTRUCTOR/DESTRUCTOR ----------------------- //
20  ExprVar(const std::string& name);
22  ExprVar(const std::string& name, const int& bit_width);
24  ExprVar(const std::string& name, const int& addr_width,
25  const int& data_width);
26 
28  ~ExprVar();
29 
30  // ------------------------- ACCESSORS/MUTATORS --------------------------- //
32  bool is_var() const { return true; }
33 
34  // ------------------------- METHODS -------------------------------------- //
35 
37  z3::expr GetZ3Expr(z3::context& z3_ctx, const Z3ExprVec& z3expr_vec,
38  const std::string& suffix = "") const;
39 
41  std::ostream& Print(std::ostream& out) const;
42 
43 private:
44  // ------------------------- MEMBERS -------------------------------------- //
45 
46  // ------------------------- HELPERS -------------------------------------- //
48  std::ostream& PrintBool(std::ostream& out) const;
50  std::ostream& PrintBv(std::ostream& out) const;
52  std::ostream& PrintMem(std::ostream& out) const;
53 
54 }; // class ExprVar
55 
56 } // namespace ilang
57 
58 #endif // ILANG_ILA_AST_EXPR_VAR_H__
std::ostream & Print(std::ostream &out) const
Output to stream.
The class for expression, which is the basic type for variables, constraints, state update expression...
Definition: expr.h:25
std::vector< z3::expr > Z3ExprVec
Vector type for z3 expression.
Definition: defines.h:19
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_var() const
Return true since this is a variable.
Definition: expr_var.h:32
ExprVar(const std::string &name)
Constructor for Boolean variable.
~ExprVar()
Default destructor.
Expression for variables (bool, bv, or mem). Variable should be the terminating nodes in the AST...
Definition: expr_var.h:16
const Symbol & name() const
Get the symbol (name).