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

Unify spec encoding for impl & fns #68

Closed
3 of 4 tasks
yannbolliger opened this issue Feb 11, 2021 · 0 comments · Fixed by #84
Closed
3 of 4 tasks

Unify spec encoding for impl & fns #68

yannbolliger opened this issue Feb 11, 2021 · 0 comments · Fixed by #84

Comments

@yannbolliger
Copy link
Collaborator

yannbolliger commented Feb 11, 2021

Specs can't be added to trait implementation functions at the current time.

Therefore, we want to move forward by encoding them as closures inside the actual function and hence unify the way we encode specs in implementation blocks and all other (non-abstract) functions. This is also similar to what Prusti is doing.

Cool things
While Stainless doesn't play along super-well for some proofs that use measures, it is nice to see that #[law] refinement in implementations of traits works out of the box. 🚀

Limitations
While the current approach solves the problems of specs in trait implementations, it's still impossible to add specs to the abstract methods in traits.

Further questions:

  • Can we annotate lambdas/expressions in a code block?
  • From @romac: Think about how to encode specs for abstract trait members (ie. might need to give the abstract members a body in order to express the specs)
  • Remove --infer-measures=no --check-measures=false and turn on/comment in all the measure specs.
  • Do we want to run the contracts, left open.

The follow-up work to solve the problem for traits is tracked here: #85. Measure inference: #86.

@yannbolliger yannbolliger changed the title Unify spec encoding for all impl/trait/fns Unify spec encoding for all impl & fns Feb 19, 2021
@yannbolliger yannbolliger changed the title Unify spec encoding for all impl & fns Unify spec encoding for impl & fns Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant