Z3
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions
sort Class Reference

A Z3 sort (aka type). Every expression (i.e., formula or term) in Z3 has a sort. More...

+ Inheritance diagram for sort:

Public Member Functions

 sort (context &c)
 
 sort (context &c, Z3_sort s)
 
 sort (sort const &s)
 
 operator Z3_sort () const
 
sortoperator= (sort const &s)
 Return true if this sort and s are equal. More...
 
Z3_sort_kind sort_kind () const
 Return the internal sort kind. More...
 
bool is_bool () const
 Return true if this sort is the Boolean sort. More...
 
bool is_int () const
 Return true if this sort is the Integer sort. More...
 
bool is_real () const
 Return true if this sort is the Real sort. More...
 
bool is_arith () const
 Return true if this sort is the Integer or Real sort. More...
 
bool is_bv () const
 Return true if this sort is a Bit-vector sort. More...
 
bool is_array () const
 Return true if this sort is a Array sort. More...
 
bool is_datatype () const
 Return true if this sort is a Datatype sort. More...
 
bool is_relation () const
 Return true if this sort is a Relation sort. More...
 
bool is_finite_domain () const
 Return true if this sort is a Finite domain sort. More...
 
unsigned bv_size () const
 Return the size of this Bit-vector sort. More...
 
sort array_domain () const
 Return the domain of this Array sort. More...
 
sort array_range () const
 Return the range of this Array sort. More...
 
- Public Member Functions inherited from ast
 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
 

Additional Inherited Members

- Protected Attributes inherited from ast
Z3_ast m_ast
 
- Protected Attributes inherited from object
contextm_ctx
 

Detailed Description

A Z3 sort (aka type). Every expression (i.e., formula or term) in Z3 has a sort.

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

Constructor & Destructor Documentation

sort ( context c)
inline

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

Referenced by sort::array_domain(), sort::array_range(), ArrayRef::domain(), ArrayRef::range(), and ExprRef::sort_kind().

352 :ast(c) {}
ast(context &c)
Definition: z3++.h:325
sort ( context c,
Z3_sort  s 
)
inline

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

Referenced by ArrayRef::domain(), ArrayRef::range(), and ExprRef::sort_kind().

353 :ast(c, reinterpret_cast<Z3_ast>(s)) {}
ast(context &c)
Definition: z3++.h:325
sort ( sort const &  s)
inline

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

Referenced by ArrayRef::domain(), ArrayRef::range(), and ExprRef::sort_kind().

354 :ast(s) {}
ast(context &c)
Definition: z3++.h:325

Member Function Documentation

sort array_domain ( ) const
inline

Return the domain of this Array sort.

Precondition
is_array()

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

Referenced by z3::select(), and z3::store().

414 { assert(is_array()); Z3_sort s = Z3_get_array_sort_domain(ctx(), *this); check_error(); return sort(ctx(), s); }
context & ctx() const
Definition: z3++.h:272
Z3_sort Z3_API Z3_get_array_sort_domain(__in Z3_context c, __in Z3_sort t)
Return the domain of the given array sort.
void check_error() const
Definition: z3++.h:273
sort(context &c)
Definition: z3++.h:352
bool is_array() const
Return true if this sort is a Array sort.
Definition: z3++.h:388
sort array_range ( ) const
inline

Return the range of this Array sort.

Precondition
is_array()

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

Referenced by z3::store().

420 { assert(is_array()); Z3_sort s = Z3_get_array_sort_range(ctx(), *this); check_error(); return sort(ctx(), s); }
Z3_sort Z3_API Z3_get_array_sort_range(__in Z3_context c, __in Z3_sort t)
Return the range of the given array sort.
context & ctx() const
Definition: z3++.h:272
void check_error() const
Definition: z3++.h:273
sort(context &c)
Definition: z3++.h:352
bool is_array() const
Return true if this sort is a Array sort.
Definition: z3++.h:388
unsigned bv_size ( ) const
inline

Return the size of this Bit-vector sort.

Precondition
is_bv()

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

