Closed dabrahams closed 1 year ago
According to @jeffreykegler IIUC, the grammars where non-unique transitional items can occur are not LR-regular, and thus not guaranteed by Leo to be parsed in linear time anyway. Open questions:
If we skip the check it certainly complicates the algorithm, which currently can assume for every ( Earley set, postdot symbol ) pair there is at most one Leo item. This uniqueness is relied on all over the place. For example, currently it is essential to the event mechanism, which needs to do Leo expansion on the fly.
I would want to do a theoretical examination to be sure all that trouble actually buys anything. Leo mentions this in his paper as an area for future research, which 30 years later it still is.
I certainly don't mean to suggest the check can be eliminated without a theoretical examination!
The check can't be eliminated, and was in fact not strict enough, as this test case demonstrates
If uniqueness wasn't guaranteed by other features of the algorithm, it's hard to imagine that the Leo optimization would actually work for all grammars and inputs. Something seems a little bit fishy about this test, but I need to better understand the optimization before I can say.