Skip to content
Symi Docs
Kotlin
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#

Explicit context

fun pi(): UniffiExpression

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

e#

Explicit context

fun e(): UniffiExpression

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

euler_gamma#

Explicit context

fun eulerGamma(): UniffiExpression

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

imaginary_unit#

Explicit context

fun imaginaryUnit(): UniffiExpression

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

infinity#

Explicit context

fun infinity(): UniffiExpression

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#

Symi documentation · Kotlin