Class DLVSolver
java.lang.Object
org.tweetyproject.lp.asp.reasoner.ASPSolver
org.tweetyproject.lp.asp.reasoner.DLVSolver
- All Implemented Interfaces:
ModelProvider<ASPRule,
,Program, AnswerSet> QualitativeReasoner<Program,
,ASPLiteral> Reasoner<Boolean,
Program, ASPLiteral>
Wrapper class for the DLV answer set solver command line utility.
- Author:
- Thomas Vengels, Tim Janus, Anna Gessler
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance pointing to a specific DLV solver.Constructs a new instance pointing to a specific DLV solver.Constructs a new instance pointing to a specific DLV solver. -
Method Summary
Modifier and TypeMethodDescriptionReturns a single (dedicated) model of the given belief base.Returns a characterizing model (answer set) of the given belief base using the given upper integer limit.Returns a characterizing model (answer set) of the given belief base.Returns a characterizing model (answer set) of the given belief base.Returns a characterizing model of the given belief baseReturns a characterizing model (answer set) of the given belief base using the given upper integer limit.boolean
query
(Program beliefbase, ASPLiteral formula) Queries the given belief base for the given formula.query
(Program beliefbase, ASPLiteral formula, InferenceMode inferenceMode) void
setOptions
(String options) Set additional command line options for DLV.void
setPathToDLV
(String pathToDLV) Sets the location of the DLV solver on the hard drive.Methods inherited from class org.tweetyproject.lp.asp.reasoner.ASPSolver
getIntegerMaximum, getMaxNumOfModels, getOutput, setIntegerMaximum, setMaxNumOfModels
-
Constructor Details
-
DLVSolver
Constructs a new instance pointing to a specific DLV solver.- Parameters:
pathToDLV
- binary location of DLV on the hard drive. The given location has to contain a binary called "dlv". Do not include the binary itself in the path.
-
DLVSolver
Constructs a new instance pointing to a specific DLV solver.- Parameters:
pathToDLV
- binary location of DLV on the hard drive. The given location has to contain a binary called "dlv". Do not include the binary itself in the path.bash
- shell to run commands
-
DLVSolver
Constructs a new instance pointing to a specific DLV solver.- Parameters:
pathToDLV
- binary location of Clingo on the hard drive. The given location has to contain a binary called "clingo". Do not include the binary itself in the path.maxNOfModels
- the maximum number of models that DLV will compute.integerMaximum
- the integer maximum ("-N" parameter) that DLV will use
-
-
Method Details
-
getModels
Returns a characterizing model (answer set) of the given belief base using the given upper integer limit. -
getModel
Returns a characterizing model (answer set) of the given belief base using the given upper integer limit. -
getModels
Description copied from interface:ModelProvider
Returns a characterizing model of the given belief base -
getModels
Description copied from class:ASPSolver
Returns a characterizing model (answer set) of the given belief base. -
getModels
Description copied from class:ASPSolver
Returns a characterizing model (answer set) of the given belief base. -
getModel
Description copied from interface:ModelProvider
Returns a single (dedicated) model of the given belief base. If the implemented method allows for more than one dedicated model, the selection may be non-deterministic.- Parameters:
p
- some belief base- Returns:
- a selected model of the belief base.
-
setOptions
Set additional command line options for DLV.- Parameters:
options
- a string of options
-
setPathToDLV
Sets the location of the DLV solver on the hard drive.- Parameters:
pathToDLV
- path to DLV
-
query
Description copied from interface:Reasoner
Queries the given belief base for the given formula.- Specified by:
query
in interfaceQualitativeReasoner<Program,
ASPLiteral> - Specified by:
query
in interfaceReasoner<Boolean,
Program, ASPLiteral> - Specified by:
query
in classASPSolver
- Parameters:
beliefbase
- a belief baseformula
- a formula- Returns:
- the answer to the query
-
query
-
isInstalled
public boolean isInstalled()- Returns:
- if the solver is installed
-