Make pre-condition available as hypothesis when rewriting inside a function #2847
andricicezar
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I'm trying to prove the following equality:
The condition of
if
is always true because of the pre-condition, thus the equality is true. I tried the following:but now F* asks me to prove
p x
, which should be true because of the pre-condition, but I have no hypothesis in the environment.I first asked this question on Slack where Nik answered with:
How hard it will be to have this? Or can you suggest any workarounds? It would be helpful for me to have this because I'm trying to prove about my import/export mechanism that import and export satisfy a cancelation law: where export takes a function with pre-post and wraps it in a new function with no pre-post in which the pre-condition is enforced dynamically, and where import takes a function with no pre-post and wraps it in a function with pre-post in which the post-condition is enforced dynamically. The proof should be quite easy if I would be able to do this rewrites, since the dynamic checks would be trivial because they enforce the pre-post which should be around. If interested, you can find a Proof of Concept here: https://github.com/andricicezar/fstar-io/blob/c7ac96726323dd4698584d8b1fd8b012f819c9eb/io/LawImportableExportable.fst
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions