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

Public Member Functions

 subsort (self, other)
 cast (self, val)
Public Member Functions inherited from SortRef
 as_ast (self)
 get_id (self)
 kind (self)
 name (self)
 __eq__ (self, other)
 __ne__ (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

Type variable reference

Definition at line 727 of file z3py.py.

Member Function Documentation

◆ cast()

cast ( self,
val )
Try to cast `val` as an element of sort `self`.

This method is used in Z3Py to convert Python objects such as integers,
floats, longs and strings into Z3 expressions.

>>> x = Int('x')
>>> RealSort().cast(x)
ToReal(x)

Reimplemented from SortRef.

Definition at line 733 of file z3py.py.

733 def cast(self, val):
734 return val
735
736

◆ subsort()

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

>>> IntSort().subsort(RealSort())
True

Reimplemented from SortRef.

Definition at line 730 of file z3py.py.

730 def subsort(self, other):
731 return True
732