Interface IReasoner

  • All Known Subinterfaces:
    IChainingReasoner
    All Known Implementing Classes:
    AbstractChainedReasoner, Reasoner

    public interface IReasoner
    General 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 in ReasoningResult instead.
    Author:
    Patrick Jähne, Sascha El-Sharkawy, Holger Eichelberger
    • 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 upgraded
        observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if 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 be ProgressObserver.NO_OBSERVER if unused
        reasonerConfiguration - 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.UNSUPPORTED if 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 be ProgressObserver.NO_OBSERVER if unused
        Returns:
        The result of this reasoning step. Can have the status Status.UNSUPPORTED if 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 be ProgressObserver.NO_OBSERVER if unused
        Returns:
        The result of this reasoning step. Can have the status Status.UNSUPPORTED if 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 evaluation
        constraints - 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 be ProgressObserver.NO_OBSERVER if unused
        Returns:
        The result of this reasoning step. Can have the status Status.UNSUPPORTED if 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 evaluation
        reasonerConfiguration - the reasoner configuration to be used for reasoning (e.g. taken from the UI, may be null)
        Returns:
        a reusable reasoner instance, return a DelegatingReasonerInstance on 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 if type is given, may imply additional constraints)
        type - the type to create the value for (may be null if var is 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 be ProgressObserver.NO_OBSERVER if unused
        Returns:
        the value creation result
      • setInterceptor

        void setInterceptor​(IReasonerInterceptor interceptor)
        Defines the optional interceptor instance.
        Parameters:
        interceptor - the interceptor