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

Crash when applying overloading to subsort productions that do not have the symbol(_) attribute #4142

Closed
Baltoli opened this issue Mar 28, 2024 · 0 comments · Fixed by #4143
Assignees

Comments

@Baltoli
Copy link
Contributor

Baltoli commented Mar 28, 2024

When working on #4045, I noticed that there was one case where a direct translation of klabel(X)overload(X) did not behave as we expected it to. This is because we missed a behaviour of klabel(X) when originally specifying the overload(_) migration.

That behaviour is that klabel(X) will create an internal1 klabel for productions that would not otherwise have one. The implementation of overloading in ModuleToKORE requires implicitly2 that overloaded symbols have an internal klabel associated with them. Under the previous implementation of overloading, it was not possible to generate an overloaded symbol without a klabel, but the new implementation permits this.

To fix the issue, we should add a check that overloaded subsorting productions have an associated symbol(_) attribute so that they have an internal klabel during KORE generation.

Footnotes

  1. These internal klabels are different to the attribute klabel(_). Roughly speaking, productions that have an internal klabel will be generated as KORE symbols, and those that don't will not. For instance, subsorting productions will not usually be KORE symbols.

  2. i.e. it crashes when this assumption is violated.

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

Successfully merging a pull request may close this issue.

1 participant