AngouriMath

Navigation

← Back to list of members

OperandOrder

 Property

Summary

Commutativity and associativity of addition and of multiplication, as two
Sound steps: a sum chain and a product chain each put into
one order, with nothing grouped, folded or rewritten.

Remarks

Why these are not RewriteRules.CanonicalOrderExact. That set sorts and
also groups -- x + x becomes 2 x, a quotient is read as a product
with a negative power -- and grouping is what makes it
SoundUnderAssumptions. A reordering alone needs no condition,
and the e-graph has none: it does not sort a commutative pair or flatten a nested
chain. These belong to this oracle only and run nowhere else, so neither
Simplify nor any rule set's output moves.
Why they are sound. The variables range over the complex numbers, or the reals,
as AreEqual(AngouriMath.Entity,AngouriMath.Entity,AngouriMath.Core.Budgets.WorkBudget,AngouriMath.Core.Transformations.Soundness,AngouriMath.Core.Domain)'s domain says, and addition and multiplication
there are commutative and associative with no side condition. Only Sumf and Mulf chains are read: a difference or a quotient is an operand, never
flattened, so no subtraction is read as adding a negation. The order is
Canonical, which is total, so two writings of one chain sort
to the same tree and meet by hash-consing. A chain is left alone (the step declines)
where an operand may be something other than a number -- see
MayNotCommute(AngouriMath.Entity) -- because a matrix product does not commute; and a
question with a matrix anywhere in it does not get these steps at all
(MayHoldAMatrix(AngouriMath.Entity)), since the library reads a name beside a transpose as
possibly a matrix (#2147)
and that name may be multiplied elsewhere in the same question.

























Angouri © 2019-2026 · Project's repo · Site's repo · Octicons · Transparency · 6003 pages online