Skip to content
Symi Docs
WASM / JavaScript

Signatures in the WASM / JavaScript view are TypeScript. Where the JavaScript facade wraps an operation its form is listed first; the other calling forms are the raw wasm-bindgen exports.

On this page

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#

Raw WebAssembly: Default context

interval(
    lower: Expression,
    upper: Expression,
    lower_open?: boolean | null,
    upper_open?: boolean | null,
): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.interval

interval(
    lower: Expression,
    upper: Expression,
    lower_open?: boolean | null,
    upper_open?: boolean | null,
): Expression

Real-line interval. Closed by default; endpoints at infinity are forced open. Degenerate shapes collapse (empty interval →\to empty set, single point →\to finite set, (−∞,∞)→(-\infty, \infty)\to real line).

real_line#

Not exposed by the WASM / JavaScript bindings. Available as Context.real_line in Python, UniffiSession.realLine in Kotlin, UniffiSession.realLine in Swift, api::Session::real_line in Rust.

The set R\mathbb{R}.

complex_plane#

Not exposed by the WASM / JavaScript bindings. Available as Context.complex_plane in Python, UniffiSession.complexPlane in Kotlin, UniffiSession.complexPlane in Swift, api::Session::complex_plane in Rust.

The set C\mathbb{C} — the ambient universe, and the domain a variable ranges over when it carries no realness assumption.

integer_set#

Not exposed by the WASM / JavaScript bindings. Available as Context.integer_set in Python, UniffiSession.integerSet in Kotlin, UniffiSession.integerSet in Swift, api::Session::integer_set in Rust.

The set Z\mathbb{Z}.

empty_set#

Not exposed by the WASM / JavaScript bindings. Available as Context.empty_set in Python, UniffiSession.emptySet in Kotlin, UniffiSession.emptySet in Swift, api::Session::empty_set in Rust.

The empty set ∅\varnothing.

finite_set#

Not exposed by the WASM / JavaScript bindings. Available as Context.finite_set in Python, UniffiSession.finiteSet in Kotlin, UniffiSession.finiteSet in Swift, api::Session::finite_set in Rust.

Finite set; elements are deduplicated and canonically ordered. An empty list gives the empty set.

set_union#

Not exposed by the WASM / JavaScript bindings. Available as Context.set_union in Python, UniffiSession.setUnion in Kotlin, UniffiSession.setUnion in Swift, api::sets::Session::set_union in Rust.

Union, computed eagerly where the structural rules allow (overlapping or touching interval pairs merge; nested unions splice, ∅\varnothing drops, R\mathbb{R} absorbs); otherwise the structural set_union node.

set_intersection#

Not exposed by the WASM / JavaScript bindings. Available as Context.set_intersection in Python, UniffiSession.setIntersection in Kotlin, UniffiSession.setIntersection in Swift, api::sets::Session::set_intersection in Rust.

Intersection, computed eagerly where the structural rules allow (interval pairs, finite-set membership filtering; R\mathbb{R} drops, ∅\varnothing absorbs); otherwise the structural set_intersection node.

set_complement#

Not exposed by the WASM / JavaScript bindings. Available as Context.set_complement in Python, UniffiSession.setComplement in Kotlin, UniffiSession.setComplement in Swift, api::sets::Session::set_complement in Rust.

The relative complement a∖ba \setminus b.

image_set#

Not exposed by the WASM / JavaScript bindings. Available as Context.image_set in Python, UniffiSession.imageSet in Kotlin, UniffiSession.imageSet in Swift, api::sets::Session::image_set in Rust.

The set {lambda_expression⁡:variable⁡∈domain⁡}\{\operatorname{lambda\_expression} : \operatorname{variable} \in \operatorname{domain}\}; variable is a binder over lambda_expression. Finite domains are enumerated element-wise at construction.

condition_set#

Not exposed by the WASM / JavaScript bindings. Available as Context.condition_set in Python, UniffiSession.conditionSet in Kotlin, UniffiSession.conditionSet in Swift, api::sets::Session::condition_set in Rust.

The set {variable⁡∈domain⁡:condition⁡}\{\operatorname{variable} \in \operatorname{domain} : \operatorname{condition}\}. This is also solveset's honest "unsolved" residue shape.

is_member#

Raw WebAssembly: Default context

isMember(element: Expression, set: Expression): boolean | undefined
Calling forms

Raw WebAssembly: Explicit context: Context.isMember

isMember(element: Expression, set: Expression): boolean | undefined

Three-valued membership: True only on structural proof, False only on a structural counterexample, None otherwise. Covers ∅\varnothing, R\mathbb{R}, finite sets, intervals, unions, intersections, complements.

is_subset#

Not exposed by the WASM / JavaScript bindings. Available as Context.is_subset in Python, UniffiSession.isSubset in Kotlin, UniffiSession.isSubset in Swift, api::sets::Session::is_subset in Rust.

Three-valued subset query: ∅⊆\varnothing \subseteq anything, structural equality, finite-set element checks, interval-in-interval endpoint tests; None otherwise.

enumerate_set_in_interval#

Not exposed by the WASM / JavaScript bindings. Available as Context.enumerate_set_in_interval in Python, UniffiSession.enumerateSetInInterval in Kotlin, UniffiSession.enumerateSetInInterval in Swift, api::sets::Session::enumerate_set_in_interval in Rust.

Exact elements of a set inside [lower⁡,upper⁡][\operatorname{lower}, \operatorname{upper}], 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 Z\mathbb{Z}, 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#

Set construction and membership over exact elements.

JavaScript
const left = symi.finiteSet([1, 2, 3]);
const right = symi.finiteSet([2, 3, 4]);

console.log(left.toString());
console.log(right.toString());
console.log(symi.emptySet.toString());

Additional API#

complexPlane#

Raw WebAssembly: Default context

complexPlane(): Expression

The set C\mathbb{C} — the ambient universe, and the domain a variable ranges over when it carries no realness assumption.

Calling forms

Explicit context: Context.complexPlane

readonly complexPlane: Expression

Raw WebAssembly: Explicit context: Context.complexPlane

complexPlane(): Expression

SymiFacade property: SymiFacade.complexPlane

readonly complexPlane: Expression

conditionSet#

Raw WebAssembly: Default context

conditionSet(
    variable: string,
    condition: Expression,
    domain: Expression,
): Expression

The set {variable⁡∈domain⁡:condition⁡}\{\operatorname{variable} \in \operatorname{domain} : \operatorname{condition}\}.

Calling forms

Raw WebAssembly: Explicit context: Context.conditionSet

conditionSet(
    variable: string,
    condition: Expression,
    domain: Expression,
): Expression

emptySet#

Raw WebAssembly: Default context

emptySet(): Expression

The empty set ∅\varnothing.

Calling forms

Explicit context: Context.emptySet

readonly emptySet: Expression

Raw WebAssembly: Explicit context: Context.emptySet

emptySet(): Expression

SymiFacade property: SymiFacade.emptySet

readonly emptySet: Expression

enumerateSetInInterval#

Raw WebAssembly: Default context

enumerateSetInInterval(
    set: Expression,
    lower: Expression,
    upper: Expression,
    lower_inclusive?: boolean | null,
    upper_inclusive?: boolean | null,
    limit?: number | null,
): SetEnumeration

Exact elements of a set inside [lower⁡,upper⁡][\operatorname{lower}, \operatorname{upper}], in increasing order, as a set_enumeration. Its 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.

Calling forms

Raw WebAssembly: Explicit context: Context.enumerateSetInInterval

enumerateSetInInterval(
    set: Expression,
    lower: Expression,
    upper: Expression,
    lower_inclusive?: boolean | null,
    upper_inclusive?: boolean | null,
    limit?: number | null,
): SetEnumeration

