Z3
Public Member Functions | Data Fields
Fixedpoint Class Reference

Fixedpoint. More...

+ Inheritance diagram for Fixedpoint:

Public Member Functions

def __init__ (self, fixedpoint=None, ctx=None)
 
def __deepcopy__ (self, memo={})
 
def __del__ (self)
 
def set (self, args, keys)
 
def help (self)
 
def param_descrs (self)
 
def assert_exprs (self, args)
 
def add (self, args)
 
def __iadd__ (self, fml)
 
def append (self, args)
 
def insert (self, args)
 
def add_rule (self, head, body=None, name=None)
 
def rule (self, head, body=None, name=None)
 
def fact (self, head, name=None)
 
def query (self, query)
 
def query_from_lvl (self, lvl, query)
 
def push (self)
 
def pop (self)
 
def update_rule (self, head, body, name)
 
def get_answer (self)
 
def get_ground_sat_answer (self)
 
def get_rules_along_trace (self)
 
def get_rule_names_along_trace (self)
 
def get_num_levels (self, predicate)
 
def get_cover_delta (self, level, predicate)
 
def add_cover (self, level, predicate, property)
 
def register_relation (self, relations)
 
def set_predicate_representation (self, f, representations)
 
def parse_string (self, s)
 
def parse_file (self, f)
 
def get_rules (self)
 
def get_assertions (self)
 
def __repr__ (self)
 
def sexpr (self)
 
def to_string (self, queries)
 
def statistics (self)
 
def reason_unknown (self)
 
def declare_var (self, vars)
 
def abstract (self, fml, is_forall=True)
 
- Public Member Functions inherited from Z3PPObject
def use_pp (self)
 

Data Fields

 ctx
 
 fixedpoint
 
 vars
 

Detailed Description

Fixedpoint.

Fixedpoint API provides methods for solving with recursive predicates

Definition at line 6481 of file z3py.py.

Constructor & Destructor Documentation

§ __init__()

def __init__ (   self,
  fixedpoint = None,
  ctx = None 
)

Definition at line 6484 of file z3py.py.

6484  def __init__(self, fixedpoint=None, ctx=None):
6485  assert fixedpoint is None or ctx is not None
6486  self.ctx = _get_ctx(ctx)
6487  self.fixedpoint = None
6488  if fixedpoint is None:
6489  self.fixedpoint = Z3_mk_fixedpoint(self.ctx.ref())
6490  else:
6491  self.fixedpoint = fixedpoint
6492  Z3_fixedpoint_inc_ref(self.ctx.ref(), self.fixedpoint)
6493  self.vars = []
6494 
Z3_fixedpoint Z3_API Z3_mk_fixedpoint(Z3_context c)
Create a new fixedpoint context.
void Z3_API Z3_fixedpoint_inc_ref(Z3_context c, Z3_fixedpoint d)
Increment the reference counter of the given fixedpoint context.

§ __del__()

def __del__ (   self)

Definition at line 6498 of file z3py.py.

6498  def __del__(self):
6499  if self.fixedpoint is not None and self.ctx.ref() is not None:
6500  Z3_fixedpoint_dec_ref(self.ctx.ref(), self.fixedpoint)
6501 
void Z3_API Z3_fixedpoint_dec_ref(Z3_context c, Z3_fixedpoint d)
Decrement the reference counter of the given fixedpoint context.

Member Function Documentation

§ __deepcopy__()

def __deepcopy__ (   self,
  memo = {} 
)

Definition at line 6495 of file z3py.py.

6495  def __deepcopy__(self, memo={}):
6496  return FixedPoint(self.fixedpoint, self.ctx)
6497 

§ __iadd__()

def __iadd__ (   self,
  fml 
)

Definition at line 6534 of file z3py.py.

6534  def __iadd__(self, fml):
6535  self.add(fml)
6536  return self
6537 

§ __repr__()

def __repr__ (   self)
Return a formatted string with all added rules and constraints.

Definition at line 6705 of file z3py.py.

6705  def __repr__(self):
6706  """Return a formatted string with all added rules and constraints."""
6707  return self.sexpr()
6708 

§ abstract()

def abstract (   self,
  fml,
  is_forall = True 
)

Definition at line 6741 of file z3py.py.

