Proof using rmri miaei.
unfold commit_invariant.
simpl. intros. break_and.
apply and_imp_2.
split.
- find_apply_lem_hyp doLeader_spec. break_or_hyp.
+ break_and.
unfold commit_invariant_host in *. simpl. intros. repeat find_higher_order_rewrite.
eapply lifted_committed_ext' with (ps := nwPackets net) (st := nwState net).
* intros. subst. repeat find_higher_order_rewrite.
match goal with
| [ |- context [ update _ _ ?x _ ?y ] ] =>
destruct (name_eq_dec x y); subst; rewrite_update
end; auto.
* match goal with
| [ H : nwState ?net ?h = (?x, ?y) |- _ ] =>
replace x with (fst (nwState net h)) in * by (rewrite H; auto);
replace y with (snd (nwState net h)) in * by (rewrite H; auto);
clear H
end.
destruct net. simpl in *. auto.
update_destruct_simplify; auto.
+ break_and.
unfold commit_invariant_host in *.
simpl. intros. repeat find_higher_order_rewrite.
match goal with
| [ H : nwState ?net ?h = (?x, ?y) |- _ ] =>
replace x with (fst (nwState net h)) in * by (rewrite H; auto);
replace y with (snd (nwState net h)) in * by (rewrite H; auto);
clear H
end.
match goal with
| [ H : context [ update _ _ ?x _ ?y ] |- _ ] =>
destruct (name_eq_dec x y); subst; rewrite_update
end.
* { eapply lifted_committed_log_allEntries_preserved.
- simpl. find_rewrite. eapply lifted_advanceCommitIndex_lifted_committed; auto.
+ simpl in *. repeat find_rewrite. auto.
+ simpl in *. repeat find_rewrite. auto.
- simpl. intros. find_higher_order_rewrite.
update_destruct_simplify.
+ repeat find_rewrite. auto.
+ auto.
- simpl. intros. find_higher_order_rewrite.
update_destruct_simplify; auto.
}
* { eapply lifted_committed_log_allEntries_preserved; eauto.
+ simpl. intros. find_higher_order_rewrite. update_destruct_simplify; repeat find_rewrite; auto.
+ simpl. intros. find_higher_order_rewrite. update_destruct_simplify; repeat find_rewrite; auto.
}
- intros Hhostpost.
unfold commit_invariant_nw in *.
simpl. intros.
find_apply_hyp_hyp.
intuition.
+ (* old packet *)
eapply_prop_hyp In In; eauto.
eauto using doLeader_preserves_committed.
+ (* new packet *)
do_in_map. subst. simpl in *.
unfold add_ghost_msg in *.
do_in_map. subst. simpl in *.
find_copy_eapply_lem_hyp doLeader_message_lci; eauto.
find_copy_eapply_lem_hyp doLeader_message_term; eauto.
unfold write_ghost_log in *.
simpl in *.
unfold commit_invariant_host in *.
simpl in *.
specialize (Hhostpost h e).
subst.
repeat find_higher_order_rewrite.
repeat rewrite_update.
simpl in *.
intuition.
Qed.

(* Specifications: *)
Lemma doGenericServer_preserves_committed :
forall (net net' : ghost_log_network) h out st' ms e t,
doGenericServer h (snd (nwState net h)) = (out, st', ms) ->
(forall h', nwState net' h' = update name_eq_dec (nwState net) h (fst (nwState net h), st') h') ->
lifted_committed net e t ->
lifted_committed net' e t.