The translation of the bagof- rule is dependent on the left hand side of the “first” rules(…) section of the given dynamic rule.

One particular case in which this fails is when both a single-valued and a tuple are used as left hand side for a dynamic rule, as in this example:

main =
  x := "x"
; y := "y"
; rules(TestRule :+ (x, y) -> 123)
; rules(TestRule :+ x -> "1")
; <bagof-TestRule> (x, y)
; debug(!"Bagof: ")     // should print [123]

Changing the order of both rules(…) lines fixes the program in this case.

Tested with strc 1.8 (21134) and strj 0.17.1pre0 based on strc 0.18r20635. However the problem probably resides in the dynamic rule lifting algorithm, particularly the dummifying of terms.

Submitted by Nathan Bruning on 14 October 2010 at 17:07

On 27 October 2011 at 13:18 Tobi Vollebregt tagged !tvo

On 16 November 2011 at 14:21 Adil Akhter tagged !adil

Log in to post comments