comments on relation between files.
note: higher order functions might allow for re-union.
1 (* Title: BaseDefinitions/error-pattern-def.sml
3 (c) due to copyright terms
5 Here is a minimum of code required for theory Know_Store,
6 further code see structure Error_Pattern.
8 signature ERROR_PATTERN_DEFINITION =
11 type T = id * term list * thm list
12 val s_to_string : T list -> string
19 structure Error_Pattern_Def(**): ERROR_PATTERN_DEFINITION(**) =
23 type id = Rule_Def.errpatID
26 id (* one identifier for a list of patterns *)
27 * term list (* error patterns *)
28 * thm list (* thms related to error patterns; note that respective lhs
29 do not match (which reflects student's error).
30 fillpatterns are stored with these thms. *)
31 fun errpat2str (id, tms, thms) =
32 "(\"" ^ id ^ "\",\n" ^ UnparseC.terms tms ^ ",\n" ^ ThmC_Def.string_of_thms thms
33 fun s_to_string errpats = (strs2str' o (map errpat2str)) errpats
35 (* for (at least) 2 kinds of access:
36 (1) given an id, find the respective fill_in's (e.g. in fun find_fill_patterns)
37 (2) given a thm, find respective fill_in's *)
38 type fill_in_id = string
40 fill_in_id (* DESIGN ?TODO: give an order w.r.t difficulty ? *)
41 * term (* the pattern with fill-in gaps *)
42 * id; (* which the fill_in would be a help for
43 DESIGN ?TODO: list for several patterns ? *)