1 (* Know_Store holds Knowledge and Exercises in Isac's Java front-end.
2 In the front-end knowledge comprises theories, problems and methods.
3 Elements of problems and methods are defined in theories alongside
4 the development of respective language elements.
5 The structure of methods and problems is independent from theories' deductive
6 structure. The respective structures are built in Build_Thydata.thy.
8 signature KESTORE_ELEMS =
10 val get_rlss: theory -> (Rule_Set.id * (ThyC.id * Rule_Set.T)) list
11 val add_rlss: (Rule_Set.id * (ThyC.id * Rule_Set.T)) list -> theory -> theory
12 val get_calcs: theory -> Eval.ml_from_prog list
13 val add_calcs: Eval.ml_from_prog list -> theory -> theory
17 structure Test_KEStore_Elems: KESTORE_ELEMS =
19 fun rls_eq ((id1, (thyID1, _)), (id2, (thyID2, _))) = id1 = id2 (*andalso thyID1 = thyID2*)
20 structure Data = Theory_Data (
21 type T = (Rule_Set.id * (ThyC.id * Rule_Set.T)) list;
24 val merge = merge rls_eq;
26 fun get_rlss thy = Data.get thy
27 fun add_rlss rlss = Data.map (curry (Library.merge rls_eq) rlss)
30 structure Data = Theory_Data (
31 type T = Eval.ml_from_prog list;
34 val merge = merge calc_eq;
36 fun get_calcs thy = Data.get thy
37 fun add_calcs calcs = Data.map (curry (Library.merge calc_eq) calcs)