1 (* Title: BaseDefinitions/theoryC.sml
3 (c) due to copyright terms
5 Probably this structure can be dropped due to improved reflection in Isabelle.
7 signature THEORY_ISAC =
10 val cut_id: string -> id
12 val last_isabelle_thy: theory
13 val session_specify_names: id list
14 val session_interpret_names: id list
15 val get_theory: id -> theory (* restricted to Isac_Knowledge *)
16 val id_to_ctxt: id -> Proof.context
17 val to_ctxt: theory -> Proof.context (* inverse of Proof_Context.theory_of *)
20 val Isac: 'a -> theory
21 val parent_of: theory -> theory -> theory
22 val sub_common : theory * theory -> theory
24 (* ---- for tests only: shifted from below to remove the Warning "unused" at fun.def. --------- *)
26 (*/-------------------------------------------------------- ! aktivate for Test_Isac BEGIN ---\* )
27 val get_thy: id -> theory (* restricted to session Isac *)
28 ( *\--- ! aktivate for Test_Isac END ----------------------------------------------------------/*)
32 structure ThyC(**): THEORY_ISAC(**) =
37 fun cut_id dn = hd (space_explode "." dn);
39 val last_isabelle_thy = @{theory Complex_Main}
40 val session_specify_names = ["Specify", "MathEngBasic", "Input_Descript",
41 "ProgLang", "Auto_Prog", "Prog_Expr", "Tactical", "Prog_Tac", "Program", "ListC", "Calculate",
42 "BaseDefinitions", "Know_Store"]
43 val session_interpret_names = ["Interpret"]
45 if member op = session_specify_names thyID
46 then Thy_Info.get_theory ("Specify." ^ thyID)
47 else if member op = session_interpret_names thyID
48 then Thy_Info.get_theory ("Interpret." ^ thyID)
49 else Thy_Info.get_theory ("Isac." ^ thyID);
51 if thy = "empty_thy_id"
52 then (get_thy "Base_Tools") (*lower bound of Knowledge*)
53 else (get_thy thy) handle _ => raise ERROR ("ME_Isa: thy \"" ^ thy ^ "\" not in system");
55 fun id_to_ctxt thy' = Proof_Context.init_global (get_theory thy');
56 fun to_ctxt thy = Proof_Context.init_global thy;
58 val id_empty = "empty_thy_id";
59 fun Isac _ = Proof_Context.theory_of (id_to_ctxt "Isac_Knowledge");
61 fun parent_of thy1 thy2 = if Context.subthy (thy1, thy2) then thy2 else thy1;
63 fun sub_common (thy1, thy2) =
64 if Context.subthy (thy1, thy2) then
66 else if Context.subthy (thy2, thy1) then
68 else get_theory "Isac_Knowledge"