Z3
Loading...
Searching...
No Matches
ComplexSortRef Class Reference
Inheritance diagram for ComplexSortRef:

Public Member Functions

 subsort (self, other)
 cast (self, val)
Public Member Functions inherited from ArithSortRef
 is_real (self)
 is_int (self)
 is_bool (self)
Public Member Functions inherited from SortRef
 as_ast (self)
 get_id (self)
 kind (self)
 name (self)
 __eq__ (self, other)
 __ne__ (self, other)
 __gt__ (self, other)
 __hash__ (self)
Public Member Functions inherited from AstRef
 __init__ (self, ast, ctx=None)
 __del__ (self)
 __deepcopy__ (self, memo={})
 __str__ (self)
 __repr__ (self)
 __eq__ (self, other)
 __hash__ (self)
 __nonzero__ (self)
 __bool__ (self)
 sexpr (self)
 ctx_ref (self)
 eq (self, other)
 translate (self, target)
 __copy__ (self)
 hash (self)
 py_value (self)
Public Member Functions inherited from Z3PPObject
 use_pp (self)

Additional Inherited Members

Data Fields inherited from AstRef
 ast = ast
 ctx = _get_ctx(ctx)
Protected Member Functions inherited from Z3PPObject
 _repr_html_ (self)

Detailed Description

The Complex sort, represented by pairs of Reals.

Definition at line 3311 of file z3py.py.

Member Function Documentation

◆ cast()

cast ( self,
val )
Try to cast `val` as an Integer or Real.

>>> IntSort().cast(10)
10
>>> is_int(IntSort().cast(10))
True
>>> is_int(10)
False
>>> RealSort().cast(10)
10
>>> is_real(RealSort().cast(10))
True

Reimplemented from ArithSortRef.

Definition at line 3317 of file z3py.py.

3317 def cast(self, val):
3318 if is_expr(val):
3319 _z3_assert(self.ctx == val.ctx, "Context mismatch")
3320 if self.eq(val.sort()):
3321 return val
3322 return ComplexVal(val, ctx=self.ctx)
3323
3324

◆ subsort()

subsort ( self,
other )
Return `True` if `self` is a subsort of `other`.

Reimplemented from ArithSortRef.

Definition at line 3314 of file z3py.py.

3314 def subsort(self, other):
3315 return False
3316