AngouriMath
DerivationPath
Description
Summary
How an expression became an answer: an ordered chain of whole expressions, each one the
result of the step before it, from the input to the value that was actually returned.
result of the step before it, from the input to the value that was actually returned.
Remarks
Simplify(System.Int32) generated including the ones it discarded, each on the
subexpression it matched. Reading them in order does not walk from the input to the answer.
This does:
Result. Compared as expressions, not as printed forms.
it keeps — ExpressionsExplored says how many — and a route through a discarded
candidate is not a route to the answer. They are excluded rather than labelled because a
derivation is read forwards: a reader following the chain from the input needs every entry
to be a step towards the answer, and a marked dead end is something to skip, which is the
same as not being there while costing the reader the skip. What was explored but not taken
is a fact about the search, and it is reported as a count for that reason.
the expression it started from and the one it produced. Where several recorded routes reach
the answer, the shortest is taken, and ties are settled by the order the engine recorded
them in — so the same input gives the same path.
Example
using AngouriMath;
using AngouriMath.Core.Transformations;
foreach (var step in DerivationPath.OfSimplifying("x ^ (-1) / (y / z)")!.Steps)
Console.WriteLine(step);Members
Abandoned
PropertyExplain
MethodExpressionsExplored
PropertyInput
PropertyResult
PropertySteps
PropertyToString
Method
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online