AngouriMath

Navigation

← Back to list of members

neutralFolds

 Field

Summary

Which operator folds away which leaf on which side, asked of
InnerSimplified rather than written out a second time.

Remarks

This used to be a hand-written table over Sumf, Minusf, Mulf,
Divf and Powf, restating identities each of those types already
implements and tests in its own InnerSimplify. Nothing kept the two in step, and
the divergence would have been silent in the worst direction: the e-graph would go on
asserting an equivalence the rest of the library had stopped believing, merging two
classes that are no longer equal.
Asking instead of restating also settles the cases that make a hand-written table
fragile, without anybody having to remember them. 0 - x is a negation and
1 / x a reciprocal, so neither folds to its other operand; 1 ^ x is the
constant 1 rather than x. And if an arm ever answers with a condition attached
— Powf's 1 ^ x already carries a Providedf domain condition — the
answer is not the bare operand, so no fold is claimed for it. A hand-written table has
no way to learn any of that.

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online