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

Remove hoare_vcg_precond_imp from wp_comb #747

Merged
merged 1 commit into from
Apr 13, 2024

Conversation

corlewis
Copy link
Member

@corlewis corlewis commented Apr 9, 2024

This being a wp_comb rule is a leftover from before wp_pre was implemented and it is being removed because in some cases it can cause unintended schematics to appear in the assumptions. See #729 for more discussion of this being a problem.

This commit also updates all of the proofs that accidentally depended on it being a wp_comb rule. In many cases this involved including classic_wp_pre, which locally returns the wp attributes to a state similar to what it was when the proofs were first written. Other cases required small rewrites, often involving using wpsimp instead of wp, and removing some uses of wp (once).

@corlewis corlewis added cleanup proof engineering nicer, shorter, more maintainable etc proofs labels Apr 9, 2024
@corlewis corlewis self-assigned this Apr 9, 2024
proof/refine/ARM/VSpace_R.thy Outdated Show resolved Hide resolved
proof/refine/X64/VSpace_R.thy Outdated Show resolved Hide resolved
Copy link
Member

@lsf37 lsf37 left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. Bit scary to see so many no_pre still in use. So much stuff to clean up..

@corlewis
Copy link
Member Author

corlewis commented Apr 9, 2024

Thanks for doing this. Bit scary to see so many no_pre still in use. So much stuff to clean up..

There's actually even more uses of no_pre than you see here, this only updates the ones that broke. A lot are duplicated across architectures of course, but it looks like there's another 219.

lemma switch_to_thread_ct_not_queued[wp]:
"\<lbrace>valid_queues\<rbrace> switch_to_thread t \<lbrace>\<lambda>rv s. not_queued (cur_thread s) s\<rbrace>"
unfolding switch_to_thread_def
by wpsimp
Copy link
Member

Choose a reason for hiding this comment

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

haha wow

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this was one of the early cases before I found classic_wp_pre and when I was trying to properly fix broken proofs. The previous proof did a lot of very convoluted work to get to the tcb_sched_action tcb_sched_dequeue step with the appropriate precondition in place. Pulling it out to a separate lemma made things a lot simpler.

Copy link
Member

@Xaphiosis Xaphiosis left a comment

Choose a reason for hiding this comment

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

I don't see anything more than what @lsf37 already pointed out. Nicely done, thank you.

This being a `wp_comb` rule is a leftover from before `wp_pre` was
implemented and it is being removed because in some cases it can cause
unintended schematics to appear in the assumptions.

This commit also updates all of the proofs that accidentally
depended on it being a `wp_comb` rule. In many cases this involved
`including classic_wp_pre`, which locally returns the wp attributes to a
state similar to what it was when the proofs were first written. Other
cases required small rewrites, often involving using `wpsimp` instead of
`wp`, and removing some uses of `wp (once)`.

Signed-off-by: Corey Lewis <[email protected]>
@corlewis corlewis merged commit d941182 into seL4:master Apr 13, 2024
13 checks passed
@corlewis corlewis deleted the hoare_vcg_precond_imp_comb branch April 13, 2024 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup proof engineering nicer, shorter, more maintainable etc proofs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants