Reference

Contents

Index

OpenSymbolicRules.ElementOf — Type
ElementOf(var, domain)

The OSR form of a membership hypothesis: var lies in domain, which may be a DomainSets.jl domain, an IntervalSets.jl interval, or a Julia type. ∈ builds one for a symbolic term, and the domain predicates read it through entailed.

source
OpenSymbolicRules.OSRDispatch — Type
OSRDispatch(rules)

A rewriter that applies rules to a term the way SymbolicUtils.Rewriters.Chain does — each rule in turn, threading the result — while skipping the rules whose pattern is headed by a different operation.

Selecting candidates costs one dictionary lookup instead of one matcher call per rule, which is what keeps a large rule set, such as the 6000 RUBI integration rules, usable.

source
OpenSymbolicRules.OSRInference — Type
OSRInference

One multi-premise inference declared by an Open Symbolic Rules inference manifest. Values remain JSON-compatible; applying an inference is the responsibility of the host proof engine.

source
OpenSymbolicRules.OSRPiece — Type
OSRPiece(value, condition)

One branch of a Piecewise expression. A final Otherwise branch has no condition of its own, so its condition is nothing.

source
OpenSymbolicRules.OSRProof — Type
OSRProof

The outcome of an equivalence check. When verified, the two sides rewrite to a common normal_form along left_steps and right_steps, under assumptions.

Every OSR rule is an oriented instance of an equation, so the steps on the right read backwards give a derivation of right from normal_form, and the two chains together form a derivation of left = right.

source
OpenSymbolicRules.OSRProofStep — Type
OSRProofStep(rule, before, after)

One licensed rewrite: rule turned the subterm before into after. A step is local, so it justifies the whole expression only together with congruence — which is exactly how a rewrite tactic works in a proof assistant.

source
OpenSymbolicRules.OSRRule — Type
OSRRule(name, description, provenance, rule)

A callable SymbolicUtils rewrite rule annotated with its stable OSR identity:id and optional machine-readable provenance from the source rule.

source
OpenSymbolicRules.OperationResult — Type
OperationResult

What a high-level operation reached, and how that reading should be taken.

An expression on its own cannot say whether it was proved, assumed, or simply not carried out — and an unknown result read as a proved equality is the one mistake this package is built to avoid. An OperationResult says which it is.

The readings are:

statusmeaning
:proveda closed form the rules established outright
:conditionala closed form, valid where the recorded assumptions hold
:unevaluatedthe operation is still standing in the value
:inapplicablethe operation does not apply to this argument
:divergentthe operation has no finite value here

See status, value, and assumptions.

source
CommonSolve.solve — Method
solve(equation, variable; backend=BuiltinBackend(), options=SolveOptions())

Solve the exact univariate rational-polynomial fragment of an Equation. The returned PolynomialRootsResult contains every rational root, its multiplicity, the unresolved residual factor, and whether the result is complete. Non-polynomial equations are rejected rather than approximated.

source
OpenSymbolicRules.BinomialQ — Method
BinomialQ(u, x)
BinomialQ(u, x, n)

Return whether u is written as a + b*x^n, with a, b, and the exponent all free of x, optionally of that exponent.

The degenerate forms count: x^n alone is one with a = 0 and b = 1.

This reads the written shape, where RUBI's BinomialQ first normalizes its argument. It therefore declines some expressions RUBI would accept — which leaves a rewrite unapplied rather than risking an invalid one — and makes it agree with BinomialMatchQ, so the normalization rules guarded by BinomialQ(u, x) && Not(BinomialMatchQ(u, x)) never fire.

source
OpenSymbolicRules.Dist — Method
Dist(u, v, x)

Return u*v.

RUBI writes Dist[u, v, x] to push the factor u inside v, whether v is a sum or an integral. The value it denotes is u*v whichever it does, so the product is the whole of its meaning; only the shape of the answer differs, and that shape is what the rules downstream restore.

source
OpenSymbolicRules.EqQ — Method
EqQ(u, v)

Return whether u and v are provably equal. Two closed arithmetic expressions are compared by value and two identical terms are equal by construction; nothing else counts as a proof, so an unproved equality is reported as false and the guarded rewrite is skipped.

source
OpenSymbolicRules.FreeQ — Method
FreeQ(expr, var)

