1 (* Title: BaseDefinitions/problem-def.sml
3 (c) due to copyright terms
5 Will be enhanced by Problem later.
7 signature PROBLEM_DEFINITION =
11 (*val e_Ptyp: T Store.node*)
12 val empty_store: T Store.node
13 (*val check_pblguh_unique: Check_Unique.guh -> T Store.T -> unit*)
14 val check_unique: Check_Unique.guh -> T Store.T -> unit
16 (* ---- for tests only: shifted from below to remove the Warning "unused" at fun.def. --------- *)
21 (*val pbts2str: T list -> string*)
22 val s_to_string: T list -> string
23 (*/-------------------------------------------------------- ! aktivate for Test_Isac BEGIN ---\* )
25 ( *\--- ! aktivate for Test_Isac END ----------------------------------------------------------/*)
29 structure Probl_Def(**): PROBLEM_DEFINITION(**) =
33 (*/------- to Celem5 -------\*)
35 {guh : Check_Unique.guh, (* unique within this isac-knowledge *)
36 mathauthors : string list, (* copyright *)
37 init : Spec.pblID, (* to start refinement with *)
38 thy : theory, (* which allows to compile that T
39 TODO: search generalized for subthy (ref.p.69*)
40 (*^^^ WN050912 NOT used during application of the problem,
41 because applied terms may be from 'subthy' as well as from super;
42 thus we take 'maxthy'; see match_ags ! *)
43 cas : term option, (* 'CAS-command' *)
44 met : Spec.metID list, (* methods solving the T *)
45 (*TODO: abstract to ?pre_model?...*)
46 prls : Rule_Set.T, (* for preds in where_ *)
47 where_ : term list, (* where - predicates *)
48 ppc : Celem4.pat list (* this is the model-pattern;
49 it contains "#Given","#Where","#Find","#Relate"-patterns
50 for constraints on identifiers see "fun cpy_nam" *)
52 val empty = {guh = "pbl_empty", mathauthors = [], init = Spec.e_pblID, thy = Thy_Info.get_theory "Pure",
53 cas = NONE, prls = Rule_Set.Empty, where_ = [], ppc = [], met = []} : T
54 fun pbt2str ({cas = cas', guh = guh', init = init', mathauthors = ma', met = met', ppc = ppc',
55 prls = prls', thy = thy', where_ = w'} : T)
56 = "{cas = " ^ (UnparseC.term_opt cas') ^ ", guh = \"" ^ guh' ^ "\", init = "
57 ^ (strs2str init') ^ ", mathauthors = " ^ (strs2str ma' |> quote) ^ ", met = "
58 ^ (strslist2strs met') ^ ", ppc = " ^ Celem4.pats2str ppc' ^ ", prls = "
59 ^ (Rule_Set.id prls' |> quote) ^ ", thy = {" ^ Context.theory_name thy' ^ "}, where_ = "
60 ^ (UnparseC.terms w') ^ "}" |> linefeed;
61 fun s_to_string pbts = map pbt2str pbts |> list2str;
62 (*\------- to Celem5 -------/*)
63 (*/------- to Celem5 -------\*)
64 val empty_store = Store.Node ("e_pblID", [empty], [])
65 type store = (T Store.node) list
66 (*\------- to Celem5 -------/*)
69 Check_Unique.message (Check_Unique.collect (#guh : T -> Check_Unique.guh));