let mcvar m r opt_cv=
debug "[mcvar] of %a" pp_root r;
match r with
| Cvar x ->
debug "[mcvar] case of mem"; M.cvar m x
| Lvar lv ->
debug "[mcvar] case of logic %a" !Ast_printer.d_logic_var lv;
let ty =
match lv.lv_type with
| Ctype ty -> ty
| ty -> Wp_parameters.fatal
"[mcvar] c type of a pure logic type %a"
!Ast_printer.d_logic_type ty
in
let obj = Ctypes.object_of ty in
match opt_cv with
| None ->
debug "[mcvar] case of none associated cvar";
let tau = Formula.Pointer (M.tau_of_loc) in
debug "[mcvar] called fresh";
let x = M.L.fresh lv.lv_name (Formula.Model tau) in
debug "[mcvar] binds %a to %a"
!Ast_printer.d_logic_var lv F.pp_var x ;
M.loc_of_term obj (F.var x)
| Some cx ->
debug "[mcvar] case of associated c varaible :%a" F.pp_var cx ;
M.loc_of_term obj (F.var cx)