equal
deleted
inserted
replaced
3 Author: Markus Wenzel, TU Muenchen |
3 Author: Markus Wenzel, TU Muenchen |
4 |
4 |
5 Global contexts: session and theory. |
5 Global contexts: session and theory. |
6 *) |
6 *) |
7 |
7 |
8 signature CONTEXT = |
8 signature BASIC_CONTEXT = |
9 sig |
9 sig |
10 val get_session: unit -> string list |
10 val get_session: unit -> string list |
11 val add_session: string -> unit |
11 val add_session: string -> unit |
12 val reset_session: unit -> unit |
12 val reset_session: unit -> unit |
13 val get_context: unit -> theory |
13 val get_context: unit -> theory |
14 val context: theory -> unit |
14 val context: theory -> unit |
15 val reset_context: unit -> unit |
15 val reset_context: unit -> unit |
|
16 end; |
|
17 |
|
18 signature CONTEXT = |
|
19 sig |
|
20 include BASIC_CONTEXT |
|
21 val >> : (theory -> theory) -> unit |
16 end; |
22 end; |
17 |
23 |
18 structure Context: CONTEXT = |
24 structure Context: CONTEXT = |
19 struct |
25 struct |
20 |
26 |
39 |
45 |
40 fun context thy = current_theory := Some thy; |
46 fun context thy = current_theory := Some thy; |
41 fun reset_context () = current_theory := None; |
47 fun reset_context () = current_theory := None; |
42 |
48 |
43 |
49 |
|
50 nonfix >>; |
|
51 fun >> f = current_theory := Some (f (get_context ())); |
|
52 |
|
53 |
44 end; |
54 end; |
45 |
55 |
46 open Context; |
56 |
|
57 structure BasicContext: BASIC_CONTEXT = Context; |
|
58 open BasicContext; |