Referenced by Fixedpoint.add_rule(), Fixedpoint.assert_exprs(), Fixedpoint.query(), Fixedpoint.query_from_lvl(), and Fixedpoint.update_rule().

6741  def abstract(self, fml, is_forall=True):
6742  if self.vars == []:
6743  return fml
6744  if is_forall:
6745  return ForAll(self.vars, fml)
6746  else:
6747  return Exists(self.vars, fml)
6748 
6749 
def Exists(vs, body, weight=1, qid="", skid="", patterns=[], no_patterns=[])
Definition: z3py.py:1923
def ForAll(vs, body, weight=1, qid="", skid="", patterns=[], no_patterns=[])
Definition: z3py.py:1904

§ add()

def add (   self,
  args 
)
Assert constraints as background axioms for the fixedpoint solver. Alias for assert_expr.

Definition at line 6530 of file z3py.py.

Referenced by Fixedpoint.__iadd__(), and Optimize.__iadd__().

6530  def add(self, *args):
6531  """Assert constraints as background axioms for the fixedpoint solver. Alias for assert_expr."""
6532  self.assert_exprs(*args)
6533 

§ add_cover()

def add_cover (   self,
  level,
  predicate,
  property 
)
Add property to predicate for the level'th unfolding. -1 is treated as infinity (infinity)

Definition at line 6663 of file z3py.py.

6663  def add_cover(self, level, predicate, property):
6664  """Add property to predicate for the level'th unfolding. -1 is treated as infinity (infinity)"""
6665  Z3_fixedpoint_add_cover(self.ctx.ref(), self.fixedpoint, level, predicate.ast, property.ast)
6666 
void Z3_API Z3_fixedpoint_add_cover(Z3_context c, Z3_fixedpoint d, int level, Z3_func_decl pred, Z3_ast property)
Add property about the predicate pred. Add a property of predicate pred at level. It gets pushed forw...

§ add_rule()

def add_rule (   self,
  head,
  body = None,
  name = None 
)
Assert rules defining recursive predicates to the fixedpoint solver.
>>> a = Bool('a')
>>> b = Bool('b')
>>> s = Fixedpoint()
>>> s.register_relation(a.decl())
>>> s.register_relation(b.decl())
>>> s.fact(a)
>>> s.rule(b, a)
>>> s.query(b)
sat

Definition at line 6546 of file z3py.py.

Referenced by Fixedpoint.fact(), and Fixedpoint.rule().

6546  def add_rule(self, head, body = None, name = None):
6547  """Assert rules defining recursive predicates to the fixedpoint solver.
6548  >>> a = Bool('a')
6549  >>> b = Bool('b')
6550  >>> s = Fixedpoint()
6551  >>> s.register_relation(a.decl())
6552  >>> s.register_relation(b.decl())
6553  >>> s.fact(a)
6554  >>> s.rule(b, a)
6555  >>> s.query(b)
6556  sat
6557  """
6558  if name is None:
6559  name = ""
6560  name = to_symbol(name, self.ctx)
6561  if body is None:
6562  head = self.abstract(head)
6563  Z3_fixedpoint_add_rule(self.ctx.ref(), self.fixedpoint, head.as_ast(), name)
6564  else:
6565  body = _get_args(body)
6566  f = self.abstract(Implies(And(body, self.ctx),head))
6567  Z3_fixedpoint_add_rule(self.ctx.ref(), self.fixedpoint, f.as_ast(), name)
6568 
void Z3_API Z3_fixedpoint_add_rule(Z3_context c, Z3_fixedpoint d, Z3_ast rule, Z3_symbol name)
Add a universal Horn clause as a named rule. The horn_rule should be of the form: ...
def to_symbol(s, ctx=None)
Definition: z3py.py:101
def And(args)
Definition: z3py.py:1578
def Implies(a, b, ctx=None)
Definition: z3py.py:1523

§ append()

def append (   self,
  args 
)
Assert constraints as background axioms for the fixedpoint solver. Alias for assert_expr.

Definition at line 6538 of file z3py.py.

6538  def append(self, *args):
6539  """Assert constraints as background axioms for the fixedpoint solver. Alias for assert_expr."""
6540  self.assert_exprs(*args)
6541 

§ assert_exprs()

def assert_exprs (   self,
  args 
)
Assert constraints as background axioms for the fixedpoint solver.

Definition at line 6516 of file z3py.py.

Referenced by Fixedpoint.add(), Optimize.add(), Fixedpoint.append(), and Fixedpoint.insert().

6516  def assert_exprs(self, *args):
6517  """Assert constraints as background axioms for the fixedpoint solver."""
6518  args = _get_args(args)
6519  s = BoolSort(self.ctx)
6520  for arg in args:
6521  if isinstance(arg, Goal) or isinstance(arg, AstVector):
6522  for f in arg:
6523  f = self.abstract(f)
6524  Z3_fixedpoint_assert(self.ctx.ref(), self.fixedpoint, f.as_ast())
6525  else:
6526  arg = s.cast(arg)
6527  arg = self.abstract(arg)
6528  Z3_fixedpoint_assert(self.ctx.ref(), self.fixedpoint, arg.as_ast())
6529 
void Z3_API Z3_fixedpoint_assert(Z3_context c, Z3_fixedpoint d, Z3_ast axiom)
Assert a constraint to the fixedpoint context.
def BoolSort(ctx=None)
Definition: z3py.py:1435

§ declare_var()

def declare_var (   self,
  vars 
)
Add variable or several variables.
The added variable or variables will be bound in the rules
and queries

Definition at line 6732 of file z3py.py.

6732  def declare_var(self, *vars):
6733  """Add variable or several variables.
6734  The added variable or variables will be bound in the rules
6735  and queries
6736  """
6737  vars = _get_args(vars)
6738  for v in vars:
6739  self.vars += [v]
6740 

§ fact()

def fact (   self,
  head,
  name = None 
)
Assert facts defining recursive predicates to the fixedpoint solver. Alias for add_rule.

Definition at line 6573 of file z3py.py.

6573  def fact(self, head, name = None):
6574  """Assert facts defining recursive predicates to the fixedpoint solver. Alias for add_rule."""
6575  self.add_rule(head, None, name)
6576 

§ get_answer()

def get_answer (   self)
Retrieve answer from last query call.

Definition at line 6632 of file z3py.py.

6632  def get_answer(self):
6633  """Retrieve answer from last query call."""
6634  r = Z3_fixedpoint_get_answer(self.ctx.ref(), self.fixedpoint)
6635  return _to_expr_ref(r, self.ctx)
6636 
Z3_ast Z3_API Z3_fixedpoint_get_answer(Z3_context c, Z3_fixedpoint d)
Retrieve a formula that encodes satisfying answers to the query.

§ get_assertions()

def get_assertions (   self)
retrieve assertions that have been added to fixedpoint context

Definition at line 6701 of file z3py.py.

6701  def get_assertions(self):
6702  """retrieve assertions that have been added to fixedpoint context"""
6703  return AstVector(Z3_fixedpoint_get_assertions(self.ctx.ref(), self.fixedpoint), self.ctx)
6704 
Z3_ast_vector Z3_API Z3_fixedpoint_get_assertions(Z3_context c, Z3_fixedpoint f)
Retrieve set of background assertions from fixedpoint context.

§ get_cover_delta()

def get_cover_delta (   self,
  level,
  predicate 
)
Retrieve properties known about predicate for the level'th unfolding. -1 is treated as the limit (infinity)

Definition at line 6658 of file z3py.py.

6658  def get_cover_delta(self, level, predicate):
6659  """Retrieve properties known about predicate for the level'th unfolding. -1 is treated as the limit (infinity)"""
6660  r = Z3_fixedpoint_get_cover_delta(self.ctx.ref(), self.fixedpoint, level, predicate.ast)
6661  return _to_expr_ref(r, self.ctx)
6662 
Z3_ast Z3_API Z3_fixedpoint_get_cover_delta(Z3_context c, Z3_fixedpoint d, int level, Z3_func_decl pred)

§ get_ground_sat_answer()

def get_ground_sat_answer (   self)
Retrieve a ground cex from last query call.

Definition at line 6637 of file z3py.py.

6637  def get_ground_sat_answer(self):
6638  """Retrieve a ground cex from last query call."""
6639  r = Z3_fixedpoint_get_ground_sat_answer(self.ctx.ref(), self.fixedpoint)
6640  return _to_expr_ref(r, self.ctx)
6641 

