Record Class CoverNode

java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.CoverNode
All Implemented Interfaces:
RelNode

public record CoverNode(int strength, boolean exact, RelNode input, SourceLocation location) extends Record implements RelNode
Covering-reduction node — COVER [EXACT] t (R).

COVER t (R) keeps a near-minimal subset of R's rows such that every distinct t-column value combination occurring in R occurs in the output (PICT-style pairwise / t-way combinatorial test generation). It is a windowed filter — output ⊆ input, output schema = input schema — the third subset-selection operator after TOP and OPTIMIZE.

The strength() is the covering strength t: a positive integer specifying how many columns must be covered in every combination. Strength 2 (all-pairs) is the most common case.

When exact() is true (COVER EXACT t (R)), the executor uses a MIP set-cover formulation (via ojAlgo) to find a provably minimal suite instead of the default greedy near-minimal algorithm.

Surface syntax: COVER t (R) or COVER EXACT t (R) (keyword-only, no glyph).

See Also:
  • Constructor Details

    • CoverNode

      public CoverNode(int strength, boolean exact, RelNode input, SourceLocation location)
      Creates an instance of a CoverNode record class.
      Parameters:
      strength - the value for the strength record component
      exact - the value for the exact record component
      input - the value for the input record component
      location - the value for the location record component
    • CoverNode

      public CoverNode(int strength, RelNode input, SourceLocation location)
      Backward-compatible constructor: exact=false.
    • CoverNode

      public CoverNode(int strength, boolean exact, RelNode input)
      Convenience constructor for tests: SourceLocation.UNKNOWN.
    • CoverNode

      public CoverNode(int strength, RelNode input)
      Convenience constructor for tests: exact=false, SourceLocation.UNKNOWN.
  • Method Details

    • accept

      public <R> R accept(RelNodeVisitor<R> visitor)
      Specified by:
      accept in interface RelNode
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • strength

      public int strength()
      Returns the value of the strength record component.
      Returns:
      the value of the strength record component
    • exact

      public boolean exact()
      Returns the value of the exact record component.
      Returns:
      the value of the exact record component
    • input

      public RelNode input()
      Returns the value of the input record component.
      Returns:
      the value of the input record component
    • location

      public SourceLocation location()
      Returns the value of the location record component.
      Specified by:
      location in interface RelNode
      Returns:
      the value of the location record component