AngouriMath
RewriteRecording
Description
Summary
Collects the rewrites that fire while it is open, so that an answer can be asked how
it was reached rather than only what it is.
it was reached rather than only what it is.
Remarks
costs one ambient read more than it did before — per rule set, not per node — and
allocates nothing. That is the condition
#746 puts on
every layer above the tree, and it is why this is a scope rather than a setting that
something might leave on.
than to the thread running it. It survives an
started under it — including on another thread — reports to it. A recording opened
inside a task is invisible to that task's siblings and to whatever started it.
order they fired in, but two flows recording into the same open recording interleave
however they happen to run. The single-threaded case — which is what
Simplify(System.Int32) is — is unaffected.
#28 asks for —
and not everything Simplify(System.Int32) does. Simplification also
expands, factorises, divides polynomials, minimises boolean expressions and then
*chooses* among the candidates by a complexity metric; the steps below are the
rewrites, in the order they fired, across every candidate that was generated,
including the ones that lost. Reading them as a route from the input to the returned
answer would be reading in something that is not there.
Example
using AngouriMath;
using AngouriMath.Core.Transformations;
using var recording = RewriteRecording.Start();
var simplified = ((Entity)"a / (b / c)").Simplify();
foreach (var step in recording.Steps)
Console.WriteLine(step);Members
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1953 pages online