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

Prove invariants with ensures #19

Open
MrChico opened this issue Oct 7, 2018 · 0 comments
Open

Prove invariants with ensures #19

MrChico opened this issue Oct 7, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@MrChico
Copy link
Member

MrChico commented Oct 7, 2018

When it comes to ensuring global properties of the system, we can by induction prove global "accounting invariants" using the ensures clause and requires clauses. I imagine a procedure that goes as follows:

For each contract, we make a spec with completely abstracted calldata (so that we can explore every execution path, this relates to #16), include the relevant storage variables and assume the desired invariant in the requires clause, and claim that however the storage updates, the invariant will hold in the ensures clause. Together with a proof that the invariant holds at contract creation, this proves by induction that the invariants hold.

We haven't really utilized the ensures clause thus far, but this seems like an excellent opportunity to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants