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.
rewrite that fired, on the subexpression it matched, across every candidate
Simplify(System.Int32) generated including the ones that lost.
Derivation is the same list with the normalisation and the repeats taken
out — 270 rewrites down to 5 on
rewrites, so reading it in order does not walk from the input to the answer.
PathFrom(AngouriMath.Entity,AngouriMath.Entity) is the one that does: whole expressions, in
order, from the input to the value that was returned, with the losing candidates left
out. Ask the first what fired, the second which identities were used, the third how it
got 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
current
FieldCurrent
PropertyDerivation
PropertyDispose
Methodedges
FieldMark
Methodrecorded
FieldStart
Methodsteps
FieldSteps
Property
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4405 pages online