Z3
Public Member Functions | Friends
symbol Class Reference
+ Inheritance diagram for symbol:

Public Member Functions

 symbol (context &c, Z3_symbol s)
 
 symbol (symbol const &s)
 
symboloperator= (symbol const &s)
 
 operator Z3_symbol () const
 
Z3_symbol_kind kind () const
 
std::string str () const
 
int to_int () const
 
- Public Member Functions inherited from object
 object (context &c)
 
 object (object const &s)
 
contextctx () const
 
Z3_error_code check_error () const
 

Friends

std::ostream & operator<< (std::ostream &out, symbol const &s)
 

Additional Inherited Members

- Protected Attributes inherited from object
contextm_ctx
 

Detailed Description

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

Constructor & Destructor Documentation

§ symbol() [1/2]

symbol ( context c,
Z3_symbol  s 
)
inline

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

382 :object(c), m_sym(s) {}
object(context &c)
Definition: z3++.h:371

§ symbol() [2/2]

symbol ( symbol const &  s)
inline

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

383 :object(s), m_sym(s.m_sym) {}
object(context &c)
Definition: z3++.h:371

Member Function Documentation

§ kind()

Z3_symbol_kind kind ( ) const
inline

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

Referenced by z3::operator<<().

386 { return Z3_get_symbol_kind(ctx(), m_sym); }
Z3_symbol_kind Z3_API Z3_get_symbol_kind(Z3_context c, Z3_symbol s)
Return Z3_INT_SYMBOL if the symbol was constructed using Z3_mk_int_symbol, and Z3_STRING_SYMBOL if th...
context & ctx() const
Definition: z3++.h:373

§ operator Z3_symbol()

operator Z3_symbol ( ) const
inline

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

385 { return m_sym; }

§ operator=()

symbol& operator= ( symbol const &  s)
inline

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

384 { m_ctx = s.m_ctx; m_sym = s.m_sym; return *this; }
context * m_ctx
Definition: z3++.h:369

§ str()

std::string str ( ) const
inline

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

Referenced by z3::operator<<().

387 { assert(kind() == Z3_STRING_SYMBOL); return Z3_get_symbol_string(ctx(), m_sym); }
Z3_symbol_kind kind() const
Definition: z3++.h:386
context & ctx() const
Definition: z3++.h:373
Z3_string Z3_API Z3_get_symbol_string(Z3_context c, Z3_symbol s)
Return the symbol name.

§ to_int()

int to_int ( ) const
inline

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

Referenced by z3::operator<<().

388 { assert(kind() == Z3_INT_SYMBOL); return Z3_get_symbol_int(ctx(), m_sym); }
Z3_symbol_kind kind() const
Definition: z3++.h:386
context & ctx() const
Definition: z3++.h:373
int Z3_API Z3_get_symbol_int(Z3_context c, Z3_symbol s)
Return the symbol int value.

Friends And Related Function Documentation

§ operator<<

std::ostream& operator<< ( std::ostream &  out,
symbol const &  s 
)
friend

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

392  {
393  if (s.kind() == Z3_INT_SYMBOL)
394  out << "k!" << s.to_int();
395  else
396  out << s.str().c_str();
397  return out;
398  }