lp.trans
Class LpSolver

java.lang.Object
  extended by lp.trans.Solver<StableModel>
      extended by 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.
 
Constructor Summary
LpSolver()
          Creates a new instance of LpSolver.
LpSolver(LparseWrapper lparseWrapper, SmodelsWrapper smodelsWrapper)
          Creates a new instance of LpSolver.
 
Method Summary
protected  StableModel parseModel(String modelString)
          Parses modelString and returns the model that it represents.
 
Methods inherited from class lp.trans.Solver
getModelCount, getNextModelString, setLparsePath, setModelLimit, setSmodelsPath, solve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

private final LpParser parser
Parser used to convert the string representation of a model into object representations of the atoms in the model.

Constructor Detail

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 lparse
smodelsWrapper - the object used to execute smodels
Method Detail

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