Proof using.
unfold handleRequestVoteReply.
intros.
repeat break_match; repeat find_inversion; subst; simpl; intuition.
Qed.

Lemma handleRequestVoteReply_spec' :
forall h st h' t r st',
handleRequestVoteReply h st h' t r = st' ->
type st' = Follower \/
st' = st \/
type st' = Candidate \/
(type st' = Leader /\
type st = Candidate /\
log st' = log st /\
r = true /\
t = currentTerm st /\
wonElection (dedup name_eq_dec (h' :: votesReceived st)) = true /\
currentTerm st' = currentTerm st).