-
Notifications
You must be signed in to change notification settings - Fork 109
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
ccorres
rules for the reply functions
#881
Conversation
config_set conditions are now wrapped in an inline function in C so that corresponding "if" statements are not automatically rewritten by ccorres. Adjust proofs accordingly. For most instances, we execute the inline function and call ccorres_rewrite to get the same proof state as before. We can then later add new specification and proof branches for these config options. Signed-off-by: Gerwin Klein <[email protected]>
To get rid of the link check failure, cherry-picking commit 9a28f50 should work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realise this was still in draft, apologies for jumping in early with the comments. If we can resolve those instantiation chains, I think this is pretty much ready to go.
Minor question on commit (message are generally good and helpful, thank you): |
It is trying to say generic Haskell and RISCV refine+crefine. Maybe in this case we should just shorten in to |
apply (rule conseqPre, rule conseqPost) | ||
apply assumption | ||
apply clarsimp | ||
apply (rule rev_bexI, rule updateSchedContext_eq) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clarsimp should discharge the assumption, then we have clarsimp, three simps, and a clarsimp... I think you can safely put a ; clarsimp simp: obj_at_simps
at the end here and save some lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(or clarsimp with a +)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were just moved. I meant to write a nicer PR description before I marked this as ready for review. But these updateSchedContext_ccorres_*
lemmas were just moved, along with schedContext_donate_ccorres
and tcbReleaseRemove_ccorres
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still a pretty easy compression if you're interested while we're here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Gerwin already found the interesting issues. When he's happy with it, don't wait up for me. I definitely agree that postcondition instantiation pattern is not great for maintenance, and some way of automating our way out of it should be explored.
Yeah I think we'd normally have two commits, one for spec changes and one for proof update. In this case, I'd probably go with your suggestion given the nature of the |
I've pushed an update with the fix for the broken links, a commit that reduces the use of |
I think I missed a few updates for the new asserts, so I'll run the proofs again locally and push an updated version soon. |
5f6f140
to
f6e43d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you were on the right track with the valid_objs' crossing, and the proofs look neater now.
Signed-off-by: Gerwin Klein <[email protected]>
The replyTCB field of a reply points to a TCB, and so should use option_to_ctcb_ptr, rather than option_to_ptr. Additionally, from_bool is preferred to to_bool. Signed-off-by: Michael McInerney <[email protected]>
Signed-off-by: Michael McInerney <[email protected]>
I'm coming to really dislike Python. Ok to ignore this here, it's some setup problem of the style checker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, the valid_objs' idea was good. We have a bit of the post condition instantiation moving into Refine, but now concentrated to just once and also in a nicer form. I like it.
This proves the ccorres rules for all functions which directly modify the reply objects, namely reply_pop, reply_push, reply_remove, and reply_remove_tcb. This refactors the Haskell definitions slightly: - the when statement in replyPop is removed, since replyPop is called only from replyRemove, which contains an explicit check for the condition in the when statement. - the call to cleanReply in replyPop is removed and replaced with an update of the replyPrev field to Nothing. This preserves semantics, since the replyNext field is set to Nothing earlier in the function. - updateSchedContext is preferred to setSchedContext. Signed-off-by: Michael McInerney <[email protected]>
Signed-off-by: Michael McInerney <[email protected]>
f6e43d9
to
eeb3165
Compare
And it now works on the same OS and python version without anything having changed. Maybe it was a networking problem or something like that. |
Test with seL4/seL4#1440