Definition config_weight (M: Cm1) : Config -> nat :=
fun '{| state := p; value := v |} => p + length M * v.

(* a non-terminating run of a counter machine has no duplicates *)
Theorem acyclicity {M: Cm1} {n: nat} {x: Config} :
not (halting M (Nat.iter n (step M) x)) ->
NoDup (map (fun i => Nat.iter i (step M) x) (seq 0 (2+n))).