mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 02:45: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
|
@ -221,6 +221,22 @@ public class Goal extends Z3Object
|
|||
return "Z3Exception: " + e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Goal to BoolExpr conversion.
|
||||
*
|
||||
* Returns a string representation of the Goal.
|
||||
**/
|
||||
public BoolExpr AsBoolExpr() {
|
||||
int n = size();
|
||||
if (n == 0)
|
||||
return getContext().mkTrue();
|
||||
else if (n == 1)
|
||||
return getFormulas()[0];
|
||||
else {
|
||||
return getContext().mkAnd(getFormulas());
|
||||
}
|
||||
}
|
||||
|
||||
Goal(Context ctx, long obj)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue