3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

update to vector format

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-11-10 15:28:16 -08:00
parent cb7e53aae4
commit 454e12fc49
17 changed files with 47 additions and 46 deletions

View file

@ -362,20 +362,19 @@ namespace Microsoft.Z3
/// <summary>
/// Return a set of cubes.
/// </summary>
public IEnumerable<BoolExpr> Cube()
public IEnumerable<BoolExpr[]> Cube()
{
while (true) {
var lvl = BacktrackLevel;
BacktrackLevel = uint.MaxValue;
BoolExpr r = (BoolExpr)Expr.Create(Context, Native.Z3_solver_cube(Context.nCtx, NativeObject, lvl));
if (r.IsFalse) {
ASTVector r = new ASTVector(Context, Native.Z3_solver_cube(Context.nCtx, NativeObject, lvl));
if (r.Size == 1 && ((Expr)r[0]).IsFalse) {
break;
}
if (r.IsTrue) {
yield return r;
break;
yield return r.ToBoolExprArray();
if (r.Size == 0) {
break;
}
yield return r;
}
}