Class GeneratorMonotonicitySource

java.lang.Object
com.darkcollective.relix.processor.generator.GeneratorMonotonicitySource
All Implemented Interfaces:
MonotoneGeneratorSource

public final class GeneratorMonotonicitySource extends Object implements MonotoneGeneratorSource
A MonotoneGeneratorSource backed by a model's sources and the generator registry: a leaf relation reports an ascending value column iff it is a generator source whose generator declares one via Generator.ascendingColumn() (the unbounded Naturals/Primes). Every other leaf returns Optional.empty().

Lets SelectionIntoGeneratorPass apply GEN-001 (σ n < k → production stop) so an otherwise non-terminating scan over an unbounded generator becomes finite. Mirrors GeneratorDistinctnessSource / GeneratorBoundednessSource.

  • Constructor Details

    • GeneratorMonotonicitySource

      public GeneratorMonotonicitySource(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

    • ascendingColumn

      public Optional<String> ascendingColumn(String relationName)
      Description copied from interface: MonotoneGeneratorSource
      Returns the ascending value column of the leaf named relationName when it is a monotone-ascending unbounded generator, else Optional.empty().
      Specified by:
      ascendingColumn in interface MonotoneGeneratorSource
      Parameters:
      relationName - the leaf relation name; never null
      Returns:
      the ascending column name, or empty when not an ascending unbounded generator