Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct access to compactly represented results for ambiguous grammars #24

Open
girving opened this issue Oct 15, 2014 · 2 comments
Open

Comments

@girving
Copy link

girving commented Oct 15, 2014

The README seems to imply that there's no way to directly traverse the DAG produced by highly ambiguous parses. That is, I'd like a polynomial time structure that compactly represents all possible parses so that I can manually filter the exponential size stream in polynomial time using dynamic programming.

Am I correct that this feature is currently missing?

@djspiewak
Copy link
Owner

You're correct that this feature is absent at present. Well, of a sort.
It is possible to produce a DAG that represents the ambiguous parse forest
simply by using immutable tree nodes and natural sharing, but this will not
prune shared suffixes. As a result, any recursively ambiguous parse will
result in a DAG with unnecessary nodes. Clearly this is not a good answer.

Unfortunately, I haven't been able to cleanly solve the problem of how to
encode a proper SPPF in a functional, combinatorial style. Definitely
open to suggestions here.

@girving
Copy link
Author

girving commented Oct 15, 2014

Thanks, I'll let you know if I come up with anything. For the moment I'm trying to avoid digging into parser algorithms as much as possible, though I may have to if I can't find a nice GLR parser generator. It's a beautiful yak, but that's not a good reason to shave it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants