with End_of_file ->
!environment
+let aliases_of_environment env =
+ Environment.fold
+ (fun domain_item codomain_items acc ->
+ List.fold_left
+ (fun strings (dsc, _) ->
+ let s =
+ match domain_item with
+ | Id id -> GrafiteAst.Ident_alias (id, dsc)
+ | Symbol (symb, i) -> GrafiteAst.Symbol_alias (symb, i, dsc)
+ | Num i -> GrafiteAst.Number_alias (i, dsc)
+ in
+ s :: strings)
+ acc codomain_items)
+ env []
+
+let commands_of_environment env =
+ List.map
+ (fun alias -> GrafiteAst.Alias (dummy_floc, alias))
+ (aliases_of_environment env)
+
let pp_environment env =
- let aliases =
- Environment.fold
- (fun domain_item codomain_items acc ->
- List.fold_left
- (fun strings (dsc, _) ->
- let s =
- match domain_item with
- | Id id ->
- GrafiteAstPp.pp_alias (GrafiteAst.Ident_alias (id, dsc)) ^ "."
- | Symbol (symb, i) ->
- GrafiteAstPp.pp_alias (GrafiteAst.Symbol_alias (symb, i, dsc))
- ^ "."
- | Num i ->
- GrafiteAstPp.pp_alias (GrafiteAst.Number_alias (i, dsc)) ^ "."
- in
- s :: strings)
- acc codomain_items)
- env []
+ let aliases = aliases_of_environment env in
+ let strings =
+ List.map (fun alias -> GrafiteAstPp.pp_alias alias ^ ".") aliases
in
- String.concat "\n" (List.sort compare aliases)
+ String.concat "\n" (List.sort compare strings)
+
*)
val parse_environment: string -> DisambiguateTypes.environment
+
+val commands_of_environment:
+ DisambiguateTypes.environment ->
+ (CicNotationPt.term, GrafiteAst.obj) GrafiteAst.command list
+
val pp_environment: DisambiguateTypes.environment -> string
+