- freshno,Some(cast_to_i_var new_t),acc_new_ps
- with Bottom -> freshno, None, acc_new_ps
- | Pacman -> raise (Backtrack "Pacman in div")
+ (* backtrack if it is a number or a variable *)
+ match new_t with
+ | `N _ -> raise (Backtrack "div=`N")
+ | `Var _
+ | `I _ as new_t -> freshno, Some(new_t), acc_new_ps
+ with
+ | Bottom -> freshno, None, acc_new_ps
+ | Pacman -> raise (Backtrack "div=PAC")