3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-12-18 18:28:33 +00:00

Java API: Bugfixes and Example.

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2012-11-27 23:06:35 +00:00
parent 2dab8147f1
commit a9883e972f
13 changed files with 2372 additions and 31 deletions

View file

@ -59,6 +59,14 @@ public class Solver extends Z3Object
Native.solverPush(Context().nCtx(), NativeObject());
}
/**
* Backtracks one backtracking point. <remarks>.
**/
public void Pop()
{
Pop(1);
}
/**
* Backtracks <paramref name="n"/> backtracking points. <remarks>Note that
* an exception is thrown if <paramref name="n"/> is not smaller than
@ -79,7 +87,7 @@ public class Solver extends Z3Object
}
/**
* Assert a constraint (or multiple) into the solver.
* Assert a multiple constraints into the solver.
* @throws Z3Exception
**/
public void Assert(BoolExpr[] constraints) throws Z3Exception
@ -92,6 +100,16 @@ public class Solver extends Z3Object
}
}
/**
* Assert one constraint into the solver.
* @throws Z3Exception
**/
public void Assert(BoolExpr constraint) throws Z3Exception
{
Context().CheckContextMatch(constraint);
Native.solverAssert(Context().nCtx(), NativeObject(), constraint.NativeObject());
}
/**
* The number of assertions in the solver.
* @throws Z3Exception
@ -144,6 +162,16 @@ public class Solver extends Z3Object
}
}
/**
* Checks whether the assertions in the solver are consistent or not.
* <remarks> <seealso cref="Model"/> <seealso cref="UnsatCore"/> <seealso
* cref="Proof"/> </remarks>
**/
public Status Check()
{
return Check(null);
}
/**
* The model of the last <code>Check</code>. <remarks> The result is
* <code>null</code> if <code>Check</code> was not invoked before, if its