mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
add pb constraints to API
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
d1937b2032
commit
2d3f6ca71d
|
@ -2249,6 +2249,36 @@ namespace Microsoft.Z3
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Pseudo-Boolean constraints
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create an at-most-k constraint.
|
||||||
|
/// </summary>
|
||||||
|
public BoolExpr MkAtMost(BoolExpr[] args, uint k)
|
||||||
|
{
|
||||||
|
Contract.Requires(args != null);
|
||||||
|
Contract.Requires(Contract.Result<BoolExpr[]>() != null);
|
||||||
|
CheckContextMatch(args);
|
||||||
|
return new BoolExpr(this, Native.Z3_mk_atmost(nCtx, (uint) args.Length,
|
||||||
|
AST.ArrayToNative(args), k));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a pseudo-Boolean <= constraint.
|
||||||
|
/// </summary>
|
||||||
|
public BoolExpr MkPBLe(int[] coeffs, BoolExpr[] args, int k)
|
||||||
|
{
|
||||||
|
Contract.Requires(args != null);
|
||||||
|
Contract.Requires(coeffs != null);
|
||||||
|
Contract.Requires(args.Length == coeffs.Length);
|
||||||
|
Contract.Requires(Contract.Result<BoolExpr[]>() != null);
|
||||||
|
CheckContextMatch(args);
|
||||||
|
return new BoolExpr(this, Native.Z3_mk_pble(nCtx, (uint) args.Length,
|
||||||
|
AST.ArrayToNative(args),
|
||||||
|
coeffs, k));
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Numerals
|
#region Numerals
|
||||||
|
|
||||||
#region General Numerals
|
#region General Numerals
|
||||||
|
|
Loading…
Reference in a new issue