Sets
Sets are ordinary Expression values; constructors route through
auto-simplification (degenerate intervals collapse, unions splice and
deduplicate, etc.). Take results apart with the structural accessors on the
expressions page.
interval#
Explicit context
fun interval(
lower: UniffiExpression,
upper: UniffiExpression,
lowerInclusive: kotlin.Boolean,
upperInclusive: kotlin.Boolean,
): UniffiExpressionReal-line interval. Closed by default; endpoints at infinity are forced open. Degenerate shapes collapse (empty interval empty set, single point finite set, real line).
real_line#
Explicit context
fun realLine(): UniffiExpressionThe set .
complex_plane#
Explicit context
fun complexPlane(): UniffiExpressionThe set — the ambient universe, and the domain a variable ranges over when it carries no realness assumption.
integer_set#
Explicit context
fun integerSet(): UniffiExpressionThe set .
empty_set#
Explicit context
fun emptySet(): UniffiExpressionThe empty set .
finite_set#
Explicit context
fun finiteSet(elements: List<UniffiExpression>): UniffiExpressionFinite set; elements are deduplicated and canonically ordered. An empty list gives the empty set.
set_union#
Explicit context
fun setUnion(
left: UniffiExpression,
right: UniffiExpression,
): UniffiExpressionUnion, computed eagerly where the structural rules allow (overlapping or
touching interval pairs merge; nested unions splice, drops, absorbs);
otherwise the structural set_union node.
set_intersection#
Explicit context
fun setIntersection(
left: UniffiExpression,
right: UniffiExpression,
): UniffiExpressionIntersection, computed eagerly where the structural rules allow (interval
pairs, finite-set membership filtering; drops, absorbs); otherwise the
structural set_intersection node.
set_complement#
Explicit context
fun setComplement(
left: UniffiExpression,
right: UniffiExpression,
): UniffiExpressionThe relative complement .
image_set#
Explicit context
fun imageSet(
lambdaExpression: UniffiExpression,
variable: kotlin.String,
domain: UniffiExpression,
): UniffiExpressionThe set ; variable is a binder
over lambda_expression. Finite domains are enumerated element-wise at
construction.
condition_set#
Explicit context
fun conditionSet(
variable: kotlin.String,
condition: UniffiExpression,
domain: UniffiExpression,
): UniffiExpressionThe set . This is also solveset's honest
"unsolved" residue shape.
is_member#
Explicit context
fun isMember(
element: UniffiExpression,
set: UniffiExpression,
): UniffiTruthValueThree-valued membership: True only on structural proof, False only on a
structural counterexample, None otherwise. Covers , , finite sets,
intervals, unions, intersections, complements.
is_subset#
Explicit context
fun isSubset(
smaller: UniffiExpression,
larger: UniffiExpression,
): UniffiTruthValueThree-valued subset query: anything, structural equality, finite-set
element checks, interval-in-interval endpoint tests; None otherwise.
enumerate_set_in_interval#
Explicit context
fun enumerateSetInInterval(
set: UniffiExpression,
lower: UniffiExpression,
upper: UniffiExpression,
lowerInclusive: kotlin.Boolean,
upperInclusive: kotlin.Boolean,
limit: kotlin.ULong?,
): UniffiSetEnumerationExact elements of a set inside , in increasing
order, as {"outcome": str, "elements": list[Expression]}. outcome is "complete" when those
are exactly the elements in the interval, "truncated" when limit cut the list short (the
family is still solved), and "declined" when the set's shape is not enumerable — never a
licence to approximate. Handles finite sets, affine image sets over , unions,
complements, and the unevaluated set_intersection(interval, image_set) shape solveset_in_domain
returns for a lattice too wide to materialize. limit defaults to 64. WASM returns a
SetEnumeration object with outcome and elements getters.
Example#
Additional API#
length#
Expression method
fun length(): kotlin.ULongNumber of elements of a finite-set expression.
SetEnumeration#
SetEnumeration.elements#
UniffiSetEnumeration method
fun elements(): List<UniffiExpression>The exact elements produced, in increasing order.
SetEnumeration.outcome#
UniffiSetEnumeration method
fun outcome(): UniffiEnumerationVerdict"complete", "truncated", or "declined".