Class CausalModel

All Implemented Interfaces:
Iterable<PlFormula>, Collection<PlFormula>, BeliefBase

public class CausalModel extends PlBeliefSet
This class describes a causal model. Reference: "Argumentation-based Causal and Counterfactual Reasoning" by Lars Bengel, Lydia Blümel, Tjitze Rienstra and Matthias Thimm, published at 1st International Workshop on Argumentation for eXplainable AI (ArgXAI, co-located with COMMA ’22), September 12, 2022
Version:
TweetyProject 1.23
Author:
Julian Sander
  • Constructor Details

    • CausalModel

      public CausalModel()
      Creates an empty causal model
    • CausalModel

      public CausalModel(Set<Equivalence> structuralEquations)
      Creates a causal model
      Parameters:
      structuralEquations - Set of boolean structural equations; One equation for each explainable atom, which only occurs on the left side of the equation
    • CausalModel

      public CausalModel(Set<Proposition> backGroundAtoms, Set<Proposition> explainableAtoms, Set<Equivalence> structuralEquations)
      Creates a causal model
      Parameters:
      backGroundAtoms - Set of background atoms
      explainableAtoms - Set of explainable atoms
      structuralEquations - Set of boolean structural equations; One equation for each explainable atom, which only occurs on the left side of the equation
  • Method Details

    • add

      public boolean add(PlFormula formula)
      Specified by:
      add in interface Collection<PlFormula>
      Overrides:
      add in class BeliefSet<PlFormula,PlSignature>
    • add

      public boolean add(PlFormula... formulas)
      Description copied from class: BeliefSet
      Adds the specified elements to the end of this collection (optional operation).
      Overrides:
      add in class BeliefSet<PlFormula,PlSignature>
      Parameters:
      formulas - to be appended to collection
      Returns:
      true if all elements were added, false otherwise
    • addAll

      public boolean addAll(Collection<? extends PlFormula> formulas)
      Specified by:
      addAll in interface Collection<PlFormula>
      Overrides:
      addAll in class BeliefSet<PlFormula,PlSignature>
    • addBackgroundAtom

      public boolean addBackgroundAtom(Proposition atom)
      Adds a specified atom to the background atoms of this instance.
      Parameters:
      atom - Atom to add to the background atoms of this instance.
      Returns:
      TRUE iff the atom was successfully added as a background atom to this instance. FALSE if the atom was already contained and leaves the set unchanged.
      Throws:
      IllegalArgumentException - if adding the specified atom would violate the definition of a causal model
    • addExplainableAtom

      public boolean addExplainableAtom(Proposition atom, Equivalence structuralEquation)
      Adds a specified atom to the explainable atoms of this instance and the specified equivalence as a structural equation for this atom.
      Parameters:
      atom - Atom to add to the explainable atoms of this instance.
      structuralEquation - Equation, having only the specified atom on the left side and a formula consisting only of atoms different than the specified atom on the right hand side of this equivalence
      Returns:
      TRUE iff the atom and the formula were successfully added to this instance. FALSE if the atom or the equation were already contained and leaves at least one of the sets unchanged.
      Throws:
      IllegalArgumentException - if adding the specified atom and or equation would violate the definition of a causal model
    • addStructuralEquation

      public boolean addStructuralEquation(Equivalence equation)
      Adds a specified equivalence to the structural equations of this instance. To this instance unknown explainable or background atoms are created and added in this process.
      Parameters:
      equation - Equation, having only one explainable atom on the left side and a formula on the right hand side of this equivalence consisting only of atoms different than the atom on the left
      Returns:
      TRUE iff the formula and all therein contained atoms were successfully added to this instance. FALSE if the equation was already contained and leaves the set unchanged.
      Throws:
      IllegalArgumentException - if adding the specified equation would violate the definition of a causal model
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Collection<PlFormula>
      Overrides:
      equals in class BeliefSet<PlFormula,PlSignature>
    • getBackGroundAtoms

      public HashSet<Proposition> getBackGroundAtoms()
      *description missing*
      Returns:
      *description missing*
    • getExplainableAtoms

      public HashSet<Proposition> getExplainableAtoms()
      *description missing*
      Returns:
      *description missing*
    • getStructuralEquations

      public HashSet<Equivalence> getStructuralEquations()
      *description missing*
      Returns:
      *description missing*
    • getTwinModel

      public CausalModel getTwinModel()
      Returns:
      A twin model to this instance.
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Collection<PlFormula>
      Overrides:
      hashCode in class BeliefSet<PlFormula,PlSignature>
    • intervene

      public void intervene(Proposition v, boolean x)
      This method implements the interventional statement, by replacing all structural equations for the specified explainable atom "v" of this causal model with a formula "v = x".
      Parameters:
      v - Explainable atom of this causal model, which is to be intervened on.
      x - Truth value of the intervention.
    • clone

      public CausalModel clone()