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

refill_budget_check_ccorres #821

Merged
merged 2 commits into from
Feb 19, 2025
Merged

refill_budget_check_ccorres #821

merged 2 commits into from
Feb 19, 2025

Conversation

michaelmcinerney
Copy link
Contributor

@michaelmcinerney michaelmcinerney commented Oct 2, 2024

No description provided.

@michaelmcinerney michaelmcinerney self-assigned this Oct 2, 2024
@michaelmcinerney michaelmcinerney added the MCS related to `rt` branch and mixed-criticality systems label Oct 2, 2024
@michaelmcinerney michaelmcinerney marked this pull request as ready for review October 2, 2024 14:46
apply (rule refill_head_ccorres)
apply clarsimp
apply clarsimp
apply clarsimp
Copy link
Member

Choose a reason for hiding this comment

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

clarsimp+

apply (clarsimp simp: typ_heap_simps' sc_ptr_to_crefill_ptr_def
csched_context_relation_def)
apply (clarsimp simp: typ_heap_simps csched_context_relation_def)
apply normalise_obj_at'
Copy link
Member

Choose a reason for hiding this comment

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

unexpected to see normalise_obj_at' so distant from the subgoal-solving statement, anything interesting going on herer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe some of these normalise_obj_at' can be removed or moved elsewhere. Maybe I don't understand what you mean by it being distant from the subgoal-solving statement. Were you expecting it to be further up or further down?

Copy link
Member

Choose a reason for hiding this comment

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

Well, normally I see it used, and then the subgoal is discharged immediately, or on the next step. This one goes on for a bit until it's actually discharged, making me wonder if something is going the long way around.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was actually able to remove a few instances of normalise_obj_at' from this proof. I think they were just copied from other proofs that used updateSchedContext ccorres rules. I most often use normalise_obj_at' after using something like obj_at_cslift_tcb or obj_at_cslift_sc, or arguing about there being an object at the tcbSchedContext, or something.

sc_valid_refills_def vs_all_heap_simps obj_at_def refill_budget_check_defs
update_sched_context_set_refills_rewrite schedule_used_defs)
method handle_overrun_simple
= (clarsimp simp: handle_overrun_def)?,
Copy link
Member

Choose a reason for hiding this comment

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

this looks nearly identical to the previous method, am I missing why we need two methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are slightly different. It's possible that they could be combined into one method that could be used instead of the two, but it could be rather annoying to try this.

in hoare_strengthen_post[rotated])
apply (fastforce simp: valid_refills_def vs_all_heap_simps)
apply (intro hoare_vcg_conj_lift_pre_fix; (solves head_insufficient_loop_simple)?)
apply (wpsimp wp: head_insufficient_loop_refills_sum)
Copy link
Member

Choose a reason for hiding this comment

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

this looks like you can combine the rest of the proof into a (wpsimp wp: ... | clarsimp simp: ...)+, I don't think there's much of interest here for the proof length

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.

Nice work. That was a much bigger change than I expected. I have minor/cleanup comments mostly.
On the "prove" commit, you're changing the spec, would be nice to have some more info, because the commit diff is huge, but the message makes it sound like something rather simple.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
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.

Yup, this is a lot larger than the title might lead one to suspect. Good work! Ready to merge from my side.

This also includes a refactoring of the definitions associated
with refill_budget_check in the ASpec and the Haskell, in order
to ease the ccorres proof. While the semantics are preserved,
this necessitated a rather large change in AInvs, mostly due to
the rather specialised lemmas regarding valid_refills.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
@michaelmcinerney michaelmcinerney merged commit b069f59 into rt Feb 19, 2025
11 checks passed
@michaelmcinerney michaelmcinerney deleted the michaelm-rbc_ccorres branch February 19, 2025 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MCS related to `rt` branch and mixed-criticality systems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants