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

(* the weight of a configuration strictly increases until the counter machine halts *)
Lemma config_weight_step_monotone {M: Cm1} {x: Config} :
not (halting M x) -> config_weight M x < config_weight M (step M x).