mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 10:55:50 +00:00
expose bounds as vector expressions instead of containing ad-hoc expressions. Issue #911
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e744d0f271
commit
e02160c674
11 changed files with 158 additions and 4 deletions
|
@ -144,6 +144,23 @@ namespace Microsoft.Z3
|
|||
{
|
||||
get { return Lower; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve a lower bound for the objective handle.
|
||||
/// </summary>
|
||||
public ArithExpr[] LowerAsVector
|
||||
{
|
||||
get { return opt.GetLowerAsVector(handle); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve an upper bound for the objective handle.
|
||||
/// </summary>
|
||||
public ArithExpr[] UpperAsVector
|
||||
{
|
||||
get { return opt.GetUpperAsVector(handle); }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -255,6 +272,25 @@ namespace Microsoft.Z3
|
|||
return (ArithExpr)Expr.Create(Context, Native.Z3_optimize_get_upper(Context.nCtx, NativeObject, index));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve a lower bound for the objective handle.
|
||||
/// </summary>
|
||||
private ArithExpr[] GetLowerAsVector(uint index)
|
||||
{
|
||||
ASTVector v = new ASTVector(Context, Native.Z3_optimize_get_lower_as_vector(Context.nCtx, NativeObject, index));
|
||||
return v.ToArithExprArray();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve an upper bound for the objective handle.
|
||||
/// </summary>
|
||||
private ArithExpr[] GetUpperAsVector(uint index)
|
||||
{
|
||||
ASTVector v = new ASTVector(Context, Native.Z3_optimize_get_upper_as_vector(Context.nCtx, NativeObject, index));
|
||||
return v.ToArithExprArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a string the describes why the last to check returned unknown
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue