public final class IntegerFormulaSolver extends java.lang.Object implements Solver<java.util.Map<IntegerVariable,java.math.BigInteger>>
IntegerFormulaSolver implements a simple constraint solver.
The solver supports equalities and inequalities of variables and constants
(x == y, x != y, x == c, x != c). A constraint has the following structure:
(e[1,1] || ... || e[1,n(1)]) && ... && (e[m,1] || ... || e[m,n(m)]).
It is assumed that the number of non-trivial disjunctions is rather small (i.e., the most of
n(i) are equal to one).
Solver.Mode| Constructor and Description |
|---|
IntegerFormulaSolver(java.util.Collection<java.util.Collection<IntegerVariable>> variables,
java.util.Collection<IntegerFormula<IntegerVariable>> formulae)
Constructs a solver.
|
IntegerFormulaSolver(java.util.Collection<IntegerVariable> variables,
IntegerFormula<IntegerVariable> formula)
Constructs a solver.
|
| Modifier and Type | Method and Description |
|---|---|
SolverResult<java.util.Map<IntegerVariable,java.math.BigInteger>> |
solve(Solver.Mode mode)
Checks whether the equation clause is satisfiable and returns a solution (if required).
|
public IntegerFormulaSolver(java.util.Collection<java.util.Collection<IntegerVariable>> variables, java.util.Collection<IntegerFormula<IntegerVariable>> formulae)
variables - the collection of variables.formulae - the constraints to be solved.java.lang.IllegalArgumentException - if some parameters are null.public IntegerFormulaSolver(java.util.Collection<IntegerVariable> variables, IntegerFormula<IntegerVariable> formula)
variables - the collection of variables.formula - the constraint to be solved.java.lang.IllegalArgumentException - if some parameters are null.public SolverResult<java.util.Map<IntegerVariable,java.math.BigInteger>> solve(Solver.Mode mode)
Solversolve in interface Solver<java.util.Map<IntegerVariable,java.math.BigInteger>>mode - the solver mode.SAT if the equation clause is satisfiable; UNSAT otherwise.