(* Utility functions *)
-let string_of_name =
+let ppname =
function
Cic.Name s -> s
| Cic.Anonymous -> "_"
| C.Meta (n,l1) ->
"?" ^ (string_of_int n) ^ "[" ^
String.concat " ; "
- (List.map (function None -> "_" | Some t -> pp t l) l1) ^
+ (List.rev_map (function None -> "_" | Some t -> pp t l) l1) ^
"]"
| C.Sort s ->
(match s with
)
| C.Cast (v,t) -> pp v l
| C.Lambda (b,s,t) ->
- "[" ^ string_of_name b ^ ":" ^ pp s l ^ "]" ^ pp t ((Some b)::l)
+ "[" ^ ppname b ^ ":" ^ pp s l ^ "]" ^ pp t ((Some b)::l)
| C.LetIn (b,s,t) ->
- "[" ^ string_of_name b ^ ":=" ^ pp s l ^ "]" ^ pp t ((Some b)::l)
+ "[" ^ ppname b ^ ":=" ^ pp s l ^ "]" ^ pp t ((Some b)::l)
| C.Appl li ->
"(" ^
(List.fold_right
(match context_entry with
Some (n,C.Decl at) ->
(separate i) ^
- string_of_name n ^ ":" ^ pp at name_context ^ " ",
+ ppname n ^ ":" ^ pp at name_context ^ " ",
(Some n)::name_context
| Some (n,C.Def (at,None)) ->
(separate i) ^
- string_of_name n ^ ":= " ^ pp at name_context ^ " ",
+ ppname n ^ ":= " ^ pp at name_context ^ " ",
(Some n)::name_context
| None ->
(separate i) ^ "_ :? _ ", None::name_context
(* Required only by the topLevel. It is the generalization of ppterm to *)
(* work with environments. *)
val pp : Cic.term -> (Cic.name option) list -> string
+
+val ppname : Cic.name -> string
+