Skip to content

Make contract inference work with simple functions #1453

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

Open
xldenis opened this issue Mar 20, 2025 · 2 comments
Open

Make contract inference work with simple functions #1453

xldenis opened this issue Mar 20, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@xldenis
Copy link
Collaborator

xldenis commented Mar 20, 2025

We support inference for closures, but another useful situation is 'dumb' getters and setters where the contract repeats the (short) function body. We should be able to specify those.

I feel like we could start with using this only on small (pure?) functions, but in principle anything without loops is game I suppose.

@jhjourdan
Copy link
Collaborator

One problem we will have with that is that we need to generate the coma code for these simple functions as part of the caller Why3 module (otherwise the inference can't work), and therefore we will need to re-prove the callee at each use. We should somehow have two odes when generating the coma code: one mode would emit everythin, and the other would only emit whatever is not behind an abstraction barrier.

@xldenis
Copy link
Collaborator Author

xldenis commented Mar 20, 2025

and therefore we will need to re-prove the callee at each use.

That's fine for things like getters and setters though. their contract is their body so its not increasing the amount of work to be done.

@Lysxia Lysxia added the enhancement New feature or request label Apr 24, 2025
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

3 participants