Z3
Public Member Functions
SeqRef Class Reference
+ Inheritance diagram for SeqRef:

Public Member Functions

def sort (self)
 
def __add__ (self, other)
 
def __radd__ (self, other)
 
def __getitem__ (self, i)
 
def at (self, i)
 
def is_string (self)
 
def is_string_value (self)
 
def as_string (self)
 
def __le__ (self, other)
 
def __lt__ (self, other)
 
def __ge__ (self, other)
 
def __gt__ (self, other)
 
- Public Member Functions inherited from ExprRef
def as_ast (self)
 
def get_id (self)
 
def sort_kind (self)
 
def __eq__ (self, other)
 
def __hash__ (self)
 
def __ne__ (self, other)
 
def params (self)
 
def decl (self)
 
def num_args (self)
 
def arg (self, idx)
 
def children (self)
 
- Public Member Functions inherited from AstRef
def __init__ (self, ast, ctx=None)
 
def __del__ (self)
 
def __deepcopy__ (self, memo={})
 
def __str__ (self)
 
def __repr__ (self)
 
def __nonzero__ (self)
 
def __bool__ (self)
 
def sexpr (self)
 
def ctx_ref (self)
 
def eq (self, other)
 
def translate (self, target)
 
def __copy__ (self)
 
def hash (self)
 
- Public Member Functions inherited from Z3PPObject
def use_pp (self)
 

Additional Inherited Members

- Data Fields inherited from AstRef
 ast
 
 ctx
 

Detailed Description

Sequence expression.

Definition at line 9990 of file z3py.py.

Member Function Documentation

◆ __add__()

def __add__ (   self,
  other 
)

Definition at line 9996 of file z3py.py.

9996  def __add__(self, other):
9997  return Concat(self, other)
9998 
def Concat(*args)
Definition: z3py.py:3817

◆ __ge__()

def __ge__ (   self,
  other 
)

Definition at line 10030 of file z3py.py.

10030  def __ge__(self, other):
10031  return SeqRef(Z3_mk_str_le(self.ctx_ref(), other.as_ast(), self.as_ast()), self.ctx)
10032 
Z3_ast Z3_API Z3_mk_str_le(Z3_context c, Z3_ast prefix, Z3_ast s)
Check if s1 is equal or lexicographically strictly less than s2.

◆ __getitem__()

def __getitem__ (   self,
  i 
)

Definition at line 10002 of file z3py.py.

10002  def __getitem__(self, i):
10003  if _is_int(i):
10004  i = IntVal(i, self.ctx)
10005  return _to_expr_ref(Z3_mk_seq_nth(self.ctx_ref(), self.as_ast(), i.as_ast()), self.ctx)
10006 
def IntVal(val, ctx=None)
Definition: z3py.py:2958
Z3_ast Z3_API Z3_mk_seq_nth(Z3_context c, Z3_ast s, Z3_ast index)
Retrieve from s the element positioned at position index. The function is under-specified if the inde...

◆ __gt__()

def __gt__ (   self,
  other 
)

Definition at line 10033 of file z3py.py.

10033  def __gt__(self, other):
10034  return SeqRef(Z3_mk_str_lt(self.ctx_ref(), other.as_ast(), self.as_ast()), self.ctx)
10035 
10036 
Z3_ast Z3_API Z3_mk_str_lt(Z3_context c, Z3_ast prefix, Z3_ast s)
Check if s1 is lexicographically strictly less than s2.

◆ __le__()

def __le__ (   self,
  other 
)

Definition at line 10024 of file z3py.py.

10024  def __le__(self, other):
10025  return SeqRef(Z3_mk_str_le(self.ctx_ref(), self.as_ast(), other.as_ast()), self.ctx)
10026 
Z3_ast Z3_API Z3_mk_str_le(Z3_context c, Z3_ast prefix, Z3_ast s)
Check if s1 is equal or lexicographically strictly less than s2.

◆ __lt__()

def __lt__ (   self,
  other 
)

Definition at line 10027 of file z3py.py.

10027  def __lt__(self, other):
10028  return SeqRef(Z3_mk_str_lt(self.ctx_ref(), self.as_ast(), other.as_ast()), self.ctx)
10029 
Z3_ast Z3_API Z3_mk_str_lt(Z3_context c, Z3_ast prefix, Z3_ast s)
Check if s1 is lexicographically strictly less than s2.

◆ __radd__()

def __radd__ (   self,
  other 
)

Definition at line 9999 of file z3py.py.

9999  def __radd__(self, other):
10000  return Concat(other, self)
10001 
def Concat(*args)
Definition: z3py.py:3817

◆ as_string()

def as_string (   self)
Return a string representation of sequence expression.

Definition at line 10018 of file z3py.py.

10018  def as_string(self):
10019  """Return a string representation of sequence expression."""
10020  if self.is_string_value():
10021  return Z3_get_string(self.ctx_ref(), self.as_ast())
10022  return Z3_ast_to_string(self.ctx_ref(), self.as_ast())
10023 
Z3_string Z3_API Z3_ast_to_string(Z3_context c, Z3_ast a)
Convert the given AST node into a string.
Z3_string Z3_API Z3_get_string(Z3_context c, Z3_ast s)
Retrieve the string constant stored in s.

◆ at()

def at (   self,
  i 
)

Definition at line 10007 of file z3py.py.

10007  def at(self, i):
10008  if _is_int(i):
10009  i = IntVal(i, self.ctx)
10010  return SeqRef(Z3_mk_seq_at(self.ctx_ref(), self.as_ast(), i.as_ast()), self.ctx)
10011 
Z3_ast Z3_API Z3_mk_seq_at(Z3_context c, Z3_ast s, Z3_ast index)
Retrieve from s the unit sequence positioned at position index. The sequence is empty if the index is...
def IntVal(val, ctx=None)
Definition: z3py.py:2958

◆ is_string()

def is_string (   self)

Definition at line 10012 of file z3py.py.

10012  def is_string(self):
10013  return Z3_is_string_sort(self.ctx_ref(), Z3_get_sort(self.ctx_ref(), self.as_ast()))
10014 
def is_string(a)
Definition: z3py.py:10065
bool Z3_API Z3_is_string_sort(Z3_context c, Z3_sort s)
Check if s is a string sort.
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.

◆ is_string_value()

def is_string_value (   self)

Definition at line 10015 of file z3py.py.

10015  def is_string_value(self):
10016  return Z3_is_string(self.ctx_ref(), self.as_ast())
10017 
def is_string_value(a)
Definition: z3py.py:10072
bool Z3_API Z3_is_string(Z3_context c, Z3_ast s)
Determine if s is a string constant.

Referenced by SeqRef.as_string().

◆ sort()

def sort (   self)
Return the sort of expression `self`.

>>> x = Int('x')
>>> (x + 1).sort()
Int
>>> y = Real('y')
>>> (x + y).sort()
Real

Reimplemented from ExprRef.

Definition at line 9993 of file z3py.py.

9993  def sort(self):
9994  return SeqSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
9995 
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.