fact: Definition add_val s (gl : list N) b := let z := zeros b in if z =? 0 then None else let k := mmod s z in let s1 := mdiv s z in let le := N.of_nat (length gl) in let v1 := nth (N.to_nat (mmod s1 le)) gl 0 in let s2 := mdiv s1 le in let b1 := ireplace k (N.eqb 0) v1 b in Some (s2, b1).
imports: Ascii String List EqNat NArith