Interface IReasoner
-
- All Known Subinterfaces:
IChainingReasoner
- All Known Implementing Classes:
AbstractChainedReasoner,Reasoner
public interface IReasonerGeneral interface for reasoner, which can be registered to the ReasonerRegistry. Please note that reasoner calls are intended to be state-less. Currently, management over successive reasoner calls on the same model is out of scope. A reasoner shall not produce superfluous output. Use the output methods inReasoningResultinstead.- Author:
- Patrick Jähne, Sascha El-Sharkawy, Holger Eichelberger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ReasoningResultcheck(Configuration cfg, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)Checks the configuration according to the given project structure and does not affect the configuration.IReasonerInstancecreateInstance(Configuration cfg, ReasonerConfiguration reasonerConfiguration)Creates a reasoner instance for repeated reasoning on the same model (no structural changes allowed during two subsequent reasoning runs).ValueCreationResultcreateValue(Configuration cfg, AbstractVariable var, IDatatype type, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)Creates the value for a certain IVML type/variable.EvaluationResultevaluate(Configuration cfg, java.util.List<Constraint> constraints, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)Evaluates a given list of constraints (in the sense of boolean conditions) which are related to and valid in the context of the given project and configuration.ReasonerDescriptorgetDescriptor()Returns a descriptor stating common information about this reasoner.ReasoningResultinitialize(Configuration cfg, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)Initializes the configuration according to the given model and propagates values, if possible.ReasoningResultisConsistent(Project project, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)Checks whether a given variability model (project) is satisfiable.voidnotify(IReasonerMessage message)Is called when a reasoner message is issued.ReasoningResultpropagate(Configuration cfg, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)Checks the configuration according to the given model and propagates values, if possible.voidsetInterceptor(IReasonerInterceptor interceptor)Defines the optional interceptor instance.ReasoningResultupgrade(java.net.URI url, ProgressObserver observer)Updates the installation of this reasoner, e.g., in order to obtain a licensed reasoner version.
-
-
-
Method Detail
-
getDescriptor
ReasonerDescriptor getDescriptor()
Returns a descriptor stating common information about this reasoner.- Returns:
- the descriptor
-
upgrade
ReasoningResult upgrade(java.net.URI url, ProgressObserver observer)
Updates the installation of this reasoner, e.g., in order to obtain a licensed reasoner version.- Parameters:
url- The location of the implementation of the reasoner which should be upgradedobserver- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unused- Returns:
- The result of this upgrade process.
-
isConsistent
ReasoningResult isConsistent(Project project, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)
Checks whether a given variability model (project) is satisfiable.- Parameters:
project- The project which should be tested whether it is satisfiable.observer- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unusedreasonerConfiguration- the reasoner configuration to be used for reasoning (e.g. taken from the UI, may be null)- Returns:
- The result of this reasoning step. Can have the status
Status.UNSUPPORTEDif the concrete reasoner does not support this operation.
-
check
ReasoningResult check(Configuration cfg, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)
Checks the configuration according to the given project structure and does not affect the configuration.- Parameters:
cfg- The current configuration to reason on.reasonerConfiguration- the reasoner configuration to be used for reasoning (e.g. taken from the UI, may be null)observer- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unused- Returns:
- The result of this reasoning step. Can have the status
Status.UNSUPPORTEDif the concrete reasoner does not support this operation.
-
propagate
ReasoningResult propagate(Configuration cfg, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)
Checks the configuration according to the given model and propagates values, if possible.- Parameters:
cfg- The configuration to reason on (may be modified as a side effect of value propagation)reasonerConfiguration- the reasoner configuration to be used for reasoning (e.g. taken from the UI, may be null)observer- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unused- Returns:
- The result of this reasoning step. Can have the status
Status.UNSUPPORTEDif the concrete reasoner does not support this operation.
-
initialize
ReasoningResult initialize(Configuration cfg, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)
Initializes the configuration according to the given model and propagates values, if possible. Reasoners implementing this function and ensure complete and proper (!) initialization of IVML models shall explicitly declareGeneralReasonerCapabilities.INCREMENTAL_REASONING. This method shell obeyConfiguration.getResolutionState().- Parameters:
cfg- The configuration to reason on (may be modified as a side effect of value propagation)reasonerConfiguration- the reasoner configuration to be used for reasoning (e.g. taken from the UI, may be null)observer- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unused- Returns:
- The result of this reasoning step. Can have the status
Status.UNSUPPORTEDif the concrete reasoner does not support this operation.
-
evaluate
EvaluationResult evaluate(Configuration cfg, java.util.List<Constraint> constraints, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)
Evaluates a given list of constraints (in the sense of boolean conditions) which are related to and valid in the context of the given project and configuration.- Parameters:
cfg- the configuration as a basis for the evaluationconstraints- the constraints (expressions which evaluate to a boolean value)reasonerConfiguration- the reasoner configuration to be used for reasoning (e.g. taken from the UI, may be null)observer- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unused- Returns:
- The result of this reasoning step. Can have the status
Status.UNSUPPORTEDif the concrete reasoner does not support this operation.
-
notify
void notify(IReasonerMessage message)
Is called when a reasoner message is issued.- Parameters:
message- the message sent
-
createInstance
IReasonerInstance createInstance(Configuration cfg, ReasonerConfiguration reasonerConfiguration)
Creates a reasoner instance for repeated reasoning on the same model (no structural changes allowed during two subsequent reasoning runs).- Parameters:
cfg- the configuration as a basis for the evaluationreasonerConfiguration- the reasoner configuration to be used for reasoning (e.g. taken from the UI, may be null)- Returns:
- a reusable reasoner instance, return a
DelegatingReasonerInstanceon this reasoner to avoid null pointer checking.
-
createValue
ValueCreationResult createValue(Configuration cfg, AbstractVariable var, IDatatype type, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)
Creates the value for a certain IVML type/variable.- Parameters:
cfg- the configuration to operate on (will not be modified)var- the variable to create the value for (may be null iftypeis given, may imply additional constraints)type- the type to create the value for (may be null ifvaris given)reasonerConfiguration- the reasoner configuration to be used for reasoning (e.g. taken from the UI, may be null)observer- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unused- Returns:
- the value creation result
-
setInterceptor
void setInterceptor(IReasonerInterceptor interceptor)
Defines the optional interceptor instance.- Parameters:
interceptor- the interceptor
-
-