Class ASPSolver
java.lang.Object
org.tweetyproject.lp.asp.reasoner.ASPSolver
- All Implemented Interfaces:
ModelProvider<ASPRule,
,Program, AnswerSet> QualitativeReasoner<Program,
,ASPLiteral> Reasoner<Boolean,
Program, ASPLiteral>
- Direct Known Subclasses:
ClingoSolver
,DLVSolver
public abstract class ASPSolver
extends Object
implements QualitativeReasoner<Program,ASPLiteral>, ModelProvider<ASPRule,Program,AnswerSet>
This class provides a common interface for asp solvers. Most implementing
classes will simply call an external grounder and solver and return the
resulting string.
- Author:
- Sebastian Homann (Original), Thomas Vengels (Modifications), Anna Gessler (Modifications)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the upper integer bound.int
Returns a characterizing model (answer set) of the given belief base using the given upper integer limit.abstract Collection
<AnswerSet> Returns a characterizing model (answer set) of the given belief base.abstract Collection
<AnswerSet> Returns a characterizing model (answer set) of the given belief base.abstract Collection
<AnswerSet> 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.Return the outputabstract Boolean
query
(Program beliefbase, ASPLiteral formula) Queries the given belief base with the provided formula and returns a boolean result.void
setIntegerMaximum
(int integerMaximum) Set the upper integer bound.void
setMaxNumOfModels
(int maxNumOfModels) Set the maximum number of models to be generated.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.tweetyproject.commons.ModelProvider
getModel
Methods inherited from interface org.tweetyproject.commons.QualitativeReasoner
isInstalled
-
Constructor Details
-
ASPSolver
public ASPSolver()
-
-
Method Details
-
getOutput
-
getMaxNumOfModels
public int getMaxNumOfModels()- Returns:
- the maximum number of models to be generated.
-
setMaxNumOfModels
public void setMaxNumOfModels(int maxNumOfModels) Set the maximum number of models to be generated.- Parameters:
maxNumOfModels
- the maximum number of models to be generated.
-
getIntegerMaximum
public int getIntegerMaximum()Get the upper integer bound. Solvers that use this attribute will only accept integers in [0,IntegerMaximum] in input programs. Likewise, only integers in [0,IntegerMaximum] will be considered by when evaluating arithmetic predicates.- Returns:
- the upper integer bound.
-
setIntegerMaximum
public void setIntegerMaximum(int integerMaximum) Set the upper integer bound. Solvers that use this attribute will only accept integers in [0,IntegerMaximum] in input programs. Likewise, only integers in [0,IntegerMaximum] will be considered by when evaluating arithmetic predicates.- Parameters:
integerMaximum
- the upper integer bound
-
getModels
Description copied from interface:ModelProvider
Returns a characterizing model of the given belief base- Specified by:
getModels
in interfaceModelProvider<ASPRule,
Program, AnswerSet> - Parameters:
p
- some belief base- Returns:
- the (selected) models of the belief base
-
getModels
Returns a characterizing model (answer set) of the given belief base using the given upper integer limit.- Parameters:
p
- a programmaxInt
- the max number of models to be returned- Returns:
- AnswerSet
-
getModel
-
getModels
Returns a characterizing model (answer set) of the given belief base.- Parameters:
p
- containing belief base- Returns:
- AnswerSet
-
getModels
Returns a characterizing model (answer set) of the given belief base.- Parameters:
f
- containing belief base- Returns:
- AnswerSet
-
query
Description copied from interface:QualitativeReasoner
Queries the given belief base with the provided formula and returns a boolean result. The result indicates whether the formula is entailed or satisfied by the belief base according to the qualitative reasoning method implemented by the reasoner.- Specified by:
query
in interfaceQualitativeReasoner<Program,
ASPLiteral> - Specified by:
query
in interfaceReasoner<Boolean,
Program, ASPLiteral> - Parameters:
beliefbase
- The belief base to be queried.formula
- The formula for which the query is made.- Returns:
- `TRUE` if the formula is entailed or satisfied by the belief base, `FALSE` otherwise.
-