Record Class ProduceBound

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 blank
operator - the bounding comparison — one of LESS, LESS_EQUAL, EQUAL
limit - 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():

  • Constructor Details

    • ProduceBound

      public ProduceBound(String column, ComparisonOperator operator, Operand limit)
      Creates an instance of a ProduceBound record class.
      Parameters:
      column - the value for the column record component
      operator - the value for the operator record component
      limit - the value for the limit record component
  • Method Details

    • inclusive

      public boolean inclusive()
      Whether the threshold itself is produced (<=/=) rather than excluded (<).
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • column

      public String column()
      Returns the value of the column record component.
      Returns:
      the value of the column record component
    • operator

      public ComparisonOperator operator()
      Returns the value of the operator record component.
      Returns:
      the value of the operator record component
    • limit

      public Operand limit()
      Returns the value of the limit record component.
      Returns:
      the value of the limit record component