Dynamic rule lifting changes non-context variables to DR_DUMMY() terms. However, this does not happen consistently. When a single-element list is used as left-hand side of a dynamic rule, the tail of the list will become []{DR_DUMMY}. So we got an empty-list tail with annotations, for which there is no syntax. Also, using a variable as left-hand side does not add the superfluous DR_DUMMY.

Test case:

main =
    rules(TestRule1 : [1] -> 2);
    all-keys-TestRule1;
    Hd;
    ?Cons(_,<id>);
    debug;

    x := [1];
    rules(TestRule2 : x -> 2);
    all-keys-TestRule2;
    Hd;
    ?Cons(_,<id>);
    debug

Expected output:

[]
[]

Actual output:

[]{DR_DUMMY}
[]
Submitted by Nathan Bruning on 31 January 2011 at 14:17

On 31 January 2011 at 16:11 Lennart Kats commented:

I didn’t really dig into the compiler code, but I expect you could add an exception for empty lists or list tails to the dummify strategy you talked about. Then if the unit tests succeed, you should be safe ;)


On 3 February 2011 at 14:12 Nathan Bruning commented:

Quick fix in r21764.

Log in to post comments