Implementation of this strategy.
Implementation of this strategy. When applied to a term produce either
a transformed term wrapped in Some
, or None
, representing a
rewriting failure.
As for the other +
with the first argument specifying a name for
the constructed strategy.
As for the other +
with the first argument specifying a name for
the constructed strategy.
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.
q
is evaluated at most once.
As for the other <
with the first argument specifying a name for
the constructed strategy.
As for the other <
with the first argument specifying a name for
the constructed strategy.
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. lr
is evaluated at most once.
As for the other <*
with the first argument specifying a name for
the constructed strategy.
As for the other <*
with the first argument specifying a name for
the constructed strategy.
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. q
is evaluated at most once.
As for the other <+
with the first argument specifying a name for
the constructed strategy.
As for the other <+
with the first argument specifying a name for
the constructed strategy.
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. q
is
evaluated at most once.
Return the value of this attribute for node t
, raising an error if
it depends on itself.
Return the value of this attribute for node t
, raising an error if
it depends on itself.
Duplicate an entry if possible.
Duplicate an entry if possible. If t1
has a memoised value associated
with it, set the value associated with t2
to the same value. If there
is no value associated with t1
, do nothing.
Return the value stored at key t
as an option.
Return the value stored at key t
as an option.
Return the value stored at key t
if there is one, otherwise
return u
.
Return the value stored at key t
if there is one, otherwise
return u
. u
is only evaluated if necessary.
Has the value at t
already been computed or not? By default, does
the memo table contain a value for t
?
Has the value at t
already been computed or not? By default, does
the memo table contain a value for t
?
The memo table.
The memo table.
Make one of these strategies with the given name and body f
.
Make one of these strategies with the given name and body f
.
Store the value u
under the key t
.
Store the value u
under the key t
.
Store the value u
under the key t
if t
does not already have an
associated value.
Store the value u
under the key t
if t
does not already have an
associated value. u
is only evaluated if necessary.
Immediately reset the memo table.
Immediately reset the memo table.
Immediately reset the memo table at t
.
Immediately reset the memo table at t
.
The number of entries in the memo table.
The number of entries in the memo table.
Identify this strategy by its name.
Identify this strategy by its name.