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

Evaluation and constants

Symi distinguishes construction, symbolic execution, direct eager evaluation, and host-language truth queries.

Operation Result
comparison or Boolean constructor symbolic relation or formula
evaluate_truth(predicate) exact three-valued host result
predicate.execute() symbolic logical_true, logical_false, or an unevaluated expression
simplify_logical(predicate) logical form simplification, not a host Boolean conversion
limit(...) deferred limit expression
evaluate_limit(...) explicitly eager limit computation
derivative(...) deferred derivative expression
differentiate(...) eager differentiation
integral(...) deferred integral expression
integrate(...) eager integration

Three-valued results are True, False, or None in Python; true, false, or null in the JavaScript facade; and TruthValue in the Rust facade. Unknown means the proposition was not proved or disproved. It is not false and does not indicate invalid input.

execute recursively evaluates executable symbolic forms. It is the uniform way to evaluate a deferred derivative, integral, limit, sum, product, or decidable predicate while retaining a symbolic result when exact evaluation declines.

Constants#

Constant Python JavaScript facade Rust facade
pi symi.pi / context.pi symi.pi / context.pi session.pi()
Euler's number symi.e / context.e symi.e / context.e session.e()
Euler–Mascheroni symi.euler_gamma symi.euler_gamma session.euler_gamma()
imaginary unit symi.imaginary_unit symi.imaginary_unit session.imaginary_unit()
infinities and common sets module/context properties facade/context properties session methods

Python and JavaScript constants are immutable properties, not zero-argument functions. Each access returns a handle in the owning default or explicit context, so normal provenance rules still apply. Code using pi(), e(), or other former module calls must remove the parentheses.

pi#

Raw WebAssembly: Default context

pi(): Expression
Calling forms

Explicit context: Context.pi

readonly pi: Expression

Raw WebAssembly: Explicit context: Context.pi

readonly pi: Expression

SymiFacade property: SymiFacade.pi

readonly pi: Expression

The circle constant π\pi. Exact in every arithmetic operation; use evaluate_numeric for a decimal value to any number of significant digits.

e#

Raw WebAssembly: Default context

e(): Expression
Calling forms

Explicit context: Context.e

readonly e: Expression

Raw WebAssembly: Explicit context: Context.e

readonly e: Expression

SymiFacade property: SymiFacade.e

readonly e: Expression

Euler's number ee, the base of the natural logarithm. exp(1) and this constant are the same expression.

euler_gamma#

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

The Euler–Mascheroni constant γ\gamma. It appears in closed forms produced by digamma and related special functions.

imaginary_unit#

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

The imaginary unit ii with i2=−1i^2 = -1. Use real_part and imaginary_part to decompose a complex expression.

infinity#

Raw WebAssembly: Default context

infinity(): Expression
Calling forms

Explicit context: Context.infinity

readonly infinity: Expression

Raw WebAssembly: Explicit context: Context.infinity

readonly infinity: Expression

SymiFacade property: SymiFacade.infinity

readonly infinity: Expression

Unsigned positive infinity ∞\infty. Negate it for −∞-\infty. Both are accepted as bounds by integrate_definite and as approach points by limit.

The remaining constants are documented with the structures that use them: logical_true and logical_false with Boolean algebra, and empty_set, real_line, complex_plane, and integer_set with sets.

Exact structural decomposition uses numerator_denominator, numerator, and denominator. Complex decomposition uses the existing complete names real_part and imaginary_part; no re or im aliases are provided.

Numeric evaluation#

Decimal approximations are produced only on explicit request, by the operations described in Numeric evaluation: evaluate_numeric for the value of a closed expression to any number of significant digits, and the numerical integration, summation, and root-finding operations beside it.

Example#

Construction, symbolic execution, and the exact host query are three separate steps.

JavaScript
const relation = symi.lessThan(symi.rational(1n, 3n), 1);

console.log(relation.toString());
console.log(relation.execute().toString());
console.log(symi.evaluateTruth(relation));
console.log(symi.pi.multiply(2).toString());

Additional API#

eulerGamma#

Raw WebAssembly: Default context

eulerGamma(): Expression

The Euler–Mascheroni constant γ\gamma.

Calling forms

Explicit context: Context.eulerGamma

readonly eulerGamma: Expression

Raw WebAssembly: Explicit context: Context.eulerGamma

eulerGamma(): Expression

SymiFacade property: SymiFacade.eulerGamma

readonly eulerGamma: Expression

imaginaryUnit#

Raw WebAssembly: Default context

imaginaryUnit(): Expression

The imaginary unit ii with i2=−1i^2 = -1.

Calling forms

Explicit context: Context.imaginaryUnit

readonly imaginaryUnit: Expression

Raw WebAssembly: Explicit context: Context.imaginaryUnit

readonly imaginaryUnit: Expression

SymiFacade property: SymiFacade.imaginaryUnit

readonly imaginaryUnit: Expression

Symi documentation · WASM / JavaScript