Returns true if expr has no free occurrence of var. Equivalent to Mathematica's FreeQ, and used primarily to identify constants relative to an integration or differentiation variable.

Binders are respected: an occurrence bound by an enclosing Lambda, Forall, or Exists is not an occurrence of the free variable, so Lambda(x, Sin(x)) is free of x.

Either side may be a collection. A quantifier binds a list, so var may be the whole binder and the predicate then asks about every variable it declares; and RUBI writes FreeQ[{a, b, m}, x], so expr may be a list whose every element must be free of the variable. When var is neither a variable nor a collection, expr is searched for it structurally instead.

source
OpenSymbolicRules.GeneralizedBinomialQ — Method
GeneralizedBinomialQ(u, x)
GeneralizedBinomialMatchQ(u, x)

Return whether u is written as a*x^q + b*x^n, with a, b, q, and n free of x and the two exponents distinct.

Two power terms with no constant one is what separates this from an ordinary binomial a + b*x^n.

source
OpenSymbolicRules.GeneralizedTrinomialQ — Method
GeneralizedTrinomialQ(u, x)
GeneralizedTrinomialMatchQ(u, x)

Return whether u is written as a*x^q + b*x^n + c*x^(2n-q), with a, b, c, q, and n free of x.

The third exponent standing at 2n - q is what distinguishes it from any three-power sum, and the ordinary trinomial is the case q = 0.

source
OpenSymbolicRules.GtQ — Method
GtQ(u, v)
GtQ(u, v, w)

Return whether the real values of the arguments are strictly decreasing, so GtQ(u, v, w) means u > v > w. Arguments that are not closed real expressions make the predicate false.

source
OpenSymbolicRules.InertTrigQ — Method
InertTrigQ(u...)

Return whether every argument is one of RUBI's inert circular heads, spelled in lower case to keep it from being evaluated.

source
OpenSymbolicRules.InverseFunctionFreeQ — Method
InverseFunctionFreeQ(u, x)

Return whether u contains no inverse function of x.

A logarithm or an inverse circular or hyperbolic function is only in the way when it involves x: Log(a) leaves an integrand alone, Log(x) does not.

source
OpenSymbolicRules.LinearMatchQ — Method
LinearMatchQ(u, x)

Return whether u is already written in the shape a + b*x, with a and b free of x.

RUBI distinguishes being linear from being written linearly. LinearQ asks about the degree; this asks whether the expression already has the shape the rules downstream pattern-match against. The pair drives the normalization rules, which fire exactly when something is linear but not yet in that shape, so reading this as a second spelling of LinearQ would make those rules loop.

A collection is read the way FreeQ reads one: every element must match.

source
OpenSymbolicRules.MemberQ — Method
MemberQ(collection, u)

Return whether u occurs in collection, which may be a Julia collection or a canonical List term.

source
OpenSymbolicRules.NeQ — Method
NeQ(u, v)

Return whether u and v are provably different. Symbolic terms are not unequal merely because their structures differ: without a proof the predicate returns false and the guarded rewrite is skipped.

source
OpenSymbolicRules.NotEqual — Method
NotEqual(a, b)

Predicate to check whether an inequality is established. This is the OSR spelling of RUBI's NeQ and shares its conservative semantics.

source
OpenSymbolicRules.PerfectSquareQ — Method
PerfectSquareQ(u)

Return whether u is provably a perfect square: a positive rational whose square root is rational, or a power with an even exponent.

Anything else answers false, which leaves the guarded rewrite unapplied rather than claiming a root that was not established.

source
OpenSymbolicRules.QuadraticMatchQ — Method
QuadraticMatchQ(u, x)

Return whether u is written as a + b*x + c*x^2, with a, b, and c free of x. The squared term must be there; the others may be absent.

source
OpenSymbolicRules.RationalQ — Method
RationalQ(us...)

Return whether every argument is an exact rational number. A floating-point value is not exact and is therefore rejected.

source
OpenSymbolicRules.Simp — Method
Simp(u)
Simp(u, x)

Return u.

The corpus writes both arities: Simp[u] 200 times and Simp[u, x] 518 times.

RUBI writes Simp[u, x] for "u, tidied up with respect to x". Tidying is optional: the expression it names is u either way, so returning u is exact rather than approximate, and the rewrite that produced it stays valid.

What matters is that it is not an inert head. A rule whose result is wrapped in an uninterpreted Simp can never be matched by the rule that should come next, which stops the rewrite chain after one step — two thirds of the problems that stalled in section 1.1.1 stalled on Simp or ExpandIntegrand.

ExpandIntegrand is deliberately not given the same reading. It too denotes an expression equal to its argument, but Int(ExpandIntegrand(u, x), x) would then become the integral it came from, and the rewrite would not terminate.

source
OpenSymbolicRules.Subst — Method
Subst(expression, variable, replacement)

Substitute variable by replacement in expression.

This is the operational reading required by OSR-E-012 for the Subst utility head emitted by integration rules. It delegates to osr_substitute, so lexical binders are respected and a replacement cannot be captured by a lambda, quantifier, or other OSR binder.

source
OpenSymbolicRules.TrinomialQ — Method
TrinomialQ(u, x)
TrinomialMatchQ(u, x)

Return whether u is written as a + b*x^n + c*x^(2n), with a, b, c, and n free of x.

The second exponent being twice the first is what distinguishes a trinomial from any three-term sum. Like BinomialQ, this reads the written shape where RUBI normalizes first, so the two spellings agree.

source
OpenSymbolicRules.TrueQ — Method
TrueQ(u)

Return whether u is the truth value, which is how RUBI reads an unset flag such as $UseGamma. Anything else, symbol or number, is not.

source
OpenSymbolicRules.alpha_equivalent — Method
alpha_equivalent(left, right)

Return whether two expressions are equal up to a consistent renaming of their bound variables. Free variables are compared by name.

julia> using OpenSymbolicRules, SymbolicUtils

julia> @syms x y;

julia> OpenSymbolicRules.alpha_equivalent(Lambda(x, Sin(x)), Lambda(y, Sin(y)))
true
source
OpenSymbolicRules.assuming — Method
assuming(f, assumptions...)

Executes a function f within a context where the provided assumptions hold true. Useful for providing local hypotheses to the CAS.

Example:

assuming(x > 0) do
    simplify(Abs(x), rules)
end
source
OpenSymbolicRules.beta_reduce — Method
beta_reduce(expression)

Carry out every Apply(Lambda(variable, body), argument) in expression, replacing it with body with argument put for variable.

The OSR expression grammar requires a head to be a name (OSR-X-004), so a lambda cannot stand in head position and an application needs a head of its own. That is what Apply is for, and reducing it is the capture-avoiding substitution osr_substitute already performs.

A rule set that differentiates term by term needs this: the structural rules return a lambda whose body applies the lambdas the base rules returned, and without reduction the answer keeps them nested instead of composing. An application whose head is not a lambda is left alone, because the rule that will produce one may not have fired yet.

julia> using OpenSymbolicRules, SymbolicUtils

julia> @syms x y;

julia> beta_reduce(Apply(Lambda(x, Sin(x)), y))
Sin(y)
source
OpenSymbolicRules.build_simplifier — Method
build_simplifier(rules::AbstractVector)

Builds a fixed-point bottom-up rewriter from a vector of SymbolicUtils rules. Rules are applied through an OSRDispatch, which skips the rules whose pattern is headed by a different operation than the term at hand.

source
OpenSymbolicRules.canonical — Method
canonical(expression)

Return a deterministic normal form of expression.

Normalizing is not evaluating. It folds what is already closed, drops what does nothing, and fixes an order where one is sound; it never decides anything the expression left open, and a head this package does not evaluate keeps its place with its operands normalized.

What it does:

  • evaluates a closed arithmetic subterm exactly, so x^(3 - 1) becomes x^2 and a correct answer stops reading as a wrong one;
  • writes a rational whose denominator is one as that integer;
  • drops an identity operand — x + 0, x * 1, x^1 — which is sound for every additive group and every multiplicative monoid, matrices included;
  • orders the summands of a sum, addition being commutative wherever it is defined.

What it deliberately does not do:

  • reorder the factors of a product. An OSR expression carries no shape information, so a factor may be a matrix or a tensor and the order is part of the meaning;
  • turn x^0 into 1, which holds only where x is nonzero;
  • change precedence, associativity, or the domain of anything.

canonical is idempotent.

source
OpenSymbolicRules.canonically_equal — Method
canonically_equal(left, right)

Return whether two expressions have the same normal form.

This is a structural test after normalization, not a proof of mathematical equality: two expressions that differ only in what canonical deliberately leaves alone still compare unequal.

source
OpenSymbolicRules.decide_condition — Method
decide_condition(condition)

Decide a Piecewise condition, returning true, false, or nothing when it is undecided.

A condition is decided when it is a Boolean literal, when it is a relation over closed arithmetic expressions, or when it — or its negation — is an active hypothesis. And, Or, and Not combine those answers with three-valued logic, so a conjunction with one false operand is false even when the other is unknown.

source
OpenSymbolicRules.differentiate — Method
differentiate(expression, variable, rules)

Differentiate expression with respect to variable using an OSR rule set.

Derivative binds its variable in a Lambda, as the OpenMath fns1#lambda symbol prescribes, so this builds Derivative(Lambda(variable, expression)), rewrites it with rules, and returns the body of the lambda it reaches. There is no second expression tree: the argument and the answer are the one canonical OSR representation throughout.

An operation the rule set cannot carry out stays a Derivative term. That is an unevaluated expression rather than a closed form nobody reached, and evaluated_derivative says which one came back.

mode = :status returns an OperationResult instead: the value beside the reading it should be given, so an unevaluated operation cannot be mistaken for a proved equality.

julia> rules = @load_osr_profile("path/to/Calculus");

julia> differentiate(Sin(x), x, rules)
Cos(x)

The example is not a doctest: it needs the Calculus rule set, which lives in its own repository and is not checked out beside the package by default.

source
OpenSymbolicRules.discriminant — Method
discriminant(polynomial) -> Rational{BigInt}

Return the exact discriminant of a nonzero univariate rational polynomial. The value is computed from the Sylvester resultant with its formal derivative, so it is zero exactly when the polynomial has a repeated root over an algebraic closure. Constants and linear polynomials have discriminant one.

source
OpenSymbolicRules.entailed — Method
entailed(subject, property)

Return whether the hypotheses in scope prove property of subject.

Each hypothesis is asked on its own, so the answer is sound but does not combine two hypotheses into a third: x ∈ ℤ proves integrality and x > 0 proves positivity, yet neither alone proves that x is a positive integer.

source
OpenSymbolicRules.equality_model — Method
equality_model(constraints) -> Union{Dict{Symbol,Symbol}, Nothing}

Return the equivalence-class representative for every term occurring in a satisfiable ground equality problem, or nothing if its disequalities contradict the equality closure. The returned map is a checkable model for the equality theory: equal terms have equal representatives.

source
OpenSymbolicRules.free_variables — Method
free_variables(expr)

Return the names that occur free in expr. A name bound by an enclosing Lambda, Forall, or Exists is not free.

julia> using OpenSymbolicRules, SymbolicUtils

julia> @syms x y;

julia> OpenSymbolicRules.free_variables(Lambda(x, Add(x, y)))
Set{Symbol} with 1 element:
  :y
source
OpenSymbolicRules.from_openmath — Function
from_openmath(object)

Convert a typed OpenMath object into an OSR/SymbolicUtils expression. This function is available when the optional OpenMath.jl extension is loaded.

source
OpenSymbolicRules.groebner_basis — Method
groebner_basis(generators; ordering=:grevlex)

Compute a reduced Gröbner basis with Buchberger's algorithm over the rational coefficient field. This pure-Julia reference implementation prioritizes exact results and traceable invariants over large-system performance.

source
OpenSymbolicRules.is_nonzero — Method
is_nonzero(x)

Returns whether x is provably nonzero. For symbolic values, this requires an explicit IsNonzero(x) assumption or a sign assumption; an unknown value is deliberately not treated as nonzero.

source
OpenSymbolicRules.is_numeric — Method
is_numeric(x)

Predicate to check if x denotes a numeric constant. A closed arithmetic expression such as Add(1, 2) is numeric; an expression containing a symbol is not.

source
OpenSymbolicRules.is_symbol — Method
is_symbol(x)

Return whether x is a variable rather than a compound expression or a literal.

A rule that binds a variable of the problem — the variable of an integral, a derivative, a sum, or a limit — is valid only when that operand really is a variable. RUBI writes this restriction as Int[integrand, x_Symbol], and a rule that loses it is unsound rather than merely incomplete: Int[x_^m_., x_Symbol] without it matches a constant integrand and returns a closed form that is not its antiderivative.

