equal
deleted
inserted
replaced
4 Auxiliary functions for defining datatypes. |
4 Auxiliary functions for defining datatypes. |
5 *) |
5 *) |
6 |
6 |
7 signature DATATYPE_AUX = |
7 signature DATATYPE_AUX = |
8 sig |
8 sig |
9 val quiet_mode : bool ref |
9 type datatype_config |
10 val message : string -> unit |
10 val default_datatype_config : datatype_config |
|
11 val message : datatype_config -> string -> unit |
11 |
12 |
12 val add_path : bool -> string -> theory -> theory |
13 val add_path : bool -> string -> theory -> theory |
13 val parent_path : bool -> theory -> theory |
14 val parent_path : bool -> theory -> theory |
14 |
15 |
15 val store_thmss_atts : string -> string list -> attribute list list -> thm list list |
16 val store_thmss_atts : string -> string list -> attribute list list -> thm list list |
65 end; |
66 end; |
66 |
67 |
67 structure DatatypeAux : DATATYPE_AUX = |
68 structure DatatypeAux : DATATYPE_AUX = |
68 struct |
69 struct |
69 |
70 |
70 val quiet_mode = ref false; |
71 (* datatype option flags *) |
71 fun message s = if !quiet_mode then () else writeln s; |
72 |
|
73 type datatype_config = { strict: bool, flat_names: bool, quiet: bool }; |
|
74 val default_datatype_config : datatype_config = |
|
75 { strict = true, flat_names = false, quiet = false }; |
|
76 fun message ({ quiet, ...} : datatype_config) s = |
|
77 if quiet then () else writeln s; |
72 |
78 |
73 fun add_path flat_names s = if flat_names then I else Sign.add_path s; |
79 fun add_path flat_names s = if flat_names then I else Sign.add_path s; |
74 fun parent_path flat_names = if flat_names then I else Sign.parent_path; |
80 fun parent_path flat_names = if flat_names then I else Sign.parent_path; |
75 |
81 |
76 |
82 |