407 { assert(is_bv()); unsigned r = Z3_get_bv_sort_size(ctx(), *this); check_error(); return r; }
bool is_bv() const
Return true if this sort is a Bit-vector sort.
Definition: z3++.h:384
context & ctx() const
Definition: z3++.h:272
void check_error() const
Definition: z3++.h:273
unsigned Z3_API Z3_get_bv_sort_size(__in Z3_context c, __in Z3_sort t)
Return the size of the given bit-vector sort.
bool is_arith ( ) const
inline

Return true if this sort is the Integer or Real sort.

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

Referenced by expr::is_arith().

380 { return is_int() || is_real(); }
bool is_int() const
Return true if this sort is the Integer sort.
Definition: z3++.h:372
bool is_real() const
Return true if this sort is the Real sort.
Definition: z3++.h:376
bool is_array ( ) const
inline

Return true if this sort is a Array sort.

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

Referenced by sort::array_domain(), sort::array_range(), and expr::is_array().

388 { return sort_kind() == Z3_ARRAY_SORT; }
Z3_sort_kind sort_kind() const
Return the internal sort kind.
Definition: z3++.h:363
bool is_bool ( ) const
inline

Return true if this sort is the Boolean sort.

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

Referenced by expr::is_bool().

368 { return sort_kind() == Z3_BOOL_SORT; }
Z3_sort_kind sort_kind() const
Return the internal sort kind.
Definition: z3++.h:363
bool is_bv ( ) const
inline

Return true if this sort is a Bit-vector sort.

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

Referenced by sort::bv_size(), and expr::is_bv().

384 { return sort_kind() == Z3_BV_SORT; }
Z3_sort_kind sort_kind() const
Return the internal sort kind.
Definition: z3++.h:363
bool is_datatype ( ) const
inline

Return true if this sort is a Datatype sort.

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

Referenced by expr::is_datatype().

392 { return sort_kind() == Z3_DATATYPE_SORT; }
Z3_sort_kind sort_kind() const
Return the internal sort kind.
Definition: z3++.h:363
bool is_finite_domain ( ) const
inline

Return true if this sort is a Finite domain sort.

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

Referenced by expr::is_finite_domain().

400 { return sort_kind() == Z3_FINITE_DOMAIN_SORT; }
Z3_sort_kind sort_kind() const
Return the internal sort kind.
Definition: z3++.h:363
bool is_int ( ) const
inline

Return true if this sort is the Integer sort.

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

Referenced by sort::is_arith(), and expr::is_int().

372 { return sort_kind() == Z3_INT_SORT; }
Z3_sort_kind sort_kind() const
Return the internal sort kind.
Definition: z3++.h:363
bool is_real ( ) const
inline

Return true if this sort is the Real sort.

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

Referenced by sort::is_arith(), and expr::is_real().

376 { return sort_kind() == Z3_REAL_SORT; }
Z3_sort_kind sort_kind() const
Return the internal sort kind.
Definition: z3++.h:363
bool is_relation ( ) const
inline

Return true if this sort is a Relation sort.

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

Referenced by expr::is_relation().

396 { return sort_kind() == Z3_RELATION_SORT; }
Z3_sort_kind sort_kind() const
Return the internal sort kind.
Definition: z3++.h:363
operator Z3_sort ( ) const
inline

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

355 { return reinterpret_cast<Z3_sort>(m_ast); }
Z3_ast m_ast
Definition: z3++.h:323
sort& operator= ( sort const &  s)
inline

Return true if this sort and s are equal.

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

359 { return static_cast<sort&>(ast::operator=(s)); }
sort(context &c)
Definition: z3++.h:352
ast & operator=(ast const &s)
Definition: z3++.h:331
Z3_sort_kind sort_kind ( ) const
inline

Return the internal sort kind.

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

Referenced by sort::is_array(), sort::is_bool(), sort::is_bv(), sort::is_datatype(), sort::is_finite_domain(), sort::is_int(), sort::is_real(), and sort::is_relation().

363 { return Z3_get_sort_kind(*m_ctx, *this); }
Z3_sort_kind Z3_API Z3_get_sort_kind(__in Z3_context c, __in Z3_sort t)
Return the sort kind (e.g., array, tuple, int, bool, etc).
context * m_ctx
Definition: z3++.h:268