§ get_num_levels()

def get_num_levels (   self,
  predicate 
)
Retrieve number of levels used for predicate in PDR engine

Definition at line 6654 of file z3py.py.

6654  def get_num_levels(self, predicate):
6655  """Retrieve number of levels used for predicate in PDR engine"""
6656  return Z3_fixedpoint_get_num_levels(self.ctx.ref(), self.fixedpoint, predicate.ast)
6657 
unsigned Z3_API Z3_fixedpoint_get_num_levels(Z3_context c, Z3_fixedpoint d, Z3_func_decl pred)
Query the PDR engine for the maximal levels properties are known about predicate. ...

§ get_rule_names_along_trace()

def get_rule_names_along_trace (   self)
retrieve rule names along the counterexample trace

Definition at line 6646 of file z3py.py.

6646  def get_rule_names_along_trace(self):
6647  """retrieve rule names along the counterexample trace"""
6648  # this is a hack as I don't know how to return a list of symbols from C++;
6649  # obtain names as a single string separated by semicolons
6650  names = _symbol2py (self.ctx, Z3_fixedpoint_get_rule_names_along_trace(self.ctx.ref(), self.fixedpoint))
6651  # split into individual names
6652  return names.split (';')
6653 

§ get_rules()

def get_rules (   self)
retrieve rules that have been added to fixedpoint context

Definition at line 6697 of file z3py.py.

6697  def get_rules(self):
6698  """retrieve rules that have been added to fixedpoint context"""
6699  return AstVector(Z3_fixedpoint_get_rules(self.ctx.ref(), self.fixedpoint), self.ctx)
6700 
Z3_ast_vector Z3_API Z3_fixedpoint_get_rules(Z3_context c, Z3_fixedpoint f)
Retrieve set of rules from fixedpoint context.

§ get_rules_along_trace()

def get_rules_along_trace (   self)
retrieve rules along the counterexample trace

Definition at line 6642 of file z3py.py.

6642  def get_rules_along_trace(self):
6643  """retrieve rules along the counterexample trace"""
6644  return AstVector(Z3_fixedpoint_get_rules_along_trace(self.ctx.ref(), self.fixedpoint), self.ctx)
6645 

§ help()

def help (   self)
Display a string describing all available options.

Definition at line 6508 of file z3py.py.

6508  def help(self):
6509  """Display a string describing all available options."""
6510  print(Z3_fixedpoint_get_help(self.ctx.ref(), self.fixedpoint))
6511 
Z3_string Z3_API Z3_fixedpoint_get_help(Z3_context c, Z3_fixedpoint f)
Return a string describing all fixedpoint available parameters.

§ insert()

def insert (   self,
  args 
)
Assert constraints as background axioms for the fixedpoint solver. Alias for assert_expr.

Definition at line 6542 of file z3py.py.

6542  def insert(self, *args):
6543  """Assert constraints as background axioms for the fixedpoint solver. Alias for assert_expr."""
6544  self.assert_exprs(*args)
6545 

§ param_descrs()

def param_descrs (   self)
Return the parameter description set.

Definition at line 6512 of file z3py.py.

6512  def param_descrs(self):
6513  """Return the parameter description set."""
6514  return ParamDescrsRef(Z3_fixedpoint_get_param_descrs(self.ctx.ref(), self.fixedpoint), self.ctx)
6515 
Z3_param_descrs Z3_API Z3_fixedpoint_get_param_descrs(Z3_context c, Z3_fixedpoint f)
Return the parameter description set for the given fixedpoint object.

§ parse_file()

def parse_file (   self,
  f 
)
Parse rules and queries from a file

Definition at line 6690 of file z3py.py.

6690  def parse_file(self, f):
6691  """Parse rules and queries from a file"""
6692  try:
6693  return AstVector(Z3_fixedpoint_from_file(self.ctx.ref(), self.fixedpoint, f), self.ctx)
6694  except Z3Exception as e:
6695  _handle_parse_error(e, self.ctx)
6696 
Z3_ast_vector Z3_API Z3_fixedpoint_from_file(Z3_context c, Z3_fixedpoint f, Z3_string s)
Parse an SMT-LIB2 file with fixedpoint rules. Add the rules to the current fixedpoint context...

§ parse_string()

def parse_string (   self,
  s 
)
Parse rules and queries from a string

Definition at line 6683 of file z3py.py.

6683  def parse_string(self, s):
6684  """Parse rules and queries from a string"""
6685  try:
6686  return AstVector(Z3_fixedpoint_from_string(self.ctx.ref(), self.fixedpoint, s), self.ctx)
6687  except Z3Exception as e:
6688  _handle_parse_error(e, self.ctx)
6689 
Z3_ast_vector Z3_API Z3_fixedpoint_from_string(Z3_context c, Z3_fixedpoint f, Z3_string s)
Parse an SMT-LIB2 string with fixedpoint rules. Add the rules to the current fixedpoint context...

§ pop()

def pop (   self)
restore to previously created backtracking point

Definition at line 6619 of file z3py.py.

6619  def pop(self):
6620  """restore to previously created backtracking point"""
6621  Z3_fixedpoint_pop(self.ctx.ref(), self.fixedpoint)
6622 
void Z3_API Z3_fixedpoint_pop(Z3_context c, Z3_fixedpoint d)
Backtrack one backtracking point.

§ push()

def push (   self)
create a backtracking point for added rules, facts and assertions

Definition at line 6615 of file z3py.py.

6615  def push(self):
6616  """create a backtracking point for added rules, facts and assertions"""
6617  Z3_fixedpoint_push(self.ctx.ref(), self.fixedpoint)
6618 
void Z3_API Z3_fixedpoint_push(Z3_context c, Z3_fixedpoint d)
Create a backtracking point.

§ query()

def query (   self,
  query 
)
Query the fixedpoint engine whether formula is derivable.
   You can also pass an tuple or list of recursive predicates.

Definition at line 6577 of file z3py.py.

6577  def query(self, *query):
6578  """Query the fixedpoint engine whether formula is derivable.
6579  You can also pass an tuple or list of recursive predicates.
6580  """
6581  query = _get_args(query)
6582  sz = len(query)
6583  if sz >= 1 and isinstance(query[0], FuncDeclRef):
6584  _decls = (FuncDecl * sz)()
6585  i = 0
6586  for q in query:
6587  _decls[i] = q.ast
6588  i = i + 1
6589  r = Z3_fixedpoint_query_relations(self.ctx.ref(), self.fixedpoint, sz, _decls)
6590  else:
6591  if sz == 1:
6592  query = query[0]
6593  else:
6594  query = And(query, self.ctx)
6595  query = self.abstract(query, False)
6596  r = Z3_fixedpoint_query(self.ctx.ref(), self.fixedpoint, query.as_ast())
6597  return CheckSatResult(r)
6598 
def And(args)
Definition: z3py.py:1578
Z3_lbool Z3_API Z3_fixedpoint_query(Z3_context c, Z3_fixedpoint d, Z3_ast query)
Pose a query against the asserted rules.
Z3_lbool Z3_API Z3_fixedpoint_query_relations(Z3_context c, Z3_fixedpoint d, unsigned num_relations, Z3_func_decl const relations[])
Pose multiple queries against the asserted rules.

§ query_from_lvl()

def query_from_lvl (   self,
  lvl,
  query 
)
Query the fixedpoint engine whether formula is derivable starting at the given query level.

Definition at line 6599 of file z3py.py.

6599  def query_from_lvl (self, lvl, *query):
6600  """Query the fixedpoint engine whether formula is derivable starting at the given query level.
6601  """
6602  query = _get_args(query)
6603  sz = len(query)
6604  if sz >= 1 and isinstance(query[0], FuncDecl):
6605  _z3_assert (False, "unsupported")
6606  else:
6607  if sz == 1:
6608  query = query[0]
6609  else:
6610  query = And(query)
6611  query = self.abstract(query, False)
6612  r = Z3_fixedpoint_query_from_lvl (self.ctx.ref(), self.fixedpoint, query.as_ast(), lvl)
6613  return CheckSatResult(r)
6614 
def And(args)
Definition: z3py.py:1578

§ reason_unknown()

def reason_unknown (   self)
Return a string describing why the last `query()` returned `unknown`.

Definition at line 6727 of file z3py.py.

6727  def reason_unknown(self):
6728  """Return a string describing why the last `query()` returned `unknown`.
6729  """
6730  return Z3_fixedpoint_get_reason_unknown(self.ctx.ref(), self.fixedpoint)
6731 
Z3_string Z3_API Z3_fixedpoint_get_reason_unknown(Z3_context c, Z3_fixedpoint d)
Retrieve a string that describes the last status returned by Z3_fixedpoint_query. ...

§ register_relation()

def register_relation (   self,
  relations 
)
Register relation as recursive

Definition at line 6667 of file z3py.py.

6667  def register_relation(self, *relations):
6668  """Register relation as recursive"""
6669  relations = _get_args(relations)
6670  for f in relations:
6671  Z3_fixedpoint_register_relation(self.ctx.ref(), self.fixedpoint, f.ast)
6672 
void Z3_API Z3_fixedpoint_register_relation(Z3_context c, Z3_fixedpoint d, Z3_func_decl f)
Register relation as Fixedpoint defined. Fixedpoint defined relations have least-fixedpoint semantics...

§ rule()

def rule (   self,
  head,
  body = None,
  name = None 
)
Assert rules defining recursive predicates to the fixedpoint solver. Alias for add_rule.

Definition at line 6569 of file z3py.py.

6569  def rule(self, head, body = None, name = None):
6570  """Assert rules defining recursive predicates to the fixedpoint solver. Alias for add_rule."""
6571  self.add_rule(head, body, name)
6572 

§ set()

def set (   self,
  args,
  keys 
)
Set a configuration option. The method `help()` return a string containing all available options.

Definition at line 6502 of file z3py.py.

6502  def set(self, *args, **keys):
6503  """Set a configuration option. The method `help()` return a string containing all available options.
6504  """
6505  p = args2params(args, keys, self.ctx)
6506  Z3_fixedpoint_set_params(self.ctx.ref(), self.fixedpoint, p.params)
6507 
def args2params(arguments, keywords, ctx=None)
Definition: z3py.py:4744
void Z3_API Z3_fixedpoint_set_params(Z3_context c, Z3_fixedpoint f, Z3_params p)
Set parameters on fixedpoint context.

§ set_predicate_representation()

def set_predicate_representation (   self,
  f,
  representations 
)
Control how relation is represented

Definition at line 6673 of file z3py.py.

6673  def set_predicate_representation(self, f, *representations):
6674  """Control how relation is represented"""
6675  representations = _get_args(representations)
6676  representations = [to_symbol(s) for s in representations]
6677  sz = len(representations)
6678  args = (Symbol * sz)()
6679  for i in range(sz):
6680  args[i] = representations[i]
6681  Z3_fixedpoint_set_predicate_representation(self.ctx.ref(), self.fixedpoint, f.ast, sz, args)
6682 
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:2813
def to_symbol(s, ctx=None)
Definition: z3py.py:101
void Z3_API Z3_fixedpoint_set_predicate_representation(Z3_context c, Z3_fixedpoint d, Z3_func_decl f, unsigned num_relations, Z3_symbol const relation_kinds[])
Configure the predicate representation.

§ sexpr()

def sexpr (   self)
Return a formatted string (in Lisp-like format) with all added constraints. We say the string is in s-expression format.

Definition at line 6709 of file z3py.py.

Referenced by Fixedpoint.__repr__(), and Optimize.__repr__().

6709  def sexpr(self):
6710  """Return a formatted string (in Lisp-like format) with all added constraints. We say the string is in s-expression format.
6711  """
6712  return Z3_fixedpoint_to_string(self.ctx.ref(), self.fixedpoint, 0, (Ast * 0)())
6713 
Z3_string Z3_API Z3_fixedpoint_to_string(Z3_context c, Z3_fixedpoint f, unsigned num_queries, Z3_ast queries[])
Print the current rules and background axioms as a string.

§ statistics()

def statistics (   self)
Return statistics for the last `query()`.

Definition at line 6722 of file z3py.py.

6722  def statistics(self):
6723  """Return statistics for the last `query()`.
6724  """
6725  return Statistics(Z3_fixedpoint_get_statistics(self.ctx.ref(), self.fixedpoint), self.ctx)
6726 
Z3_stats Z3_API Z3_fixedpoint_get_statistics(Z3_context c, Z3_fixedpoint d)
Retrieve statistics information from the last call to Z3_fixedpoint_query.

