-
Notifications
You must be signed in to change notification settings - Fork 152
Upstream symbolic bytes
lookup, List
membership lemmas
#2702
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
Upstream symbolic bytes
lookup, List
membership lemmas
#2702
Conversation
bytes
lookup lemmas for symbolic immutablesbytes
lookup, List
membership lemmas
|
||
rule [lookup-as-asWord]: | ||
B:Bytes [ I:Int ] => #asWord ( #range ( B, I, 1 ) ) | ||
requires 0 <=Int I andBool I <=Int lengthBytes(B) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be I <Int lengthBytes(B)
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, it should be, thank you @lucasmt! It is I <Int lengthBytes(B)
in the rule we're using in Kontrol, I'll update it here. I guess I should also make sure Kontrol tests are passing with this version of KEVM, I'll open a PR in Kontrol checking that and will merge it — with the <Int
change — if they're passing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in d38bec6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving the PR, just have one comment above that I think needs to be addressed before it's merged
I opened a PR in Kontrol to test if upstreamed lemmas don't negatively affect the tests and are applied if I take out the same lemmas from Kontrol aux files. The tests are passing: runtimeverification/kontrol#1059 (there's a minor expected output diff in some |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes #2476.
This PR adds lemmas for lookups in partially symbolic
bytes
arrays; specifically, in runtime bytecode of contracts that containimmutable
variables that are initialized in a constructor with a symbolic value. It also addsList
membership lemmas that facilitate checking if a performed call is allowed in Kontrol when theallowCalls
cheatcode is used.Once this PR is merged, the relevant lemmas should be removed from
KONTROL-AUX-LEMMAS
and https://github.com/runtimeverification/kontrol/blob/master/src/tests/integration/test-data/symbolic-bytes-lemmas.k.