let kind_of_num n = match n with 0 -> M0 | 1 -> M1 | 2 -> M2 | 3 -> M3
  | _ -> failwith "only a number between 0 and 3 is valid for wp model"