Assumptions
Assumptions are typed, canonical propositions over scalar expressions. They are kept separately from the legacy per-symbol compatibility record, so compound Boolean formulas and immutable local scopes do not lose information.
Queries are three-valued: True means entailed, False means refuted, and
None / undefined means that the bounded symbolic engine cannot decide.
could_hold is a possibility query and may return true when ask is unknown.
A result keeps the facts it was derived under: the durable assumptions, local
scope, or constraint its operation ran against, together with the facts its
operands were derived under. Clearing or replacing an assumption later does not
change what an earlier result means. Combining results whose facts contradict
each other — x refined under x > 0 and -x refined under x < 0, for
example — declines with an assumption conflict rather than producing a value no
input could satisfy, and so does substituting a value that refutes one of
those facts.
The retained facts describe when the returned object is valid, not how it was
written: sqrt(x^2) refined under x > 0 returns x, and that x stays
qualified by x > 0 even though a freshly built x is the same expression. The
facts stay attached when their symbols disappear from the result — signum(x)
refined under x > 0 is 1, still qualified by x > 0 — so a value of the
result is valid only for inputs that satisfy them. They are conservative: a
result may carry facts its derivation never consulted, but never omits one it
did. A result whose facts were not recorded — from an operation that does not
track them, from deserialization, or from a call during which the session's
facts changed — is marked as having unknown provenance, which is never the same
as having no conditions. Checking supplied values against retained facts never
consults the declared assumptions: a fact still declared in the session is not
evidence that a value supplied for its symbol satisfies it.
Proposition builders#
real_assumption#
Explicit context
fun realAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is real.
rational_assumption#
Explicit context
fun rationalAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is rational.
integer_assumption#
Explicit context
fun integerAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is an integer.
natural_assumption#
Explicit context
fun naturalAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is a natural number.
positive_integer_assumption#
Explicit context
fun positiveIntegerAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is a positive integer.
positive_assumption#
Explicit context
fun positiveAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is strictly positive.
negative_assumption#
Explicit context
fun negativeAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is strictly negative.
nonzero_assumption#
Explicit context
fun nonzeroAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is nonzero.
finite_assumption#
Explicit context
fun finiteAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is finite.
complex_assumption#
Explicit context
fun complexAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is a finite complex number.
extended_real_assumption#
Explicit context
fun extendedRealAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is an extended real, including signed infinity.
infinite_assumption#
Explicit context
fun infiniteAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is one of the two signed infinities.
irrational_assumption#
Explicit context
fun irrationalAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is real and not rational.
zero_assumption#
Explicit context
fun zeroAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is exactly zero.
even_assumption#
Explicit context
fun evenAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is an even integer.
odd_assumption#
Explicit context
fun oddAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is an odd integer.
prime_assumption#
Explicit context
fun primeAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is a proven ordinary prime integer.
composite_assumption#
Explicit context
fun compositeAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is a proven ordinary composite integer.
algebraic_assumption#
Explicit context
fun algebraicAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is algebraic over the rationals.
transcendental_assumption#
Explicit context
fun transcendentalAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression is transcendental over the rationals.
defined_assumption#
Explicit context
fun definedAssumption(subject: UniffiExpression): UniffiAssumptionPropositionBuild a proposition asserting that an expression denotes one scalar value at the active point. Its negation asserts that the expression is undefined there; definedness alone authorizes no value, finiteness, realness, sign, continuity, or analyticity.
equal_assumption#
Explicit context
fun equalAssumption(
left: UniffiExpression,
right: UniffiExpression,
): UniffiAssumptionPropositionBuild a defined scalar equality proposition.
not_equal_assumption#
Explicit context
fun notEqualAssumption(
left: UniffiExpression,
right: UniffiExpression,
): UniffiAssumptionPropositionBuild a defined scalar disequality proposition.
less_assumption#
Explicit context
fun lessAssumption(
left: UniffiExpression,
right: UniffiExpression,
): UniffiAssumptionPropositionBuild a strict extended-real order proposition.
less_or_equal_assumption#
Explicit context
fun lessOrEqualAssumption(
left: UniffiExpression,
right: UniffiExpression,
): UniffiAssumptionPropositionBuild a non-strict extended-real order proposition.
greater_assumption#
Explicit context
fun greaterAssumption(
left: UniffiExpression,
right: UniffiExpression,
): UniffiAssumptionPropositionBuild a strict extended-real order proposition by reversing its operands canonically.
greater_or_equal_assumption#
Explicit context
fun greaterOrEqualAssumption(
left: UniffiExpression,
right: UniffiExpression,
): UniffiAssumptionPropositionBuild a non-strict extended-real order proposition by reversing its operands canonically.
member_assumption#
Explicit context
fun memberAssumption(
element: UniffiExpression,
setExpression: UniffiExpression,
): UniffiAssumptionPropositionBuild a scalar-membership proposition.
congruent_assumption#
Explicit context
fun congruentAssumption(
left: UniffiExpression,
right: UniffiExpression,
modulus: UniffiExpression,
): UniffiAssumptionPropositionBuild an integer-congruence proposition with a positive integer modulus.
assumption_equal#
Not exposed by the Kotlin bindings. Available as api::Session::assumption_equal in Rust.
Construct an equality proposition over two scalar expressions.
assumption_not_equal#
Not exposed by the Kotlin bindings. Available as api::Session::assumption_not_equal in Rust.
Construct a disequality proposition over two scalar expressions.
assumption_less#
Not exposed by the Kotlin bindings. Available as api::Session::assumption_less in Rust.
Construct a strict scalar-order proposition.
assumption_less_or_equal#
Not exposed by the Kotlin bindings. Available as api::Session::assumption_less_or_equal in Rust.
Construct a non-strict scalar-order proposition.
assumption_greater#
Not exposed by the Kotlin bindings. Available as api::Session::assumption_greater in Rust.
Construct a strict scalar-order proposition with reversed operands.
assumption_greater_or_equal#
Not exposed by the Kotlin bindings. Available as api::Session::assumption_greater_or_equal in Rust.
Construct a non-strict scalar-order proposition with reversed operands.
assumption_member#
Not exposed by the Kotlin bindings. Available as api::Session::assumption_member in Rust.
Construct a scalar-membership proposition.
assumption_congruent#
Not exposed by the Kotlin bindings. Available as api::Session::assumption_congruent in Rust.
Construct an integer congruence proposition.
assumption_proposition_from_logical_expression#
Explicit context
fun assumptionPropositionFromLogicalExpression(logicalExpression: UniffiExpression): UniffiAssumptionPropositionConvert a supported Boolean relation expression into a typed assumption proposition.
Matrix proposition builders#
Matrix propositions use an immutable, context-owned snapshot of the matrix. They
return the same three-valued results as scalar assumptions and reject matrices
from another context or an earlier context generation. matrix_shape additionally
records the required dimensions in the canonical formula and serialization.
matrix_shape#
Build a proposition asserting that a matrix has the requested positive row and column counts.
square_matrix#
Build a proposition asserting that a matrix is square.
zero_matrix#
Build a proposition asserting that every matrix entry is zero.
identity_matrix#
Build a proposition asserting that a matrix is an identity matrix.
diagonal_matrix#
Build a proposition asserting that a matrix is diagonal.
upper_triangular_matrix#
Build a proposition asserting that a matrix is upper triangular.
lower_triangular_matrix#
Build a proposition asserting that a matrix is lower triangular.
symmetric_matrix#
Build a proposition asserting that a matrix equals its transpose.
hermitian_matrix#
Build a proposition asserting that a matrix equals its conjugate transpose.
orthogonal_matrix#
Build a proposition asserting that a real square matrix is orthogonal.
unitary_matrix#
Build a proposition asserting that a square matrix is unitary.
normal_matrix#
Build a proposition asserting that a square matrix commutes with its conjugate transpose.
full_rank_matrix#
Build a proposition asserting that a matrix has full rank.
invertible_matrix#
Build a proposition asserting that a matrix is square and invertible.
singular_matrix#
Build a proposition asserting that a matrix is square and singular.
integer_entries#
Build a proposition asserting that every matrix entry is an integer.
real_entries#
Build a proposition asserting that every matrix entry is real.
complex_entries#
Build a proposition asserting that every matrix entry is a finite complex value.
positive_definite_matrix#
Build a proposition asserting that a matrix is positive definite under the engine's exact Hermitian/real-domain convention.
positive_semidefinite_matrix#
Build a proposition asserting that a matrix is positive semidefinite under the engine's exact Hermitian/real-domain convention.
Scalar classification#
natural includes zero. positive and negative include the matching signed infinity;
zero is finite zero, and nonzero includes non-real finite complex values and signed
infinities. nonnegative and nonpositive are universe-guarded extended-real propositions;
a bare negated sign does not establish either one. Prime and composite are not complements:
negative integers, zero, and one are neither.
Primality is exact and proof-producing. A probable-prime screening result is deliberately unknown and is never exposed as a symbolic prime fact.
Proposition objects#
assumption_proposition#
An immutable, context-owned Boolean assumption formula.
and#
Conjoin two propositions and return a canonical proposition.
UniffiAssumptionProposition method
fun and(other: UniffiAssumptionProposition): UniffiAssumptionPropositionProvides the and operation on this mobile object.
or#
Disjoin two propositions and return a canonical proposition.
UniffiAssumptionProposition method
fun or(other: UniffiAssumptionProposition): UniffiAssumptionPropositionProvides the or operation on this mobile object.
not#
Negate a proposition and return a canonical proposition.
UniffiAssumptionProposition method
fun not(): UniffiAssumptionPropositionProvides the not operation on this mobile object.
relation_kind#
Return the canonical relation kind for a relation atom.
UniffiAssumptionProposition method
fun relationKind(): kotlin.String?Provides the relation_kind operation on this mobile object.
left_operand#
Return the left relation or congruence operand when present.
UniffiAssumptionProposition method
fun leftOperand(): UniffiExpression?Provides the left_operand operation on this mobile object.
right_operand#
Return the right relation or congruence operand when present.
UniffiAssumptionProposition method
fun rightOperand(): UniffiExpression?Provides the right_operand operation on this mobile object.
membership_element#
Return the membership element when present.
UniffiAssumptionProposition method
fun membershipElement(): UniffiExpression?Provides the membership_element operation on this mobile object.
membership_set#
Return the membership set expression when present.
UniffiAssumptionProposition method
fun membershipSet(): UniffiExpression?Provides the membership_set operation on this mobile object.
congruence_modulus#
Return the congruence modulus when present.
UniffiAssumptionProposition method
fun congruenceModulus(): UniffiExpression?Provides the congruence_modulus operation on this mobile object.
serialize#
Serialize a proposition in the versioned canonical formula grammar.
UniffiAssumptionProposition method
fun serialize(): kotlin.StringProvides the serialize operation on this mobile object.
deserialize_assumption_proposition#
Explicit context
fun deserializeAssumptionProposition(text: kotlin.String): UniffiAssumptionPropositionParse a versioned canonical assumption proposition in the receiving context.
Durable contexts and scopes#
add_assumptions#
Explicit context
fun addAssumptions(proposition: UniffiAssumptionProposition): UnitAtomically add a proposition to the durable assumption context. Contradictory updates are rejected without changing the prior state.
clear_all_assumptions#
Explicit context
fun clearAllAssumptions(): UnitClear both durable formulas and legacy symbol assumptions.
ask#
Explicit context
fun ask(proposition: UniffiAssumptionProposition): UniffiTruthValueCalling forms and variants
Variant using local assumptions — UniffiAssumptionScope method: UniffiAssumptionScope.ask
fun ask(proposition: UniffiAssumptionProposition): UniffiTruthValueReturn whether a proposition is entailed by the current durable context.
could_hold#
Explicit context
fun couldHold(proposition: UniffiAssumptionProposition): UniffiTruthValueCalling forms and variants
Variant using local assumptions — UniffiAssumptionScope method: UniffiAssumptionScope.couldHold
fun couldHold(proposition: UniffiAssumptionProposition): UniffiTruthValueReturn whether the current durable context is compatible with a proposition.
assuming#
Explicit context
fun assuming(proposition: UniffiAssumptionProposition): UniffiAssumptionScopeCalling forms and variants
Variant using local assumptions — UniffiAssumptionScope method: UniffiAssumptionScope.assuming
fun assuming(proposition: UniffiAssumptionProposition): UniffiAssumptionScopeCreate an immutable local scope by overlaying a proposition. The overlay does not change the owning context.
assumption_scope#
An immutable local assumption scope. Its scope-aware operations—simplify,
refine, integrate, integrate_definite, evaluate_limit,
taylor_series, laplace_transform, fourier_transform, singularities,
and continuous_domain—execute through the captured assumptions without
mutating the owning context. Each one asks the same shared assumption session
that the durable entry points use, so a compound or relational fact reaches
them exactly as a per-symbol declaration does. If an assumption cannot be
checked for the requested operation, the operation keeps its ordinary
unevaluated or declined result rather than guessing a branch. Each of those
operations is documented with its subject — integrate on
Calculus, for instance — as an explicitly labelled
variant that runs under local assumptions, not as an alias of the durable form.
refine#
Explicit context
fun refine(
target: UniffiExpression,
assumptions: UniffiAssumptionProposition?,
): UniffiExpressionCalling forms and variants
Expression method: UniffiExpression.refine
fun refine(assumptions: UniffiAssumptionProposition?): UniffiExpressionVariant using local assumptions — UniffiAssumptionScope method: UniffiAssumptionScope.refine
fun refine(target: UniffiExpression): UniffiExpressionSimplify an expression using durable assumptions or one checked local proposition.
Additional API#
nonnegative_assumption#
Explicit context
fun nonnegativeAssumption(subject: UniffiExpression): UniffiAssumptionPropositionProvides the nonnegative_assumption operation on this mobile object.
nonpositive_assumption#
Explicit context
fun nonpositiveAssumption(subject: UniffiExpression): UniffiAssumptionPropositionProvides the nonpositive_assumption operation on this mobile object.
AssumptionProposition#
AssumptionProposition.plain_text#
UniffiAssumptionProposition method
fun plainText(): kotlin.StringThe canonical plain-text form of this assumption proposition.