Inheritance diagram for ApplyResult:Public Member Functions | |
| def | __init__ |
| def | __del__ |
| def | __len__ |
| def | __getitem__ |
| def | __repr__ |
| def | sexpr |
| def | convert_model |
| def | as_expr |
Public Member Functions inherited from Z3PPObject | |
| def | use_pp |
Data Fields | |
| result | |
| ctx | |
An ApplyResult object contains the subgoals produced by a tactic when applied to a goal. It also contains model and proof converters.
| def __del__ | ( | self | ) |
| def __getitem__ | ( | self, | |
| idx | |||
| ) |
Return one of the subgoals stored in ApplyResult object `self`.
>>> a, b = Ints('a b')
>>> g = Goal()
>>> g.add(Or(a == 0, a == 1), Or(b == 0, b == 1), a > b)
>>> t = Tactic('split-clause')
>>> r = t(g)
>>> r[0]
[a == 0, Or(b == 0, b == 1), a > b]
>>> r[1]
[a == 1, Or(b == 0, b == 1), a > b]
Definition at line 6570 of file z3py.py.
| def __len__ | ( | self | ) |
Return the number of subgoals in `self`.
>>> a, b = Ints('a b')
>>> g = Goal()
>>> g.add(Or(a == 0, a == 1), Or(b == 0, b == 1), a > b)
>>> t = Tactic('split-clause')
>>> r = t(g)
>>> len(r)
2
>>> t = Then(Tactic('split-clause'), Tactic('split-clause'))
>>> len(t(g))
4
>>> t = Then(Tactic('split-clause'), Tactic('split-clause'), Tactic('propagate-values'))
>>> len(t(g))
1
Definition at line 6551 of file z3py.py.
| def __repr__ | ( | self | ) |
| def as_expr | ( | self | ) |
Return a Z3 expression consisting of all subgoals.
>>> x = Int('x')
>>> g = Goal()
>>> g.add(x > 1)
>>> g.add(Or(x == 2, x == 3))
>>> r = Tactic('simplify')(g)
>>> r
[[Not(x <= 1), Or(x == 2, x == 3)]]
>>> r.as_expr()
And(Not(x <= 1), Or(x == 2, x == 3))
>>> r = Tactic('split-clause')(g)
>>> r
[[x > 1, x == 2], [x > 1, x == 3]]
>>> r.as_expr()
Or(And(x > 1, x == 2), And(x > 1, x == 3))
Definition at line 6625 of file z3py.py.
| def convert_model | ( | self, | |
| model, | |||
idx = 0 |
|||
| ) |
Convert a model for a subgoal into a model for the original 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.convert_model(s.model(), 1)
[b = 0, a = 1]
Definition at line 6594 of file z3py.py.
| def sexpr | ( | self | ) |
Return a textual representation of the s-expression representing the set of subgoals in `self`.
Definition at line 6590 of file z3py.py.
| ctx |
Definition at line 6545 of file z3py.py.
Referenced by Probe.__eq__(), Probe.__ge__(), ApplyResult.__getitem__(), Probe.__gt__(), Probe.__le__(), Probe.__lt__(), Probe.__ne__(), Tactic.apply(), ApplyResult.as_expr(), ApplyResult.convert_model(), Tactic.param_descrs(), and Tactic.solver().
| result |
Definition at line 6544 of file z3py.py.
Referenced by ApplyResult.__del__(), ApplyResult.__getitem__(), ApplyResult.__len__(), ApplyResult.convert_model(), and ApplyResult.sexpr().
1.8.5