Z3
Public Member Functions | Data Fields
Goal Class Reference
+ Inheritance diagram for Goal:

Public Member Functions

def __init__ (self, models=True, unsat_cores=False, proofs=False, ctx=None, goal=None)
 
def __deepcopy__ (self, memo={})
 
def __del__ (self)
 
def depth (self)
 
def inconsistent (self)
 
def prec (self)
 
def precision (self)
 
def size (self)
 
def __len__ (self)
 
def get (self, i)
 
def __getitem__ (self, arg)
 
def assert_exprs (self, *args)
 
def append (self, *args)
 
def insert (self, *args)
 
def add (self, *args)
 
def convert_model (self, model)
 
def __repr__ (self)
 
def sexpr (self)
 
def dimacs (self)
 
def translate (self, target)
 
def __copy__ (self)
 
def __deepcopy__ (self, memo={})
 
def simplify (self, *arguments, **keywords)
 
def as_expr (self)
 
- Public Member Functions inherited from Z3PPObject
def use_pp (self)
 

Data Fields

 ctx
 
 goal
 

Detailed Description

Goal is a collection of constraints we want to find a solution or show to be unsatisfiable (infeasible).

Goals are processed using Tactics. A Tactic transforms a goal into a set of subgoals.
A goal has a solution if one of its subgoals has a solution.
A goal is unsatisfiable if all subgoals are unsatisfiable.

Definition at line 5171 of file z3py.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  models = True,
  unsat_cores = False,
  proofs = False,
  ctx = None,
  goal = None 
)

Definition at line 5179 of file z3py.py.

5179  def __init__(self, models=True, unsat_cores=False, proofs=False, ctx=None, goal=None):
5180  if z3_debug():
5181  _z3_assert(goal is None or ctx is not None, "If goal is different from None, then ctx must be also different from None")
5182  self.ctx = _get_ctx(ctx)
5183  self.goal = goal
5184  if self.goal is None:
5185  self.goal = Z3_mk_goal(self.ctx.ref(), models, unsat_cores, proofs)
5186  Z3_goal_inc_ref(self.ctx.ref(), self.goal)
5187 

◆ __del__()

def __del__ (   self)

Definition at line 5191 of file z3py.py.

5191  def __del__(self):
5192  if self.goal is not None and self.ctx.ref() is not None:
5193  Z3_goal_dec_ref(self.ctx.ref(), self.goal)
5194 

Member Function Documentation

◆ __copy__()

def __copy__ (   self)

Definition at line 5425 of file z3py.py.

5425  def __copy__(self):
5426  return self.translate(self.ctx)
5427 

◆ __deepcopy__() [1/2]

def __deepcopy__ (   self,
  memo = {} 
)

Definition at line 5188 of file z3py.py.

5188  def __deepcopy__(self, memo={}):
5189  return Goal(False, False, False, self.ctx, self.goal)
5190 

Referenced by Goal.__deepcopy__().

◆ __deepcopy__() [2/2]

def __deepcopy__ (   self,
  memo = {} 
)

Definition at line 5428 of file z3py.py.

5428  def __deepcopy__(self, memo={}):
5429  return self.translate(self.ctx)
5430 

◆ __getitem__()

def __getitem__ (   self,
  arg 
)
Return a constraint in the goal `self`.

>>> g = Goal()
>>> x, y = Ints('x y')
>>> g.add(x == 0, y > x)
>>> g[0]
x == 0
>>> g[1]
y > x

Definition at line 5299 of file z3py.py.

5299  def __getitem__(self, arg):
5300  """Return a constraint in the goal `self`.
5301 
5302  >>> g = Goal()
5303  >>> x, y = Ints('x y')
5304  >>> g.add(x == 0, y > x)
5305  >>> g[0]
5306  x == 0
5307  >>> g[1]
5308  y > x
5309  """
5310  if arg >= len(self):
5311  raise IndexError
5312  return self.get(arg)
5313 

◆ __len__()

def __len__ (   self)
Return the number of constraints in the goal `self`.