source
OpenSymbolicRules.limit — Method
limit(expression, variable, point, rules; direction=BothSides)

Take the limit of expression as variable approaches point, using an OSR rule set.

Limit carries its point, its approach, and a lambda-bound expression, so this assembles Limit(point, direction, Lambda(variable, expression)) and rewrites it. The arguments are taken in the order a reader expects rather than the order the term stores them.

A limit the rule set does not cover stays a Limit term, which is the honest answer: no value was established.

source
OpenSymbolicRules.linear_model — Method
linear_model(constraints) -> Union{Dict{Symbol,Rational{BigInt}}, Nothing}

Return an exact rational model for a satisfiable conjunction of linear constraints, or nothing if it is inconsistent. The model is reconstructed from the Fourier–Motzkin elimination layers and satisfies strict bounds without floating point approximation.

source
OpenSymbolicRules.linear_satisfiable — Method
linear_satisfiable(constraints) -> Bool

Decide conjunctions of linear constraints over exact rational arithmetic using Fourier–Motzkin elimination. A constraint represents Σ coefficients[variable] * variable relation bound, where relation is one of :le, :lt, or :eq. Strict inequalities are preserved exactly.

This is a theory solver for a future pure-Julia DPLL(T) engine; it does not use floating point arithmetic, a native library, or an external SMT process.

source
OpenSymbolicRules.linear_smt_model — Method
linear_smt_model(clauses, atoms) -> Union{NamedTuple, Nothing}

Return a checkable model for a satisfiable linear DPLL(T) problem. The result has booleans, a DIMACS-variable assignment, and rationals, the exact rational assignment for the selected linear-theory branch. Return nothing when the problem is unsatisfiable.

source
OpenSymbolicRules.linear_smt_satisfiable — Method
linear_smt_satisfiable(clauses, atoms) -> Bool

Decide a propositional CNF formula whose atoms are exact rational linear constraints. clauses uses DIMACS literals and atoms maps each positive atom number to a LinearConstraint. The solver combines the local pure-Julia DPLL search with Fourier–Motzkin theory consistency checks.

Negated equality is expanded exactly into its strict-less-than and strict-greater-than theory branches.

source
OpenSymbolicRules.neq_reading — Method
neq_reading()
neq_reading!(reading)

Read, or select, how NeQ answers when neither equality nor inequality was established.

:proved_distinct, the default, answers false: a predicate answers true only when the property is established, so an unproved inequality leaves its rewrite unapplied.

:not_proved_equal answers true instead, which is how RUBI reads the same guard. NeQ[m, -1] then holds for a symbolic m, on the reading that the rule it guards is valid wherever m is not -1 and that the case m == -1 is caught by an earlier rule in the ordered profile. That is a different and weaker claim, and the rewrites it admits are conditional on an assumption nobody recorded, so it is off by default. It exists because the choice between the two readings has a measurable cost that is better decided with numbers than by argument.

Either reading still refuses to call provably equal things different.

source
OpenSymbolicRules.normalize_fact — Method
normalize_fact(fact)

Return the OSR facts a hypothesis stands for.

A host may spell a membership hypothesis in its own type — Symbolics.jl builds a VarDomainPairing for x ∈ 2..5 once it is loaded — so a hypothesis is normalised to ElementOf when it enters the context, and the entailment rules then only ever see OSR facts.

source
OpenSymbolicRules.normalize_sqrt — Method
normalize_sqrt(value)

Construct an exact OSR square-root expression for a numeric integer or rational literal. Perfect squares become exact numbers; otherwise a bounded perfect square factor is extracted and the remaining Sqrt head retains the OpenMath arith1#root semantics. Negative and nonnumeric values remain unevaluated.

source
OpenSymbolicRules.occurs_free — Method
occurs_free(expr, name)

Return whether name occurs free in expr. This answers the single question FreeQ asks without materialising the whole free-variable set, and it stops at the first free occurrence.

source
OpenSymbolicRules.osr_collection — Method
osr_collection(expr)

Return the elements of a collection expression, or nothing when expr is not one. SymbolicUtils keeps a vector of plain values as a literal but wraps a vector holding symbolic expressions in an array_literal term, so a collection reaches this library in either shape.

source
OpenSymbolicRules.osr_degree — Method
osr_degree(expr, variable)