finiteSet#

Raw WebAssembly: Default context

finiteSet(elements: Expression[]): Expression

Finite set; elements are deduplicated and canonically ordered. An empty list gives the empty set.

Calling forms

Explicit context: Context.finiteSet

finiteSet(values: Iterable<ExpressionLike>): Expression

Raw WebAssembly: Explicit context: Context.finiteSet

finiteSet(elements: Expression[]): Expression

SymiFacade method: SymiFacade.finiteSet

finiteSet(values: Iterable<ExpressionLike>): Expression

imageSet#

Raw WebAssembly: Default context

imageSet(
    lambda_expression: Expression,
    variable: string,
    domain: Expression,
): Expression

The set {lambda_expression⁡:variable⁡∈domain⁡}\{\operatorname{lambda\_expression} : \operatorname{variable} \in \operatorname{domain}\}; variable is a binder over lambda_expression.

Calling forms

Raw WebAssembly: Explicit context: Context.imageSet

imageSet(
    lambda_expression: Expression,
    variable: string,
    domain: Expression,
): Expression

integerSet#

Raw WebAssembly: Default context

integerSet(): Expression

The set Z\mathbb{Z}.

Calling forms

Explicit context: Context.integerSet

readonly integerSet: Expression

Raw WebAssembly: Explicit context: Context.integerSet

integerSet(): Expression

SymiFacade property: SymiFacade.integerSet

readonly integerSet: Expression

isSubset#

Raw WebAssembly: Default context

isSubset(set_a: Expression, set_b: Expression): boolean | undefined

Three-valued subset query: ∅⊆\varnothing \subseteq anything, structural equality, finite-set element checks, interval-in-interval endpoint tests; None otherwise.

Calling forms

Raw WebAssembly: Explicit context: Context.isSubset

isSubset(set_a: Expression, set_b: Expression): boolean | undefined

length#

Raw WebAssembly: Expression method

readonly length: number

Number of elements of a finite-set expression.

realLine#

Raw WebAssembly: Default context

realLine(): Expression

The set R\mathbb{R}.

Calling forms

Explicit context: Context.realLine

readonly realLine: Expression

Raw WebAssembly: Explicit context: Context.realLine

realLine(): Expression

SymiFacade property: SymiFacade.realLine

readonly realLine: Expression

setComplement#

Raw WebAssembly: Default context

setComplement(set_a: Expression, set_b: Expression): Expression

The relative complement a∖ba \setminus b.

Calling forms

Raw WebAssembly: Explicit context: Context.setComplement

setComplement(set_a: Expression, set_b: Expression): Expression

setIntersection#

Raw WebAssembly: Default context

setIntersection(set_a: Expression, set_b: Expression): Expression

Intersection, computed eagerly where the structural rules allow (interval pairs, finite-set membership filtering; R\mathbb{R} drops, ∅\varnothing absorbs); otherwise the structural set_intersection node.

Calling forms

Raw WebAssembly: Explicit context: Context.setIntersection

setIntersection(set_a: Expression, set_b: Expression): Expression

setUnion#

Raw WebAssembly: Default context

setUnion(set_a: Expression, set_b: Expression): Expression

Union, computed eagerly where the structural rules allow (overlapping or touching interval pairs merge; nested unions splice, ∅\varnothing drops, R\mathbb{R} absorbs); otherwise the structural set_union node.

Calling forms

Raw WebAssembly: Explicit context: Context.setUnion

setUnion(set_a: Expression, set_b: Expression): Expression

SetEnumeration#

SetEnumeration.elements#

Raw WebAssembly: SetEnumeration property

readonly elements: Expression[]

The exact elements produced, in increasing order.

SetEnumeration.outcome#

Raw WebAssembly: SetEnumeration property

readonly outcome: string

"complete", "truncated", or "declined".

Symi documentation · WASM / JavaScript