java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.ProduceBound
- Record Components:
column- the generator's ascending value column the bound applies to; must not be blankoperator- the bounding comparison — one ofLESS,LESS_EQUAL,EQUALlimit- the constant upper-bound literal; must not be null
public record ProduceBound(String column, ComparisonOperator operator, Operand limit)
extends Record
A production stop folded into a monotone generator leaf by the optimizer's
SelectionIntoGeneratorPass (GEN-001).
An unbounded ascending generator (Naturals, Primes) produces
values forever, so a σ above it that only filters never terminates. When
the selection carries a top-level upper bound on the generator's
ascending value column (n < k, n <= k, n = k), that bound
is recorded here so the executor can stop producing (a takeWhile
over the ordered stream) once the threshold is passed — turning a non-terminating
scan into a finite one, and making the leaf boundedness-BOUNDED.
The σ that produced it always remains above the leaf as a residual
filter, so this bound only affects how much is produced, never the
result — the rewrite is correctness-preserving by construction. The original
selection predicate determines the operator():
ComparisonOperator.LESS— stop whilecolumn < limit(exclusive);ComparisonOperator.LESS_EQUAL/ComparisonOperator.EQUAL— stop whilecolumn <= limit(inclusive;=relies on the residual σ for the exact match).
-
Constructor Summary
ConstructorsConstructorDescriptionProduceBound(String column, ComparisonOperator operator, Operand limit) Creates an instance of aProduceBoundrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolumn()Returns the value of thecolumnrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanWhether the threshold itself is produced (<=/=) rather than excluded (<).limit()Returns the value of thelimitrecord component.operator()Returns the value of theoperatorrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
inclusive
public boolean inclusive()Whether the threshold itself is produced (<=/=) rather than excluded (<). -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
column
Returns the value of thecolumnrecord component.- Returns:
- the value of the
columnrecord component
-
operator
Returns the value of theoperatorrecord component.- Returns:
- the value of the
operatorrecord component
-
limit
Returns the value of thelimitrecord component.- Returns:
- the value of the
limitrecord component
-