Apply this strategy to a term, producing either a transformed term
wrapped in Some, or None, representing a rewriting failure.
Apply this strategy to a term, producing either a transformed term
wrapped in Some, or None, representing a rewriting failure.
Non-deterministic choice.
Non-deterministic choice. Normally, construct a strategy that
first applies either this strategy or the given strategy. If it
succeeds, succeed with the resulting term. Otherwise, apply q.
Currently implemented as deterministic choice, but this behaviour
should not be relied upon.
When used as the argument to the < conditional choice
combinator, + just serves to hold the two strategies that are
chosen between by the conditional choice.
Conditional choice: c < l + r.
Conditional choice: c < l + r. Construct a strategy that first
applies this strategy (c). If c succeeds, the strategy applies
l to the resulting term, otherwise it applies r to the original
subject term.
Sequential composition.
Sequential composition. Construct a strategy that first applies
this strategy. If it succeeds, then apply q to the new subject
term. Otherwise fail.
Deterministic choice.
Deterministic choice. Construct a strategy that first applies
this strategy. If it succeeds, succeed with the resulting term.
Otherwise, apply q to the original subject term.
Term-rewriting strategies. A strategy is a function that takes a term as input and either succeeds producing a new term (
Some), or fails (None).