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

Check for cyclicity as part of TreeAutomaton#evaluateInSemiring #14

Open
akoehn opened this issue Dec 4, 2015 · 0 comments
Open

Check for cyclicity as part of TreeAutomaton#evaluateInSemiring #14

akoehn opened this issue Dec 4, 2015 · 0 comments
Labels
enhancement New feature or request major

Comments

@akoehn
Copy link
Owner

akoehn commented Dec 4, 2015

Original report by Alexander Koller (Bitbucket: akoller, GitHub: akoller).


Right now, evaluateInSemiring will return an (incorrect) value if the tree automaton has cycles. We should check for cycles in TreeAutomaton#getStatesInBottomUpOrder and throw an exception if a cycle occurs.

This has two advantages. First, it ensures that evaluateInSemiring is only used when it returns the correct value. Second, it makes the use of TreeAutomaton#isCyclic in JLanguageViewer unnecessary (the if block can just be replaced by catching the exception). For some reason, this method is incredibly slow for some grammars, and it would be good to get rid of it.

@akoehn akoehn added major enhancement New feature or request labels Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request major
Projects
None yet
Development

No branches or pull requests

1 participant