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

HOTFIX: restore subsort injections removed by LLVM #452

Merged

Conversation

jberthold
Copy link
Member

@jberthold jberthold commented Jan 10, 2024

Terms returned from the LLVM simplification are wrapped into a top-level rawTerm(inj{S, SortKItem{}}(_)) which is removed when deserialising the result term from the returned string.

However, when the returned term is of a subsort A of the required sort B, there would be a chain of injections A -> B -> KItem which is shortened out to A -> KItem by the LLVM simplifier, apparently.

In simplifyTerm we restore the required A -> B injection when it is necessary, checking that A is indeed a subsort of B beforehand. If the result sort A is not a subsort of the required sort B, an error message is printed and the original unsimplified term is returned.

Fixes #451

Terms returned from the LLVM simplification are wrapped into a
top-level `rawTerm(inj{S, SortKItem{}}(_))` which is removed
when deserialising the result term from the returned string.

However, when the returned term is of a subsort A of the required
sort B, there would be a chain of injections `A -> B -> KItem` which
is shortened out to `A -> KItem` by the LLVM simplifier, apparently.

In `simplifyTerm` we restore the required `A -> B` injection when it
is necessary, checking that `A` is indeed a subsort of `B` beforehand.
If the result sort `A` is not a subsort of the required sort `B`, an
error message is printed and the original unsimplified term is
returned.
@goodlyrottenapple goodlyrottenapple marked this pull request as ready for review January 10, 2024 12:44
Copy link
Contributor

@goodlyrottenapple goodlyrottenapple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving...should we wait for the integration test?

@geo2a
Copy link
Contributor

geo2a commented Jan 10, 2024

Running KEVM integration test now, let's wait until that passes and merge

@rv-jenkins rv-jenkins merged commit 6dd78c2 into main Jan 10, 2024
5 checks passed
@rv-jenkins rv-jenkins deleted the HOTFIX-restore-required-subsort-injections-after-llvm branch January 10, 2024 15:02
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.

Backend update causes crash when falling back to old backend
4 participants