Permit rules that consume multiples of one identifier to go unlabled if they don't appear in the various expressions

Issue #42 resolved
Sean Kauffman repo owner created an issue

Suppose a rule like

a :- b before b

This will fail to compile with a message that you must label the intervals if you have multiple copies of the same one. This was not hard to implement in the semantic analysis, but it is annoying because if the above rule there is no actual need for labels.

The reason you need labels is if you try to do the following

a :- b before b where b.id = b.id

This one much more reasonably should fail as it is pretty easy to argue that it is ambiguous, even though it might be clear to a user what they want. This is reasonable to prohibit from a programming language point of view, anyway.

The tough part, I think, is how to deal with the situation where you have, say

a :- b before (x:b before y:b) where b.id = y.id
a :- b before (x:b before y:b) where x.id = y.id

1 is not okay, 2 is okay. Right? Because in 1 you are trying to refer to an interval that is repeated without using a label, while in 2 you are not referring to a b interval without using a label. How to get it so this last case passes is a challenge.

Comments (2)

  1. Log in to comment