Return the degree of expr as a polynomial in variable, or nothing when expr is not a polynomial built from canonical arithmetic heads. A subterm free of variable is a coefficient of degree zero, whatever its own shape.

source
OpenSymbolicRules.osr_number — Method
osr_number(expr)

Return the exact numeric value of a closed OSR arithmetic expression, or nothing when expr still contains a symbol, uses a head with no arithmetic meaning, or does not denote a number at all.

julia> using OpenSymbolicRules

julia> OpenSymbolicRules.osr_number(Power(2, -1))
1//2

julia> OpenSymbolicRules.osr_number(Add(1, 2))
3
source
OpenSymbolicRules.osr_substitute — Method
osr_substitute(expr, variable => replacement)

Substitute replacement for the free occurrences of variable in expr. The substitution is capture-avoiding: a binder whose variable occurs free in replacement is alpha-renamed first, so the replacement keeps referring to the same variable it did outside the binder.

julia> using OpenSymbolicRules, SymbolicUtils

julia> @syms x y;

julia> OpenSymbolicRules.osr_substitute(Lambda(y, Add(x, y)), x => y)
Lambda(y1, Add(y, y1))
source
OpenSymbolicRules.prove — Method
prove(left, right, rules; assumptions=nothing)
prove(equation, rules; assumptions=nothing)

Search for a rewrite path between two expressions and return the OSRProof that records it.

Both sides are normalised with rules and the normal forms are compared up to a renaming of bound variables, so the search succeeds exactly when the two sides are joinable by the rule set. This is sound but incomplete: a rule set that is not confluent may fail to join two equivalent expressions, which is why a failure is reported as unproved rather than as a disproof.

@syms x
rules = @load_osr_profile("path/to/Trigonometry")
proof = prove(Add(Power(Sin(x), 2), Power(Cos(x), 2)), 1, rules)
verified(proof) # true
source
OpenSymbolicRules.rational_roots — Method
rational_roots(polynomial) -> Vector{NamedTuple}

Return every rational root of a nonzero univariate rational polynomial and its exact multiplicity. Irreducible factors of degree greater than one are omitted; this function never approximates algebraic or transcendental roots.

source
OpenSymbolicRules.rational_smt_model — Method
rational_smt_model(clauses, atoms) -> Union{NamedTuple, Nothing}

Return Boolean and exact rational witnesses for rational_smt_satisfiable. The Boolean assignments use the caller's equality/disequality atom semantics, not the internal equality normalization.

source
OpenSymbolicRules.rational_smt_satisfiable — Method
rational_smt_satisfiable(clauses, atoms) -> Bool

Decide a DPLL(T) problem containing exact rational linear atoms and equality or disequality atoms over the same rational variables. Equality atoms are translated to x - y = 0; disequality atoms are translated with the exact strict-order branching already used by the linear theory. This entry point is not for uninterpreted equality terms, which belong to smt_satisfiable.

source
OpenSymbolicRules.rule_paths — Method
rule_paths(root; profile=nothing)

Return the ordered rewrite manifests declared by an OSR repository or its rules directory. With profile, return the named rewrite profile.

source
OpenSymbolicRules.sat_model — Method
sat_model(clauses) -> Union{Dict{Int,Bool}, Nothing}

Return a Boolean model for a satisfiable DIMACS CNF formula, or nothing when it is unsatisfiable. The returned dictionary is a directly checkable witness: every input clause contains at least one literal whose variable has the stated truth value.

source
OpenSymbolicRules.satisfiable — Method
satisfiable(clauses) -> Bool

Decide a propositional CNF formula using a pure-Julia DPLL implementation. Each inner vector is a disjunction and the outer vector is a conjunction. Literals use the DIMACS convention: positive n denotes variable n, and negative -n denotes its negation. Literal zero is invalid.

This is deliberately a SAT foundation, not a claim to support all SMT theories. It is the Boolean kernel on which a pure-Julia DPLL(T) layer can add equality, rational arithmetic, and other theory solvers with explicit proof evidence.

source
OpenSymbolicRules.select_piece — Method
select_piece(expr)

Reduce a Piecewise expression to the value of the branch that applies, or return it unchanged when the applicable branch is not settled.

Branches are examined in order. A branch is taken once its condition is decided true and every earlier condition is decided false; an undecided condition stops the search, because a later branch may not overtake one that might yet apply.

