AngouriMath

Navigation

← Back to list of members

ChoiceCount

 Property

Summary

How many candidate matches this pattern can offer at most, or
Unbounded when it cannot say.

Remarks

Between IsDeterministic — exactly one — and Match(AngouriMath.Entity,AngouriMath.Core.Transformations.Matching.Bindings) —
however many — sits the case that is neither and is very common: a
Commutative``1(AngouriMath.Core.Transformations.Matching.MatchPattern,AngouriMath.Core.Transformations.Matching.MatchPattern) node of deterministic children, which offers the written
order and the swapped one and nothing else. Enumerating two candidates through
MatchCore(AngouriMath.Entity,AngouriMath.Core.Transformations.Matching.Bindings) allocates an iterator state machine per pattern node, and a
rewrite pass makes an attempt at every node of the tree, so on a set that runs on
every pass that is measurable: 165.05 MB to 171.37 MB of SolveMediumHard, +3.8%,
for two commutative rules in RewriteRules.Power.
#1079
This is an upper bound, not a count: a child whose name is already bound offers
one candidate or none depending on what it is asked to match, which is not known until
it is asked. TryMatchChoice(AngouriMath.Entity,AngouriMath.Core.Transformations.Matching.Bindings,System.Int32,AngouriMath.Core.Transformations.Matching.Bindings@) answers false for an index
that does not exist, so a caller walks every index and skips the misses.

























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