Class AbstractFrozenChecker<M extends ContainableModelElement>

java.lang.Object
net.ssehub.easy.varModel.model.rewrite.modifier.AbstractFrozenChecker<M>
Type Parameters:
M - Type of ContainableModelElements, which shall be handled by this class.
All Implemented Interfaces:
IModelElementFilter<M>
Direct Known Subclasses:
FrozenCompoundConstraintsOmitter, FrozenConstraintsFilter, FrozenConstraintVarFilter, FrozenTypeDefResolver

public abstract class AbstractFrozenChecker<M extends ContainableModelElement> extends Object implements IModelElementFilter<M>
Super class for Filters which should remove elements based on already frozen variables.
Author:
El-Sharkawy
  • Field Details

  • Constructor Details

    • AbstractFrozenChecker

      protected AbstractFrozenChecker(Configuration config)
      Single constructor of this class.
      Parameters:
      config - A already initialized Configuration, needed for checking whether an arbitrary variable is already frozen.
  • Method Details

    • getVariable

      protected IDecisionVariable getVariable(AbstractVariable declaration)
      Returns the specified IDecisionVariable.
      Parameters:
      declaration - The declaration for which the configuration entity should be returned.
      Returns:
      The IDecisionVariable for the given declaration
    • getConfiguration

      public final Configuration getConfiguration()
      Getter for the configuration (passed to the constructor).
      Returns:
      The currently used configuration.
    • constraintIsFrozen

      protected boolean constraintIsFrozen(ConstraintSyntaxTree constraint, RewriteContext context)
      Checks whether the given constraint contains only constant values or frozen variables.
      Parameters:
      constraint - The constraint to check.
      context - Knowledge of the current translation, comes from the ProjectRewriteVisitor
      Returns:
      true if the constraint contains only frozen/constant elements or is null, false if it contain at least one open variable.
    • allInstancesAreFrozen

      protected boolean allInstancesAreFrozen(AbstractVariable declaration, RewriteContext context)
      Checks whether all instances of the given declaration are already frozen.
      Parameters:
      declaration - The declaration to check (if it is nested, it can have multiple instances).
      context - Knowledge of the current translation, comes from the ProjectRewriteVisitor
      Returns:
      true if all instances are frozen or if it has no instances, false otherwise.