mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 20:05:51 +00:00
Added conversion function for Goal to Expr conversion in .NET, Java, ML
This commit is contained in:
parent
98f2de3216
commit
004bf1471f
4 changed files with 43 additions and 0 deletions
|
@ -208,6 +208,21 @@ namespace Microsoft.Z3
|
|||
return Native.Z3_goal_to_string(Context.nCtx, NativeObject);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Goal to BoolExpr conversion.
|
||||
/// </summary>
|
||||
/// <returns>A string representation of the Goal.</returns>
|
||||
public BoolExpr AsBoolExpr() {
|
||||
uint n = Size;
|
||||
if (n == 0)
|
||||
return Context.MkTrue();
|
||||
else if (n == 1)
|
||||
return Formulas[0];
|
||||
else {
|
||||
return Context.MkAnd(Formulas);
|
||||
}
|
||||
}
|
||||
|
||||
#region Internal
|
||||
internal Goal(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue