let add_array_reference_param x n = 
  oracle "[ByARef] first step + (%a,%d)" pp_var_type x n;
  try 
    if not (fst (ByAReference.find x) = n) then 
      (oracle "[ByARef] remove %a: ko arity" pp_var_type x;
       ByAReference.remove x ; ByValue.replace x ())
    else (oracle "[ByARef] (%a,%d) already" pp_var_type x n;()) 
  with Not_found ->
    oracle "[ByARef] %a not yet"pp_var_type x;
    if ByValue.mem x then 
      (oracle "[ByARef] not add %a : byValue" pp_var_type x; ())
    else
      begin 
        try let (_,calls) = ByPReference.find x in 
        oracle "[ByARef] %a in byPRef : promote to byAref"
          pp_var_type x;
        ByAReference.replace x (n,calls); ByPReference.remove x 
        with Not_found -> 
          (oracle "[ByARef] add (%a,%d)" pp_var_type x n;
           ByAReference.replace x (n,[]))
      end