let split meth p =
  let nb = Wp_parameters.SplitDim.get()
  in let max_depth = if nb < 0 then 0 (* <- do not prune the search *) else (2 + nb)
     and max_split = (* 2**|nb| *)
      try
        Big_int.int_of_big_int (Big_int.power_int_positive_int 2 (if nb < 0 then -nb else nb))
      with (Invalid_argument _ | Failure _) ->
        Wp_parameters.debug ~dkey "Invalid value for option %s@." Wp_parameters.SplitDim.name;
        0 (* <- do not split *)
  in
  let bag =
    match meth with
      | Mcfg.EffectAssigns -> dispatch max_depth max_split (p_unfold Env.empty p)
      | _ -> dispatch max_depth max_split p
  in let nb = Bag.length bag
      (* TODO:
         if the bag is not full and [max_depth]<>0
         then it could be possible to iter once more
         on the elements of the bag with [max_depth]=0 *)

  in if nb > 1 then
      Wp_parameters.debug ~dkey "Predicate splited into %d parts@." nb;
    bag