1 (* tactics, tacticals etc. for scripts
3 use_thy_only"Scripts/Script";
4 use_thy"../Scripts/Script";
8 Script = ListG + Tools +
12 ID (* identifiers for thy, ruleset,... *)
13 arg (* argument of subproblem *)
21 (*types of subproblems' arguments*)
23 real_list_ :: (real list) => arg
24 real_set_ :: (real set) => arg
26 bool_list_ :: (bool list) => arg
29 Rewrite :: "[ID, bool, 'a] => 'a"
30 Rewrite'_Inst:: "[(real * real) list, ID, bool, 'a] => 'a"
31 ("(Rewrite'_Inst (_ _ _))" 11)
32 (*without last argument ^^ for @@*)
33 Rewrite'_Set :: "[ID, bool, 'a] => 'a" ("(Rewrite'_Set (_ _))" 11)
35 :: "[(real * real) list, ID, bool, 'a] => 'a"
36 ("(Rewrite'_Set'_Inst (_ _ _))" 11)
37 (*without last argument ^^ for @@*)
38 Calculate :: "[ID, 'a] => 'a"
39 Substitute :: "[(real * real) list, 'a] => 'a"
40 Map :: "['a => 'b, 'a list] => 'b list"
41 Tac :: "ID => 'a" (*deprecated; only use in Test.ML*)
43 "['a list, 'b set] => 'a list"
44 ("Check'_elementwise (_ _)" 11)
46 SubProblem :: "[ID * ID list * ID list, arg list] => 'a"
47 Problem :: "[ID * ID list] => 'a"
49 Or'_to'_List :: "bool => 'a list" ("Or'_to'_List (_)" 11)
50 (*=========== record these ^^^ in 'tacs' in Script.ML =========*)
52 (*special formulas for frontend 'CAS format'*)
53 Subproblem :: "(ID * ID list) => 'a"
55 (*script-expressions (tacticals)*)
56 Seq :: "['a => 'a, 'a => 'a, 'a] => 'a" (infixr "@@" 10) (*@ used*)
57 Try :: "['a => 'a, 'a] => 'a"
58 Repeat :: "['a => 'a, 'a] => 'a"
59 Or :: "['a => 'a, 'a => 'a, 'a] => 'a" (infixr "Or" 10)
60 While :: "[bool, 'a => 'a, 'a] => 'a" ("((While (_) Do)//(_))" 9)
61 (*'b => bool doesn't work with "contains_root _"*)
62 Letpar :: "['a, 'a => 'b] => 'b"
63 (*--- defined in Isabelle/scr/HOL/HOL.thy:
64 Let :: "['a, 'a => 'b] => 'b"
65 "_Let" :: "[letbinds, 'a] => 'a" ("(let (_)/ in (_))" 10)
66 If :: "[bool, 'a, 'a] => 'a" ("(if (_)/ then (_)/ else (_))" 10)
67 %x. P x .. lambda is defined in Isabelles meta logic
71 failtac, idletac :: 'a
72 (*... + RECORD IN 'screxpr' in Script.ML *)
74 (*for scripts generated automatically from rls*)
75 Stepwise :: "['z, 'z] => 'z" ("((Script Stepwise (_ =))// (_))" 9)
76 Stepwise'_inst:: "['z,real,'z] => 'z"
77 ("((Script Stepwise'_inst (_ _ =))// (_))" 9)
80 (*SHIFT -> resp.thys ----vvv---------------------------------------------*)
81 (*script-names: initial capital letter,
82 type of last arg (=script-body) == result-type !
83 Xxxx :: script ids, duplicate result-type 'r in last argument:
88 (*make'_solution'_set :: "bool => bool list"
89 ("(make'_solution'_set (_))" 11)
92 :: "[ID * (ID list) * ID, bool,real,real set] => real"
93 ("(max'_on'_interval (_)/ (_ _ _))" 9)
95 :: "[ID * (ID list) * ID,
96 real,real,real,real,bool list] => bool list"
97 ("(find'_vals (_)/ (_ _ _ _ _))" 9)
99 make'_fun :: "[ID * (ID list) * ID, real,real,bool list] => bool"
100 ("(make'_fun (_)/ (_ _ _))" 9)
103 :: "[ID * (ID list) * ID, bool,real] => bool list"
104 ("(solve'_univar (_)/ (_ _ ))" 9)
106 :: "[ID * (ID list) * ID, bool,real,bool] => bool list"
107 ("(solve'_univar (_)/ (_ _ _))" 9)
112 ("((Script Testeq (_ =))// \
116 \ bool list] => bool list"
117 ("((Script Testeq2 (_ =))// \
120 Testterm :: "[real, \
122 ("((Script Testterm (_ =))// \
125 Testchk :: "[bool, real, \
126 \ real list] => real list"
127 ("((Script Testchk (_ _ =))// \
129 (*... + RECORD IN 'subpbls' in Script.ML *)
130 (*SHIFT -> resp.thys ----^^^----------------------------*)
134 "_Letpar" :: "[letbinds, 'a] => 'a" ("(letpar (_)/ in (_))" 10)
138 "_Letpar (_binds b bs) e" == "_Letpar b (_Letpar bs e)"
139 "letpar x = a in e" == "Letpar a (%x. e)"