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

RFC Function Contracts #2620

Merged
merged 41 commits into from
Aug 25, 2023
Merged

Conversation

JustusAdam
Copy link
Contributor

@JustusAdam JustusAdam commented Jul 24, 2023

Rendered

Proposes the addition of function contracts and mechanisms to check them and use them as modular abstractions.

@JustusAdam JustusAdam requested a review from a team as a code owner July 24, 2023 19:30
@JustusAdam JustusAdam changed the title Function contract RFC first draft RFC Function Contracts Jul 24, 2023
@JustusAdam JustusAdam self-assigned this Jul 24, 2023
@JustusAdam JustusAdam added this to the Function Contracts MVP milestone Jul 24, 2023
@JustusAdam JustusAdam marked this pull request as draft July 24, 2023 20:00
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

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

I like this structure much better! Thanks.

I haven't finished reviewing it yet. I'll keep looking at it later today.

I do have two things I would like to discuss:

  1. Our previous contract implementation uses #[kani::modifies] instead of assigns. I like that better.
  2. I think it should be up to the user to verify their contracts. We shouldn't enforce it inside Kani, especially for contracts defined in a dependency.

rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

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

Please don't forget to change the summary.md file

rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
Copy link
Contributor

@adpaco-aws adpaco-aws left a comment

Choose a reason for hiding this comment

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

The "User Experience" section is structured in a way that makes it a little hard-to-follow. It seems to me that you're trying to tackle three problems at once: specification, checking and replacement. Maybe each could have their own subsection instead of being itemized?
There's a similar issue with "Rationale and alternatives" and "Future possibilities", although I haven't carefully read them yet.

rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0008-function-contracts.md Outdated Show resolved Hide resolved
JustusAdam and others added 4 commits August 9, 2023 12:30
Co-authored-by: Celina G. Val <celinval@amazon.com>
Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
Copy link
Contributor

@adpaco-aws adpaco-aws left a comment

Choose a reason for hiding this comment

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

Thanks @JustusAdam , it's looking great! Only a couple technical comments, the rest are more related to writing.

rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
JustusAdam and others added 4 commits August 15, 2023 21:12
Co-authored-by: Celina G. Val <celinval@amazon.com>
Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

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

Almost there. :)

rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
JustusAdam and others added 2 commits August 16, 2023 18:16
@celinval
Copy link
Contributor

BTW, please wait for a second approval before merging. Thanks!

Copy link
Contributor

@adpaco-aws adpaco-aws left a comment

Choose a reason for hiding this comment

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

Thanks @JustusAdam ! Please take care of unresolved comments before merging.

rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/SUMMARY.md Show resolved Hide resolved
@JustusAdam
Copy link
Contributor Author

BTW, please wait for a second approval before merging. Thanks!

I'm going to wait for @remi-delmas-3000 to give it another look because there are some unresolved comments before merging.

rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Outdated Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Show resolved Hide resolved
rfc/src/rfcs/0009-function-contracts.md Show resolved Hide resolved
@JustusAdam JustusAdam merged commit 62142e4 into model-checking:main Aug 25, 2023
12 checks passed
@JustusAdam JustusAdam deleted the contracts-rfc branch August 25, 2023 00:34
tautschnig pushed a commit to tautschnig/kani that referenced this pull request Aug 30, 2023
Co-authored-by: Celina G. Val <celinval@amazon.com>
Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: In Progress
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants