Skip to content

Commit fe78677

Browse files
Some more cleanup in wp_EInit.
1 parent 682c421 commit fe78677

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

theories/rules/rules_EInit.v

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -804,27 +804,25 @@ Section cap_lang_rules.
804804
eapply (auth_update_alloc (Excl <$> cur_tb) (Excl <$> (<[tidx := eid]> cur_tb)) (Excl <$> {[ tidx := eid ]})).
805805
rewrite fmap_insert.
806806
rewrite map_fmap_singleton.
807-
apply gmap.alloc_singleton_local_update.
807+
apply gmap.alloc_singleton_local_update; try easy.
808808
{ clear -HEC Hdomtbcompl.
809809
rewrite lookup_fmap.
810810
apply fmap_None.
811-
rewrite HEC in Hdomtbcompl.
811+
apply not_elem_of_dom.
812+
enough (tidx ∉ dom cur_tb ∪ dom prev_tb) by set_solver.
812813
rewrite dom_union_L in Hdomtbcompl.
813-
rewrite -not_elem_of_dom.
814-
assert (tidx ∉ dom cur_tb ∪ dom prev_tb); last set_solver.
815814
rewrite Hdomtbcompl.
816815
apply not_elem_of_list_to_set.
817816
intro Htidx.
818817
apply elem_of_seq in Htidx; lia.
819818
}
820-
{ done. }
821819

822820
(* mod update for <[(enumcur σ) := eid]> etable in ALL_TB *)
823821
iMod (own_update with "Hall_tb") as "(Hall_tb & Hall_frag)".
824822
eapply (auth_update_alloc (to_agree <$> all_tb) (to_agree <$> (<[tidx := eid]> all_tb)) (to_agree <$> {[ tidx := eid ]})).
825823
rewrite fmap_insert.
826824
rewrite map_fmap_singleton.
827-
apply gmap.alloc_singleton_local_update.
825+
apply gmap.alloc_singleton_local_update; try easy.
828826
{ clear -HEC Htbcompl Hdomtbcompl.
829827
rewrite lookup_fmap.
830828
apply fmap_None.
@@ -838,11 +836,10 @@ Section cap_lang_rules.
838836
intro Htidx.
839837
apply elem_of_seq in Htidx; lia.
840838
}
841-
{ done. }
842839
cbn.
843-
iCombine "Hecauth HECv" as "HEC".
844-
iMod (own_update with "HEC") as "(Hecauth & HECv)".
845-
apply (excl_auth_update _ _ (enumcur σ + 1)).
840+
841+
iMod (own_update_2 with "Hecauth HECv") as "(Hecauth & HECv)".
842+
{ apply (excl_auth_update _ _ (enumcur σ + 1)). }
846843

847844
iMod (gen_heap_update_inSepM _ _ r_code (LCap machine_base.E f f0 (f ^+ 1)%a (v+1)) with
848845
"Hσr Hregs") as "(Hσr & Hregs)"; eauto.
@@ -872,17 +869,14 @@ Section cap_lang_rules.
872869
{
873870
iFrame.
874871
rewrite !insert_insert.
875-
iEval (rewrite insert_commute; eauto) in "Hregs".
876-
rewrite !insert_insert.
877-
iEval (rewrite insert_commute; eauto) in "Hregs".
878-
iFrame.
872+
iEval (rewrite (insert_commute _ r_code); eauto) in "Hregs".
873+
now rewrite !insert_insert.
879874
}
880875
{ apply elem_of_dom. by repeat (rewrite lookup_insert_is_Some'; right). }
881876
{
882877
rewrite insert_insert.
883-
rewrite insert_commute; auto.
878+
rewrite (insert_commute _ r_code); auto.
884879
rewrite insert_insert.
885-
rewrite insert_commute; auto.
886880
by do 2 (apply insert_mono).
887881
}
888882
{
@@ -917,8 +911,7 @@ Section cap_lang_rules.
917911
{ subst.
918912
incrementPC_inv; simplify_map_eq.
919913
iExists _, _, _, _, _, _; iFrame; cbn; iPureIntro.
920-
split; first done.
921-
split.
914+
intuition eauto.
922915
{
923916
rewrite dom_insert_L disjoint_union_l; split ; auto.
924917
rewrite disjoint_singleton_l.
@@ -927,27 +920,23 @@ Section cap_lang_rules.
927920
rewrite not_elem_of_list_to_set.
928921
rewrite elem_of_seq; solve_finz+.
929922
}
930-
split.
931923
{
932924
rewrite dom_union_L dom_insert_L -union_assoc_L -dom_union_L Hdomtbcompl.
933925
replace ( enumcur σ + 1) with (S (enumcur σ)) by lia.
934926
rewrite seq_S; simpl.
935927
rewrite list_to_set_app_L.
936928
set_solver+.
937929
}
938-
split.
939930
{ rewrite map_disjoint_insert_l; split; last done.
940931
rewrite -not_elem_of_dom.
941932
assert (enumcur σ ∉ dom prev_tb ∪ dom (etable σ)) as H'; last set_solver+H'.
942933
rewrite union_comm_L -dom_union_L Hdomtbcompl.
943934
rewrite not_elem_of_list_to_set.
944935
rewrite elem_of_seq; solve_finz+.
945936
}
946-
split.
947937
{ rewrite !insert_union_singleton_l.
948938
by rewrite map_union_assoc.
949939
}
950-
eapply Hcorr'.
951940
}
952941

953942
{ iApply ("Hφ" with "[$Hregs' $Hmem $HECv Hcur_frag Hall_frag]"). iLeft.

0 commit comments

Comments
 (0)