src/Tools/isac/BaseDefinitions/method-def.sml
author wneuper <Walther.Neuper@jku.at>
Thu, 04 Aug 2022 12:48:37 +0200
changeset 60509 2e0b7ca391dc
parent 60475 4efa686417f0
child 60514 19bd2f740479
permissions -rw-r--r--
polish naming in Rewrite_Order
     1 (* Title:  BaseDefinitions/method-def.sml
     2    Author: Walther Neuper
     3    (c) due to copyright terms
     4 
     5 Here is a minimum of code required for Know_Store.thy.
     6 For main code see structure MethodC.
     7 *)
     8 signature METHOD_DEFINITION =
     9 sig
    10   type id = References_Def.id;
    11   val id_empty: id
    12   val id_to_string: id -> string
    13 
    14   type T
    15 (*type met*)
    16   val empty: T
    17 (*val e_met: T*)
    18   type store
    19 (*type mets*)
    20   val empty_store: T Store.node
    21 (*val e_Mets: T Store.node*)
    22   val check_unique: Check_Unique.id -> T Store.T -> unit
    23 (*val check_metguh_unique: Check_Unique.id -> T Store.T -> unit*)
    24 end
    25 
    26 (**)
    27 structure Meth_Def(**): METHOD_DEFINITION(**) =
    28 struct
    29 (**)
    30 
    31 type id = References_Def.id;
    32 val id_empty = References_Def.empty_meth_id;
    33 val id_to_string = References_Def.id_to_string;
    34 
    35 (* data for methods stored in 'methods'-database *)
    36 type T =                          (* TODO WN200620: review ---------------------vvvvv         *)
    37   {guh       : Check_Unique.id,   (* unique within Isac_Knowledge, for html-presentation      *)
    38   mathauthors: string list,       (* copyright                                                *)
    39   init       : References_Def.id, (* DEL: WN060721 pblID introduced mistakenly                *)
    40   rew_ord'   : Rewrite_Ord.id,    (* for ordered rewriting by Tactic.Rewrite                  *)
    41   erls       : Rule_Set.T,        (* for conditions in rewriting by Tactic.Rewrite            *)
    42   srls       : Rule_Set.T,        (* for evaluating Prog_Expr                                 *)
    43   crls       : Rule_Set.T,        (* DEL: for check_elementwise                               *)
    44   nrls       : Rule_Set.T,        (* for rewriting by Tactic.Rewrite                          *)
    45   errpats    : Error_Pattern_Def.T list, (* error patterns expected in this method            *)
    46   calc       : Rule_Def.calc list,(* ?DEL                                                     *)
    47   scr        : Rule.program,      (* filled in MethodC.prep_input                             *)
    48   prls       : Rule_Set.T,        (* for evaluation of preconditions in "#Where" on "#Given"  *)
    49   ppc        : Model_Pattern.T,   (* contains "#Given", "#Where", "#Find", "#Relate"
    50                                      for constraints on identifiers see "O_Model.copy_name"   *)
    51   pre        : term list          (* ? DEL, as soon as they are input interactively ?         *)
    52 	};
    53 val empty = {guh = "met_empty", mathauthors = [], init = id_empty, rew_ord' = Rewrite_Ord.id_empty,
    54 	erls = Rule_Set.empty, srls = Rule_Set.empty, prls = Rule_Set.empty, calc = [], crls = Rule_Set.empty,
    55 	errpats = [], nrls = Rule_Set.empty, ppc = [], pre = [], scr = Rule.Empty_Prog};
    56 val empty_store = Store.Node ("empty_meth_id", [empty],[]);
    57 
    58 type store = (T Store.node) list;
    59 
    60 val check_unique =
    61   Check_Unique.message (Check_Unique.collect (#guh: T -> Check_Unique.id));
    62 
    63 (**)end(**)