kumulant

BoolExpr

@Serializable
sealed interface BoolExpr(source)

Wire-serialisable AST for boolean predicates over the same input environment as ScalarExpr. Consumed by every spec-side filter operator and by IfExpr's condition slot.

Build via the comparison operators (gt / ge / lt / le / eq) on ScalarExpr and the boolean combinators (and / or / not). The resulting expression round-trips on the wire alongside the rest of the spec.

Examples:

X gt 0.0                          // positive values only<br>(X gt 0.0) and (X lt 100.0)       // half-open interval<br>In(VIndex, listOf(0.0, 2.0, 5.0)) // coordinate index in {0, 2, 5}

See ScalarExpr for the input-environment convention.

Inheritors

Functions

Link copied to clipboard
infix fun BoolExpr.and(rhs: BoolExpr): BoolExpr

Short-circuiting conjunction.

Link copied to clipboard
abstract fun eval(x: Double, y: Double = 0.0, v: DoubleArray = EMPTY_VECTOR, primary: Result? = null): Boolean

Evaluate this predicate against the per-update inputs. Returns true to keep an observation under filter or to take the then branch under IfExpr.

Link copied to clipboard
operator fun BoolExpr.not(): BoolExpr

Logical negation.

Link copied to clipboard
infix fun BoolExpr.or(rhs: BoolExpr): BoolExpr

Short-circuiting disjunction.

eval

abstract fun eval(x: Double, y: Double = 0.0, v: DoubleArray = EMPTY_VECTOR, primary: Result? = null): Boolean(source)

Evaluate this predicate against the per-update inputs. Returns true to keep an observation under filter or to take the then branch under IfExpr.