org.eclipse.incquery.runtime.matchers.planning.helpers

## Class BuildHelper

- java.lang.Object
- - org.eclipse.incquery.runtime.matchers.planning.helpers.BuildHelper

-     public class BuildHelper
      extends java.lang.Object

  Author:
    Gabor Bergmann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BuildHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `areAllVariablesDetermined(SubPlan plan, java.util.Collection<PVariable> determining, IQueryMetaContext context)`
    `static boolean` | `areVariablesDetermined(SubPlan plan, java.util.Collection<PVariable> determining, java.util.Collection<PVariable> determined, IQueryMetaContext context)`
    `static void` | `finalCheck(PBody pSystem, SubPlan plan, IQueryMetaContext context)` Verifies whether all constraints are enforced and exported parameters are present.
    `static PConstraint` | `getAnyUnenforcedConstraint(PBody pSystem, SubPlan plan)` Finds an arbitrary constraint that is not enforced at the given plan.
    `static SubPlan` | `trimUnneccessaryVariables(SubPlanFactory planFactory, SubPlan plan, boolean onlyIfNotDetermined, IQueryMetaContext context)` Reduces the number of tuples by trimming (existentially quantifying) the set of variables that are visible in the subplan, are not exported parameters, have all their constraints already enforced in the subplan, and thus will not be needed anymore.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BuildHelper

          public BuildHelper()

  - ### Method Detail

    - #### trimUnneccessaryVariables

          public static SubPlan trimUnneccessaryVariables(SubPlanFactory planFactory,
                                                          SubPlan plan,
                                                          boolean onlyIfNotDetermined,
                                                          IQueryMetaContext context)

      Reduces the number of tuples by trimming (existentially quantifying) the set of variables that
      - are visible in the subplan,
      - are not exported parameters,
      - have all their constraints already enforced in the subplan,
      and thus will not be needed anymore.
      Parameters:
        `onlyIfNotDetermined` - if true, no trimming performed unless there is at least one such variable
      Returns:
        the plan after the trimming (possibly the original)

    - #### areAllVariablesDetermined

          public static boolean areAllVariablesDetermined(SubPlan plan,
                                                          java.util.Collection<PVariable> determining,
                                                          IQueryMetaContext context)

      Returns:
        true iff a set of given variables functionally determine all visible variables in the subplan according to the subplan's constraints

    - #### areVariablesDetermined

          public static boolean areVariablesDetermined(SubPlan plan,
                                                       java.util.Collection<PVariable> determining,
                                                       java.util.Collection<PVariable> determined,
                                                       IQueryMetaContext context)

      Returns:
        true iff one set of given variables functionally determine the other set according to the subplan's constraints

    - #### getAnyUnenforcedConstraint

          public static PConstraint getAnyUnenforcedConstraint(PBody pSystem,
                                                               SubPlan plan)

      Finds an arbitrary constraint that is not enforced at the given plan.
      Parameters:
        `pSystem` -
        `plan` -
      Returns:
        a PConstraint that is not enforced, if any, or null if all are enforced

    - #### finalCheck

          public static void finalCheck(PBody pSystem,
                                        SubPlan plan,
                                        IQueryMetaContext context)
                                 throws QueryProcessingException

      Verifies whether all constraints are enforced and exported parameters are present.
      Parameters:
        `pSystem` -
        `plan` -
      Throws:
        `QueryProcessingException`