new_name
in
let rec aux env term =
-(* prerr_endline ("ENV " ^ NotationPp.pp_env env); *)
match term with
| Ast.AttributedTerm (a, term) -> (*Ast.AttributedTerm (a, *)aux env term
| Ast.Appl terms -> Ast.Appl (List.map (aux env) terms)
and aux_meta_substs env meta_substs = List.map (aux_opt env) meta_substs
and aux_variable env = function
| Ast.NumVar name -> Ast.Num (Env.lookup_num env name, 0)
- | Ast.IdentVar name -> Ast.Ident (Env.lookup_string env name, None)
+ | Ast.IdentVar name ->
+ (match Env.lookup_string env name with
+ Env.Ident x -> Ast.Ident (x, None)
+ | Env.Var x -> Ast.Variable (Ast.IdentVar x))
| Ast.TermVar (name,(Ast.Level l|Ast.Self l)) ->
Ast.AttributedTerm (`Level l,Env.lookup_term env name)
| Ast.FreshVar name -> Ast.Ident (lookup_fresh_name name, None)