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

Directly construct KCFGs in foundry-kompile #1377

Merged
merged 12 commits into from
Sep 16, 2022
Merged

Directly construct KCFGs in foundry-kompile #1377

merged 12 commits into from
Sep 16, 2022

Conversation

ehildenb
Copy link
Member

@ehildenb ehildenb commented Sep 14, 2022

Fixes: #1374

This makes a series of small improvements:

  • We avoid including the spec-modules in the definition.
  • We directly construct kcfgs.json from the Foundry output, instead of turning into K specs and then turning back into KCFGs after. As such, we can skip the kprove --dry-run --emit-json-spec ... step, and remove --reparse argument. Options spec_module and parsed_spec.
  • We start the proofs with an arbitrary initial account set, instead of .Bag.
  • Add option --depth to kevm foundry-prove ..., so you can inspect intermediate states.
  • Add option --[no-]minimize to kprove_args, which means we by default minimize the proof output, but give the option to not minimize with --no-minimize.
  • Adds symbol attribute to generated productions for contract_to_k, so that we can be sure the klabels will be exactly how we generate them.
  • Adds options --lemma to kprove_args, so that users can pass in lemmas on the CLI to use for simplification.

@ehildenb ehildenb marked this pull request as ready for review September 16, 2022 03:09
Comment on lines -157 to -159
_spec_module = KFlatModule(
spec_module if spec_module else 'SPEC', [], [KImport(mname) for mname in [_m.name for _m in claims_modules]]
)
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason behind removing the spec module? Is it to separate the auto-generated rules from the hand-written claims?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to reduce the output size since we aren't using the claims anymore to make the input specifications. The KCFGs are stored structurally (instead of textual claims), and then when we want to run the proof, the KCFG is written as a claim to a file for calling KProve on.

@rv-jenkins rv-jenkins merged commit 2aaec12 into master Sep 16, 2022
@rv-jenkins rv-jenkins deleted the direct-cfgs branch September 16, 2022 22:14
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.

Directly construct KCFGs instead of parsing
4 participants