Section WDFA.
Hypothesis wdfa:U->Σ->(U*Z).
Fixpoint WDFA_match(ls:Word):U*Z :=
match ls with
| nil => (U0,Z0)
| h::t => let (u,z) := WDFA_match t in
let (u',a) := wdfa u h in
(u',(z+a)%Z)
end.
Definition WDFA_pop(u0:U) :=
concat
(map (fun i0 =>
map (fun u1 => (u1,i0,snd (wdfa u1 i0))) (filter (fun u1 => U_eqb (fst (wdfa u1 i0)) u0) U_list))
Σ_list).

Lemma WDFA_pop_spec u0:
forall u1 i0 d1,
wdfa u1 i0 = (u0,d1) ->
In (u1,i0,d1) (WDFA_pop u0).