(** The compilation function is obtained by iterating the [parmov_step] function.  To show that this iteration always terminates, we introduce the following measure over states. *)
Open Scope nat_scope.
Definition measure (st: state) : nat :=
match st with
| State mu sigma tau => 2 * List.length mu + List.length sigma
end.

Lemma measure_decreasing_1:
forall st st',
dtransition st st' -> measure st' < measure st.