§ to_string()

def to_string (   self,
  queries 
)
Return a formatted string (in Lisp-like format) with all added constraints.
   We say the string is in s-expression format.
   Include also queries.

Definition at line 6714 of file z3py.py.

6714  def to_string(self, queries):
6715  """Return a formatted string (in Lisp-like format) with all added constraints.
6716  We say the string is in s-expression format.
6717  Include also queries.
6718  """
6719  args, len = _to_ast_array(queries)
6720  return Z3_fixedpoint_to_string(self.ctx.ref(), self.fixedpoint, len, args)
6721 
Z3_string Z3_API Z3_fixedpoint_to_string(Z3_context c, Z3_fixedpoint f, unsigned num_queries, Z3_ast queries[])
Print the current rules and background axioms as a string.

§ update_rule()

def update_rule (   self,
  head,
  body,
  name 
)
update rule

Definition at line 6623 of file z3py.py.

6623  def update_rule(self, head, body, name):
6624  """update rule"""
6625  if name is None:
6626  name = ""
6627  name = to_symbol(name, self.ctx)
6628  body = _get_args(body)
6629  f = self.abstract(Implies(And(body, self.ctx),head))
6630  Z3_fixedpoint_update_rule(self.ctx.ref(), self.fixedpoint, f.as_ast(), name)
6631 
def to_symbol(s, ctx=None)
Definition: z3py.py:101
def And(args)
Definition: z3py.py:1578
def Implies(a, b, ctx=None)
Definition: z3py.py:1523
void Z3_API Z3_fixedpoint_update_rule(Z3_context c, Z3_fixedpoint d, Z3_ast a, Z3_symbol name)
Update a named rule. A rule with the same name must have been previously created. ...

Field Documentation

§ ctx

ctx

Definition at line 6486 of file z3py.py.

Referenced by Probe.__call__(), Fixedpoint.__deepcopy__(), Optimize.__deepcopy__(), ApplyResult.__deepcopy__(), Tactic.__deepcopy__(), Probe.__deepcopy__(), Fixedpoint.__del__(), Optimize.__del__(), ApplyResult.__del__(), Tactic.__del__(), Probe.__del__(), Probe.__eq__(), Probe.__ge__(), ApplyResult.__getitem__(), Probe.__gt__(), Probe.__le__(), ApplyResult.__len__(), Probe.__lt__(), Probe.__ne__(), Fixedpoint.add_cover(), Fixedpoint.add_rule(), Optimize.add_soft(), Tactic.apply(), ApplyResult.as_expr(), Fixedpoint.assert_exprs(), Optimize.assert_exprs(), Optimize.assertions(), Optimize.check(), ApplyResult.convert_model(), Optimize.from_file(), Optimize.from_string(), Fixedpoint.get_answer(), Fixedpoint.get_assertions(), Fixedpoint.get_cover_delta(), Fixedpoint.get_ground_sat_answer(), Fixedpoint.get_num_levels(), Fixedpoint.get_rule_names_along_trace(), Fixedpoint.get_rules(), Fixedpoint.get_rules_along_trace(), Fixedpoint.help(), Optimize.help(), Tactic.help(), Optimize.maximize(), Optimize.minimize(), Optimize.model(), Optimize.objectives(), Fixedpoint.param_descrs(), Optimize.param_descrs(), Tactic.param_descrs(), Fixedpoint.parse_file(), Fixedpoint.parse_string(), Fixedpoint.pop(), Optimize.pop(), Fixedpoint.push(), Optimize.push(), Fixedpoint.query(), Fixedpoint.query_from_lvl(), Fixedpoint.reason_unknown(), Optimize.reason_unknown(), Fixedpoint.register_relation(), Fixedpoint.set(), Optimize.set(), Fixedpoint.set_predicate_representation(), Fixedpoint.sexpr(), Optimize.sexpr(), ApplyResult.sexpr(), Tactic.solver(), Fixedpoint.statistics(), Optimize.statistics(), Fixedpoint.to_string(), and Fixedpoint.update_rule().

§ fixedpoint

fixedpoint

§ vars

vars

Definition at line 6493 of file z3py.py.

Referenced by Fixedpoint.abstract(), and Fixedpoint.declare_var().