let call_res_and_add_post kf call_env res post p =
    let called_res_var = WpFol.lv_to_fol_var (Macros.result_var kf) in
    (* change the name of the result in the post
     * in order to avoid confusing it with current result 
     * Even with kf_res_var, because of recursive calls.
     * *)

    let new_var = (Fol.fresh_var called_res_var) in
    let called_res = Fol.Tvar new_var in
    let p = match res with None -> p
      | Some res -> assign_exp res (Some called_res) p
    in
    let do_post post p = 
      let post = replace_at_vars call_env (LogicLabel "Post") post in
      let post = replace_at_vars call_env (LogicLabel "Here") post in
      let post = subst_var called_res_var (Some (Fol.Tvar new_var)) post in
        Fol.pimplies (post, p)
    in
    let p = List.fold_right do_post post p in
    let p = MT.pred_forall ~fresh:false new_var p in
      p