mirror of
https://github.com/Z3Prover/z3
synced 2025-06-08 07:03:23 +00:00
Java API: slight overhaul in preparation for the FP additions
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
8e7278f02c
commit
376614a782
38 changed files with 1289 additions and 889 deletions
|
@ -56,8 +56,9 @@ public class Solver extends Z3Object
|
|||
}
|
||||
|
||||
/**
|
||||
* The current number of backtracking points (scopes). <seealso cref="Pop"/>
|
||||
* <seealso cref="Push"/>
|
||||
* The current number of backtracking points (scopes).
|
||||
* @see pop
|
||||
* @see push
|
||||
**/
|
||||
public int getNumScopes() throws Z3Exception
|
||||
{
|
||||
|
@ -66,7 +67,8 @@ public class Solver extends Z3Object
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a backtracking point. <seealso cref="Pop"/>
|
||||
* Creates a backtracking point.
|
||||
* @see pop
|
||||
**/
|
||||
public void push() throws Z3Exception
|
||||
{
|
||||
|
@ -74,7 +76,8 @@ public class Solver extends Z3Object
|
|||
}
|
||||
|
||||
/**
|
||||
* Backtracks one backtracking point. <remarks>.
|
||||
* Backtracks one backtracking point.
|
||||
* Remarks: .
|
||||
**/
|
||||
public void pop() throws Z3Exception
|
||||
{
|
||||
|
@ -82,9 +85,11 @@ public class Solver extends Z3Object
|
|||
}
|
||||
|
||||
/**
|
||||
* Backtracks <paramref name="n"/> backtracking points. <remarks>Note that
|
||||
* an exception is thrown if <paramref name="n"/> is not smaller than
|
||||
* <code>NumScopes</code></remarks> <seealso cref="Push"/>
|
||||
* Backtracks {@code n} backtracking points.
|
||||
* Remarks: Note that
|
||||
* an exception is thrown if {@code n} is not smaller than
|
||||
* {@code NumScopes}
|
||||
* @see push
|
||||
**/
|
||||
public void pop(int n) throws Z3Exception
|
||||
{
|
||||
|
@ -92,8 +97,9 @@ public class Solver extends Z3Object
|
|||
}
|
||||
|
||||
/**
|
||||
* Resets the Solver. <remarks>This removes all assertions from the
|
||||
* solver.</remarks>
|
||||
* Resets the Solver.
|
||||
* Remarks: This removes all assertions from the
|
||||
* solver.
|
||||
**/
|
||||
public void reset() throws Z3Exception
|
||||
{
|
||||
|
@ -115,12 +121,12 @@ public class Solver extends Z3Object
|
|||
}
|
||||
}
|
||||
|
||||
// / <summary>
|
||||
// /
|
||||
// / Assert multiple constraints into the solver, and track them (in the
|
||||
// unsat) core
|
||||
// / using the Boolean constants in ps.
|
||||
// / </summary>
|
||||
// / <remarks>
|
||||
// /
|
||||
// / Remarks:
|
||||
// / This API is an alternative to <see cref="Check"/> with assumptions for
|
||||
// extracting unsat cores.
|
||||
// / Both APIs can be used in the same solver. The unsat core will contain a
|
||||
|
@ -128,7 +134,7 @@ public class Solver extends Z3Object
|
|||
// / of the Boolean variables provided using <see cref="AssertAndTrack"/>
|
||||
// and the Boolean literals
|
||||
// / provided using <see cref="Check"/> with assumptions.
|
||||
// / </remarks>
|
||||
// /
|
||||
public void assertAndTrack(BoolExpr[] constraints, BoolExpr[] ps) throws Z3Exception
|
||||
{
|
||||
getContext().checkContextMatch(constraints);
|
||||
|
@ -141,11 +147,11 @@ public class Solver extends Z3Object
|
|||
constraints[i].getNativeObject(), ps[i].getNativeObject());
|
||||
}
|
||||
|
||||
// / <summary>
|
||||
// /
|
||||
// / Assert a constraint into the solver, and track it (in the unsat) core
|
||||
// / using the Boolean constant p.
|
||||
// / </summary>
|
||||
// / <remarks>
|
||||
// /
|
||||
// / Remarks:
|
||||
// / This API is an alternative to <see cref="Check"/> with assumptions for
|
||||
// extracting unsat cores.
|
||||
// / Both APIs can be used in the same solver. The unsat core will contain a
|
||||
|
@ -153,7 +159,7 @@ public class Solver extends Z3Object
|
|||
// / of the Boolean variables provided using <see cref="AssertAndTrack"/>
|
||||
// and the Boolean literals
|
||||
// / provided using <see cref="Check"/> with assumptions.
|
||||
// / </remarks>
|
||||
// /
|
||||
public void assertAndTrack(BoolExpr constraint, BoolExpr p) throws Z3Exception
|
||||
{
|
||||
getContext().checkContextMatch(constraint);
|
||||
|
@ -193,8 +199,10 @@ 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>
|
||||
* Remarks:
|
||||
* @see getModel
|
||||
* @see getUnsatCore
|
||||
* @see getProof
|
||||
**/
|
||||
public Status check(Expr... assumptions) throws Z3Exception
|
||||
{
|
||||
|
@ -219,8 +227,10 @@ 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>
|
||||
* Remarks:
|
||||
* @see getModel
|
||||
* @see getUnsatCore
|
||||
* @see getProof
|
||||
**/
|
||||
public Status check() throws Z3Exception
|
||||
{
|
||||
|
@ -228,10 +238,11 @@ public class Solver extends Z3Object
|
|||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* results was not <code>SATISFIABLE</code>, or if model production is not
|
||||
* enabled. </remarks>
|
||||
* The model of the last {@code Check}.
|
||||
* Remarks: The result is
|
||||
* {@code null} if {@code Check} was not invoked before, if its
|
||||
* results was not {@code SATISFIABLE}, or if model production is not
|
||||
* enabled.
|
||||
*
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
|
@ -245,10 +256,11 @@ public class Solver extends Z3Object
|
|||
}
|
||||
|
||||
/**
|
||||
* The proof of the last <code>Check</code>. <remarks> The result is
|
||||
* <code>null</code> if <code>Check</code> was not invoked before, if its
|
||||
* results was not <code>UNSATISFIABLE</code>, or if proof production is
|
||||
* disabled. </remarks>
|
||||
* The proof of the last {@code Check}.
|
||||
* Remarks: The result is
|
||||
* {@code null} if {@code Check} was not invoked before, if its
|
||||
* results was not {@code UNSATISFIABLE}, or if proof production is
|
||||
* disabled.
|
||||
*
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
|
@ -262,10 +274,11 @@ public class Solver extends Z3Object
|
|||
}
|
||||
|
||||
/**
|
||||
* The unsat core of the last <code>Check</code>. <remarks> The unsat core
|
||||
* is a subset of <code>Assertions</code> The result is empty if
|
||||
* <code>Check</code> was not invoked before, if its results was not
|
||||
* <code>UNSATISFIABLE</code>, or if core production is disabled. </remarks>
|
||||
* The unsat core of the last {@code Check}.
|
||||
* Remarks: The unsat core
|
||||
* is a subset of {@code Assertions} The result is empty if
|
||||
* {@code Check} was not invoked before, if its results was not
|
||||
* {@code UNSATISFIABLE}, or if core production is disabled.
|
||||
*
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
|
@ -282,8 +295,8 @@ public class Solver extends Z3Object
|
|||
}
|
||||
|
||||
/**
|
||||
* A brief justification of why the last call to <code>Check</code> returned
|
||||
* <code>UNKNOWN</code>.
|
||||
* A brief justification of why the last call to {@code Check} returned
|
||||
* {@code UNKNOWN}.
|
||||
**/
|
||||
public String getReasonUnknown() throws Z3Exception
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue