Interface MonotoneGeneratorSource

All Known Implementing Classes:
GeneratorMonotonicitySource
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MonotoneGeneratorSource
Supplies, for a leaf relation, the column on which it is a monotone-ascending unbounded generator — the one fact the optimizer needs to decide that an upper-bound selection (n < k) can be folded into the producer as a termination stop (GEN-001).

It is the producer analogue of DistinctnessSource / BoundednessSource: a leaf seam supplied by the runtime (which knows the generator catalogue), consulted by the optimizer through the OptimizationContext. A leaf that is not an ascending unbounded generator returns Optional.empty() and is never bounded by this pass.

Only ascending, unbounded generators (Naturals, Primes) need report a column: a finite generator terminates on its own, and a non-monotone one cannot be safely stopped by a value threshold.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    A source under which no leaf is a monotone generator (the production default off-path).
  • Method Summary

    Modifier and Type
    Method
    Description
    ascendingColumn(String relationName)
    Returns the ascending value column of the leaf named relationName when it is a monotone-ascending unbounded generator, else Optional.empty().
  • Field Details

    • NONE

      static final MonotoneGeneratorSource NONE
      A source under which no leaf is a monotone generator (the production default off-path).
  • Method Details

    • ascendingColumn

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