Package ru.ispras.fortress.solver
Interface Solver
-
- All Known Implementing Classes:
BoolectorSolver
,Cvc4Solver
,Sat4jSolver
,SolverBase
,Z3Solver
public interface Solver
TheSolver
interface provides a protocol for working with different kinds of constraint solvers in a universal way.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addCustomOperation(Function function)
Register a custom operation that extends the functionality of the solver.boolean
addCustomOperation(FunctionTemplate template)
Register a custom operation that extends the functionality of the solver.java.lang.String
getDescription()
Returns the description of the solver.java.lang.String
getName()
Returns the name of the solver.java.lang.String
getSolverPath()
Returns the path to the external solver executable used by the current solver object.boolean
isGeneric()
Returns true if the solver is generic and false if it is custom.boolean
isSupported(ConstraintKind kind)
Check whether the specified constraint kind is supported by the solver.void
setSolverPath(java.lang.String value)
Sets the path to the external solver executable used by the current solver object.SolverResult
solve(Constraint constraint)
Solves the specified constraint.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the name of the solver.- Returns:
- Solver name.
-
getDescription
java.lang.String getDescription()
Returns the description of the solver.- Returns:
- solver description.
-
isSupported
boolean isSupported(ConstraintKind kind)
Check whether the specified constraint kind is supported by the solver.- Parameters:
kind
- Constraint kind.- Returns:
- true if the constraint kind is supported or false otherwise.
-
isGeneric
boolean isGeneric()
Returns true if the solver is generic and false if it is custom.- Returns:
- true for generic solvers or false for custom ones.
-
solve
SolverResult solve(Constraint constraint)
Solves the specified constraint.- Parameters:
constraint
- A constraint object.- Returns:
- Result of solving the constraint.
-
addCustomOperation
boolean addCustomOperation(Function function)
Register a custom operation that extends the functionality of the solver. The operation is implemented in terms of existing operations and represents a function.- Parameters:
function
- Object describing the semantics and syntax of the function.- Returns:
true
if no such operation has been previously registered orfalse
otherwise.
-
addCustomOperation
boolean addCustomOperation(FunctionTemplate template)
Register a custom operation that extends the functionality of the solver. The operation is implemented in terms of existing operation and represents a family of functions derived from the same template. Functions share the same logic, but may operate on different data types.- Parameters:
template
- Function template that describes the semantics and syntax of a family of similar functions.- Returns:
true
if no such operation has been previously registered orfalse
otherwise.
-
getSolverPath
java.lang.String getSolverPath()
Returns the path to the external solver executable used by the current solver object.- Returns:
- Path
-
setSolverPath
void setSolverPath(java.lang.String value)
Sets the path to the external solver executable used by the current solver object.- Parameters:
value
- Path
-
-