+ let rec aux = function
+ | Ast.Appl ts ->
+ Ast.AttributedTerm (`Level (Parser.apply_prec, Parser.apply_assoc),
+ Ast.Layout (Ast.Box ((Ast.HOV, true, true), List.map k ts)))
+ | Ast.Binder (`Forall, (Ast.Ident ("_", _), ty), body)
+ | Ast.Binder (`Pi, (Ast.Ident ("_", _), ty), body) ->
+ Ast.AttributedTerm (`Level (Parser.binder_prec, Parser.binder_assoc),
+ Ast.Layout (Ast.Box ((Ast.HV, false, true), [
+ aux_ty ty;
+ Ast.Layout (Ast.Box ((Ast.H, false, false), [
+ Ast.Literal (`Symbol "\\to"); k body]))])))
+ | Ast.Binder (binder_kind, (id, ty), body) ->
+ Ast.AttributedTerm (`Level (Parser.binder_prec, Parser.binder_assoc),
+ Ast.Layout (Ast.Box ((Ast.HV, false, true), [
+ Ast.Layout (Ast.Box ((Ast.H, false, false), [
+ Ast.Literal (`Symbol (resolve_binder binder_kind));
+ k id;
+ Ast.Literal (`Symbol ":");
+ aux_ty ty ]));
+ Ast.Layout (Ast.Box ((Ast.H, false, false), [
+ Ast.Literal (`Symbol ".");
+ k body ]))])))
+ | t -> CicNotationUtil.visit_ast ~special_k k t
+ and aux_ty = function
+ | None -> Ast.Literal (`Symbol "?")
+ | Some ty -> k ty