Z3
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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 2472 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 2475 of file z3py.py.

Referenced by BitVecNumRef.as_signed_long().

2476  def as_long(self):
2477  """Return a Z3 integer numeral as a Python long (bignum) numeral.
2478 
2479  >>> v = IntVal(1)
2480  >>> v + 1
2481  1 + 1
2482  >>> v.as_long() + 1
2483  2
2484  """
2485  if __debug__:
2486  _z3_assert(self.is_int(), "Integer value expected")
2487  return int(self.as_string())
def is_int
Definition: z3py.py:1930
def as_long
Definition: z3py.py:2475
def as_string
Definition: z3py.py:2488
def as_string (   self)
Return a Z3 integer numeral as a Python string.
>>> v = IntVal(100)
>>> v.as_string()
'100'

Definition at line 2488 of file z3py.py.

Referenced by IntNumRef.as_long(), and BitVecNumRef.as_long().

2489  def as_string(self):
2490  """Return a Z3 integer numeral as a Python string.
2491  >>> v = IntVal(100)
2492  >>> v.as_string()
2493  '100'
2494  """
2495  return Z3_get_numeral_string(self.ctx_ref(), self.as_ast())
def as_ast
Definition: z3py.py:296
Z3_string Z3_API Z3_get_numeral_string(__in Z3_context c, __in Z3_ast a)
Return numeral value, as a string of a numeric constant term.
def ctx_ref
Definition: z3py.py:305
def as_string
Definition: z3py.py:2488