-
Notifications
You must be signed in to change notification settings - Fork 9
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
Implement kevm.forgetBranch cheatcode #899
Implement kevm.forgetBranch cheatcode #899
Conversation
Needed for runtimeverification/kontrol#899 to expose the `simplify` endpoint in the `custom_step` function.
I think this should be implemented as a custom
As a separate custom command, it's instead looks like:
In the second approach, iterating on removing the desired constraints is a very tight loop of commands that never even need to load a haskell backend up (inspecting kcfg, pruning nodes, and forgetting constraints), and you can resume the proof directly from the spot that you left off, instead of returning all the way to the beginning to even see if your change worked. |
I think we can have both. Custom command is a debugging method with quick response, cheatcode is a fixed proof for CI? |
After having read through, I think we should definitely have both, because the separate custom command allows for quick debugging and then the Solidity-level forgetting allows for a continuous proof. |
Here are my thoughts, starting from:
From the point of understanding and debugging whether or not removing or abstracting a constraint will work, I 100% agree with @ehildenb that we should have a separate From the point of understanding what are the constraints that can be removed, those are all already present and clearly visible in the Solidity code, and using a cheatcode to remove them would ideally be straightforward. However, there are two snags:
When it comes to |
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.
The cheatcode seems to be working on our tests, so I'm approving this and we can revisit it later to revise the implementation/add a command-line version.
* Implement kevm.forgetBranch cheatcode (#899) * draft FOUNDRYSemantics * forgetBranch * add mlEqualsTrue * minor corrections * add simplification step * formatting * add back not equal * rename FOUNDRYSemantics to KontrolSemantics * checking for negation as well * correcting indentation * expanding functionality * heuristic simplifications * further refinement * refactoring _exec_forget_custom_step * add show test * fix test * update expected output --------- Co-authored-by: Petar Maksimovic <[email protected]> Co-authored-by: Palina <[email protected]> Co-authored-by: Petar Maksimović <[email protected]> * Update dependency: deps/kevm_release (#940) * deps/kevm_release: Set Version 1.0.780 * Sync Poetry files: kevm-pyk version 1.0.780 * flake.{nix,lock}: update Nix derivations --------- Co-authored-by: devops <[email protected]> * Build Custom Kontrol Versions using a workflow (#941) * new file: .github/workflows/kup-build-kontrol.yml - Adding a new feature to build kontrol images using kup and --overrides * Update .github/workflows/kup-build-kontrol.yml Co-authored-by: Everett Hildenbrandt <[email protected]> * modified: .github/workflows/docker-push.yml modified: .github/workflows/kup-build-kontrol.yml - Standardizing the naming between these two workflows to know which is for which - Docker-push builds a custom version of kontrol with fixed dependencies already published and built with kontrol - kup-build-kontrol.yml will build the existing kontrol code with a single new dependency modified: README.md - Adding some readme instructions. * renamed: .github/workflows/docker-push.yml -> .github/workflows/kontrol-push-fixed-deps.yml renamed: .github/workflows/kup-build-kontrol.yml -> .github/workflows/kontrol-push-unfixed-deps.yml modified: README.md - Add some background between the two kontrol build workflows * modified: README.md -- Adding content to explain the two custom kontrol build workflows * Update README.md Co-authored-by: Anton Savienko <[email protected]> * Filling in the 'get' placeholder with functionality to fetch appropriate defaults when nothing is provided * modified: README.md - Adding instructions to fetch hash and use the wrofklow with multiple dep options now available * Update spelling and gramar * modified: .github/workflows/kontrol-push-unfixed-deps.yml - Fixing reporting of final versions used to build kontrol. - Removing dfining override for undefined inputs to the workflow --------- Co-authored-by: Everett Hildenbrandt <[email protected]> Co-authored-by: Anton Savienko <[email protected]> --------- Co-authored-by: Andrei Văcaru <[email protected]> Co-authored-by: Petar Maksimovic <[email protected]> Co-authored-by: Palina <[email protected]> Co-authored-by: Petar Maksimović <[email protected]> Co-authored-by: rv-jenkins <[email protected]> Co-authored-by: devops <[email protected]> Co-authored-by: Freeman <[email protected]> Co-authored-by: Everett Hildenbrandt <[email protected]> Co-authored-by: Anton Savienko <[email protected]>
blocked on:
#903blocked on:
runtimeverification/kontrol-cheatcodes#15blocked on:
runtimeverification/evm-semantics#2662blocked on:
runtimeverification/k#4700Changes in this PR:
forgetBranch(uint256,uint8,uint256)
:#forget Int Int Int
production at the top of the K Cell. The#forget
rule is set as acut-rule
.FOUNDRYSemantics(KEVMSemantics)
, that is inheriting the KEVMSemantics.FOUNDRYSemantics
:_check_forget_pattern(self, cterm: CTerm) -> bool
: checks if theforget
cut-rule is at the top of the K Cell_exec_forget_custom_step(self, cterm: CTerm, cterm_symbolic: CTermSymbolic) -> KCFGExtendResult
:#forget
K production and reconstructs the constraint.CTermSymbolic.simplify
endpoint and aCTerm
created from an empty configuration.Step
is returned; otherwise,None
is returned.can_make_custom_step
andcustom_step
to check and run theforget
pattern.Usage example: