org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred

## Class BaseTypeSafeConstraint

- java.lang.Object
- - org.eclipse.viatra.query.runtime.matchers.psystem.BasePConstraint
  - - org.eclipse.viatra.query.runtime.matchers.psystem.DeferredPConstraint
    - - org.eclipse.viatra.query.runtime.matchers.psystem.VariableDeferredPConstraint
      - - org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.BaseTypeSafeConstraint

- All Implemented Interfaces:
    PConstraint, PTraceable
  Direct Known Subclasses:
    ExpressionEvaluation

      public abstract class BaseTypeSafeConstraint
      extends VariableDeferredPConstraint

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Set<PVariable>` | `inputVariables`
    `protected PVariable` | `outputVariable`

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.matchers.psystem.BasePConstraint

      `pBody`

    - ### Fields inherited from interface org.eclipse.viatra.query.runtime.matchers.psystem.PConstraint

      `COMPARE_BY_MONOTONOUS_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseTypeSafeConstraint(PBody pBody, java.util.Set<PVariable> inputVariables, PVariable outputVariable)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PVariable` | `checkTypeSafety(SubPlan plan, IQueryMetaContext context)` Checks whether all type restrictions are already enforced on affected variables.
    `protected void` | `doReplaceVariable(PVariable obsolete, PVariable replacement)`
    `java.util.Set<PVariable>` | `getDeducedVariables()` The set of variables whose potential values can be enumerated (once all non-deduced variables have known values).
    `java.util.Set<PVariable>` | `getDeferringVariables()`
    `PVariable` | `getOutputVariable()`
    `boolean` | `isReadyAt(SubPlan plan, IQueryMetaContext context)` Refine further if needed

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.matchers.psystem.BasePConstraint

      `checkSanity, delete, getAffectedVariables, getBody, getFunctionalDependencies, getMonotonousID, getPSystem, replaceVariable, toString, toStringRest`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### inputVariables

          protected java.util.Set<PVariable> inputVariables

    - #### outputVariable

          protected PVariable outputVariable

  - ### Constructor Detail

    - #### BaseTypeSafeConstraint

          public BaseTypeSafeConstraint(PBody pBody,
                                        java.util.Set<PVariable> inputVariables,
                                        PVariable outputVariable)

      Parameters:
        `pBody` -
        `inputVariables` -
        `outputVariable` - null iff no output (check-only)

  - ### Method Detail

    - #### getOutputVariable

          public PVariable getOutputVariable()

    - #### getDeducedVariables

          public java.util.Set<PVariable> getDeducedVariables()

      Description copied from interface: `PConstraint`
      The set of variables whose potential values can be enumerated (once all non-deduced variables have known values).

    - #### getDeferringVariables

          public java.util.Set<PVariable> getDeferringVariables()

      Specified by:
        `getDeferringVariables` in class `VariableDeferredPConstraint`

    - #### isReadyAt

          public boolean isReadyAt(SubPlan plan,
                                   IQueryMetaContext context)

      Description copied from class: `VariableDeferredPConstraint`
      Refine further if needed
      Overrides:
        `isReadyAt` in class `VariableDeferredPConstraint`

    - #### checkTypeSafety

          public PVariable checkTypeSafety(SubPlan plan,
                                           IQueryMetaContext context)

      Checks whether all type restrictions are already enforced on affected variables.
      Parameters:
        `plan` -
      Returns:
        a variable whose type safety is not enforced yet, or null if the plan is typesafe

    - #### doReplaceVariable

          protected void doReplaceVariable(PVariable obsolete,
                                           PVariable replacement)

      Specified by:
        `doReplaceVariable` in class `BasePConstraint`