Proof using.
intros. unfold doGenericServer in *.
repeat break_match; find_inversion;
use_applyEntries_spec; simpl in *;
subst; auto.
Qed.

(* Specifications: *)
Theorem handleTimeout_log :
forall h st out st' ps,
handleTimeout h st = (out, st', ps) ->
log st' = log st.
Lemma handleRequestVoteReply_spec :
forall h st h' t r st',
st' = handleRequestVoteReply h st h' t r ->
log st' = log st /\
(forall v, In v (votesReceived st) -> In v (votesReceived st')) /\
((currentTerm st' = currentTerm st /\ type st' = type st)
\/ type st' <> Candidate) /\
(type st <> Leader /\ type st' = Leader ->
(type st = Candidate /\ wonElection (dedup name_eq_dec
(votesReceived st')) = true)).
Lemma handleRequestVoteReply_matchIndex :
forall n st src t v,
type (handleRequestVoteReply n st src t v) = Leader ->
(type st = Leader /\ matchIndex (handleRequestVoteReply n st src t v) = matchIndex st) \/
(assoc_default name_eq_dec (matchIndex (handleRequestVoteReply n st src t v)) n 0
= maxIndex (log (handleRequestVoteReply n st src t v))).
Lemma handleClientRequest_term_votedFor :
forall h st client id c os st' m,
handleClientRequest h st client id c = (os, st', m) ->
type st' = type st /\
currentTerm st' = currentTerm st /\
votedFor st' = votedFor st.