The definition of undefine-R for a dynamic rule R, contains a call to aux-R, assuming the
definition of a dynamic rule

rules(  f(|).x1 :+ DR_UNDEFINE(x2) -> (y0, y1, y2) )

which is part of the implementation of dependent dynamic rules. For non-dependent dynamic
rules, undefine-R is generated with the call to aux-R, even while it does not exist. This is not
a problem when (a) the dynamic rule is has no dummy subterms (the entire lhs is used as
key) (thus, the number of arguments passed to aux-R is 2), and/or (b) the dynamic rule is not
defined in a library. When defined in a program, all definitions that are not used are ignored,
which is why this problem has gone unnoticed. When used in a library all definitions are preserved.

The solution is to generate a dummy undefine-R definition when for non-dependent rules R as

undefine-R = fail

This will be harmless in the case a proper undefine-R is generated (the fail alternatives will be
ignored). It will however change the ‘calling convention’ of undefine-R in case it is used for
non-dependent dynamic rules; that is, undefine-R will fail in those cases.

Submitted on 9 August 2006 at 15:17

Log in to post comments