Class GeneratorMonotonicitySource
java.lang.Object
com.darkcollective.relix.processor.generator.GeneratorMonotonicitySource
- All Implemented Interfaces:
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.
-
Field Summary
Fields inherited from interface com.darkcollective.relix.cost.MonotoneGeneratorSource
NONE -
Constructor Summary
ConstructorsConstructorDescriptionGeneratorMonotonicitySource(Map<String, SourceDeclaration> sources, GeneratorRegistry registry) -
Method Summary
Modifier and TypeMethodDescriptionascendingColumn(String relationName) Returns the ascending value column of the leaf namedrelationNamewhen it is a monotone-ascending unbounded generator, elseOptional.empty().
-
Constructor Details
-
GeneratorMonotonicitySource
public GeneratorMonotonicitySource(Map<String, SourceDeclaration> sources, GeneratorRegistry registry) - Parameters:
sources- canonical (lower-cased) relation name → source declaration (as inSemanticModel.sources()); must not be nullregistry- the generator registry; must not be null
-
-
Method Details
-
ascendingColumn
Description copied from interface:MonotoneGeneratorSourceReturns the ascending value column of the leaf namedrelationNamewhen it is a monotone-ascending unbounded generator, elseOptional.empty().- Specified by:
ascendingColumnin interfaceMonotoneGeneratorSource- Parameters:
relationName- the leaf relation name; never null- Returns:
- the ascending column name, or empty when not an ascending unbounded generator
-