lp.trans
Class LpSolver
java.lang.Object
lp.trans.Solver<StableModel>
lp.trans.LpSolver
public class LpSolver
- extends Solver<StableModel>
A class that computes stable models of a grounded normal logic program.
- Version:
- 1.0.0
- Author:
- Martin Slota
- See Also:
LpGrounder
|
Field Summary |
private LpParser |
parser
Parser used to convert the string representation of a model into object
representations of the atoms in the model. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parser
private final LpParser parser
- Parser used to convert the string representation of a model into object
representations of the atoms in the model.
LpSolver
public LpSolver()
- Creates a new instance of
LpSolver. It will create new instances
of LparseWrapper and SmodelsWrapper classes and use them
to compute the stable models of grounded normal logic programs passed in
through the Solver.solve(LogicProgram, Consumer) method.
LpSolver
public LpSolver(LparseWrapper lparseWrapper,
SmodelsWrapper smodelsWrapper)
- Creates a new instance of
LpSolver. It will use the given
instances of LparseWrapper and SmodelsWrapper classes and
use them to compute the stable models of grounded normal logic programs
passed in through the Solver.solve(LogicProgram, Consumer) method.
- Parameters:
lparseWrapper - the object used to execute lparsesmodelsWrapper - the object used to execute smodels
parseModel
protected StableModel parseModel(String modelString)
- Parses
modelString and returns the model that it represents.
- Specified by:
parseModel in class Solver<StableModel>
- Parameters:
modelString - a string representation of a model returned by smodels
- Returns:
- the object representation of the model