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
Remove usages of K frontend code #1007
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The backend relied on the K Frontend's libraries to perform pretty-printing of KORE terms back to KAST when errors occur (e.g. to print the counterexample for a non-exhaustive match). We need to remove these usages so that the backend only depends on `scala-kore`. In a subsequent change, we'll update the error-handling mechanism so that the KORE term can be passed back to the frontend and pretty-printed there.
Previously, this pattern was pretty-printed directly by the matching compiler. Now that we no longer depend on the K Frontend, we can't do this pretty-printing here and instead need to attach the KORE term to the exception and bubble it up to the caller. This will require a change in the K Frontend at the point where errors are translated to turn this pattern into a KAST term that can be shown to the user.
This commit removes the old dependency on the K Frontend, and replaces all usages in the matching compiler's scala code with references to the new `scala-kore` library. This change is largely mechanical.
In #923, we removed the old Maven / Nix infrastructure but subsequently had to revert that change because the KORE snapshot JARs from the frontend would break the Nix hash on every K release. This commit reinstates that change and brings the LLVM backend's Maven / Nix code up to date with K's. Co-authored-by: Samuel Balco <goodlyrottenapple@gmail.com>
Baltoli
requested review from
goodlyrottenapple,
theo25,
dwightguth,
Scott-Guest and
gtrepta
March 6, 2024 11:25
goodlyrottenapple
approved these changes
Mar 6, 2024
When imported into the K frontend, the older version of the `scala-kore` library caused a clash between classes in the same package namespace. This PR uses a newer release that fixes the collision.
gtrepta
reviewed
Mar 6, 2024
matching/src/main/java/org/kframework/backend/llvm/matching/MatchingException.java
Outdated
Show resolved
Hide resolved
Scott-Guest
approved these changes
Mar 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR finalises the removal of the LLVM backend's dependence on the K frontend, now that we have the shared data structures extracted out to the
scala-kore
repository. There are a few smaller changes that make up this PR, but the commit history is clean and can be reviewed commit-by-commit.Once this is merged, the LLVM backend will no longer depend on the K Frontend and we will have eliminated the backwards edge in the K dependency graph!
Fixes: #999