Definition getStL n d (C : TPCCoh d) (pf : n \in nodes) : Log :=
match find log (getLocal n d) as f return _ = f -> _ with
Some v => fun epf => icast (sym_eq (cohStL C pf epf)) (dyn_val v)
| _ => fun epf => [::]
end (erefl _).

(* Specifications: *)
(* TODO: get rid of duplication *)
Lemma getStL_Kc n d (C : TPCCoh d) (pf : n \in nodes) (m : CStateT) (l : Log):
getLocal n d = st :-> m \+ log :-> l -> getStL C pf = l.
Lemma getStL_Kp n d (C : TPCCoh d) (pf : n \in nodes) (m : PStateT) (l : Log):
getLocal n d = st :-> m \+ log :-> l -> getStL C pf = l.
Lemma cn_in : cn \in nodes.
Lemma getStPE l n i j C C' pf :
n \in pts ->
getLocal n (getStatelet j l) = getLocal n (getStatelet i l) ->
@getStP n (getStatelet j l) C' pf = @getStP n (getStatelet i l) C pf.
Lemma getStLE l this i j pf pf' :
forall (N : this \in cn :: pts),
getLocal this (getStatelet j l) = getLocal this (getStatelet i l) ->
@getStL _ (getStatelet j l) pf' (cn_pts_in N) =
@getStL _ (getStatelet i l) pf (cn_pts_in N).