1 (* Title: BaseDefinitions/model-pattern.sml
3 (c) due to copyright terms
5 A pattern to be combined with a formalisation (Formalise.T) yielding an O_Model.T..
7 signature MODEL_PATTERN =
11 val to_string: single list -> string
13 type descriptor = term
14 val variables: T -> term list
15 (* ---- for tests only: shifted from below to remove the Warning "unused" at fun.def. --------- *)
16 val to_string': T -> string
17 (*/-------------------------------------------------------- ! aktivate for Test_Isac BEGIN ---\* )
19 ( *\--- ! aktivate for Test_Isac END ----------------------------------------------------------/*)
23 structure Model_Pattern(**): MODEL_PATTERN(**) =
27 (* the pattern for an item of a problems model or a methods guard *)
28 type m_field = string;
29 type descriptor = term;
31 (m_field * (* field Given, Find, Relate *)
32 (descriptor * (* for snd term *)
33 term)) (* id | arbitrary term *);
36 fun pat2str (field, (dsc, id)) = pair2str (field, pair2str (UnparseC.term dsc, UnparseC.term id));
37 fun to_string pats = (strs2str o (map pat2str)) pats;
38 fun pat2str' (field, (dsc, id)) = pair2str (field, pair2str (UnparseC.term dsc, UnparseC.term id)) ^ "\n";
39 fun to_string' pats = (strs2str o (map pat2str')) pats;
41 (* get the variables out of a pbl_; FIXME.WN.0311: is_copy_named ...obscure!!! *)
44 fun var_of_pbl_ (_, (_, t)) = t: term
45 in ((map var_of_pbl_)(* o (filter_out is_copy_named)*)) pbl_ end