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#
api::Session method
pub fn real_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is real.
rational_assumption#
api::Session method
pub fn rational_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is rational.
integer_assumption#
api::Session method
pub fn integer_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is an integer.
natural_assumption#
api::Session method
pub fn natural_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is a natural number.
positive_integer_assumption#
api::Session method
pub fn positive_integer_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is a positive integer.
positive_assumption#
api::Session method
pub fn positive_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is strictly positive.
negative_assumption#
api::Session method
pub fn negative_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is strictly negative.
nonzero_assumption#
api::Session method
pub fn nonzero_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is nonzero.
finite_assumption#
api::Session method
pub fn finite_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is finite.
complex_assumption#
api::Session method
pub fn complex_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is a finite complex number.
extended_real_assumption#
api::Session method
pub fn extended_real_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is an extended real, including signed infinity.
infinite_assumption#
api::Session method
pub fn infinite_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is one of the two signed infinities.
irrational_assumption#
api::Session method
pub fn irrational_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is real and not rational.
zero_assumption#
api::Session method
pub fn zero_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is exactly zero.
even_assumption#
api::Session method
pub fn even_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is an even integer.
odd_assumption#
api::Session method
pub fn odd_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is an odd integer.
prime_assumption#
api::Session method
pub fn prime_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is a proven ordinary prime integer.
composite_assumption#
api::Session method
pub fn composite_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is a proven ordinary composite integer.
algebraic_assumption#
api::Session method
pub fn algebraic_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is algebraic over the rationals.
transcendental_assumption#
api::Session method
pub fn transcendental_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a proposition asserting that an expression is transcendental over the rationals.
defined_assumption#
api::Session method
pub fn defined_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Build 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#
api::defaults::Session method
pub fn equal_assumption(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a defined scalar equality proposition.
not_equal_assumption#
api::defaults::Session method
pub fn not_equal_assumption(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a defined scalar disequality proposition.
less_assumption#
api::defaults::Session method
pub fn less_assumption(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a strict extended-real order proposition.
less_or_equal_assumption#
api::defaults::Session method
pub fn less_or_equal_assumption(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a non-strict extended-real order proposition.
greater_assumption#
api::defaults::Session method
pub fn greater_assumption(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a strict extended-real order proposition by reversing its operands canonically.
greater_or_equal_assumption#
api::defaults::Session method
pub fn greater_or_equal_assumption(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a non-strict extended-real order proposition by reversing its operands canonically.
member_assumption#
api::defaults::Session method
pub fn member_assumption(
&self,
element: &Expression,
set_expression: &Expression,
) -> Result<AssumptionProposition, ApiError>Build a scalar-membership proposition.
congruent_assumption#
api::defaults::Session method
pub fn congruent_assumption(
&self,
left: &Expression,
right: &Expression,
modulus: &Expression,
) -> Result<AssumptionProposition, ApiError>Build an integer-congruence proposition with a positive integer modulus.
assumption_equal#
api::Session method
pub fn assumption_equal(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct an equality proposition over two scalar expressions.
assumption_not_equal#
api::Session method
pub fn assumption_not_equal(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a disequality proposition over two scalar expressions.
assumption_less#
api::Session method
pub fn assumption_less(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a strict scalar-order proposition.
assumption_less_or_equal#
api::Session method
pub fn assumption_less_or_equal(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a non-strict scalar-order proposition.
assumption_greater#
api::Session method
pub fn assumption_greater(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a strict scalar-order proposition with reversed operands.
assumption_greater_or_equal#
api::Session method
pub fn assumption_greater_or_equal(
&self,
left: &Expression,
right: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a non-strict scalar-order proposition with reversed operands.
assumption_member#
api::Session method
pub fn assumption_member(
&self,
element: &Expression,
set_expression: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a scalar-membership proposition.
assumption_congruent#
api::Session method
pub fn assumption_congruent(
&self,
left: &Expression,
right: &Expression,
modulus: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct an integer congruence proposition.
assumption_proposition_from_logical_expression#
api::Session method
pub fn assumption_proposition_from_logical_expression(
&self,
logical_expression: &Expression,
) -> Result<AssumptionProposition, ApiError>Convert 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.
api::AssumptionProposition method
pub fn and(
&self,
other: &AssumptionProposition,
) -> Result<AssumptionProposition, ApiError>Conjoin this proposition with another proposition.
or#
Disjoin two propositions and return a canonical proposition.
api::AssumptionProposition method
pub fn or(
&self,
other: &AssumptionProposition,
) -> Result<AssumptionProposition, ApiError>Disjoin this proposition with another proposition.
not#
Negate a proposition and return a canonical proposition.
api::AssumptionProposition method
pub fn not(&self) -> Result<AssumptionProposition, ApiError>Negate this proposition in canonical negation-normal form.
relation_kind#
Return the canonical relation kind for a relation atom.
api::AssumptionProposition method
pub fn relation_kind(&self) -> Result<Option<&'static str>, ApiError>Return the canonical relation kind when this proposition is one relation atom.
left_operand#
Return the left relation or congruence operand when present.
api::AssumptionProposition method
pub fn left_operand(&self) -> Result<Option<Expression>, ApiError>Return the left relation or congruence operand when present.
right_operand#
Return the right relation or congruence operand when present.
api::AssumptionProposition method
pub fn right_operand(&self) -> Result<Option<Expression>, ApiError>Return the right relation or congruence operand when present.
membership_element#
Return the membership element when present.
api::AssumptionProposition method
pub fn membership_element(&self) -> Result<Option<Expression>, ApiError>Return the membership element when this proposition is one membership atom.
membership_set#
Return the membership set expression when present.
api::AssumptionProposition method
pub fn membership_set(&self) -> Result<Option<Expression>, ApiError>Return the membership set when this proposition is one membership atom.
congruence_modulus#
Return the congruence modulus when present.
api::AssumptionProposition method
pub fn congruence_modulus(&self) -> Result<Option<Expression>, ApiError>Return the modulus when this proposition is one congruence atom.
serialize#
Serialize a proposition in the versioned canonical formula grammar.
api::AssumptionProposition method
pub fn serialize(&self) -> Result<String, ApiError>Serialize this proposition in the versioned canonical formula grammar.
deserialize_assumption_proposition#
api::Session method
pub fn deserialize_assumption_proposition(
&self,
text: &str,
) -> Result<AssumptionProposition, ApiError>Parse a versioned canonical assumption proposition in the receiving context.
Durable contexts and scopes#
add_assumptions#
api::Session method
pub fn add_assumptions(
&self,
proposition: &AssumptionProposition,
) -> Result<(), ApiError>Atomically add a proposition to the durable assumption context. Contradictory updates are rejected without changing the prior state.
clear_all_assumptions#
api::Session method
pub fn clear_all_assumptions(&self) -> Result<(), ApiError>Clear both durable formulas and legacy symbol assumptions.
ask#
api::Session method
pub fn ask(
&self,
proposition: &AssumptionProposition,
) -> Result<TruthValue, ApiError>Calling forms and variants
Variant using local assumptions — api::AssumptionScope method: api::AssumptionScope::ask
pub fn ask(
&self,
proposition: &AssumptionProposition,
) -> Result<TruthValue, ApiError>Return whether a proposition is entailed by the current durable context.
could_hold#
api::Session method
pub fn could_hold(
&self,
proposition: &AssumptionProposition,
) -> Result<TruthValue, ApiError>Calling forms and variants
Variant using local assumptions — api::AssumptionScope method: api::AssumptionScope::could_hold
pub fn could_hold(
&self,
proposition: &AssumptionProposition,
) -> Result<TruthValue, ApiError>Return whether the current durable context is compatible with a proposition.
assuming#
api::Session method
pub fn assuming(
&self,
proposition: &AssumptionProposition,
) -> Result<AssumptionScope, ApiError>Calling forms and variants
Variant using local assumptions — api::AssumptionScope method: api::AssumptionScope::assuming
pub fn assuming(
&self,
proposition: &AssumptionProposition,
) -> Result<AssumptionScope, ApiError>Create 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#
api::Session method
pub fn refine(
&self,
target: &Expression,
assumptions: Option<&AssumptionProposition>,
) -> Result<Expression, ApiError>Calling forms and variants
api::Expression method: api::Expression::refine
pub fn refine(
&self,
assumptions: Option<&AssumptionProposition>,
) -> Result<Expression, ApiError>Variant using local assumptions — api::AssumptionScope method: api::AssumptionScope::refine
pub fn refine(
&self,
target: &Expression,
) -> Result<Expression, ApiError>Simplify an expression using durable assumptions or one checked local proposition.
Additional API#
algebraic#
api::Session method
pub fn algebraic(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct an algebraicity proposition for a scalar expression.
all_assumptions#
api::Session method
pub fn all_assumptions(&self) -> Result<AssumptionReport, ApiError>Return the lossless durable assumption report.
assumption_report_of#
api::Session method
pub fn assumption_report_of<'a, VariableType>(
&self,
variable: VariableType,
) -> Result<AssumptionReport, ApiError>
where
VariableType: Into<VariableLike<'a>>,Return the durable assumption report while validating a scalar subject.
complex#
api::Session method
pub fn complex(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a finite-complex proposition for a scalar expression.
composite#
api::Session method
pub fn composite(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a compositeness proposition for a scalar expression.
declared_symbol#
api::Session method
pub fn declared_symbol(
&self,
name: &str,
declaration: SymbolDeclaration,
) -> Result<Expression, ApiError>The scalar domain and sign facts a binding may declare when interning a symbol.
defined#
api::Session method
pub fn defined(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a pointwise definedness proposition for a scalar expression.
even#
api::Session method
pub fn even(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct an evenness proposition for a scalar expression.
extended_real#
api::Session method
pub fn extended_real(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct an extended-real proposition for a scalar expression.
finite#
api::Session method
pub fn finite(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a finiteness proposition for a scalar expression.
infinite#
api::Session method
pub fn infinite(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct an infinity proposition for a scalar expression.
irrational#
api::Session method
pub fn irrational(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct an irrationality proposition for a scalar expression.
logical_assumption_and#
api::Session method
pub fn logical_assumption_and<I>(
&self,
propositions: I,
) -> Result<AssumptionProposition, ApiError>
where
I: IntoIterator<Item = AssumptionProposition>,Combine propositions with canonical conjunction.
logical_assumption_not#
api::Session method
pub fn logical_assumption_not(
&self,
proposition: &AssumptionProposition,
) -> Result<AssumptionProposition, ApiError>Negate a proposition in canonical negation-normal form.
logical_assumption_or#
api::Session method
pub fn logical_assumption_or<I>(
&self,
propositions: I,
) -> Result<AssumptionProposition, ApiError>
where
I: IntoIterator<Item = AssumptionProposition>,Combine propositions with canonical disjunction.
matrix_assumption#
api::Session method
pub fn matrix_assumption(
&self,
subject: &Matrix,
predicate: MatrixPredicate,
) -> Result<AssumptionProposition, ApiError>Builds the proposition asserting a named matrix predicate of a matrix subject.
natural#
api::Session method
pub fn natural(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a natural-number proposition for a scalar expression.
negative#
api::Session method
pub fn negative(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a strict-negativity proposition for a scalar expression.
nonnegative#
api::Session method
pub fn nonnegative(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a universe-guarded nonnegative proposition for a scalar expression.
nonnegative_assumption#
api::Session method
pub fn nonnegative_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Constructs the nonnegative_assumption proposition for a scalar expression.
nonpositive#
api::Session method
pub fn nonpositive(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a universe-guarded nonpositive proposition for a scalar expression.
nonpositive_assumption#
api::Session method
pub fn nonpositive_assumption(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Constructs the nonpositive_assumption proposition for a scalar expression.
nonzero#
api::Session method
pub fn nonzero(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a nonzero proposition for a scalar expression.
odd#
api::Session method
pub fn odd(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct an oddness proposition for a scalar expression.
positive#
api::Session method
pub fn positive(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a strict-positivity proposition for a scalar expression.
positive_integer#
api::Session method
pub fn positive_integer(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a positive-integer proposition for a scalar expression.
real#
api::Session method
pub fn real(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a realness proposition for a scalar expression.
transcendental#
api::Session method
pub fn transcendental(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a transcendence proposition for a scalar expression.
zero#
api::Session method
pub fn zero(
&self,
subject: &Expression,
) -> Result<AssumptionProposition, ApiError>Construct a zero proposition for a scalar expression.
AssumptionProposition#
Type
pub struct AssumptionPropositionA typed immutable assumption proposition owned by a session.
AssumptionProposition.generation#
api::AssumptionProposition method
pub fn generation(&self) -> u64The session generation this object was created in.
AssumptionProposition.is_stale#
api::AssumptionProposition method
pub fn is_stale(&self) -> boolWhether this object predates its session's most recent reset.
AssumptionProposition.session#
api::AssumptionProposition method
pub fn session(&self) -> SessionThe session that owns this object, for host adapters that carry the owner alongside it.
AssumptionProposition.stable_text#
api::AssumptionProposition method
pub fn stable_text(&self) -> Result<String, ApiError>Return the deterministic canonical formula spelling.
AssumptionReport#
api re_export
pub use crate::assumptions::knowledge_base::AssumptionReport;A deterministic report of the active durable assumption state.
AssumptionScope#
Type
pub struct AssumptionScopeAn immutable local assumption scope owned by a session.
AssumptionScope.assumptions#
api::AssumptionScope method
pub fn assumptions(&self) -> Result<AssumptionReport, ApiError>Return the captured scope report as a canonical formula report.
Quantifier#
Type
pub enum QuantifierA quantifier binding one variable of a prenex formula.
Quantifier.Exists#
api::logic::Quantifier variant
Exists,The existential quantifier.
Quantifier.Forall#
api::logic::Quantifier variant
Forall,The universal quantifier.
Quantifier.from_name#
api::logic::Quantifier method
pub fn from_name(name: &str) -> Result<Self, ApiError>Resolve the stable spelling a binding passes across the boundary.
Quantifier.name#
api::logic::Quantifier method
pub fn name(&self) -> &'static strThe stable spelling of this quantifier.
TruthValue#
api re_export
pub use crate::assumptions::TruthValue;Re-exports the three-valued assumption verdict shared by every binding.