Class AbstractCausalReasoner

java.lang.Object
org.tweetyproject.causal.reasoner.AbstractCausalReasoner
All Implemented Interfaces:
ModelProvider<PlFormula, CausalKnowledgeBase, CausalInterpretation>, QualitativeReasoner<CausalKnowledgeBase, PlFormula>, Reasoner<Boolean, CausalKnowledgeBase, PlFormula>
Direct Known Subclasses:
AbstractArgumentationBasedCausalReasoner

public abstract class AbstractCausalReasoner extends Object implements QualitativeReasoner<CausalKnowledgeBase, PlFormula>, ModelProvider<PlFormula, CausalKnowledgeBase, CausalInterpretation>
General abstract reasoner for basic causal reasoning with CausalKnowledgeBase
Author:
Lars Bengel
  • Constructor Details

    • AbstractCausalReasoner

      public AbstractCausalReasoner()
  • Method Details

    • getModels

      public abstract Collection<CausalInterpretation> getModels(CausalKnowledgeBase cbase, Collection<PlFormula> observations, Map<Proposition, Boolean> interventions)
      Computes the set of all interpretations that can be concluded from the causal knowledge base and observations
      Parameters:
      cbase - some causal knowledge base
      observations - some logical formulae over atoms of the causal knowledge base
      interventions - a set of interventions on causal atoms
      Returns:
      the set of interpretations that can be concluded from the causal knowledge base
    • getConclusions

      public Collection<PlFormula> getConclusions(CausalKnowledgeBase cbase, Collection<PlFormula> observations, Map<Proposition, Boolean> interventions)
      Computes the set of all literal expressions that can be concluded from the causal knowledge base and observations
      Parameters:
      cbase - some causal knowledge base
      observations - some logical formulae over atoms of the causal knowledge base
      interventions - a set of interventions on causal atoms
      Returns:
      the set of expressions that can be concluded from the given knowledge
    • getConclusions

      public Collection<PlFormula> getConclusions(CausalKnowledgeBase cbase, Collection<PlFormula> observations)
      Computes the set of all literal expressions that can be concluded from the causal knowledge base and observation
      Parameters:
      cbase - some causal knowledge base
      observations - some logical formula over atoms of the causal knowledge base
      Returns:
      the set of expressions that can be concluded from the given knowledge
    • getConclusions

      public Collection<PlFormula> getConclusions(CausalKnowledgeBase cbase, PlFormula observation)
      Computes the set of all literal expressions that can be concluded from the causal knowledge base and observation
      Parameters:
      cbase - some causal knowledge base
      observation - some logical formula over atoms of the causal knowledge base
      Returns:
      the set of expressions that can be concluded from the given knowledge
    • getConclusions

      public Collection<PlFormula> getConclusions(CausalKnowledgeBase cbase)
      Computes the set of all literal expressions that can be concluded from the causal knowledge base
      Parameters:
      cbase - some causal knowledge base
      Returns:
      the set of expressions that can be concluded from the given knowledge
    • query

      public boolean query(CausalKnowledgeBase cbase, Collection<PlFormula> observations, Map<Proposition, Boolean> interventions, PlFormula effect)
      Determines whether the given effect is entailed by the causal knowledge base together with the observations
      Parameters:
      cbase - some causal knowledge base
      observations - some logical formulae over atoms of the causal knowledge base
      interventions - a set of interventions on causal atoms
      effect - some logical formula over atoms of the causal knowledge base
      Returns:
      TRUE iff the causal knowledge base together with the observations logically entails the effect
    • query

      public boolean query(CausalKnowledgeBase cbase, Collection<PlFormula> observations, PlFormula effect)
      Determines whether the given effect is entailed by the causal knowledge base together with the observations
      Parameters:
      cbase - some causal knowledge base
      observations - some logical formulae over atoms of the causal knowledge base
      effect - some logical formula over atoms of the causal knowledge base
      Returns:
      TRUE iff the causal knowledge base together with the observations logically entails the effect
    • query

      public boolean query(CausalKnowledgeBase cbase, PlFormula observation, PlFormula effect)
      Determines whether the given effect is entailed by the causal knowledge base together with the observation
      Parameters:
      cbase - some causal knowledge base
      observation - some logical formula over atoms of the causal knowledge base
      effect - some logical formula over atoms of the causal knowledge base
      Returns:
      TRUE iff the causal knowledge base together with the observation logically entails the effect
    • query

      public Boolean query(CausalKnowledgeBase cbase, PlFormula effect)
      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 interface QualitativeReasoner<CausalKnowledgeBase, PlFormula>
      Specified by:
      query in interface Reasoner<Boolean, CausalKnowledgeBase, PlFormula>
      Parameters:
      cbase - The belief base to be queried.
      effect - The formula for which the query is made.
      Returns:
      `TRUE` if the formula is entailed or satisfied by the belief base, `FALSE` otherwise.
    • getModels

      public Collection<CausalInterpretation> getModels(CausalKnowledgeBase cbase, Collection<PlFormula> observations)
      Computes the set of all interpretations that can be concluded from the causal knowledge base and observation
      Parameters:
      cbase - some causal knowledge base
      observations - some logical formula over atoms of the causal knowledge base
      Returns:
      the set of interpretations that can be concluded from the causal knowledge base
    • getModels

      public Collection<CausalInterpretation> getModels(CausalKnowledgeBase cbase, PlFormula observation)
      Computes the set of all interpretations that can be concluded from the causal knowledge base and observation
      Parameters:
      cbase - some causal knowledge base
      observation - some logical formula over atoms of the causal knowledge base
      Returns:
      the set of interpretations that can be concluded from the causal knowledge base
    • getModels

      Description copied from interface: ModelProvider
      Returns a characterizing model of the given belief base
      Specified by:
      getModels in interface ModelProvider<PlFormula, CausalKnowledgeBase, CausalInterpretation>
      Parameters:
      cbase - some belief base
      Returns:
      the (selected) models of the belief base
    • getModel

      public CausalInterpretation getModel(CausalKnowledgeBase cbase, Collection<PlFormula> observations, Map<Proposition, Boolean> interventions)
      Computes some interpretation that can be concluded from the causal knowledge base and observations
      Parameters:
      cbase - some causal knowledge base
      observations - some logical formulae over atoms of the causal knowledge base
      interventions - a set of interventions on causal atoms
      Returns:
      an interpretation that can be concluded from the causal knowledge base
    • getModel

      public CausalInterpretation getModel(CausalKnowledgeBase cbase, Collection<PlFormula> observations)
      Computes some interpretation that can be concluded from the causal knowledge base and observations
      Parameters:
      cbase - some causal knowledge base
      observations - some logical formulae over atoms of the causal knowledge base
      Returns:
      an interpretation that can be concluded from the causal knowledge base
    • getModel

      public CausalInterpretation getModel(CausalKnowledgeBase cbase, PlFormula observation)
      Computes some interpretation that can be concluded from the causal knowledge base and observations
      Parameters:
      cbase - some causal knowledge base
      observation - some logical formula over atoms of the causal knowledge base
      Returns:
      an interpretation that can be concluded from the causal knowledge base
    • getModel

      public CausalInterpretation getModel(CausalKnowledgeBase cbase)
      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.
      Specified by:
      getModel in interface ModelProvider<PlFormula, CausalKnowledgeBase, CausalInterpretation>
      Parameters:
      cbase - some belief base
      Returns:
      a selected model of the belief base.
    • isInstalled

      public boolean isInstalled()
      Description copied from interface: QualitativeReasoner
      Checks whether the underlying solver or reasoning mechanism used by this reasoner is installed and available for use. This can be helpful when the reasoner depends on external tools or libraries for performing the reasoning tasks.
      Specified by:
      isInstalled in interface QualitativeReasoner<CausalKnowledgeBase, PlFormula>
      Returns:
      `true` if the solver is installed and available, `false` otherwise.