Z3
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions
IntNumRef Class Reference
+ Inheritance diagram for IntNumRef:

Public Member Functions

def as_long
 
def as_string
 
- Public Member Functions inherited from ArithRef
def sort
 
def is_int
 
def is_real
 
def __add__
 
def __radd__
 
def __mul__
 
def __rmul__
 
def __sub__
 
def __rsub__
 
def __pow__
 
def __rpow__
 
def __div__
 
def __truediv__
 
def __rdiv__
 
def __rtruediv__
 
def __mod__
 
def __rmod__
 
def __neg__
 
def __pos__
 
def __le__
 
def __lt__
 
def __gt__
 
def __ge__
 
- Public Member Functions inherited from ExprRef
def as_ast
 
def get_id
 
def sort
 
def sort_kind
 
def __eq__
 
def __ne__
 
def decl
 
def num_args
 
def arg
 
def children
 
- Public Member Functions inherited from AstRef
def __init__
 
def __del__
 
def __str__
 
def __repr__
 
def sexpr
 
def as_ast
 
def get_id
 
def ctx_ref
 
def eq
 
def translate
 
def hash
 
- Public Member Functions inherited from Z3PPObject
def use_pp
 

Additional Inherited Members

- Data Fields inherited from AstRef
 ast
 
 ctx
 

Detailed Description

Integer values.

Definition at line 2497 of file z3py.py.

Member Function Documentation

def as_long (   self)
Return a Z3 integer numeral as a Python long (bignum) numeral. 

>>> v = IntVal(1)
>>> v + 1
1 + 1
>>> v.as_long() + 1
2

Definition at line 2500 of file z3py.py.

2501  def as_long(self):
2502  """Return a Z3 integer numeral as a Python long (bignum) numeral.
2503 
2504  >>> v = IntVal(1)
2505  >>> v + 1
2506  1 + 1
2507  >>> v.as_long() + 1
2508  2
2509  """
2510  if __debug__:
2511  _z3_assert(self.is_int(), "Integer value expected")
2512  return int(self.as_string())
def is_int
Definition: z3py.py:1955
def as_long
Definition: z3py.py:2500
def as_string
Definition: z3py.py:2513
def as_string (   self)
Return a Z3 integer numeral as a Python string.
>>> v = IntVal(100)
>>> v.as_string()
'100'

Definition at line 2513 of file z3py.py.

Referenced by IntNumRef.as_long().

2514  def as_string(self):
2515  """Return a Z3 integer numeral as a Python string.
2516  >>> v = IntVal(100)
2517  >>> v.as_string()
2518  '100'
2519  """
2520  return Z3_get_numeral_string(self.ctx_ref(), self.as_ast())
Z3_string Z3_API Z3_get_numeral_string(Z3_context c, Z3_ast a)
Return numeral value, as a string of a numeric constant term.
def as_ast
Definition: z3py.py:296
def ctx_ref
Definition: z3py.py:304
def as_string
Definition: z3py.py:2513