Record Solidity/K mapping for input names #747
Closed
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.
Partially addresses #710.
As suggested by @ehildenb, this PR generates a new file
out/kompiled/input-mapping.json
that contains a mapping between a Solidity variable name and its K representation. The file is structured as follows:This PR also changes the return value of
arg_names
from a list of processed input names to a dictionary storing a mapping between the processed (VV0_from_114b9705
) and original (from
) input names.This mapping is then used to decode K variable names back to the original ones in the mode/counterexample, which depends on these two PRs in KEVM and pyk:
variable_name_mapping
toprint_model
,print_failure_info
evm-semantics#2560variable_names_mapping
toAPRProof
, counterexample generation k#4574For our documentation
CounterTest
example, the model looks like this:It can also be useful when parsing precondition NatSpec comments (WIP), and for Simbolik. The newly generated file doesn't occupy too much additional storage: it takes 256 Kb on a relatively big client codebase, where
contracts.k
takes 2.6 Mb.