org.sat4j.specs
Interface IProblem

All Known Subinterfaces:
ISolver
All Known Implementing Classes:
Minimal4CardinalityModel, Minimal4InclusionModel, ModelIterator, PBSolver, SolutionCounter, Solver, SolverDecorator

public interface IProblem

Access to the information related to a given problem instance.

Author:
leberre

Method Summary
 boolean isSatisfiable()
          Check the satisfiability of the set of constraints contained inside the solver.
 boolean isSatisfiable(IVecInt assumps)
          Check the satisfiability of the set of constraints contained inside the solver.
 int[] model()
          Provide a model (if any) for a satisfiable formula.
 int nConstraints()
          To know the number of constraints currently available in the solver.
 int nVars()
          To know the number of variables used in the solver.
 

Method Detail

model

int[] model()
Provide a model (if any) for a satisfiable formula. That method should be called AFTER isSatisfiable() if the formula is satisfiable. Else an exception UnsupportedOperationException is launched.

Returns:
a model of the formula as an array of literals to satisfy.

isSatisfiable

boolean isSatisfiable()
                      throws TimeoutException
Check the satisfiability of the set of constraints contained inside the solver.

Returns:
true if the set of constraints is satisfiable, else false.
Throws:
TimeoutException

isSatisfiable

boolean isSatisfiable(IVecInt assumps)
                      throws TimeoutException
Check the satisfiability of the set of constraints contained inside the solver.

Parameters:
assumps - a set of literals (represented by usual non null integers in Dimacs format).
Returns:
true if the set of constraints is satisfiable when literals are satisfied, else false.
Throws:
TimeoutException

nConstraints

int nConstraints()
To know the number of constraints currently available in the solver. (without taking into account learnt constraints).

Returns:
the number of contraints added to the solver

nVars

int nVars()
To know the number of variables used in the solver.

Returns:
the number of variables created using newVar().