>>> g = Goal()
>>> len(g)
0
>>> x, y = Ints('x y')
>>> g.add(x == 0, y > x)
>>> len(g)
2

Definition at line 5273 of file z3py.py.

5273  def __len__(self):
5274  """Return the number of constraints in the goal `self`.
5275 
5276  >>> g = Goal()
5277  >>> len(g)
5278  0
5279  >>> x, y = Ints('x y')
5280  >>> g.add(x == 0, y > x)
5281  >>> len(g)
5282  2
5283  """
5284  return self.size()
5285 

Referenced by AstVector.__getitem__(), and AstVector.__setitem__().

◆ __repr__()

def __repr__ (   self)

Definition at line 5391 of file z3py.py.

5391  def __repr__(self):
5392  return obj_to_string(self)
5393 

◆ add()

def add (   self,
args 
)
Add constraints.

>>> x = Int('x')
>>> g = Goal()
>>> g.add(x > 0, x < 2)
>>> g
[x > 0, x < 2]

Definition at line 5351 of file z3py.py.

5351  def add(self, *args):
5352  """Add constraints.
5353 
5354  >>> x = Int('x')
5355  >>> g = Goal()
5356  >>> g.add(x > 0, x < 2)
5357  >>> g
5358  [x > 0, x < 2]
5359  """
5360  self.assert_exprs(*args)
5361 

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

◆ append()

def append (   self,
args 
)
Add constraints.

>>> x = Int('x')
>>> g = Goal()
>>> g.append(x > 0, x < 2)
>>> g
[x > 0, x < 2]

Definition at line 5329 of file z3py.py.

5329  def append(self, *args):
5330  """Add constraints.
5331 
5332  >>> x = Int('x')
5333  >>> g = Goal()
5334  >>> g.append(x > 0, x < 2)
5335  >>> g
5336  [x > 0, x < 2]
5337  """
5338  self.assert_exprs(*args)
5339 

◆ as_expr()

def as_expr (   self)
Return goal `self` as a single Z3 expression.

>>> x = Int('x')
>>> g = Goal()
>>> g.as_expr()
True
>>> g.add(x > 1)
>>> g.as_expr()
x > 1
>>> g.add(x < 10)
>>> g.as_expr()
And(x > 1, x < 10)

Definition at line 5451 of file z3py.py.

5451  def as_expr(self):
5452  """Return goal `self` as a single Z3 expression.
5453 
5454  >>> x = Int('x')
5455  >>> g = Goal()
5456  >>> g.as_expr()
5457  True
5458  >>> g.add(x > 1)
5459  >>> g.as_expr()
5460  x > 1
5461  >>> g.add(x < 10)
5462  >>> g.as_expr()
5463  And(x > 1, x < 10)
5464  """
5465  sz = len(self)
5466  if sz == 0:
5467  return BoolVal(True, self.ctx)
5468  elif sz == 1:
5469  return self.get(0)
5470  else:
5471  return And([ self.get(i) for i in range(len(self)) ], self.ctx)
5472 

◆ assert_exprs()

def assert_exprs (   self,
args 
)
Assert constraints into the goal.

>>> x = Int('x')
>>> g = Goal()
>>> g.assert_exprs(x > 0, x < 2)
>>> g
[x > 0, x < 2]

Definition at line 5314 of file z3py.py.

5314  def assert_exprs(self, *args):
5315  """Assert constraints into the goal.
5316 
5317  >>> x = Int('x')
5318  >>> g = Goal()
5319  >>> g.assert_exprs(x > 0, x < 2)
5320  >>> g
5321  [x > 0, x < 2]
5322  """
5323  args = _get_args(args)
5324  s = BoolSort(self.ctx)
5325  for arg in args:
5326  arg = s.cast(arg)
5327  Z3_goal_assert(self.ctx.ref(), self.goal, arg.as_ast())
5328 

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

◆ convert_model()

def convert_model (   self,
  model 
)
Retrieve model from a satisfiable goal
>>> a, b = Ints('a b')
>>> g = Goal()
>>> g.add(Or(a == 0, a == 1), Or(b == 0, b == 1), a > b)
>>> t = Then(Tactic('split-clause'), Tactic('solve-eqs'))
>>> r = t(g)
>>> r[0]
[Or(b == 0, b == 1), Not(0 <= b)]
>>> r[1]
[Or(b == 0, b == 1), Not(1 <= b)]
>>> # Remark: the subgoal r[0] is unsatisfiable
>>> # Creating a solver for solving the second subgoal
>>> s = Solver()
>>> s.add(r[1])
>>> s.check()
sat
>>> s.model()
[b = 0]
>>> # Model s.model() does not assign a value to `a`
>>> # It is a model for subgoal `r[1]`, but not for goal `g`
>>> # The method convert_model creates a model for `g` from a model for `r[1]`.
>>> r[1].convert_model(s.model())
[b = 0, a = 1]

Definition at line 5362 of file z3py.py.

5362  def convert_model(self, model):
5363  """Retrieve model from a satisfiable goal
5364  >>> a, b = Ints('a b')
5365  >>> g = Goal()
5366  >>> g.add(Or(a == 0, a == 1), Or(b == 0, b == 1), a > b)
5367  >>> t = Then(Tactic('split-clause'), Tactic('solve-eqs'))
5368  >>> r = t(g)
5369  >>> r[0]
5370  [Or(b == 0, b == 1), Not(0 <= b)]
5371  >>> r[1]
5372  [Or(b == 0, b == 1), Not(1 <= b)]
5373  >>> # Remark: the subgoal r[0] is unsatisfiable
5374  >>> # Creating a solver for solving the second subgoal
5375  >>> s = Solver()
5376  >>> s.add(r[1])
5377  >>> s.check()
5378  sat
5379  >>> s.model()
5380  [b = 0]
5381  >>> # Model s.model() does not assign a value to `a`
5382  >>> # It is a model for subgoal `r[1]`, but not for goal `g`
5383  >>> # The method convert_model creates a model for `g` from a model for `r[1]`.
5384  >>> r[1].convert_model(s.model())
5385  [b = 0, a = 1]
5386  """
5387  if z3_debug():
5388  _z3_assert(isinstance(model, ModelRef), "Z3 Model expected")
5389  return ModelRef(Z3_goal_convert_model(self.ctx.ref(), self.goal, model.model), self.ctx)
5390 

◆ depth()

def depth (   self)
Return the depth of the goal `self`. The depth corresponds to the number of tactics applied to `self`.

>>> x, y = Ints('x y')
>>> g = Goal()
>>> g.add(x == 0, y >= x + 1)
>>> g.depth()
0
>>> r = Then('simplify', 'solve-eqs')(g)
>>> # r has 1 subgoal
>>> len(r)
1
>>> r[0].depth()
2

Definition at line 5195 of file z3py.py.

5195  def depth(self):
5196  """Return the depth of the goal `self`. The depth corresponds to the number of tactics applied to `self`.
5197 
5198  >>> x, y = Ints('x y')
5199  >>> g = Goal()
5200  >>> g.add(x == 0, y >= x + 1)
5201  >>> g.depth()
5202  0
5203  >>> r = Then('simplify', 'solve-eqs')(g)
5204  >>> # r has 1 subgoal
5205  >>> len(r)
5206  1
5207  >>> r[0].depth()
5208  2
5209  """
5210  return int(Z3_goal_depth(self.ctx.ref(), self.goal))
5211 

◆ dimacs()

def dimacs (   self)
Return a textual representation of the goal in DIMACS format.

Definition at line 5398 of file z3py.py.

5398  def dimacs(self):
5399  """Return a textual representation of the goal in DIMACS format."""
5400  return Z3_goal_to_dimacs_string(self.ctx.ref(), self.goal)
5401 

◆ get()

def get (   self,
  i 
)
Return a constraint in the goal `self`.

>>> g = Goal()
>>> x, y = Ints('x y')
>>> g.add(x == 0, y > x)
>>> g.get(0)
x == 0
>>> g.get(1)
y > x

Definition at line 5286 of file z3py.py.

5286  def get(self, i):
5287  """Return a constraint in the goal `self`.
5288 
5289  >>> g = Goal()
5290  >>> x, y = Ints('x y')
5291  >>> g.add(x == 0, y > x)
5292  >>> g.get(0)
5293  x == 0
5294  >>> g.get(1)
5295  y > x
5296  """
5297  return _to_expr_ref(Z3_goal_formula(self.ctx.ref(), self.goal, i), self.ctx)
5298 

Referenced by Goal.__getitem__(), and Goal.as_expr().

◆ inconsistent()

def inconsistent (   self)
Return `True` if `self` contains the `False` constraints.

>>> x, y = Ints('x y')
>>> g = Goal()
>>> g.inconsistent()
False
>>> g.add(x == 0, x == 1)
>>> g
[x == 0, x == 1]
>>> g.inconsistent()
False
>>> g2 = Tactic('propagate-values')(g)[0]
>>> g2.inconsistent()
True

Definition at line 5212 of file z3py.py.

5212  def inconsistent(self):
5213  """Return `True` if `self` contains the `False` constraints.
5214 
5215  >>> x, y = Ints('x y')
5216  >>> g = Goal()
5217  >>> g.inconsistent()
5218  False
5219  >>> g.add(x == 0, x == 1)
5220  >>> g
5221  [x == 0, x == 1]
5222  >>> g.inconsistent()
5223  False
5224  >>> g2 = Tactic('propagate-values')(g)[0]
5225  >>> g2.inconsistent()
5226  True
5227  """
5228  return Z3_goal_inconsistent(self.ctx.ref(), self.goal)
5229 

◆ insert()

def insert (   self,
args 
)
Add constraints.

>>> x = Int('x')
>>> g = Goal()
>>> g.insert(x > 0, x < 2)
>>> g
[x > 0, x < 2]

Definition at line 5340 of file z3py.py.

5340  def insert(self, *args):
5341  """Add constraints.
5342 
5343  >>> x = Int('x')
5344  >>> g = Goal()
5345  >>> g.insert(x > 0, x < 2)
5346  >>> g
5347  [x > 0, x < 2]
5348  """
5349  self.assert_exprs(*args)
5350 

◆ prec()

def prec (   self)
Return the precision (under-approximation, over-approximation, or precise) of the goal `self`.

>>> g = Goal()
>>> g.prec() == Z3_GOAL_PRECISE
True
>>> x, y = Ints('x y')
>>> g.add(x == y + 1)
>>> g.prec() == Z3_GOAL_PRECISE
True
>>> t  = With(Tactic('add-bounds'), add_bound_lower=0, add_bound_upper=10)
>>> g2 = t(g)[0]
>>> g2
[x == y + 1, x <= 10, x >= 0, y <= 10, y >= 0]
>>> g2.prec() == Z3_GOAL_PRECISE
False
>>> g2.prec() == Z3_GOAL_UNDER
True

Definition at line 5230 of file z3py.py.

5230  def prec(self):
5231  """Return the precision (under-approximation, over-approximation, or precise) of the goal `self`.
5232 
5233  >>> g = Goal()
5234  >>> g.prec() == Z3_GOAL_PRECISE
5235  True
5236  >>> x, y = Ints('x y')
5237  >>> g.add(x == y + 1)
5238  >>> g.prec() == Z3_GOAL_PRECISE
5239  True
5240  >>> t = With(Tactic('add-bounds'), add_bound_lower=0, add_bound_upper=10)
5241  >>> g2 = t(g)[0]
5242  >>> g2
5243  [x == y + 1, x <= 10, x >= 0, y <= 10, y >= 0]
5244  >>> g2.prec() == Z3_GOAL_PRECISE
5245  False
5246  >>> g2.prec() == Z3_GOAL_UNDER
5247  True
5248  """
5249  return Z3_goal_precision(self.ctx.ref(), self.goal)
5250 

Referenced by Goal.precision().

◆ precision()

def precision (   self)
Alias for `prec()`.

>>> g = Goal()
>>> g.precision() == Z3_GOAL_PRECISE
True

Definition at line 5251 of file z3py.py.

5251  def precision(self):
5252  """Alias for `prec()`.
5253 
5254  >>> g = Goal()
5255  >>> g.precision() == Z3_GOAL_PRECISE
5256  True
5257  """
5258  return self.prec()
5259 

◆ sexpr()

def sexpr (   self)
Return a textual representation of the s-expression representing the goal.

Definition at line 5394 of file z3py.py.

5394  def sexpr(self):
5395  """Return a textual representation of the s-expression representing the goal."""
5396  return Z3_goal_to_string(self.ctx.ref(), self.goal)
5397 

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

◆ simplify()

def simplify (   self,
arguments,
**  keywords 
)
Return a new simplified goal.

This method is essentially invoking the simplify tactic.

>>> g = Goal()
>>> x = Int('x')
>>> g.add(x + 1 >= 2)
>>> g
[x + 1 >= 2]
>>> g2 = g.simplify()
>>> g2
[x >= 1]
>>> # g was not modified
>>> g
[x + 1 >= 2]

Definition at line 5431 of file z3py.py.

5431  def simplify(self, *arguments, **keywords):
5432  """Return a new simplified goal.
5433 
5434  This method is essentially invoking the simplify tactic.
5435 
5436  >>> g = Goal()
5437  >>> x = Int('x')
5438  >>> g.add(x + 1 >= 2)
5439  >>> g
5440  [x + 1 >= 2]
5441  >>> g2 = g.simplify()
5442  >>> g2
5443  [x >= 1]
5444  >>> # g was not modified
5445  >>> g
5446  [x + 1 >= 2]
5447  """
5448  t = Tactic('simplify')
5449  return t.apply(self, *arguments, **keywords)[0]
5450 

◆ size()

def size (   self)
Return the number of constraints in the goal `self`.

>>> g = Goal()
>>> g.size()
0
>>> x, y = Ints('x y')
>>> g.add(x == 0, y > x)
>>> g.size()
2

Definition at line 5260 of file z3py.py.

5260  def size(self):
5261  """Return the number of constraints in the goal `self`.
5262 
5263  >>> g = Goal()
5264  >>> g.size()
5265  0
5266  >>> x, y = Ints('x y')
5267  >>> g.add(x == 0, y > x)
5268  >>> g.size()
5269  2
5270  """
5271  return int(Z3_goal_size(self.ctx.ref(), self.goal))
5272 

Referenced by Goal.__len__().

◆ translate()

def translate (   self,
  target 
)
Copy goal `self` to context `target`.

>>> x = Int('x')
>>> g = Goal()
>>> g.add(x > 10)
>>> g
[x > 10]
>>> c2 = Context()
>>> g2 = g.translate(c2)
>>> g2
[x > 10]
>>> g.ctx == main_ctx()
True
>>> g2.ctx == c2
True
>>> g2.ctx == main_ctx()
False

Definition at line 5402 of file z3py.py.

5402  def translate(self, target):
5403  """Copy goal `self` to context `target`.
5404 
5405  >>> x = Int('x')
5406  >>> g = Goal()
5407  >>> g.add(x > 10)
5408  >>> g
5409  [x > 10]
5410  >>> c2 = Context()
5411  >>> g2 = g.translate(c2)
5412  >>> g2
5413  [x > 10]
5414  >>> g.ctx == main_ctx()
5415  True
5416  >>> g2.ctx == c2
5417  True
5418  >>> g2.ctx == main_ctx()
5419  False
5420  """
5421  if z3_debug():
5422  _z3_assert(isinstance(target, Context), "target must be a context")
5423  return Goal(goal=Z3_goal_translate(self.ctx.ref(), self.goal, target.ref()), ctx=target)
5424 

Referenced by Goal.__copy__(), AstVector.__copy__(), FuncInterp.__copy__(), ModelRef.__copy__(), Solver.__copy__(), Goal.__deepcopy__(), AstVector.__deepcopy__(), FuncInterp.__deepcopy__(), ModelRef.__deepcopy__(), and Solver.__deepcopy__().

Field Documentation

◆ ctx

ctx

Definition at line 5182 of file z3py.py.

Referenced by Probe.__call__(), AstMap.__contains__(), Goal.__copy__(), AstVector.__copy__(), FuncInterp.__copy__(), ModelRef.__copy__(), Solver.__copy__(), Goal.__deepcopy__(), AstVector.__deepcopy__(), AstMap.__deepcopy__(), FuncEntry.__deepcopy__(), FuncInterp.__deepcopy__(), ModelRef.__deepcopy__(), Statistics.__deepcopy__(), Solver.__deepcopy__(), Fixedpoint.__deepcopy__(), Optimize.__deepcopy__(), ApplyResult.__deepcopy__(), Tactic.__deepcopy__(), Probe.__deepcopy__(), Goal.__del__(), AstVector.__del__(), AstMap.__del__(), FuncEntry.__del__(), FuncInterp.__del__(), ModelRef.__del__(), Statistics.__del__(), Solver.__del__(), Fixedpoint.__del__(), Optimize.__del__(), ApplyResult.__del__(), Tactic.__del__(), Probe.__del__(), Probe.__eq__(), Probe.__ge__(), AstVector.__getitem__(), ModelRef.__getitem__(), Statistics.__getitem__(), ApplyResult.__getitem__(), AstMap.__getitem__(), Probe.__gt__(), Probe.__le__(), AstVector.__len__(), AstMap.__len__(), ModelRef.__len__(), Statistics.__len__(), ApplyResult.__len__(), Probe.__lt__(), Probe.__ne__(), AstMap.__repr__(), Statistics.__repr__(), AstVector.__setitem__(), AstMap.__setitem__(), Fixedpoint.add_cover(), Fixedpoint.add_rule(), Optimize.add_soft(), Tactic.apply(), FuncEntry.arg_value(), FuncInterp.arity(), Goal.as_expr(), ApplyResult.as_expr(), Solver.assert_and_track(), Optimize.assert_and_track(), Goal.assert_exprs(), Solver.assert_exprs(), Fixedpoint.assert_exprs(), Optimize.assert_exprs(), Solver.assertions(), Optimize.assertions(), Solver.check(), Optimize.check(), Solver.consequences(), Goal.convert_model(), ModelRef.decls(), Goal.depth(), Goal.dimacs(), Solver.dimacs(), FuncInterp.else_value(), FuncInterp.entry(), AstMap.erase(), ModelRef.eval(), Solver.from_file(), Optimize.from_file(), Solver.from_string(), Optimize.from_string(), Goal.get(), Fixedpoint.get_answer(), Fixedpoint.get_assertions(), Fixedpoint.get_cover_delta(), Fixedpoint.get_ground_sat_answer(), ModelRef.get_interp(), Statistics.get_key_value(), Fixedpoint.get_num_levels(), Fixedpoint.get_rule_names_along_trace(), Fixedpoint.get_rules(), Fixedpoint.get_rules_along_trace(), ModelRef.get_sort(), ModelRef.get_universe(), Solver.help(), Fixedpoint.help(), Optimize.help(), Tactic.help(), Solver.import_model_converter(), Goal.inconsistent(), AstMap.keys(), Statistics.keys(), Optimize.maximize(), Optimize.minimize(), Solver.model(), Optimize.model(), Solver.non_units(), FuncEntry.num_args(), FuncInterp.num_entries(), Solver.num_scopes(), ModelRef.num_sorts(), Optimize.objectives(), Solver.param_descrs(), Fixedpoint.param_descrs(), Optimize.param_descrs(), Tactic.param_descrs(), Fixedpoint.parse_file(), Fixedpoint.parse_string(), Optimize.pop(), Solver.pop(), Goal.prec(), Solver.proof(), Solver.push(), Optimize.push(), AstVector.push(), Fixedpoint.query(), Fixedpoint.query_from_lvl(), Solver.reason_unknown(), Fixedpoint.reason_unknown(), Optimize.reason_unknown(), Fixedpoint.register_relation(), AstMap.reset(), Solver.reset(), AstVector.resize(), Solver.set(), Fixedpoint.set(), Optimize.set(), Fixedpoint.set_predicate_representation(), Goal.sexpr(), AstVector.sexpr(), ModelRef.sexpr(), Solver.sexpr(), Fixedpoint.sexpr(), Optimize.sexpr(), ApplyResult.sexpr(), Goal.size(), Tactic.solver(), Solver.statistics(), Fixedpoint.statistics(), Optimize.statistics(), Solver.to_smt2(), Fixedpoint.to_string(), Solver.trail(), Solver.trail_levels(), AstVector.translate(), FuncInterp.translate(), Goal.translate(), ModelRef.translate(), Solver.translate(), Solver.units(), Solver.unsat_core(), Optimize.unsat_core(), Fixedpoint.update_rule(), and FuncEntry.value().

◆ goal

goal
z3::range
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3488
Z3_goal_precision
Z3_goal_prec Z3_API Z3_goal_precision(Z3_context c, Z3_goal g)
Return the "precision" of the given goal. Goals can be transformed using over and under approximation...
Z3_goal_size
unsigned Z3_API Z3_goal_size(Z3_context c, Z3_goal g)
Return the number of formulas in the given goal.
Z3_mk_goal
Z3_goal Z3_API Z3_mk_goal(Z3_context c, bool models, bool unsat_cores, bool proofs)
Create a goal (aka problem). A goal is essentially a set of formulas, that can be solved and/or trans...
z3py.simplify
def simplify(a, *arguments, **keywords)
Utils.
Definition: z3py.py:8205
Z3_goal_formula
Z3_ast Z3_API Z3_goal_formula(Z3_context c, Z3_goal g, unsigned idx)
Return a formula from the given goal.
Z3_goal_depth
unsigned Z3_API Z3_goal_depth(Z3_context c, Z3_goal g)
Return the depth of the given goal. It tracks how many transformations were applied to it.
z3py.And
def And(*args)
Definition: z3py.py:1700
Z3_goal_to_dimacs_string
Z3_string Z3_API Z3_goal_to_dimacs_string(Z3_context c, Z3_goal g)
Convert a goal into a DIMACS formatted string. The goal must be in CNF. You can convert a goal to CNF...
Z3_goal_dec_ref
void Z3_API Z3_goal_dec_ref(Z3_context c, Z3_goal g)
Decrement the reference counter of the given goal.
Z3_goal_translate
Z3_goal Z3_API Z3_goal_translate(Z3_context source, Z3_goal g, Z3_context target)
Copy a goal g from the context source to the context target.
Z3_goal_to_string
Z3_string Z3_API Z3_goal_to_string(Z3_context c, Z3_goal g)
Convert a goal into a string.
Z3_goal_inc_ref
void Z3_API Z3_goal_inc_ref(Z3_context c, Z3_goal g)
Increment the reference counter of the given goal.
z3py.z3_debug
def z3_debug()
Definition: z3py.py:56
Z3_goal_assert
void Z3_API Z3_goal_assert(Z3_context c, Z3_goal g, Z3_ast a)
Add a new formula a to the given goal. The formula is split according to the following procedure that...
z3py.BoolVal
def BoolVal(val, ctx=None)
Definition: z3py.py:1570
Z3_goal_convert_model
Z3_model Z3_API Z3_goal_convert_model(Z3_context c, Z3_goal g, Z3_model m)
Convert a model of the formulas of a goal to a model of an original goal. The model may be null,...
z3py.BoolSort
def BoolSort(ctx=None)
Definition: z3py.py:1553
Z3_goal_inconsistent
bool Z3_API Z3_goal_inconsistent(Z3_context c, Z3_goal g)
Return true if the given goal contains the formula false.