Skip to content

Commit

Permalink
haskell+design+proof: add deletionIsSafe2 assert to deleteObjects
Browse files Browse the repository at this point in the history
Signed-off-by: Michael McInerney <[email protected]>
  • Loading branch information
michaelmcinerney committed Mar 26, 2024
1 parent 96410b0 commit 15921b1
Show file tree
Hide file tree
Showing 42 changed files with 1,761 additions and 1,575 deletions.
3 changes: 1 addition & 2 deletions proof/crefine/AARCH64/Detype_C.thy
Original file line number Diff line number Diff line change
Expand Up @@ -1553,8 +1553,7 @@ lemma deleteObjects_ccorres':
doMachineOp_modify modify_modify o_def ksPSpace_ksMSu_comm
bind_assoc modify_machinestate_assert_cnodes_swap modify_machinestate_assert_ptables_swap
modify_modify_bind)
apply (rule ccorres_stateAssert_fwd)
apply (rule ccorres_stateAssert_fwd)
apply (rule ccorres_stateAssert_fwd)+
apply (rule ccorres_stateAssert_after)
apply (rule ccorres_from_vcg)
apply (rule allI, rule conseqPre, vcg)
Expand Down
2 changes: 1 addition & 1 deletion proof/crefine/AARCH64/Refine_C.thy
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ lemma no_fail_callKernel:
apply (rule corres_nofail)
apply (rule corres_guard_imp)
apply (rule kernel_corres)
apply (force simp: word_neq_0_conv)
apply (force simp: word_neq_0_conv schact_is_rct_def)
apply (simp add: sch_act_simple_def)
apply metis
done
Expand Down
2 changes: 1 addition & 1 deletion proof/crefine/ARM/Detype_C.thy
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ lemma deleteObjects_ccorres':
doMachineOp_modify modify_modify o_def ksPSpace_ksMSu_comm
bind_assoc modify_machinestate_assert_cnodes_swap
modify_modify_bind)
apply (rule ccorres_stateAssert_fwd)
apply (rule ccorres_stateAssert_fwd)+
apply (rule ccorres_stateAssert_after)
apply (rule ccorres_from_vcg)
apply (rule allI, rule conseqPre, vcg)
Expand Down
2 changes: 1 addition & 1 deletion proof/crefine/ARM/Refine_C.thy
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ lemma no_fail_callKernel:
apply (rule corres_nofail)
apply (rule corres_guard_imp)
apply (rule kernel_corres)
apply force
apply (force simp: schact_is_rct_def)
apply (simp add: sch_act_simple_def)
apply metis
done
Expand Down
2 changes: 1 addition & 1 deletion proof/crefine/ARM_HYP/Detype_C.thy
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ lemma deleteObjects_ccorres':
doMachineOp_modify modify_modify o_def ksPSpace_ksMSu_comm
bind_assoc modify_machinestate_assert_cnodes_swap
modify_modify_bind)
apply (rule ccorres_stateAssert_fwd)
apply (rule ccorres_stateAssert_fwd)+
apply (rule ccorres_stateAssert_after)
apply (rule ccorres_from_vcg)
apply (rule allI, rule conseqPre, vcg)
Expand Down
2 changes: 1 addition & 1 deletion proof/crefine/ARM_HYP/Refine_C.thy
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ lemma no_fail_callKernel:
apply (rule corres_nofail)
apply (rule corres_guard_imp)
apply (rule kernel_corres)
apply force
apply (force simp: schact_is_rct_def)
apply (simp add: sch_act_simple_def)
apply metis
done
Expand Down
2 changes: 1 addition & 1 deletion proof/crefine/RISCV64/Detype_C.thy
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ lemma deleteObjects_ccorres':
doMachineOp_modify modify_modify o_def ksPSpace_ksMSu_comm
bind_assoc modify_machinestate_assert_cnodes_swap
modify_modify_bind)
apply (rule ccorres_stateAssert_fwd)
apply (rule ccorres_stateAssert_fwd)+
apply (rule ccorres_stateAssert_after)
apply (rule ccorres_from_vcg)
apply (rule allI, rule conseqPre, vcg)
Expand Down
2 changes: 1 addition & 1 deletion proof/crefine/RISCV64/Refine_C.thy
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ lemma no_fail_callKernel:
apply (rule corres_nofail)
apply (rule corres_guard_imp)
apply (rule kernel_corres)
apply (force simp: word_neq_0_conv)
apply (force simp: word_neq_0_conv schact_is_rct_def)
apply (simp add: sch_act_simple_def)
apply metis
done
Expand Down
2 changes: 1 addition & 1 deletion proof/crefine/X64/Detype_C.thy
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ lemma deleteObjects_ccorres':
doMachineOp_modify modify_modify o_def ksPSpace_ksMSu_comm
bind_assoc modify_machinestate_assert_cnodes_swap
modify_modify_bind)
apply (rule ccorres_stateAssert_fwd)
apply (rule ccorres_stateAssert_fwd)+
apply (rule ccorres_stateAssert_after)
apply (rule ccorres_from_vcg)
apply (rule allI, rule conseqPre, vcg)
Expand Down
2 changes: 1 addition & 1 deletion proof/crefine/X64/Refine_C.thy
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ lemma no_fail_callKernel:
apply (rule corres_nofail)
apply (rule corres_guard_imp)
apply (rule kernel_corres)
apply (force simp: word_neq_0_conv)
apply (force simp: word_neq_0_conv schact_is_rct_def)
apply (simp add: sch_act_simple_def)
apply metis
done
Expand Down
36 changes: 19 additions & 17 deletions proof/refine/AARCH64/Arch_R.thy
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ lemma set_cap_device_and_range_aligned:
lemma performASIDControlInvocation_corres:
"asid_ci_map i = i' \<Longrightarrow>
corres dc
(einvs and ct_active and valid_aci i)
(einvs and ct_active and valid_aci i and schact_is_rct)
(invs' and ct_active' and valid_aci' i')
(perform_asid_control_invocation i)
(performASIDControlInvocation i')"
Expand Down Expand Up @@ -274,6 +274,7 @@ lemma performASIDControlInvocation_corres:
subgoal by (fastforce simp:cte_wp_at_caps_of_state descendants_range_def2 empty_descendants_range_in)
apply (fold_subgoals (prefix))[2]
subgoal premises prems using prems by (clarsimp simp:invs_def valid_state_def)+
apply (clarsimp simp: schact_is_rct_def)
apply (clarsimp simp:cte_wp_at_caps_of_state)
apply (drule detype_locale.non_null_present)
apply (fastforce simp:cte_wp_at_caps_of_state)
Expand Down Expand Up @@ -332,26 +333,27 @@ lemma performASIDControlInvocation_corres:
simp_all add: is_simple_cap'_def isCap_simps descendants_range'_def2
null_filter_descendants_of'[OF null_filter_simp']
capAligned_def asid_low_bits_def)
apply (erule descendants_range_caps_no_overlapI')
apply (fastforce simp:cte_wp_at_ctes_of is_aligned_neg_mask_eq)
apply (simp add:empty_descendants_range_in')
apply (simp add:word_bits_def bit_simps)
apply (rule is_aligned_weaken)
apply (rule is_aligned_shiftl_self[unfolded shiftl_t2n,where p = 1,simplified])
apply (simp add:pageBits_def)
apply (erule descendants_range_caps_no_overlapI')
apply (fastforce simp:cte_wp_at_ctes_of is_aligned_neg_mask_eq)
apply (simp add:empty_descendants_range_in')
apply (simp add:word_bits_def bit_simps)
apply (rule is_aligned_weaken)
apply (rule is_aligned_shiftl_self[unfolded shiftl_t2n,where p = 1,simplified])
apply (simp add:pageBits_def)
apply clarsimp
apply (drule(1) cte_cap_in_untyped_range)
apply (fastforce simp:cte_wp_at_ctes_of)
apply assumption+
apply fastforce
apply simp
apply clarsimp
apply (drule(1) cte_cap_in_untyped_range)
apply (fastforce simp:cte_wp_at_ctes_of)
apply (drule (1) cte_cap_in_untyped_range)
apply (fastforce simp add: cte_wp_at_ctes_of)
apply assumption+
apply (clarsimp simp: invs'_def valid_state'_def if_unsafe_then_cap'_def cte_wp_at_ctes_of)
apply fastforce
apply simp
apply clarsimp
apply (drule (1) cte_cap_in_untyped_range)
apply (fastforce simp add: cte_wp_at_ctes_of)
apply assumption+
apply (clarsimp simp: invs'_def valid_state'_def if_unsafe_then_cap'_def cte_wp_at_ctes_of)
apply fastforce
apply simp
done

definition vcpu_invocation_map :: "vcpu_invocation \<Rightarrow> vcpuinvocation" where
Expand Down Expand Up @@ -1378,7 +1380,7 @@ lemma performARMVCPUInvocation_corres:
lemma arch_performInvocation_corres:
"archinv_relation ai ai' \<Longrightarrow>
corres (dc \<oplus> (=))
(einvs and ct_active and valid_arch_inv ai)
(einvs and ct_active and valid_arch_inv ai and schact_is_rct)
(invs' and ct_active' and valid_arch_inv' ai')
(arch_perform_invocation ai) (Arch.performInvocation ai')"
apply (clarsimp simp: arch_perform_invocation_def
Expand Down
Loading

0 comments on commit 15921b1

Please sign in to comment.