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

Remove usages of K frontend code #1007

Merged
merged 7 commits into from Mar 6, 2024
Merged

Remove usages of K frontend code #1007

merged 7 commits into from Mar 6, 2024

Conversation

Baltoli
Copy link
Collaborator

@Baltoli Baltoli commented Mar 6, 2024

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

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.
Baltoli and others added 3 commits March 6, 2024 11:25
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>
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.
@rv-jenkins rv-jenkins merged commit fb17cba into master Mar 6, 2024
7 checks passed
@rv-jenkins rv-jenkins deleted the drop-k branch March 6, 2024 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove back-edge dependency on the K frontend
5 participants