Package org.eclipse.viatra.query.runtime.matchers.psystem.rewriters

## Class PBodyNormalizer

- java.lang.Object
- - org.eclipse.viatra.query.runtime.matchers.psystem.rewriters.AbstractRewriterTraceSource
  - - org.eclipse.viatra.query.runtime.matchers.psystem.rewriters.PDisjunctionRewriter
    - - org.eclipse.viatra.query.runtime.matchers.psystem.rewriters.PBodyNormalizer

-     public class PBodyNormalizer
      extends PDisjunctionRewriter

  A disjunction rewriter for creating a normalized form of specification, unifying variables and running basic sanity checks. This rewriter does not copy but modifies directly the original specification, requiring a mutable disjunction.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PBodyNormalizer​(IQueryMetaContext context)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `PBody` | `normalizeBody​(PBody body)` | Provides a normalized version of the pattern body.
    `PDisjunction` | `rewrite​(PDisjunction disjunction)` |
    `void` | `setContext​(IQueryMetaContext context)` |
    `protected boolean` | `shouldCalculateImpliedTypes​(PQuery query)` | Returns whether unary constraint elimination is enabled.
    `protected boolean` | `shouldExpandWeakenedAlternatives​(PQuery query)` | Returns whether 'weakened alternative' suggestions of the context shall be expanded as additional PConstraints.

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

      `rewrite`

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

      `addTrace, derivativeRemoved, getTraceCollector, getTraces, setTraceCollector`

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

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

- - ### Constructor Detail

    - #### PBodyNormalizer

          public PBodyNormalizer​(IQueryMetaContext context)

  - ### Method Detail

    - #### shouldCalculateImpliedTypes

          protected boolean shouldCalculateImpliedTypes​(PQuery query)

      Returns whether unary constraint elimination is enabled. This behavior can be customized by creating a subclass with a custom implementation.
      Since:
        1.6

    - #### shouldExpandWeakenedAlternatives

          protected boolean shouldExpandWeakenedAlternatives​(PQuery query)

      Returns whether 'weakened alternative' suggestions of the context shall be expanded as additional PConstraints. This behavior can be customized by creating a subclass with a custom implementation.
      Since:
        1.6

    - #### rewrite

          public PDisjunction rewrite​(PDisjunction disjunction)

      Specified by:
        `rewrite` in class `PDisjunctionRewriter`

    - #### setContext

          public void setContext​(IQueryMetaContext context)

    - #### normalizeBody

          public PBody normalizeBody​(PBody body)

      Provides a normalized version of the pattern body. May return a different version than the original version if needed.
      Parameters:
        `body` -