After, the recent experiments, I reviewed the implementation of *cut* in
Grako.
Grako's implementation of *cut *is in the spirit of Prolog, which means
that a *cut* applies only to the nearest choice (optional, closure) in the
runtime stack. That means that memos for positions before that of the last
choice have a non-zero theoretical probability of being reused.
The explanation for the low impact of my optimistic memo pruning on
performance should be that the grammar is for a structured,
largely unambiguous, and quite probably LL(k) programming language, which
makes it unlikely that previous memos are reused after any structured
construct ("IF" *cut*) has been entered.
Cheers,
--
Juancarlo *Añez*
_______________________________________________
PEG mailing list
[email protected]
https://lists.csail.mit.edu/mailman/listinfo/peg