[-Test_Isac] funpack: prep. replace ID::type by char string
1 (* Title: tactics, tacticals etc. for scripts
2 Author: Walther Neuper 000224
3 (c) due to copyright terms
6 theory Script imports Tools begin
9 ID (* identifiers for thy, ruleset,... *)
12 arg (* argument of subproblem *)
16 (*types of subproblems' arguments*)
18 REAL_LIST :: "(real list) => arg"
19 REAL_SET :: "(real set) => arg"
21 BOOL_LIST :: "(bool list) => arg"
22 REAL_REAL :: "(real => real) => arg"
25 Rewrite :: "[ID, bool, 'a] => 'a"
26 Rewrite'_Inst:: "[(real * real) list, ID, bool, 'a] => 'a"
27 ("(Rewrite'_Inst (_ _ _))" 11)
28 (*without last argument ^^ for @@*)
29 Rewrite'_Set :: "[char list, bool, 'a] => 'a" ("(Rewrite'_Set (_ _))" 11)
31 :: "[(real * real) list, ID, bool, 'a] => 'a"
32 ("(Rewrite'_Set'_Inst (_ _ _))" 11)
33 (*without last argument ^^ for @@*)
34 Calculate :: "[ID, 'a] => 'a" (*WN100816 PLUS, TIMES, POWER miss.in scr*)
35 Calculate1 :: "[ID, 'a] => 'a" (*FIXXXME: unknown to script-interpreter*)
37 (* WN0509 substitution now is rewriting by a list of terms (of type bool)
38 Substitute :: "[(real * real) list, 'a] => 'a"*)
39 Substitute :: "[bool list, 'a] => 'a"
41 Map :: "['a => 'b, 'a list] => 'b list"
43 "['a list, 'b set] => 'a list"
44 ("Check'_elementwise (_ _)" 11)
45 Take :: "'a => 'a" (*for non-var args as long as no 'o'*)
46 SubProblem :: "[char list * char list list * char list list, arg list] => 'a"
48 Or'_to'_List :: "bool => 'a list" ("Or'_to'_List (_)" 11)
49 (*=========== record these ^^^ in 'tacs' in Script.ML =========*)
52 Problem :: "[ID * ID list] => 'a"
54 (*special formulas for frontend 'CAS format'*)
55 Subproblem :: "(ID * ID list) => 'a"
57 (*script-expressions (tacticals)*)
58 Seq :: "['a => 'a, 'a => 'a, 'a] => 'a" (infixr "@@" 10) (*@ used*)
59 Try :: "['a => 'a, 'a] => 'a"
60 Repeat :: "['a => 'a, 'a] => 'a"
61 Or :: "['a => 'a, 'a => 'a, 'a] => 'a" (infixr "Or" 10)
62 While :: "[bool, 'a => 'a, 'a] => 'a" ("((While (_) Do)//(_))" 9)
63 (*WN100723 because of "Error in syntax translation" below...
64 (*'b => bool doesn't work with "contains_root _"*)
65 Letpar :: "['a, 'a => 'b] => 'b"
66 (*--- defined in Isabelle/scr/HOL/HOL.thy:
67 Let :: "['a, 'a => 'b] => 'b"
68 "_Let" :: "[letbinds, 'a] => 'a" ("(let (_)/ in (_))" 10)
69 If :: "[bool, 'a, 'a] => 'a" ("(if (_)/ then (_)/ else (_))" 10)
70 %x. P x .. lambda is defined in Isabelles meta logic
75 (*... + RECORD IN 'screxpr' in Script.ML *)
77 (*for scripts generated automatically from rls*)
78 Stepwise :: "['z, 'z] => 'z" ("((Script Stepwise (_ =))// (_))" 9)
79 Stepwise'_inst:: "['z,real,'z] => 'z"
80 ("((Script Stepwise'_inst (_ _ =))// (_))" 9)
83 (*SHIFT -> resp.thys ----vvv---------------------------------------------*)
84 (*script-names: initial capital letter,
85 type of last arg (=script-body) == result-type !
86 Xxxx :: script ids, duplicate result-type 'r in last argument:
91 (*make'_solution'_set :: "bool => bool list"
92 ("(make'_solution'_set (_))" 11)
95 :: "[ID * (ID list) * ID, bool,real,real set] => real"
96 ("(max'_on'_interval (_)/ (_ _ _))" 9)
98 :: "[ID * (ID list) * ID,
99 real,real,real,real,bool list] => bool list"
100 ("(find'_vals (_)/ (_ _ _ _ _))" 9)
102 make'_fun :: "[ID * (ID list) * ID, real,real,bool list] => bool"
103 ("(make'_fun (_)/ (_ _ _))" 9)
106 :: "[ID * (ID list) * ID, bool,real] => bool list"
107 ("(solve'_univar (_)/ (_ _ ))" 9)
109 :: "[ID * (ID list) * ID, bool,real,bool] => bool list"
110 ("(solve'_univar (_)/ (_ _ _))" 9)
113 Testeq :: "[bool, bool] => bool"
114 ("((Script Testeq (_ =))// (_))" 9)
116 Testeq2 :: "[bool, bool list] => bool list"
117 ("((Script Testeq2 (_ =))// (_))" 9)
119 Testterm :: "[real, real] => real"
120 ("((Script Testterm (_ =))// (_))" 9)
122 Testchk :: "[bool, real, real list] => real list"
123 ("((Script Testchk (_ _ =))// (_))" 9)
124 (*... + RECORD IN 'subpbls' in Script.ML *)
125 (*SHIFT -> resp.thys ----^^^----------------------------*)
130 "_Letpar" :: "[letbinds, 'a] => 'a" ("(letpar (_)/ in (_))" 10)
134 "_Letpar (_binds b bs) e" == "_Letpar b (_Letpar bs e)"
135 "letpar x = a in e" == "Letpar a (%x. e)"
136 *** Error in syntax translation rule: rhs contains extra variables
137 *** ("_Letpar" ("_bind" x a) e) -> (Letpar a ("_abs" x e))
138 *** At command "translations" (line 140 of "/usr/local/isabisac/src/Pure/isac/Scripts/Script").