Proof using.
intros. unfold handleAppendEntries, advanceCurrentTerm in *.
repeat break_match; find_inversion; simpl in *; auto.
Qed.

(* Specifications: *)
Lemma handleAppendEntriesReply_clientCache:
forall h st (d : raft_data)
(m : list (name * msg)) (t : nat) (es : list entry)
(res : bool) h',
handleAppendEntriesReply h st h' t es res = (d, m) ->
clientCache d = clientCache st.
Lemma handleAppendEntriesReply_stateMachine:
forall h st (d : raft_data)
(m : list (name * msg)) (t : nat) (es : list entry)
(res : bool) h',
handleAppendEntriesReply h st h' t es res = (d, m) ->
stateMachine d = stateMachine st.
Theorem handleAppendEntries_votesReceived :
forall h st t n pli plt es ci st' ps,
handleAppendEntries h st t n pli plt es ci = (st', ps) ->
votesReceived st' = votesReceived st.
Theorem handleAppendEntriesReply_log_term_type :
forall h st n t es r st' ps,
handleAppendEntriesReply h st n t es r = (st', ps) ->
(log st' = log st /\ currentTerm st' = currentTerm st /\ type st' = type st) \/
type st' = Follower.