mirror of
https://github.com/Z3Prover/z3
synced 2025-06-03 21:01:22 +00:00
fix debug build, add access to numerics from model
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e98da4320b
commit
d45b8a3ac8
3 changed files with 29 additions and 1 deletions
|
@ -931,6 +931,26 @@ namespace Microsoft.Z3
|
||||||
return new BoolExpr(this, Native.Z3_mk_xor(nCtx, t1.NativeObject, t2.NativeObject));
|
return new BoolExpr(this, Native.Z3_mk_xor(nCtx, t1.NativeObject, t2.NativeObject));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create an expression representing <c>t1 xor t2 xor t3 ... </c>.
|
||||||
|
/// </summary>
|
||||||
|
public BoolExpr MkXor(IEnumerable<BoolExpr> ts)
|
||||||
|
{
|
||||||
|
Debug.Assert(ts != null);
|
||||||
|
Debug.Assert(ts.All(a => a != null));
|
||||||
|
CheckContextMatch<BoolExpr>(ts);
|
||||||
|
BoolExpr r = null;
|
||||||
|
foreach (var t in ts) {
|
||||||
|
if (r == null)
|
||||||
|
r = t;
|
||||||
|
else
|
||||||
|
r = MkXor(r, t);
|
||||||
|
}
|
||||||
|
if (r == null)
|
||||||
|
r = MkTrue();
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create an expression representing <c>t[0] and t[1] and ...</c>.
|
/// Create an expression representing <c>t[0] and t[1] and ...</c>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -238,6 +238,14 @@ namespace Microsoft.Z3
|
||||||
return Eval(t, completion);
|
return Eval(t, completion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Evaluate expression to a double, assuming it is a numeral already.
|
||||||
|
/// </summary>
|
||||||
|
public double Double(Expr t) {
|
||||||
|
var r = Eval(t, true);
|
||||||
|
return Native.Z3_get_numeral_double(Context.nCtx, r.NativeObject);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The number of uninterpreted sorts that the model has an interpretation for.
|
/// The number of uninterpreted sorts that the model has an interpretation for.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -405,7 +405,7 @@ public:
|
||||||
|
|
||||||
TRACE("opt",
|
TRACE("opt",
|
||||||
tout << "sat: " << is_sat << " num cores: " << cores.size() << "\n";
|
tout << "sat: " << is_sat << " num cores: " << cores.size() << "\n";
|
||||||
for (auto const& c : cores) display_vec(tout, c);
|
for (auto const& c : cores) display_vec(tout, c.m_core);
|
||||||
tout << "num assumptions: " << m_asms.size() << "\n";);
|
tout << "num assumptions: " << m_asms.size() << "\n";);
|
||||||
|
|
||||||
return is_sat;
|
return is_sat;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue