let rec collect_apps_builtin targs = 
  let s = "[BuiltinCall]" in
  match targs with 
    | [] -> () 
    | t::args -> 
        (match by_array_reference_pattern_term t.term_node with 
           | Ok (x,b,n) ->
               debug "%s %a in array ref position with %s with dim = %d" 
                 s !Ast_printer.d_logic_var x (string_addr b) n;
               logic_param_memory_info x; 
               ok_array_term s (var_type_of_lvar x) n b Prop
           | Ko (x,_,_) -> 
               debug "%s %a is not in a array ref position"
                 s !Ast_printer.d_logic_var x ;
               let x = var_type_of_lvar x in 
               if is_formal_var_type x 
               then remove_array_reference_param x
               else ArgAReference.remove x
                 
           | Any -> 
               ( match by_pointer_reference_pattern_term t.term_node with 
                   | Ok (x,b,n) ->  
                       debug "%s %a in ptr ref position with %s with %d *" 
                         s !Ast_printer.d_logic_var x (string_addr b) n;
                       logic_param_memory_info x;
                       ok_pointer_term s (var_type_of_lvar x) n b Prop
                   | Ko (x,_,_) ->
                       debug "%s %a is not in a ptr ref position" 
                         s !Ast_printer.d_logic_var x ;
                       let x = var_type_of_lvar x in
                       if is_formal_var_type x 
                       then remove_ptr_reference_param x
                       else ArgPReference.remove x
                   | Any -> ()
               )
        ); collect_apps_builtin args