Section LeadersHaveLeaderLogsStrong.
Context {orig_base_params : BaseParams}.
Context {one_node_params : OneNodeParams orig_base_params}.
Context {raft_params : RaftParams orig_base_params}.
Context {rri : raft_refinement_interface}.
Proof using.
intros.
unfold handleRequestVoteReply, advanceCurrentTerm in *.
repeat break_match; try find_inversion; subst; simpl in *; intuition.
Qed.
Ltac start :=
red; unfold leaders_have_leaderLogs_strong; intros;
subst; simpl in *; find_higher_order_rewrite;
update_destruct; subst; rewrite_update; eauto; simpl in *.
Proof using.
intros. unfold handleAppendEntries, advanceCurrentTerm in *.
repeat break_match; find_inversion; auto.
Qed.
Proof using.
intros. unfold handleAppendEntriesReply, advanceCurrentTerm in *.
repeat break_match; find_inversion; auto.
Qed.
Proof using.
intros. unfold handleRequestVote, advanceCurrentTerm in *.
repeat break_match; find_inversion; auto.
Qed.
Proof using.
intros. unfold handleClientRequest in *.
repeat break_match; find_inversion; intuition eauto.
simpl in *. right. eexists; simpl in *; intuition eauto.
reflexivity.
Qed.
Proof using.
intros. unfold handleTimeout, tryToBecomeLeader in *.
repeat break_match; find_inversion; auto.
Qed.

Lemma doGenericServer_type :
forall h st os st' ms,
doGenericServer h st = (os, st', ms) ->
type st' = type st /\ currentTerm st' = currentTerm st /\ log st' = log st.