Z3
Public Member Functions | Protected Attributes | Friends
ast Class Reference
+ Inheritance diagram for ast:

Public Member Functions

 ast (context &c)
 
 ast (context &c, Z3_ast n)
 
 ast (ast const &s)
 
 ~ast ()
 
 operator Z3_ast () const
 
 operator bool () const
 
astoperator= (ast const &s)
 
Z3_ast_kind kind () const
 
unsigned hash () const
 
std::string to_string () const
 
- Public Member Functions inherited from object
 object (context &c)
 
contextctx () const
 
Z3_error_code check_error () const
 

Protected Attributes

Z3_ast m_ast
 
- Protected Attributes inherited from object
contextm_ctx
 

Friends

std::ostream & operator<< (std::ostream &out, ast const &n)
 
bool eq (ast const &a, ast const &b)
 Return true if the ASTs are structurally identical. More...
 

Detailed Description

Definition at line 550 of file z3++.h.

Constructor & Destructor Documentation

ast ( context c)
inline

Definition at line 554 of file z3++.h.

554 :object(c), m_ast(0) {}
object(context &c)
Definition: z3++.h:472
Z3_ast m_ast
Definition: z3++.h:552
ast ( context c,
Z3_ast  n 
)
inline

Definition at line 555 of file z3++.h.

555 :object(c), m_ast(n) { Z3_inc_ref(ctx(), m_ast); }
context & ctx() const
Definition: z3++.h:473
object(context &c)
Definition: z3++.h:472
Z3_ast m_ast
Definition: z3++.h:552
void Z3_API Z3_inc_ref(Z3_context c, Z3_ast a)
Increment the reference counter of the given AST. The context c should have been created using Z3_mk_...
ast ( ast const &  s)
inline

Definition at line 556 of file z3++.h.

556 :object(s), m_ast(s.m_ast) { Z3_inc_ref(ctx(), m_ast); }
context & ctx() const
Definition: z3++.h:473
object(context &c)
Definition: z3++.h:472
Z3_ast m_ast
Definition: z3++.h:552
void Z3_API Z3_inc_ref(Z3_context c, Z3_ast a)
Increment the reference counter of the given AST. The context c should have been created using Z3_mk_...
~ast ( )
inline

Definition at line 557 of file z3++.h.

557 { if (m_ast) { Z3_dec_ref(*m_ctx, m_ast); } }
void Z3_API Z3_dec_ref(Z3_context c, Z3_ast a)
Decrement the reference counter of the given AST. The context c should have been created using Z3_mk_...
Z3_ast m_ast
Definition: z3++.h:552
context * m_ctx
Definition: z3++.h:470

Member Function Documentation

unsigned hash ( ) const
inline

Definition at line 569 of file z3++.h.

569 { unsigned r = Z3_get_ast_hash(ctx(), m_ast); check_error(); return r; }
Z3_error_code check_error() const
Definition: z3++.h:474
context & ctx() const
Definition: z3++.h:473
unsigned Z3_API Z3_get_ast_hash(Z3_context c, Z3_ast a)
Return a hash code for the given AST. The hash code is structural but two different AST objects can m...
Z3_ast m_ast
Definition: z3++.h:552
Z3_ast_kind kind ( ) const
inline

Definition at line 568 of file z3++.h.

Referenced by expr::is_app(), expr::is_numeral(), expr::is_quantifier(), and expr::is_var().

568 { Z3_ast_kind r = Z3_get_ast_kind(ctx(), m_ast); check_error(); return r; }
Z3_error_code check_error() const
Definition: z3++.h:474
Z3_ast_kind Z3_API Z3_get_ast_kind(Z3_context c, Z3_ast a)
Return the kind of the given AST.
Z3_ast_kind
The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types...
Definition: z3_api.h:140
context & ctx() const
Definition: z3++.h:473
Z3_ast m_ast
Definition: z3++.h:552
operator bool ( ) const
inline

Definition at line 559 of file z3++.h.

559 { return m_ast != 0; }
Z3_ast m_ast
Definition: z3++.h:552
operator Z3_ast ( ) const
inline

Definition at line 558 of file z3++.h.

558 { return m_ast; }
Z3_ast m_ast
Definition: z3++.h:552
ast& operator= ( ast const &  s)
inline

Definition at line 560 of file z3++.h.

560  {
561  Z3_inc_ref(s.ctx(), s.m_ast);
562  if (m_ast)
563  Z3_dec_ref(ctx(), m_ast);
564  object::operator=(s);
565  m_ast = s.m_ast;
566  return *this;
567  }
void Z3_API Z3_dec_ref(Z3_context c, Z3_ast a)
Decrement the reference counter of the given AST. The context c should have been created using Z3_mk_...
context & ctx() const
Definition: z3++.h:473
Z3_ast m_ast
Definition: z3++.h:552
void Z3_API Z3_inc_ref(Z3_context c, Z3_ast a)
Increment the reference counter of the given AST. The context c should have been created using Z3_mk_...
std::string to_string ( ) const
inline

Definition at line 571 of file z3++.h.

571 { return std::string(Z3_ast_to_string(ctx(), m_ast)); }
Z3_string Z3_API Z3_ast_to_string(Z3_context c, Z3_ast a)
Convert the given AST node into a string.
context & ctx() const
Definition: z3++.h:473
Z3_ast m_ast
Definition: z3++.h:552

Friends And Related Function Documentation

bool eq ( ast const &  a,
ast const &  b 
)
friend

Return true if the ASTs are structurally identical.

Definition at line 583 of file z3++.h.

583 { return Z3_is_eq_ast(a.ctx(), a, b); }
bool Z3_API Z3_is_eq_ast(Z3_context c, Z3_ast t1, Z3_ast t2)
Compare terms.
std::ostream& operator<< ( std::ostream &  out,
ast const &  n 
)
friend

Definition at line 579 of file z3++.h.

579  {
580  out << Z3_ast_to_string(n.ctx(), n.m_ast); return out;
581  }
Z3_string Z3_API Z3_ast_to_string(Z3_context c, Z3_ast a)
Convert the given AST node into a string.

Field Documentation

Z3_ast m_ast
protected