Section WDFA_sgn.
Hypothesis wdfa_sgn: Dir->U->bool.
Definition wdfa_sgn_closed:=
forall d0 u0,
wdfa_sgn d0 u0 = true ->
forall u1 i0 d1,
wdfa u1 i0 = (u0,d1) ->
((d1*(Dir_to_Z d0)>=0)%Z /\
wdfa_sgn d0 u1 = true).

Lemma wdfa_sgn_spec:
wdfa_sgn_closed ->
forall ls u0 d1,
WDFA_match ls = (u0,d1) ->
forall d0,
wdfa_sgn d0 u0 = true ->
(d1*(Dir_to_Z d0)>=0)%Z.