source
OpenSymbolicRules.smt_model — Method
smt_model(clauses, atoms) -> Union{NamedTuple, Nothing}

Return a checkable model for CNF clauses over ground equality atoms. The result contains the Boolean booleans assignment and the equality classes map, or nothing when the problem is unsatisfiable.

source
OpenSymbolicRules.smt_satisfiable — Method
smt_satisfiable(clauses, atoms) -> Bool

Decide CNF Boolean clauses over ground equality atoms. Clauses use DIMACS literals and atoms maps each positive number to an EqualityConstraint. This is a pure-Julia DPLL(T) entry point for the equality theory.

source
OpenSymbolicRules.squarefree_decomposition — Method
squarefree_decomposition(polynomial) -> Vector{NamedTuple}

Factor a nonzero univariate rational polynomial into monic square-free factors and their positive multiplicities. The scalar leading coefficient is omitted: the returned factors describe the root structure exactly over an algebraic closure and can be used directly by exact factorization or solving backends.

source
OpenSymbolicRules.status — Method
status(result)

Return how a result should be read: one of :proved, :conditional, :unevaluated, :inapplicable, or :divergent.

source
OpenSymbolicRules.to_openmath — Function
to_openmath(expression)

Convert an OSR/SymbolicUtils expression into a typed OpenMath object. This function is available when the optional OpenMath.jl extension is loaded.

source
OpenSymbolicRules.to_osr — Function
to_osr(expr)

Converts Symbolics.jl operations into OpenSymbolicRules.jl pedagogical format. Requires loading Symbolics first (using Symbolics).

source
OpenSymbolicRules.to_sparse_polynomial — Method
to_sparse_polynomial(expression, variables) -> SparsePolynomial

Convert a SymbolicUtils expression to an exact polynomial over ℚ. Variables are explicitly named to prevent accidental conversion of parameters or non-polynomial subexpressions. Only addition, multiplication, non-negative integer powers, and exact rational coefficients are admitted.

source
OpenSymbolicRules.to_symbolic_polynomial — Method
to_symbolic_polynomial(polynomial, variables)

Rebuild a SymbolicUtils expression from an exact sparse polynomial. The map must associate every polynomial variable name with its symbolic expression.

source
OpenSymbolicRules.to_symbolics — Function
to_symbolics(expr)

Converts OpenSymbolicRules.jl pedagogical format back into Symbolics.jl operations. Requires loading Symbolics first (using Symbolics).

source
OpenSymbolicRules.value — Method
value(result)

Return the expression a result reached. For an :unevaluated result that is the operation still standing, not a closed form.

source
OpenSymbolicRules.verified — Method
verified(proof)

Return whether a rewrite path between the two sides was found.

A verified proof is sound: every step is a rule application whose constraints held where it fired. An unverified one is not a disproof — the rule set may simply lack the path — so the two sides are reported as unproved rather than unequal.

source
SymbolicUtils.simplify — Method
simplify(expr, rules::AbstractVector; mode::Symbol=:fast, on_step=nothing)

Applies a set of OSR rules to an expression until it stops changing. Supported modes:

  • :fast : standard execution (default). Returns the result.
  • :trace : returns a tuple (result, steps_array) where each step is a NamedTuple (rule, before, after).

Set on_step to a callback to observe each rewrite without requiring output from this library. Rules loaded by @load_osr are OSRRule values, so trace steps expose their stable name and human-readable description.

source
OpenSymbolicRules.@load_osr — Macro
@load_osr("path/to/rule.json")

Load an Open Symbolic Rules JSON file at compile-time and return a vector of SymbolicUtils.jl rules.

source
OpenSymbolicRules.@load_osr_profile — Macro
@load_osr_profile("repository/path"[, :profile])

Compile the complete default or named rewrite manifest of an OSR repository. The repository path is relative to the caller source file.

source
OpenSymbolicRules.UninterpretedHeads — Module
UninterpretedHeads

Symbolic functions standing for OSR operations this package does not evaluate.

An operator a rule file declares carries an OpenMath symbol, so it denotes a definite mathematical operation; when no implementation of it is reachable, what is missing is the evaluation, not the meaning. Such a head becomes a symbolic function here rather than in the module that loaded the rule file, so loading a rule file introduces no name into the caller's scope and shadows nothing.

source

See also the Internal reference for developer helpers.