Proof using uii lmi aelli lci rri.
unfold state_machine_safety_host'. intros.
find_copy_apply_lem_hyp leader_completeness_invariant.
unfold leader_completeness in *. intuition.
unfold committed in *. break_exists. intuition.
repeat match goal with
| [ H : directly_committed _ ?e |- _ ] =>
try match goal with
| H' : context [ allEntries ] |- _ =>
match type of H' with
| context [ e ] => fail 3
end
end;
let Hnew := fresh "H" in
remember H as Hnew; unfold directly_committed in Hnew;
match goal with
| [ Heq : Hnew = H |- _ ] => clear Heq
end
end.
break_exists. intuition.
assert (NoDup nodes) by eauto using all_fin_NoDup.
match goal with
| H : NoDup nodes, _ : NoDup ?l1, _ : NoDup ?l2 |- _ =>
eapply pigeon with (l := nodes) (sub1 := l1) (sub2 := l2) in H
end; eauto using all_fin_all, name_eq_dec, div2_correct.
break_exists.
intuition.
repeat find_apply_hyp_hyp.
do 2 find_apply_lem_hyp all_entries_leader_logs_invariant; auto.
intuition; try solve [break_exists; intuition; find_false; eauto].
match goal with
| [ _ : eIndex ?e <= eIndex ?x, _ : eIndex ?e' <= eIndex ?x',
_ : In ?x ?l |- ?e = ?e' ] =>
cut (In e l /\ In e' l)
end;
[intros; intuition;
eapply uniqueIndices_elim_eq;
eauto using lift_uniqueIndices_log|].
intuition;
match goal with
| _ : In ?e ?l, _ : eIndex ?e <= eIndex ?x, _ : In ?x ?l' |- In ?e ?l' =>
assert (entries_match l l') as Hem by eauto using lift_entries_match;
specialize (Hem x x e)
end; intuition.
Qed.
Ltac copy_eapply_prop_hyp P Q :=
match goal with
| [ H : context [ P ], H' : context [ Q ] |- _ ] =>
copy_eapply H H'
end.

(* Specifications: *)
Lemma entries_contiguous :
forall net p t n pli plt es ci,
refined_raft_intermediate_reachable net ->
In p (nwPackets net) ->
pBody p = AppendEntries t n pli plt es ci ->
contiguous_range_exact_lo es pli.