Class NaturalsGenerator
java.lang.Object
com.darkcollective.relix.processor.generator.NaturalsGenerator
- All Implemented Interfaces:
Generator
Naturals — the canonical infinite leaf: the
natural numbers ℕ₀ 0, 1, 2, 3, … in a single column n:NUMBER.
Takes no arguments.
The rows are produced by an arbitrary-precision BigInteger counter, so
the stream never overflows — it is genuinely unbounded. unbounded() is
therefore true: a blocking operator over Naturals (e.g.
γ count (Naturals)) is a plan-time error, while a streaming consumer with a
bound — λ 10 (Naturals) — pulls only as many rows as it needs (the limit
operator consumes the stream lazily). The series is strictly increasing, so it is
duplicateFree().
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe single column on which this generator emits values in strictly ascending order, when it is an unbounded generator — the seam the optimizer'sGEN-001pass consults to fold an upper-bound selection into a production stop.booleanWhether this generator is inherently duplicate-free (every row distinct).name()Lazily produces the generator's rows.The schema (heading) this generator produces for the given arguments.booleanWhether this generator is provably infinite.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.darkcollective.relix.processor.generator.Generator
cardinality
-
Constructor Details
-
NaturalsGenerator
public NaturalsGenerator()
-
-
Method Details
-
name
-
schema
Description copied from interface:GeneratorThe schema (heading) this generator produces for the given arguments. Implementations should keep this total where possible — argument validation that only affects the rows belongs inGenerator.rows(java.util.Map<java.lang.String, java.lang.String>, com.darkcollective.relix.symbol.Schema). -
rows
Description copied from interface:GeneratorLazily produces the generator's rows.- Specified by:
rowsin interfaceGenerator- Parameters:
args- the raw generator arguments (e.g.lo/hi/step)schema- the schema returned byGenerator.schema(Map)for the same args- Returns:
- a lazy stream of rows; the caller closes it
-
unbounded
public boolean unbounded()Description copied from interface:GeneratorWhether this generator is provably infinite. Read byGeneratorBoundednessSource; finite generators (the default) reportfalse. -
duplicateFree
public boolean duplicateFree()Description copied from interface:GeneratorWhether this generator is inherently duplicate-free (every row distinct). Read byGeneratorDistinctnessSource, which feeds distinctness-drivenδelimination (DIST-001).- Specified by:
duplicateFreein interfaceGenerator- Returns:
trueif the generator never emits a duplicate row
-
ascendingColumn
Description copied from interface:GeneratorThe single column on which this generator emits values in strictly ascending order, when it is an unbounded generator — the seam the optimizer'sGEN-001pass consults to fold an upper-bound selection into a production stop. Returning a column declares "an upper bound on this column is a sound termination condition" (atakeWhile).The default is empty: finite generators terminate on their own, and a non-monotone generator cannot be safely stopped by a value threshold.
- Specified by:
ascendingColumnin interfaceGenerator- Returns:
- the ascending value column, or empty when not an ascending unbounded generator
-