2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department, University of Bologna, Italy.
6 ||T|| HELM is free software; you can redistribute it and/or
7 ||A|| modify it under the terms of the GNU General Public License
8 \ / version 2 or (at your option) any later version.
9 \ / This software is distributed as is, NO WARRANTY.
10 V_______________________________________________________________ *)
12 module ET = RolesTypes
13 module EU = RolesUtils
18 let out_tag i tag h map och l =
19 let aux och = List.iter (map (succ i) och) l in
20 if h then Printf.fprintf och "%s(%s%t)\n" (indent i) tag aux
21 else Printf.fprintf och "%s(%s\n%t%s)\n" (indent i) tag aux (indent i)
23 let string_map f _i och x =
24 Printf.fprintf och " %S" (f x)
26 let out_stage i och v =
27 out_tag i "ver" true (string_map EU.string_of_stage) och [v]
29 let out_old i och os =
30 out_tag i "old" true (string_map EU.string_of_oobj) och os
32 let out_new i och ns =
33 out_tag i "new" true (string_map EU.string_of_nobj) och ns
35 let out_role i och r =
37 out_stage i och r.ET.rs;
38 out_old i och r.ET.ro;
41 out_tag i "rel" false map och [r]
43 let out_roles i och rs =
44 out_tag i "base" false out_role och rs
46 let out_status och st =
48 out_roles i och st.ET.sr;
49 out_stage i och st.ET.ss;
50 out_old i och st.ET.so;
51 out_new i och st.ET.sn
53 output_string och "roles:";
54 out_tag 0 "top" false map och [st]