Package net.sf.tweety.lp.asp.reasoner
Class DLVSolver
- java.lang.Object
-
- net.sf.tweety.lp.asp.reasoner.ASPSolver
-
- net.sf.tweety.lp.asp.reasoner.DLVSolver
-
- All Implemented Interfaces:
net.sf.tweety.commons.ModelProvider<ASPRule,Program,AnswerSet>,net.sf.tweety.commons.QualitativeReasoner<Program,ASPLiteral>,net.sf.tweety.commons.Reasoner<Boolean,Program,ASPLiteral>
public class DLVSolver extends ASPSolver
Wrapper class for the DLV answer set solver command line utility.- Author:
- Thomas Vengels, Tim Janus, Anna Gessler
-
-
Field Summary
-
Fields inherited from class net.sf.tweety.lp.asp.reasoner.ASPSolver
integerMaximum, maxNumOfModels, outputData
-
-
Method Summary
Modifier and Type Method Description AnswerSetgetModel(Program p)List<AnswerSet>getModels(File file)Returns a characterizing model (answer set) of the given belief base.List<AnswerSet>getModels(String p)Returns a characterizing model (answer set) of the given belief base.List<AnswerSet>getModels(Program p)protected List<AnswerSet>parseResult(String s)Processes a string containing answer sets and returns an AnswerSetList.Booleanquery(Program beliefbase, ASPLiteral formula)Booleanquery(Program beliefbase, ASPLiteral formula, net.sf.tweety.commons.InferenceMode inferenceMode)voidsetOptions(String options)Set additional command line options for DLV.voidsetPathToDLV(String pathToDLV)Sets the location of the DLV solver on the hard drive.-
Methods inherited from class net.sf.tweety.lp.asp.reasoner.ASPSolver
getIntegerMaximum, getMaxNumOfModels, getModel, getModels, getOutput, setIntegerMaximum, setMaxNumOfModels
-
-
-
-
Constructor Detail
-
DLVSolver
public DLVSolver(String pathToDLV)
Constructs a new instance pointing to a specific DLV solver.- Parameters:
pathToDLV- binary location of DLV on the hard drive
-
DLVSolver
public DLVSolver(String pathToDLV, net.sf.tweety.commons.util.Shell bash)
Constructs a new instance pointing to a specific DLV solver.- Parameters:
pathToDLV- binary location of DLV on the hard drivebash- shell to run commands
-
-
Method Detail
-
getModels
public List<AnswerSet> getModels(String p)
Description copied from class:ASPSolverReturns a characterizing model (answer set) of the given belief base.
-
getModels
public List<AnswerSet> getModels(File file)
Description copied from class:ASPSolverReturns a characterizing model (answer set) of the given belief base.
-
parseResult
protected List<AnswerSet> parseResult(String s)
Processes a string containing answer sets and returns an AnswerSetList.- Parameters:
s- String containing DLV output- Returns:
- AnswerSet
-
setOptions
public void setOptions(String options)
Set additional command line options for DLV.- Parameters:
options- a string of options
-
setPathToDLV
public void setPathToDLV(String pathToDLV)
Sets the location of the DLV solver on the hard drive.- Parameters:
pathToDLV- path to DLV
-
query
public Boolean query(Program beliefbase, ASPLiteral formula)
- Specified by:
queryin interfacenet.sf.tweety.commons.QualitativeReasoner<Program,ASPLiteral>- Specified by:
queryin interfacenet.sf.tweety.commons.Reasoner<Boolean,Program,ASPLiteral>- Specified by:
queryin classASPSolver
-
query
public Boolean query(Program beliefbase, ASPLiteral formula, net.sf.tweety.commons.InferenceMode inferenceMode)
-
-