public interface IProblem extends RandomAccessModel
Modifier and Type | Method and Description |
---|---|
int[] |
findModel()
Look for a model satisfying all the clauses available in the problem.
|
int[] |
findModel(IVecInt assumps)
Look for a model satisfying all the clauses available in the problem.
|
boolean |
isSatisfiable()
Check the satisfiability of the set of constraints contained inside the
solver.
|
boolean |
isSatisfiable(boolean globalTimeout)
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.
|
boolean |
isSatisfiable(IVecInt assumps,
boolean globalTimeout)
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 |
newVar(int howmany)
Declare
howmany variables in the problem (and thus in the
vocabulary), that will be represented using the Dimacs format by integers
ranging from 1 to howmany. |
int |
nVars()
To know the number of variables used in the solver as declared by
newVar()
In case the method newVar() has not been used, the method returns the
number of variables used in the solver.
|
int[] |
primeImplicant()
Provide a prime implicant, i.e. a set of literal that is sufficient to
satisfy all constraints of the problem.
|
boolean |
primeImplicant(int p)
Check if a given literal is part of the prime implicant computed by the
primeImplicant() method. |
void |
printInfos(PrintWriter out)
To print additional informations regarding the problem.
|
void |
printInfos(PrintWriter out,
String prefix)
Deprecated.
|
model
int[] model()
isSatisfiable()
,
isSatisfiable(IVecInt)
int[] primeImplicant()
boolean primeImplicant(int p)
primeImplicant()
method.p
- a literal in Dimacs formatprimeImplicant()
boolean isSatisfiable() throws TimeoutException
TimeoutException
boolean isSatisfiable(IVecInt assumps, boolean globalTimeout) throws TimeoutException
assumps
- a set of literals (represented by usual non null integers in
Dimacs format).globalTimeout
- whether that call is part of a global process (i.e.
optimization) or not. if (global), the timeout will not be
reset between each call.TimeoutException
boolean isSatisfiable(boolean globalTimeout) throws TimeoutException
globalTimeout
- whether that call is part of a global process (i.e.
optimization) or not. if (global), the timeout will not be
reset between each call.TimeoutException
boolean isSatisfiable(IVecInt assumps) throws TimeoutException
assumps
- a set of literals (represented by usual non null integers in
Dimacs format).TimeoutException
int[] findModel() throws TimeoutException
if (isSatisfiable()) {
return model();
}
return null;
null
if no model is foundTimeoutException
- if a model cannot be found within the given timeout.int[] findModel(IVecInt assumps) throws TimeoutException
if (isSatisfiable(assumpt)) {
return model();
}
return null;
null
if no model is foundTimeoutException
- if a model cannot be found within the given timeout.int nConstraints()
int newVar(int howmany)
howmany
variables in the problem (and thus in the
vocabulary), that will be represented using the Dimacs format by integers
ranging from 1 to howmany. That feature allows encodings to create
additional variables with identifier starting at howmany+1.howmany
- number of variables to createnVars()
int nVars()
newVar(int)
@Deprecated void printInfos(PrintWriter out, String prefix)
out
- the place to print the informationprefix
- the prefix to put in front of each linevoid printInfos(PrintWriter out)
out
- the place to print the information#setLogPrefix(String)
Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.