mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 11:55:51 +00:00
merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
c513f3ca09
883 changed files with 13979 additions and 16480 deletions
|
@ -2262,7 +2262,7 @@ namespace Microsoft.Z3
|
|||
/// Maps f on the argument arrays.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Eeach element of <c>args</c> must be of an array sort <c>[domain_i -> range_i]</c>.
|
||||
/// Each element of <c>args</c> must be of an array sort <c>[domain_i -> range_i]</c>.
|
||||
/// The function declaration <c>f</c> must have type <c> range_1 .. range_n -> range</c>.
|
||||
/// <c>v</c> must have sort range. The sort of the result is <c>[domain_i -> range]</c>.
|
||||
/// <seealso cref="MkArraySort(Sort, Sort)"/>
|
||||
|
@ -2515,7 +2515,7 @@ namespace Microsoft.Z3
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// Concatentate sequences.
|
||||
/// Concatenate sequences.
|
||||
/// </summary>
|
||||
public SeqExpr MkConcat(params SeqExpr[] t)
|
||||
{
|
||||
|
@ -2862,7 +2862,7 @@ namespace Microsoft.Z3
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Term of a given sort. This function can be use to create numerals that fit in a machine integer.
|
||||
/// Create a Term of a given sort. This function can be used to create numerals that fit in a machine integer.
|
||||
/// It is slightly faster than <c>MakeNumeral</c> since it is not necessary to parse a string.
|
||||
/// </summary>
|
||||
/// <param name="v">Value of the numeral</param>
|
||||
|
@ -2878,7 +2878,7 @@ namespace Microsoft.Z3
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Term of a given sort. This function can be use to create numerals that fit in a machine integer.
|
||||
/// Create a Term of a given sort. This function can be used to create numerals that fit in a machine integer.
|
||||
/// It is slightly faster than <c>MakeNumeral</c> since it is not necessary to parse a string.
|
||||
/// </summary>
|
||||
/// <param name="v">Value of the numeral</param>
|
||||
|
@ -2894,7 +2894,7 @@ namespace Microsoft.Z3
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Term of a given sort. This function can be use to create numerals that fit in a machine integer.
|
||||
/// Create a Term of a given sort. This function can be used to create numerals that fit in a machine integer.
|
||||
/// It is slightly faster than <c>MakeNumeral</c> since it is not necessary to parse a string.
|
||||
/// </summary>
|
||||
/// <param name="v">Value of the numeral</param>
|
||||
|
@ -2910,7 +2910,7 @@ namespace Microsoft.Z3
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a Term of a given sort. This function can be use to create numerals that fit in a machine integer.
|
||||
/// Create a Term of a given sort. This function can be used to create numerals that fit in a machine integer.
|
||||
/// It is slightly faster than <c>MakeNumeral</c> since it is not necessary to parse a string.
|
||||
/// </summary>
|
||||
/// <param name="v">Value of the numeral</param>
|
||||
|
@ -3127,6 +3127,20 @@ namespace Microsoft.Z3
|
|||
|
||||
return (BitVecNum)MkNumeral(v, MkBitVecSort(size));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a bit-vector numeral.
|
||||
/// </summary>
|
||||
/// <param name="bits">An array of bits representing the bit-vector. Least signficant bit is at position 0.</param>
|
||||
public BitVecNum MkBV(bool[] bits)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<BitVecNum>() != null);
|
||||
int[] _bits = new int[bits.Length];
|
||||
for (int i = 0; i < bits.Length; ++i) _bits[i] = bits[i] ? 1 : 0;
|
||||
return (BitVecNum)Expr.Create(this, Native.Z3_mk_bv_numeral(nCtx, (uint)bits.Length, _bits));
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion // Numerals
|
||||
|
@ -3197,7 +3211,7 @@ namespace Microsoft.Z3
|
|||
/// Create an existential Quantifier.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Creates an existential quantifier using de-Brujin indexed variables.
|
||||
/// Creates an existential quantifier using de-Bruijn indexed variables.
|
||||
/// (<see cref="MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)"/>).
|
||||
/// </remarks>
|
||||
public Quantifier MkExists(Sort[] sorts, Symbol[] names, Expr body, uint weight = 1, Pattern[] patterns = null, Expr[] noPatterns = null, Symbol quantifierID = null, Symbol skolemID = null)
|
||||
|
@ -3306,160 +3320,10 @@ namespace Microsoft.Z3
|
|||
#endregion
|
||||
|
||||
#region SMT Files & Strings
|
||||
/// <summary>
|
||||
/// Convert a benchmark into an SMT-LIB formatted string.
|
||||
/// </summary>
|
||||
/// <param name="name">Name of the benchmark. The argument is optional.</param>
|
||||
/// <param name="logic">The benchmark logic. </param>
|
||||
/// <param name="status">The status string (sat, unsat, or unknown)</param>
|
||||
/// <param name="attributes">Other attributes, such as source, difficulty or category.</param>
|
||||
/// <param name="assumptions">Auxiliary assumptions.</param>
|
||||
/// <param name="formula">Formula to be checked for consistency in conjunction with assumptions.</param>
|
||||
/// <returns>A string representation of the benchmark.</returns>
|
||||
public string BenchmarkToSMTString(string name, string logic, string status, string attributes,
|
||||
BoolExpr[] assumptions, BoolExpr formula)
|
||||
{
|
||||
Contract.Requires(assumptions != null);
|
||||
Contract.Requires(formula != null);
|
||||
Contract.Ensures(Contract.Result<string>() != null);
|
||||
|
||||
return Native.Z3_benchmark_to_smtlib_string(nCtx, name, logic, status, attributes,
|
||||
(uint)assumptions.Length, AST.ArrayToNative(assumptions),
|
||||
formula.NativeObject);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse the given string using the SMT-LIB parser.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The symbol table of the parser can be initialized using the given sorts and declarations.
|
||||
/// The symbols in the arrays <paramref name="sortNames"/> and <paramref name="declNames"/>
|
||||
/// don't need to match the names of the sorts and declarations in the arrays <paramref name="sorts"/>
|
||||
/// and <paramref name="decls"/>. This is a useful feature since we can use arbitrary names to
|
||||
/// reference sorts and declarations.
|
||||
/// </remarks>
|
||||
public void ParseSMTLIBString(string str, Symbol[] sortNames = null, Sort[] sorts = null, Symbol[] declNames = null, FuncDecl[] decls = null)
|
||||
{
|
||||
uint csn = Symbol.ArrayLength(sortNames);
|
||||
uint cs = Sort.ArrayLength(sorts);
|
||||
uint cdn = Symbol.ArrayLength(declNames);
|
||||
uint cd = AST.ArrayLength(decls);
|
||||
if (csn != cs || cdn != cd)
|
||||
throw new Z3Exception("Argument size mismatch");
|
||||
Native.Z3_parse_smtlib_string(nCtx, str,
|
||||
AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts),
|
||||
AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse the given file using the SMT-LIB parser.
|
||||
/// </summary>
|
||||
/// <seealso cref="ParseSMTLIBString"/>
|
||||
public void ParseSMTLIBFile(string fileName, Symbol[] sortNames = null, Sort[] sorts = null, Symbol[] declNames = null, FuncDecl[] decls = null)
|
||||
{
|
||||
uint csn = Symbol.ArrayLength(sortNames);
|
||||
uint cs = Sort.ArrayLength(sorts);
|
||||
uint cdn = Symbol.ArrayLength(declNames);
|
||||
uint cd = AST.ArrayLength(decls);
|
||||
if (csn != cs || cdn != cd)
|
||||
throw new Z3Exception("Argument size mismatch");
|
||||
Native.Z3_parse_smtlib_file(nCtx, fileName,
|
||||
AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts),
|
||||
AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The number of SMTLIB formulas parsed by the last call to <c>ParseSMTLIBString</c> or <c>ParseSMTLIBFile</c>.
|
||||
/// </summary>
|
||||
public uint NumSMTLIBFormulas { get { return Native.Z3_get_smtlib_num_formulas(nCtx); } }
|
||||
|
||||
/// <summary>
|
||||
/// The formulas parsed by the last call to <c>ParseSMTLIBString</c> or <c>ParseSMTLIBFile</c>.
|
||||
/// </summary>
|
||||
public BoolExpr[] SMTLIBFormulas
|
||||
{
|
||||
get
|
||||
{
|
||||
Contract.Ensures(Contract.Result<BoolExpr[]>() != null);
|
||||
|
||||
uint n = NumSMTLIBFormulas;
|
||||
BoolExpr[] res = new BoolExpr[n];
|
||||
for (uint i = 0; i < n; i++)
|
||||
res[i] = (BoolExpr)Expr.Create(this, Native.Z3_get_smtlib_formula(nCtx, i));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The number of SMTLIB assumptions parsed by the last call to <c>ParseSMTLIBString</c> or <c>ParseSMTLIBFile</c>.
|
||||
/// </summary>
|
||||
public uint NumSMTLIBAssumptions { get { return Native.Z3_get_smtlib_num_assumptions(nCtx); } }
|
||||
|
||||
/// <summary>
|
||||
/// The assumptions parsed by the last call to <c>ParseSMTLIBString</c> or <c>ParseSMTLIBFile</c>.
|
||||
/// </summary>
|
||||
public BoolExpr[] SMTLIBAssumptions
|
||||
{
|
||||
get
|
||||
{
|
||||
Contract.Ensures(Contract.Result<BoolExpr[]>() != null);
|
||||
|
||||
uint n = NumSMTLIBAssumptions;
|
||||
BoolExpr[] res = new BoolExpr[n];
|
||||
for (uint i = 0; i < n; i++)
|
||||
res[i] = (BoolExpr)Expr.Create(this, Native.Z3_get_smtlib_assumption(nCtx, i));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The number of SMTLIB declarations parsed by the last call to <c>ParseSMTLIBString</c> or <c>ParseSMTLIBFile</c>.
|
||||
/// </summary>
|
||||
public uint NumSMTLIBDecls { get { return Native.Z3_get_smtlib_num_decls(nCtx); } }
|
||||
|
||||
/// <summary>
|
||||
/// The declarations parsed by the last call to <c>ParseSMTLIBString</c> or <c>ParseSMTLIBFile</c>.
|
||||
/// </summary>
|
||||
public FuncDecl[] SMTLIBDecls
|
||||
{
|
||||
get
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FuncDecl[]>() != null);
|
||||
|
||||
uint n = NumSMTLIBDecls;
|
||||
FuncDecl[] res = new FuncDecl[n];
|
||||
for (uint i = 0; i < n; i++)
|
||||
res[i] = new FuncDecl(this, Native.Z3_get_smtlib_decl(nCtx, i));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The number of SMTLIB sorts parsed by the last call to <c>ParseSMTLIBString</c> or <c>ParseSMTLIBFile</c>.
|
||||
/// </summary>
|
||||
public uint NumSMTLIBSorts { get { return Native.Z3_get_smtlib_num_sorts(nCtx); } }
|
||||
|
||||
/// <summary>
|
||||
/// The declarations parsed by the last call to <c>ParseSMTLIBString</c> or <c>ParseSMTLIBFile</c>.
|
||||
/// </summary>
|
||||
public Sort[] SMTLIBSorts
|
||||
{
|
||||
get
|
||||
{
|
||||
Contract.Ensures(Contract.Result<Sort[]>() != null);
|
||||
|
||||
uint n = NumSMTLIBSorts;
|
||||
Sort[] res = new Sort[n];
|
||||
for (uint i = 0; i < n; i++)
|
||||
res[i] = Sort.Create(this, Native.Z3_get_smtlib_sort(nCtx, i));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse the given string using the SMT-LIB2 parser.
|
||||
/// </summary>
|
||||
/// <seealso cref="ParseSMTLIBString"/>
|
||||
/// <returns>A conjunction of assertions in the scope (up to push/pop) at the end of the string.</returns>
|
||||
public BoolExpr[] ParseSMTLIB2String(string str, Symbol[] sortNames = null, Sort[] sorts = null, Symbol[] declNames = null, FuncDecl[] decls = null)
|
||||
{
|
||||
|
@ -3735,7 +3599,7 @@ namespace Microsoft.Z3
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a tactic that fails if the goal is not triviall satisfiable (i.e., empty)
|
||||
/// Create a tactic that fails if the goal is not trivially satisfiable (i.e., empty)
|
||||
/// or trivially unsatisfiable (i.e., contains `false').
|
||||
/// </summary>
|
||||
public Tactic FailIfNotDecided()
|
||||
|
@ -4794,7 +4658,7 @@ namespace Microsoft.Z3
|
|||
/// Conversion of a floating-point term into a bit-vector.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Produces a term that represents the conversion of the floating-poiunt term t into a
|
||||
/// Produces a term that represents the conversion of the floating-point term t into a
|
||||
/// bit-vector term of size sz in 2's complement format (signed when signed==true). If necessary,
|
||||
/// the result will be rounded according to rounding mode rm.
|
||||
/// </remarks>
|
||||
|
@ -4815,7 +4679,7 @@ namespace Microsoft.Z3
|
|||
/// Conversion of a floating-point term into a real-numbered term.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Produces a term that represents the conversion of the floating-poiunt term t into a
|
||||
/// Produces a term that represents the conversion of the floating-point term t into a
|
||||
/// real number. Note that this type of conversion will often result in non-linear
|
||||
/// constraints over real terms.
|
||||
/// </remarks>
|
||||
|
@ -4834,7 +4698,7 @@ namespace Microsoft.Z3
|
|||
/// <remarks>
|
||||
/// The size of the resulting bit-vector is automatically determined. Note that
|
||||
/// IEEE 754-2008 allows multiple different representations of NaN. This conversion
|
||||
/// knows only one NaN and it will always produce the same bit-vector represenatation of
|
||||
/// knows only one NaN and it will always produce the same bit-vector representation of
|
||||
/// that NaN.
|
||||
/// </remarks>
|
||||
/// <param name="t">FloatingPoint term.</param>
|
||||
|
|
|
@ -932,7 +932,7 @@ namespace Microsoft.Z3
|
|||
/// Indicates whether the term is a proof by condensed transitivity of a relation
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Condensed transitivity proof. This proof object is only used if the parameter PROOF_MODE is 1.
|
||||
/// Condensed transitivity proof.
|
||||
/// It combines several symmetry and transitivity proofs.
|
||||
/// Example:
|
||||
/// T1: (R a b)
|
||||
|
@ -959,7 +959,7 @@ namespace Microsoft.Z3
|
|||
/// Tn: (R t_n s_n)
|
||||
/// [monotonicity T1 ... Tn]: (R (f t_1 ... t_n) (f s_1 ... s_n))
|
||||
/// Remark: if t_i == s_i, then the antecedent Ti is suppressed.
|
||||
/// That is, reflexivity proofs are supressed to save space.
|
||||
/// That is, reflexivity proofs are suppressed to save space.
|
||||
/// </remarks>
|
||||
public bool IsProofMonotonicity { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_MONOTONICITY; } }
|
||||
|
||||
|
@ -1002,7 +1002,7 @@ namespace Microsoft.Z3
|
|||
public bool IsProofAndElimination { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_AND_ELIM; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is a proof by eliminiation of not-or
|
||||
/// Indicates whether the term is a proof by elimination of not-or
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Given a proof for (not (or l_1 ... l_n)), produces a proof for (not l_i).
|
||||
|
@ -1035,14 +1035,11 @@ namespace Microsoft.Z3
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A proof for rewriting an expression t into an expression s.
|
||||
/// This proof object is used if the parameter PROOF_MODE is 1.
|
||||
/// This proof object can have n antecedents.
|
||||
/// The antecedents are proofs for equalities used as substitution rules.
|
||||
/// The object is also used in a few cases if the parameter PROOF_MODE is 2.
|
||||
/// The cases are:
|
||||
/// The object is used in a few cases:
|
||||
/// - When applying contextual simplification (CONTEXT_SIMPLIFIER=true)
|
||||
/// - When converting bit-vectors to Booleans (BIT2BOOL=true)
|
||||
/// - When pulling ite expression up (PULL_CHEAP_ITE_TREES=true)
|
||||
/// </remarks>
|
||||
public bool IsProofRewriteStar { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_REWRITE_STAR; } }
|
||||
|
||||
|
@ -1054,15 +1051,6 @@ namespace Microsoft.Z3
|
|||
/// </remarks>
|
||||
public bool IsProofPullQuant { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_PULL_QUANT; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is a proof for pulling quantifiers out.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A proof for (iff P Q) where Q is in prenex normal form.
|
||||
/// This proof object is only used if the parameter PROOF_MODE is 1.
|
||||
/// This proof object has no antecedents
|
||||
/// </remarks>
|
||||
public bool IsProofPullQuantStar { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_PULL_QUANT_STAR; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is a proof for pushing quantifiers in.
|
||||
|
@ -1112,7 +1100,7 @@ namespace Microsoft.Z3
|
|||
public bool IsProofQuantInst { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_QUANT_INST; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is a hypthesis marker.
|
||||
/// Indicates whether the term is a hypothesis marker.
|
||||
/// </summary>
|
||||
/// <remarks>Mark a hypothesis in a natural deduction style proof.</remarks>
|
||||
public bool IsProofHypothesis { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_HYPOTHESIS; } }
|
||||
|
@ -1304,28 +1292,6 @@ namespace Microsoft.Z3
|
|||
/// </remarks>
|
||||
public bool IsProofNNFNeg { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_NNF_NEG; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is a proof for (~ P Q) here Q is in negation normal form.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A proof for (~ P Q) where Q is in negation normal form.
|
||||
///
|
||||
/// This proof object is only used if the parameter PROOF_MODE is 1.
|
||||
///
|
||||
/// This proof object may have n antecedents. Each antecedent is a PR_DEF_INTRO.
|
||||
/// </remarks>
|
||||
public bool IsProofNNFStar { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_NNF_STAR; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is a proof for (~ P Q) where Q is in conjunctive normal form.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A proof for (~ P Q) where Q is in conjunctive normal form.
|
||||
/// This proof object is only used if the parameter PROOF_MODE is 1.
|
||||
/// This proof object may have n antecedents. Each antecedent is a PR_DEF_INTRO.
|
||||
/// </remarks>
|
||||
public bool IsProofCNFStar { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_CNF_STAR; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is a proof for a Skolemization step
|
||||
/// </summary>
|
||||
|
@ -1433,7 +1399,7 @@ namespace Microsoft.Z3
|
|||
/// <remarks>
|
||||
/// Filter (restrict) a relation with respect to a predicate.
|
||||
/// The first argument is a relation.
|
||||
/// The second argument is a predicate with free de-Brujin indices
|
||||
/// The second argument is a predicate with free de-Bruijn indices
|
||||
/// corresponding to the columns of the relation.
|
||||
/// So the first column in the relation has index 0.
|
||||
/// </remarks>
|
||||
|
@ -1649,7 +1615,7 @@ namespace Microsoft.Z3
|
|||
public bool IsFPMul { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_MUL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is a floating-point divison term
|
||||
/// Indicates whether the term is a floating-point division term
|
||||
/// </summary>
|
||||
public bool IsFPDiv { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_DIV; } }
|
||||
|
||||
|
@ -1709,7 +1675,7 @@ namespace Microsoft.Z3
|
|||
public bool IsFPLe { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_LE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is a floating-point greater-than or erqual term
|
||||
/// Indicates whether the term is a floating-point greater-than or equal term
|
||||
/// </summary>
|
||||
public bool IsFPGe { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_GE; } }
|
||||
|
||||
|
@ -1789,7 +1755,7 @@ namespace Microsoft.Z3
|
|||
|
||||
#region Bound Variables
|
||||
/// <summary>
|
||||
/// The de-Burijn index of a bound variable.
|
||||
/// The de-Bruijn index of a bound variable.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Bound variables are indexed by de-Bruijn indices. It is perhaps easiest to explain
|
||||
|
|
|
@ -253,7 +253,7 @@ namespace Microsoft.Z3
|
|||
/// The uninterpreted sorts that the model has an interpretation for.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Z3 also provides an intepretation for uninterpreted sorts used in a formula.
|
||||
/// Z3 also provides an interpretation for uninterpreted sorts used in a formula.
|
||||
/// The interpretation for a sort is a finite set of distinct values. We say this finite set is
|
||||
/// the "universe" of the sort.
|
||||
/// </remarks>
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace Microsoft.Z3
|
|||
/// <summary>
|
||||
/// Retrieve a lower bound for the objective handle.
|
||||
/// </summary>
|
||||
public ArithExpr Lower
|
||||
public Expr Lower
|
||||
{
|
||||
get { return opt.GetLower(handle); }
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ namespace Microsoft.Z3
|
|||
/// <summary>
|
||||
/// Retrieve an upper bound for the objective handle.
|
||||
/// </summary>
|
||||
public ArithExpr Upper
|
||||
public Expr Upper
|
||||
{
|
||||
get { return opt.GetUpper(handle); }
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ namespace Microsoft.Z3
|
|||
/// <summary>
|
||||
/// Retrieve the value of an objective.
|
||||
/// </summary>
|
||||
public ArithExpr Value
|
||||
public Expr Value
|
||||
{
|
||||
get { return Lower; }
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ namespace Microsoft.Z3
|
|||
/// <summary>
|
||||
/// Retrieve a lower bound for the objective handle.
|
||||
/// </summary>
|
||||
public ArithExpr[] LowerAsVector
|
||||
public Expr[] LowerAsVector
|
||||
{
|
||||
get { return opt.GetLowerAsVector(handle); }
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ namespace Microsoft.Z3
|
|||
/// <summary>
|
||||
/// Retrieve an upper bound for the objective handle.
|
||||
/// </summary>
|
||||
public ArithExpr[] UpperAsVector
|
||||
public Expr[] UpperAsVector
|
||||
{
|
||||
get { return opt.GetUpperAsVector(handle); }
|
||||
}
|
||||
|
@ -240,8 +240,9 @@ namespace Microsoft.Z3
|
|||
/// Declare an arithmetical maximization objective.
|
||||
/// Return a handle to the objective. The handle is used as
|
||||
/// to retrieve the values of objectives after calling Check.
|
||||
/// The expression can be either an arithmetical expression or bit-vector.
|
||||
/// </summary>
|
||||
public Handle MkMaximize(ArithExpr e)
|
||||
public Handle MkMaximize(Expr e)
|
||||
{
|
||||
return new Handle(this, Native.Z3_optimize_maximize(Context.nCtx, NativeObject, e.NativeObject));
|
||||
}
|
||||
|
@ -250,45 +251,46 @@ namespace Microsoft.Z3
|
|||
/// Declare an arithmetical minimization objective.
|
||||
/// Similar to MkMaximize.
|
||||
/// </summary>
|
||||
public Handle MkMinimize(ArithExpr e)
|
||||
public Handle MkMinimize(Expr e)
|
||||
{
|
||||
return new Handle(this, Native.Z3_optimize_minimize(Context.nCtx, NativeObject, e.NativeObject));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve a lower bound for the objective handle.
|
||||
/// </summary>
|
||||
private ArithExpr GetLower(uint index)
|
||||
private Expr GetLower(uint index)
|
||||
{
|
||||
return (ArithExpr)Expr.Create(Context, Native.Z3_optimize_get_lower(Context.nCtx, NativeObject, index));
|
||||
return Expr.Create(Context, Native.Z3_optimize_get_lower(Context.nCtx, NativeObject, index));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve an upper bound for the objective handle.
|
||||
/// </summary>
|
||||
private ArithExpr GetUpper(uint index)
|
||||
private Expr GetUpper(uint index)
|
||||
{
|
||||
return (ArithExpr)Expr.Create(Context, Native.Z3_optimize_get_upper(Context.nCtx, NativeObject, index));
|
||||
return 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)
|
||||
private Expr[] GetLowerAsVector(uint index)
|
||||
{
|
||||
ASTVector v = new ASTVector(Context, Native.Z3_optimize_get_lower_as_vector(Context.nCtx, NativeObject, index));
|
||||
return v.ToArithExprArray();
|
||||
return v.ToExprArray();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve an upper bound for the objective handle.
|
||||
/// </summary>
|
||||
private ArithExpr[] GetUpperAsVector(uint index)
|
||||
private Expr[] GetUpperAsVector(uint index)
|
||||
{
|
||||
ASTVector v = new ASTVector(Context, Native.Z3_optimize_get_upper_as_vector(Context.nCtx, NativeObject, index));
|
||||
return v.ToArithExprArray();
|
||||
return v.ToExprArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -55,8 +55,8 @@ namespace Microsoft.Z3
|
|||
/// </summary>
|
||||
public Params Add(Symbol name, double value)
|
||||
{
|
||||
Contract.Requires(name != null);
|
||||
|
||||
Contract.Requires(name != null);
|
||||
|
||||
Native.Z3_params_set_double(Context.nCtx, NativeObject, name.NativeObject, value);
|
||||
return this;
|
||||
}
|
||||
|
@ -91,7 +91,11 @@ namespace Microsoft.Z3
|
|||
public Params Add(string name, bool value)
|
||||
{
|
||||
Native.Z3_params_set_bool(Context.nCtx, NativeObject, Context.MkSymbol(name).NativeObject, (value) ? 1 : 0);
|
||||
<<<<<<< HEAD
|
||||
return this;
|
||||
=======
|
||||
return this;
|
||||
>>>>>>> fc719a5ee82361ffedb9ef46793e3401fdc32cc5
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -100,7 +104,11 @@ namespace Microsoft.Z3
|
|||
public Params Add(string name, uint value)
|
||||
{
|
||||
Native.Z3_params_set_uint(Context.nCtx, NativeObject, Context.MkSymbol(name).NativeObject, value);
|
||||
<<<<<<< HEAD
|
||||
return this;
|
||||
=======
|
||||
return this;
|
||||
>>>>>>> fc719a5ee82361ffedb9ef46793e3401fdc32cc5
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -99,6 +99,49 @@ namespace Microsoft.Z3
|
|||
public void Set(Symbol name, Symbol value) { Parameters = Context.MkParams().Add(name, value); }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets parameter on the solver
|
||||
/// </summary>
|
||||
public void Set(string name, bool value) { Parameters = Context.MkParams().Add(name, value); }
|
||||
/// <summary>
|
||||
/// Sets parameter on the solver
|
||||
/// </summary>
|
||||
public void Set(string name, uint value) { Parameters = Context.MkParams().Add(name, value); }
|
||||
/// <summary>
|
||||
/// Sets parameter on the solver
|
||||
/// </summary>
|
||||
public void Set(string name, double value) { Parameters = Context.MkParams().Add(name, value); }
|
||||
/// <summary>
|
||||
/// Sets parameter on the solver
|
||||
/// </summary>
|
||||
public void Set(string name, string value) { Parameters = Context.MkParams().Add(name, value); }
|
||||
/// <summary>
|
||||
/// Sets parameter on the solver
|
||||
/// </summary>
|
||||
public void Set(string name, Symbol value) { Parameters = Context.MkParams().Add(name, value); }
|
||||
/// <summary>
|
||||
/// Sets parameter on the solver
|
||||
/// </summary>
|
||||
public void Set(Symbol name, bool value) { Parameters = Context.MkParams().Add(name, value); }
|
||||
/// <summary>
|
||||
/// Sets parameter on the solver
|
||||
/// </summary>
|
||||
public void Set(Symbol name, uint value) { Parameters = Context.MkParams().Add(name, value); }
|
||||
/// <summary>
|
||||
/// Sets parameter on the solver
|
||||
/// </summary>
|
||||
public void Set(Symbol name, double value) { Parameters = Context.MkParams().Add(name, value); }
|
||||
/// <summary>
|
||||
/// Sets parameter on the solver
|
||||
/// </summary>
|
||||
public void Set(Symbol name, string value) { Parameters = Context.MkParams().Add(name, value); }
|
||||
/// <summary>
|
||||
/// Sets parameter on the solver
|
||||
/// </summary>
|
||||
public void Set(Symbol name, Symbol value) { Parameters = Context.MkParams().Add(name, value); }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves parameter descriptions for solver.
|
||||
/// </summary>
|
||||
|
@ -316,7 +359,10 @@ namespace Microsoft.Z3
|
|||
return lboolToStatus(r);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> fc719a5ee82361ffedb9ef46793e3401fdc32cc5
|
||||
/// <summary>
|
||||
/// Retrieve fixed assignments to the set of variables in the form of consequences.
|
||||
/// Each consequence is an implication of the form
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace Microsoft.Z3
|
|||
public bool IsDouble { get { return m_is_double; } }
|
||||
|
||||
/// <summary>
|
||||
/// The string representation of the the entry's value.
|
||||
/// The string representation of the entry's value.
|
||||
/// </summary>
|
||||
public string Value
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue