An ApplyResult object contains the subgoals produced by a tactic when applied to a goal.
It also contains model and proof converters.
Definition at line 8082 of file z3py.py.
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 8118 of file z3py.py.
8119 """Return one of the subgoals stored in ApplyResult object `self`.
8121 >>> a, b = Ints('a b')
8123 >>> g.add(Or(a == 0, a == 1), Or(b == 0, b == 1), a > b)
8124 >>> t = Tactic('split-clause')
8127 [a == 0, Or(b == 0, b == 1), a > b]
8129 [a == 1, Or(b == 0, b == 1), a > b]
8131 if idx >= len(self):
def __getitem__(self, idx)
Z3_goal Z3_API Z3_apply_result_get_subgoal(Z3_context c, Z3_apply_result r, unsigned i)
Return one of the subgoals in the Z3_apply_result object returned by Z3_tactic_apply.
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 8099 of file z3py.py.
8100 """Return the number of subgoals in `self`.
8102 >>> a, b = Ints('a b')
8104 >>> g.add(Or(a == 0, a == 1), Or(b == 0, b == 1), a > b)
8105 >>> t = Tactic('split-clause')
8109 >>> t = Then(Tactic('split-clause'), Tactic('split-clause'))
8112 >>> t = Then(Tactic('split-clause'), Tactic('split-clause'), Tactic('propagate-values'))
unsigned Z3_API Z3_apply_result_get_num_subgoals(Z3_context c, Z3_apply_result r)
Return the number of subgoals in the Z3_apply_result object returned by Z3_tactic_apply.
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 8142 of file z3py.py.
8143 """Return a Z3 expression consisting of all subgoals.
8148 >>> g.add(Or(x == 2, x == 3))
8149 >>> r = Tactic('simplify')(g)
8151 [[Not(x <= 1), Or(x == 2, x == 3)]]
8153 And(Not(x <= 1), Or(x == 2, x == 3))
8154 >>> r = Tactic('split-clause')(g)
8156 [[x > 1, x == 2], [x > 1, x == 3]]
8158 Or(And(x > 1, x == 2), And(x > 1, x == 3))
expr range(expr const &lo, expr const &hi)