src/Tools/isac/BaseDefinitions/references-def.sml
author wneuper <Walther.Neuper@jku.at>
Fri, 27 May 2022 15:12:54 +0200
changeset 60428 203438ff792f
parent 60303 815b0dc8b589
child 60494 3dee3ec06f54
permissions -rw-r--r--
replace literals with constants
     1 (* Title:  BaseDefinitions/refernces-def.sml
     2    Author: Walther Neuper
     3    (c) due to copyright terms
     4 
     5 References into Know_Store.
     6 *)
     7 signature REFERENCES_DEFINITION =
     8 sig
     9   type id (* will be specialised to Problem.id, MethodC.id *)
    10   val id_to_string: id -> string
    11   val empty_probl_id: id
    12   val empty_meth_id: id
    13   val explode_id: string -> id
    14   val implode_id: id -> string
    15 
    16   type T
    17   val empty: T
    18   val to_string: string * string list * string list -> string
    19 
    20   val select : T -> T -> T
    21 end
    22 
    23 (**)
    24 structure References_Def(**): REFERENCES_DEFINITION(**) =
    25 struct
    26 (**)
    27 
    28 type id = string list;
    29 val id_to_string = strs2str;
    30 val empty_probl_id = ["empty_probl_id"];
    31 val empty_meth_id = ["empty_meth_id"];
    32 
    33 val explode_id = space_explode "/";
    34 val implode_id = space_implode "/";
    35 
    36 type T =    (* 3-dimensional universe of math knowledge:       *)
    37   ThyC.id * (* reference to a theory comprising definitions    *)
    38   id *      (* will become Problem.id; a reference into a tree *)
    39   id;       (* will become MethodC.id; a reference into a tree  *)
    40 fun to_string (dom, pbl, met) = 
    41   "(" ^ quote dom ^ ", " ^ strs2str pbl ^ ", " ^ strs2str met ^ ")";
    42 val empty = (ThyC.id_empty, empty_probl_id, empty_meth_id);
    43 
    44 (* select a Specification; if still unspecified take it from PblObj.origin *)
    45 fun select (odI, opI, omI) (dI, pI, mI) =
    46   (if dI = ThyC.id_empty then odI else dI,
    47    if pI = empty_probl_id then opI else pI,
    48    if mI = empty_meth_id then omI else mI);
    49 
    50 (**)end(**)