Add a new partial function to the definition of this attribute.
Add a new partial function to the definition of this attribute. Resets the memo table for this attribute.
Remove a partial function from the definition of this attribute, if it's there, otherwise have no effect.
Remove a partial function from the definition of this attribute, if it's
there, otherwise have no effect. If g
appears more than once in the
definition, just remove the first one. Resets the memo table for this
attribute.
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. IF the value has been memoised, return it.
Otherwise, the functions list is tried in order. The first partial
function on that list that is defined will be used. If no partial
function on this list is defined, then f
will be used.
Execute a block and restore the state of this dynamic attribute after the block has executed.
Execute a block and restore the state of this dynamic attribute after the block has executed. The idea is that the block can add to the definition of the attribute for use within the block. Any definitions that are added will be automatically removed at the end of the block.
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
, set the value associated with t2
to
u
.
List of functions that currently dynamically define this attribute.
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
.
Has the value of this attribute at t
already been computed or not?
If the table contains Some (u)
then we've computed it and the value
was u
.
Has the value of this attribute at t
already been computed or not?
If the table contains Some (u)
then we've computed it and the value
was u
. If the memo table contains None
we are in the middle of
computing it. Otherwise the memo table contains no entry for t
.
The memo table.
The memo table.
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.
Report a cycle in the calculation of this attribute discovered when
evaluating the attribute on value t
.
Report a cycle in the calculation of this attribute discovered when
evaluating the attribute on value t
. Throws an IllegalStateException
.
Immediately reset the memo table.
Immediately reset the memo table.
Immediately reset the memo table at t
.
Immediately reset the memo table at t
.
Check to see if a reset has been requested via the common memo version, and if so, do it.
Check to see if a reset has been requested via the common memo version, and if so, do it.
The attribute's string representation is its name.
The attribute's string representation is its name.
A cached dynamic attribute of a node type
T
with value of typeU
, supported by a memo table and circularity test. The value of the attribute is initially computed by the functionf
, but the definition can be augmented dynamically. The result is memoised so that it is only evaluated once for a given definition. The attribute definition should not itself require the value of this attribute. If it does, a circularity error is reported by throwing anIllegalStateException
. This kind of attribute encapsulates state to keep track of the current definition, so an instance should only be used from one thread at a time.