On 21 April 2004 at 09:09 Jira commented:

STR-13, adam:
When lifting a dynrule with another rules block in its condion,

DynRule1 : t1 -> t2 where rules(DynRule2: …)

that rules block has not been lifted yet. Thus, for determining the contextvars in the RHS and condition of the rule to be lifted, the tvars of a rules block is determined. The current tvars implementation always considers all vars in a rules block to be locally bound, resulting in an empty list:

 <tvars> |[ rules (..) ]| => []

This is incorrect, but done out of safety: for dynrule lifting, all contextvars should be returned, and the tvars (and underlying free-variables) has no knowledge of the ContextVar rule that propagates this information. Consider:

 ?x

; |[ rules (A: x -> z) ]| => [Var(“x”)]
; |[ rules (B: z -> x) ]| => [Var(“x”)]

For both A and B, the only context-bound var is x, this not depends on its position in a LHS, RHS or condition, but merely on the fact that x was previously bound and had become a context var.

Probably a redesign of the determination of contextually bound vars should be specifically aimed at dynamic rules/ContextVar-checking.


On 28 January 2013 at 14:45 Eelco Visser removed tag 0.18M4

On 28 January 2013 at 14:45 Eelco Visser tagged interesting

Log in to post comments