1 (* Title: BaseDefinitions/refernces-def.sml
3 (c) due to copyright terms
5 References into Know_Store.
7 signature REFERENCES_DEFINITION =
9 type id (* will be specialised to Problem.id, MethodC.id *)
10 val id_to_string: id -> string
11 val empty_probl_id: id
13 val explode_id: string -> id
14 val implode_id: id -> string
18 val to_string: string * string list * string list -> string
20 val select : T -> T -> T
24 structure References_Def(**): REFERENCES_DEFINITION(**) =
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"];
33 val explode_id = space_explode "/";
34 val implode_id = space_implode "/";
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);
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);