mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
reset backtrack level at each cube
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
ee3ed3a27a
commit
cb7e53aae4
|
@ -364,9 +364,10 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<BoolExpr> Cube()
|
public IEnumerable<BoolExpr> Cube()
|
||||||
{
|
{
|
||||||
int rounds = 0;
|
|
||||||
while (true) {
|
while (true) {
|
||||||
BoolExpr r = (BoolExpr)Expr.Create(Context, Native.Z3_solver_cube(Context.nCtx, NativeObject, BacktrackLevel));
|
var lvl = BacktrackLevel;
|
||||||
|
BacktrackLevel = uint.MaxValue;
|
||||||
|
BoolExpr r = (BoolExpr)Expr.Create(Context, Native.Z3_solver_cube(Context.nCtx, NativeObject, lvl));
|
||||||
if (r.IsFalse) {
|
if (r.IsFalse) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -374,7 +375,6 @@ namespace Microsoft.Z3
|
||||||
yield return r;
|
yield return r;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++rounds;
|
|
||||||
yield return r;
|
yield return r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6287,7 +6287,9 @@ class Solver(Z3PPObject):
|
||||||
def cube(self):
|
def cube(self):
|
||||||
"""Get set of cubes"""
|
"""Get set of cubes"""
|
||||||
while True:
|
while True:
|
||||||
r = _to_expr_ref(Z3_solver_cube(self.ctx.ref(), self.solver, self.backtrack_level), self.ctx)
|
lvl = self.backtrack_level
|
||||||
|
self.backtrack_level = 4000000000
|
||||||
|
r = _to_expr_ref(Z3_solver_cube(self.ctx.ref(), self.solver, lvl), self.ctx)
|
||||||
if (is_false(r)):
|
if (is_false(r)):
|
||||||
return
|
return
|
||||||
if (is_true(r)):
|
if (is_true(r)):
|
||||||
|
|
Loading…
Reference in a new issue