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
 
- Public Member Functions inherited from object
 object (context &c)
 
 object (object const &s)
 
contextctx () const
 
void 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 409 of file z3++.h.

Constructor & Destructor Documentation

§ ast() [1/3]

ast ( context c)
inline

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

413 :object(c), m_ast(0) {}
object(context &c)
Definition: z3++.h:330
Z3_ast m_ast
Definition: z3++.h:411

§ ast() [2/3]

ast ( context c,
Z3_ast  n 
)
inline

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

414 :object(c), m_ast(n) { Z3_inc_ref(ctx(), m_ast); }
context & ctx() const
Definition: z3++.h:332
object(context &c)
Definition: z3++.h:330
Z3_ast m_ast
Definition: z3++.h:411
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() [3/3]

ast ( ast const &  s)
inline

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

415 :object(s), m_ast(s.m_ast) { Z3_inc_ref(ctx(), m_ast); }
context & ctx() const
Definition: z3++.h:332
object(context &c)
Definition: z3++.h:330
Z3_ast m_ast
Definition: z3++.h:411
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 ( )
inline

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

416 { 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:411
context * m_ctx
Definition: z3++.h:328

Member Function Documentation

§ hash()

unsigned hash ( ) const
inline

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

Referenced by AstRef::__hash__().

421 { unsigned r = Z3_get_ast_hash(ctx(), m_ast); check_error(); return r; }
context & ctx() const
Definition: z3++.h:332
Z3_ast m_ast
Definition: z3++.h:411
void check_error() const
Definition: z3++.h:333

§ kind()

Z3_ast_kind kind ( ) const
inline

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

420 { Z3_ast_kind r = Z3_get_ast_kind(ctx(), m_ast); check_error(); return r; }
context & ctx() const
Definition: z3++.h:332
Z3_ast_kind
The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types...
Definition: z3_api.h:183
Z3_ast m_ast
Definition: z3++.h:411
void check_error() const
Definition: z3++.h:333

§ operator bool()

operator bool ( ) const
inline

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

418 { return m_ast != 0; }
Z3_ast m_ast
Definition: z3++.h:411

§ operator Z3_ast()

operator Z3_ast ( ) const
inline

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

417 { return m_ast; }
Z3_ast m_ast
Definition: z3++.h:411

§ operator=()

ast& operator= ( ast const &  s)
inline

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

Referenced by sort::operator=(), func_decl::operator=(), and expr::operator=().

419 { Z3_inc_ref(s.ctx(), s.m_ast); if (m_ast) Z3_dec_ref(ctx(), m_ast); m_ctx = s.m_ctx; m_ast = s.m_ast; return *this; }
context & ctx() const
Definition: z3++.h:332
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:411
context * m_ctx
Definition: z3++.h:328
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_...

Friends And Related Function Documentation

§ eq

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

Return true if the ASTs are structurally identical.

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

Referenced by AstRef::__eq__(), SortRef::cast(), and BoolSortRef::cast().

433 { return Z3_is_eq_ast(a.ctx(), a, b) != 0; }

§ operator<<

std::ostream& operator<< ( std::ostream &  out,
ast const &  n 
)
friend

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

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

Field Documentation

§ m_ast

Z3_ast m_ast
protected

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

Referenced by z3::operator<<(), and ast::operator=().