Class GeneratorDistinctnessSource

java.lang.Object
com.darkcollective.relix.processor.generator.GeneratorDistinctnessSource
All Implemented Interfaces:
DistinctnessSource

public final class GeneratorDistinctnessSource extends Object implements DistinctnessSource
A DistinctnessSource backed by a model's sources and the generator registry: a leaf relation is duplicate-free iff it is a generator source whose generator declares Generator.duplicateFree() (e.g. Range). Every other leaf is conservatively not known distinct.

Lets DistinctEliminationPass apply DIST-001 (`δ(R) → R`) over an inherently-distinct generator — which, for an unbounded one, also dissolves the δ unbounded-retained-state hazard.

  • Constructor Details

    • GeneratorDistinctnessSource

      public GeneratorDistinctnessSource(Map<String,SourceDeclaration> sources, GeneratorRegistry registry)
      Parameters:
      sources - canonical (lower-cased) relation name → source declaration (as in SemanticModel.sources()); must not be null
      registry - the generator registry; must not be null
  • Method Details

    • duplicateFreeLeaf

      public boolean duplicateFreeLeaf(String relationName)
      Specified by:
      duplicateFreeLeaf in interface DistinctnessSource
      Parameters:
      relationName - the leaf relation name; never null
      Returns:
      true if that leaf is inherently duplicate-free