test/Tools/isac/ADDTESTS/accumulate-val/lucas_interpreter.sml
author wneuper <Walther.Neuper@jku.at>
Wed, 24 Aug 2022 19:02:19 +0200
changeset 60539 ae95769de108
parent 60538 b44ed7b738f4
child 60609 5967b6e610b5
permissions -rw-r--r--
use Eval.* instead of Eval_Def.* wherever possible
     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.
     7 *)
     8 signature KESTORE_ELEMS =
     9 sig
    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
    14   (*etc*)
    15 end;                               
    16 
    17 structure Test_KEStore_Elems: KESTORE_ELEMS =
    18 struct
    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;
    22     val empty = [];
    23     val extend = I;
    24     val merge = merge rls_eq;
    25     );  
    26   fun get_rlss thy = Data.get thy
    27   fun add_rlss rlss = Data.map (curry (Library.merge rls_eq) rlss)
    28 
    29   val calc_eq = rls_eq
    30   structure Data = Theory_Data (
    31     type T = Eval.ml_from_prog list;
    32     val empty = [];
    33     val extend = I;
    34     val merge = merge calc_eq;
    35     );                                                              
    36   fun get_calcs thy = Data.get thy
    37   fun add_calcs calcs = Data.map (curry (Library.merge calc_eq) calcs)
    38 
    39   (*etc*)
    40 end;