walther@60096
|
1 |
(* Title: src/Tools/isac/BridgeJEdit/Calculation.thy
|
walther@60095
|
2 |
Author: Walther Neuper, JKU Linz
|
walther@60095
|
3 |
(c) due to copyright terms
|
walther@60095
|
4 |
|
walther@60121
|
5 |
Outer syntax for Isabelle/Isac's Calculation.
|
walther@60095
|
6 |
*)
|
walther@60095
|
7 |
|
walther@60095
|
8 |
theory Calculation
|
walther@60115
|
9 |
imports
|
walther@60149
|
10 |
(**) "~~/src/Tools/isac/Knowledge/Build_Thydata" (*remove after devel.of BridgeJEdit*)
|
walther@60149
|
11 |
(** )"~~/src/Tools/isac/MathEngine/MathEngine" ( *activate after devel.of BridgeJEdit*)
|
walther@60149
|
12 |
(**) "HOL-SPARK.SPARK" (*remove after devel.of BridgeJEdit*)
|
walther@60095
|
13 |
keywords
|
walther@60127
|
14 |
"Example" :: thy_load ("str") (* "spark_vc" :: thy_goal *)
|
walther@60132
|
15 |
and "Problem" :: thy_decl (* root-problem + recursively in Solution;
|
walther@60132
|
16 |
"spark_vc" :: thy_goal *)
|
walther@60162
|
17 |
and "Specification" "Model" "References" :: diag
|
walther@60162
|
18 |
and "Solution" :: thy_decl (* structure only *)
|
walther@60162
|
19 |
and "Where" "Given" "Find" "Relate" :: prf_decl (* await input of term, cp.from "from".."have" *)
|
walther@60162
|
20 |
(* ^^^^^^ :: before_command quasi_command thy_decl thy_defn thy_stmt diag prf_decl *)
|
walther@60158
|
21 |
(*and "Where" (* only output, preliminarily *)*)
|
walther@60162
|
22 |
and "RTheory" :: thy_decl (* await input of string; "R" distingues "Problem".."RProblem" *)
|
walther@60162
|
23 |
and "RProblem" "RMethod" :: thy_decl (* await input of string list *)
|
walther@60158
|
24 |
and "Tactic" (* optional for each step 0..end of calculation *)
|
walther@60095
|
25 |
begin
|
walther@60155
|
26 |
declare [[ML_print_depth = 99999]]
|
walther@60123
|
27 |
(**)ML_file parseC.sml(**)
|
walther@60146
|
28 |
(**)ML_file preliminary.sml(**)
|
walther@60146
|
29 |
|
walther@60095
|
30 |
|
walther@60123
|
31 |
section \<open>new code for Outer_Syntax Example, Problem, ...\<close>
|
walther@60123
|
32 |
text \<open>
|
walther@60156
|
33 |
code for Example, Problem shifted into structure Preliminary.
|
walther@60156
|
34 |
\<close>
|
walther@60123
|
35 |
|
walther@60151
|
36 |
subsubsection \<open>cp from Pure.thy\<close>
|
walther@60123
|
37 |
ML \<open>
|
walther@60156
|
38 |
\<close> ML \<open> (* for "from" ~~ "Given:" *)
|
walther@60151
|
39 |
(* original *)
|
walther@60151
|
40 |
val facts = Parse.and_list1 Parse.thms1;
|
walther@60151
|
41 |
facts: (Facts.ref * Token.src list) list list parser;
|
walther@60123
|
42 |
\<close> ML \<open>
|
walther@60151
|
43 |
val facts =
|
walther@60151
|
44 |
(writeln "####-## from parser";
|
walther@60151
|
45 |
Parse.$$$ ":" |-- Parse.and_list1 Parse.thms1)(** ) --| Parse.$$$ "Where"( **);
|
walther@60151
|
46 |
facts: (Facts.ref * Token.src list) list list parser;
|
walther@60151
|
47 |
\<close> ML \<open>
|
walther@60123
|
48 |
\<close> ML \<open>
|
walther@60148
|
49 |
\<close>
|
walther@60123
|
50 |
|
walther@60157
|
51 |
subsubsection \<open>tools to analyse parsing in Outer_Syntax >> \<close>
|
walther@60157
|
52 |
ML \<open>
|
walther@60157
|
53 |
\<close> text \<open> (*original basics.ML*)
|
walther@60157
|
54 |
op |>> : ('a * 'b) * ('a -> 'c) -> 'c * 'b;
|
walther@60157
|
55 |
fun (x, y) |>> f = (f x, y);
|
walther@60157
|
56 |
\<close> text \<open> (*original scan.ML*)
|
walther@60157
|
57 |
op >> : ('a -> 'b * 'c) * ('b -> 'd) -> 'a -> 'd * 'c; (*---vvv*)
|
walther@60157
|
58 |
fun (scan >> f) xs = scan xs |>> f;
|
walther@60157
|
59 |
\<close> ML \<open>
|
walther@60157
|
60 |
\<close> ML \<open> (*cp.from originals*)
|
walther@60157
|
61 |
infix 3 @>>;
|
walther@60157
|
62 |
fun (scan @>> f) xs = scan xs |>> f;
|
walther@60157
|
63 |
op @>> : ('a -> 'b * 'c) * ('b -> 'd) -> 'a -> 'd * 'c; (*---^^^*)
|
walther@60157
|
64 |
\<close> ML \<open> (*appl.to parser*)
|
walther@60157
|
65 |
op @>> : (Token.src -> 'b * Token.src) * ('b -> 'd) -> Token.src -> 'd * Token.src; (*---^^^*)
|
walther@60157
|
66 |
\<close> ML \<open>
|
walther@60157
|
67 |
\<close> ML \<open> (*add analysis*)
|
walther@60157
|
68 |
\<close> text \<open>
|
walther@60157
|
69 |
datatype T = Pos of (int * int * int) * Properties.T;
|
walther@60157
|
70 |
|
walther@60157
|
71 |
fun s_to_string (Pos ((line, offset, end_offset), _)) = ("Pos ((" ^
|
walther@60157
|
72 |
string_of_int line ^ ", " ^ string_of_int offset ^ ", " ^ string_of_int end_offset ^ "), [_])")
|
walther@60157
|
73 |
|
walther@60157
|
74 |
s_to_string: src -> string
|
walther@60157
|
75 |
\<close> text \<open>
|
walther@60157
|
76 |
datatype T = Token of (Symbol_Pos.text * Position.range) * (kind * string) * slot
|
walther@60157
|
77 |
\<close> ML \<open>
|
walther@60157
|
78 |
Token.pos_of; (*^^^^^^^^^^^^^^^*)
|
walther@60157
|
79 |
Token.end_pos_of; (*^^^^^^^^^^^^^*)
|
walther@60157
|
80 |
Token.unparse; (*^^^^^^^^^^^^^*)
|
walther@60157
|
81 |
\<close> ML \<open>
|
walther@60157
|
82 |
fun string_of_tok tok = ("\nToken ((" ^
|
walther@60157
|
83 |
Position.to_string (Token.pos_of tok) ^ ", " ^
|
walther@60157
|
84 |
Position.to_string (Token.end_pos_of tok) ^ "), " ^
|
walther@60157
|
85 |
Token.unparse tok ^ ", _)")
|
walther@60157
|
86 |
\<close> ML \<open>
|
walther@60157
|
87 |
fun string_of_toks toks = fold (curry op ^) (map string_of_tok toks |> rev |> separate ", ") "";
|
walther@60157
|
88 |
string_of_toks: Token.src -> string;
|
walther@60157
|
89 |
\<close> ML \<open>
|
walther@60157
|
90 |
Token.s_to_string: Token.src -> string; (*<-- string_of_toks WN*)
|
walther@60157
|
91 |
\<close> ML \<open>
|
walther@60157
|
92 |
fun (scan @>> f) xs = (@{print}{a = "_ >> ", toks = xs(*GIVES\<rightarrow>"?"*)}; scan xs) |>> f;
|
walther@60157
|
93 |
fun (scan @>> f) xs = (writeln ("toks= " ^ Token.s_to_string xs); scan xs) |>> f;
|
walther@60157
|
94 |
op @>> : (Token.src -> 'b * Token.src) * ('b -> 'd) -> Token.src -> 'd * Token.src; (*---^^^*)
|
walther@60157
|
95 |
\<close> ML \<open>
|
walther@60157
|
96 |
op @>> : (Token.T list -> 'a * 'b) * ('a -> 'c) -> Token.T list -> 'c * 'b
|
walther@60157
|
97 |
\<close> ML \<open>
|
walther@60157
|
98 |
\<close> ML \<open> (*Scan < Token in bootstrap, thus we take Token.s_to_string as argument of >> *)
|
walther@60157
|
99 |
infix 3 @@>>;
|
walther@60157
|
100 |
\<close> ML \<open>
|
walther@60157
|
101 |
fun ((write, scan) @@>> f) xs = (write xs; scan xs) |>> f;
|
walther@60157
|
102 |
op @@>> : (('a -> 'b) * ('a -> 'c * 'd)) * ('c -> 'e) -> 'a -> 'e * 'd
|
walther@60157
|
103 |
\<close> ML \<open>
|
walther@60157
|
104 |
\<close> ML \<open>
|
walther@60157
|
105 |
\<close> ML \<open>
|
walther@60157
|
106 |
\<close> ML \<open>
|
walther@60157
|
107 |
\<close>
|
walther@60157
|
108 |
|
walther@60157
|
109 |
|
walther@60148
|
110 |
subsubsection \<open>TODO\<close>
|
walther@60123
|
111 |
ML \<open>
|
walther@60123
|
112 |
\<close> ML \<open>
|
walther@60132
|
113 |
\<close> ML \<open>
|
walther@60157
|
114 |
\<close> ML \<open>
|
walther@60097
|
115 |
\<close>
|
walther@60097
|
116 |
|
walther@60153
|
117 |
section \<open>setup command_keyword + preliminary test\<close>
|
walther@60157
|
118 |
ML \<open>
|
walther@60103
|
119 |
\<close> ML \<open>
|
walther@60103
|
120 |
val _ =
|
walther@60117
|
121 |
Outer_Syntax.command \<^command_keyword>\<open>Example\<close> "start a Calculation from a Formalise-file"
|
walther@60117
|
122 |
(Resources.provide_parse_files "Example" -- Parse.parname
|
walther@60155
|
123 |
>> (Toplevel.theory o (*vvvvvvvvvvvvvvvvvvvv--- HACK makes test independent from session Isac*)
|
walther@60155
|
124 |
(Preliminary.load_formalisation @{theory Biegelinie} ParseC.formalisation)) );
|
walther@60155
|
125 |
\<close> ML \<open>
|
walther@60155
|
126 |
(Toplevel.theory o (Preliminary.load_formalisation @{theory Biegelinie} ParseC.formalisation))
|
walther@60155
|
127 |
:
|
walther@60155
|
128 |
(theory -> Token.file list * theory) * (*_a*)Token.T ->
|
walther@60155
|
129 |
Toplevel.transition -> Toplevel.transition
|
walther@60155
|
130 |
(* ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^*)
|
walther@60110
|
131 |
\<close> ML \<open>
|
walther@60123
|
132 |
val _ =
|
walther@60156
|
133 |
Outer_Syntax.command \<^command_keyword>\<open>Problem\<close>
|
walther@60123
|
134 |
"start a Specification, either from scratch or from preceding 'Example'"
|
walther@60156
|
135 |
(** )(ParseC.problem >> (Toplevel.theory o Preliminary.init_specify));( **)
|
walther@60157
|
136 |
(**)((writeln o Token.s_to_string, ParseC.problem_headline)
|
walther@60157
|
137 |
@@>> (Toplevel.theory o Preliminary.init_specify));(**)
|
walther@60123
|
138 |
\<close> ML \<open>
|
walther@60160
|
139 |
Preliminary.init_specify: ParseC.problem_headline -> theory -> theory;
|
walther@60160
|
140 |
(Toplevel.theory o Preliminary.init_specify)
|
walther@60160
|
141 |
: ParseC.problem_headline -> Toplevel.transition -> Toplevel.transition;
|
walther@60160
|
142 |
\<close> ML \<open>
|
walther@60156
|
143 |
(**) Preliminary.init_specify: ParseC.problem_headline -> theory -> theory;(**)
|
walther@60156
|
144 |
(* ^^^^^^ ^^^^^^*)
|
walther@60156
|
145 |
(**)(Toplevel.theory o Preliminary.init_specify):
|
walther@60156
|
146 |
ParseC.problem_headline -> Toplevel.transition -> Toplevel.transition;(**)
|
walther@60156
|
147 |
(* ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^*)
|
walther@60155
|
148 |
\<close> ML \<open>
|
walther@60161
|
149 |
\<close> ML \<open>
|
walther@60161
|
150 |
OMod_Data.get
|
walther@60161
|
151 |
\<close> ML \<open>
|
walther@60161
|
152 |
fun dummy (_(*":"*): string) thy =
|
walther@60161
|
153 |
let
|
walther@60161
|
154 |
val refs' = Refs_Data.get thy
|
walther@60161
|
155 |
val o_model = OMod_Data.get thy
|
walther@60161
|
156 |
val i_model = IMod_Data.get thy
|
walther@60161
|
157 |
val _ =
|
walther@60161
|
158 |
@{print} {a = "### dummy Specification", refs = refs', o_model = o_model, i_model = i_model}
|
walther@60161
|
159 |
in
|
walther@60161
|
160 |
thy
|
walther@60161
|
161 |
end;
|
walther@60161
|
162 |
\<close> ML \<open>
|
walther@60160
|
163 |
(Toplevel.theory o dummy): string -> Toplevel.transition -> Toplevel.transition
|
walther@60160
|
164 |
\<close> ML \<open>
|
walther@60158
|
165 |
val _ =
|
walther@60158
|
166 |
(*Outer_Syntax.command @{command_keyword ISAC} "embedded ISAC language"
|
walther@60158
|
167 |
(Parse.input Parse.cartouche >> (fn input =>
|
walther@60158
|
168 |
Toplevel.keep (fn _ => ignore (ML_Lex.read_source (*true*) input))))
|
walther@60160
|
169 |
*)Outer_Syntax.command \<^command_keyword>\<open>Specification\<close> "Specification dummy"
|
walther@60161
|
170 |
((writeln o Token.s_to_string, Parse.$$$ ":") @@>> (Toplevel.theory o dummy))
|
walther@60158
|
171 |
\<close> ML \<open>
|
walther@60158
|
172 |
val _ =
|
walther@60160
|
173 |
Outer_Syntax.command \<^command_keyword>\<open>Model\<close> "Model dummy"
|
walther@60161
|
174 |
((writeln o Token.s_to_string, Parse.$$$ ":") @@>> (Toplevel.theory o dummy))
|
walther@60155
|
175 |
\<close> ML \<open>
|
walther@60151
|
176 |
val _ =
|
walther@60151
|
177 |
Outer_Syntax.command \<^command_keyword>\<open>Given\<close> "input Given items to the Model of a Specification"
|
walther@60157
|
178 |
(* (facts >> (Toplevel.proof o Proof.from_thmss_cmd));*)
|
walther@60157
|
179 |
((writeln o Token.s_to_string, facts) @@>> (Toplevel.proof o Proof.from_thmss_cmd));
|
walther@60151
|
180 |
val _ =
|
walther@60158
|
181 |
Outer_Syntax.command \<^command_keyword>\<open>Where\<close> "input Find items to the Model of a Specification"
|
walther@60158
|
182 |
(facts @>> (Toplevel.proof o Proof.from_thmss_cmd));
|
walther@60158
|
183 |
val _ =
|
walther@60155
|
184 |
Outer_Syntax.command \<^command_keyword>\<open>Find\<close> "input Find items to the Model of a Specification"
|
walther@60157
|
185 |
(facts @>> (Toplevel.proof o Proof.from_thmss_cmd));
|
walther@60151
|
186 |
val _ =
|
walther@60151
|
187 |
Outer_Syntax.command \<^command_keyword>\<open>Relate\<close> "input Relate items to the Model of a Specification"
|
walther@60157
|
188 |
(facts @>> (Toplevel.proof o Proof.from_thmss_cmd));
|
walther@60151
|
189 |
\<close> ML \<open>
|
walther@60155
|
190 |
(Toplevel.proof o Proof.from_thmss_cmd)
|
walther@60155
|
191 |
:
|
walther@60155
|
192 |
(Facts.ref * Token.src list) list list -> Toplevel.transition -> Toplevel.transition
|
walther@60155
|
193 |
(* ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^*)
|
walther@60151
|
194 |
\<close> ML \<open>
|
walther@60158
|
195 |
val _ =
|
walther@60158
|
196 |
Outer_Syntax.command @{command_keyword References} "References dummy"
|
walther@60158
|
197 |
(Parse.$$$ ":" >> (fn _ => Toplevel.keep (fn _ => ignore (writeln ""))));
|
walther@60158
|
198 |
val _ =
|
walther@60158
|
199 |
Outer_Syntax.command @{command_keyword RTheory} "RTheory dummy"
|
walther@60158
|
200 |
(Parse.$$$ ":" -- Parse.string
|
walther@60158
|
201 |
>> (fn _ => Toplevel.keep (fn _ => ignore (writeln ""))));
|
walther@60158
|
202 |
val _ =
|
walther@60158
|
203 |
Outer_Syntax.command @{command_keyword RProblem} "RProblem dummy"
|
walther@60158
|
204 |
(Parse.$$$ ":" -- (Parse.$$$ "[" |-- Parse.list1 Parse.string --| Parse.$$$ "]")
|
walther@60158
|
205 |
>> (fn _ => Toplevel.keep (fn _ => ignore (writeln ""))));
|
walther@60158
|
206 |
val _ =
|
walther@60158
|
207 |
Outer_Syntax.command @{command_keyword RMethod} "RMethod dummy"
|
walther@60158
|
208 |
(Parse.$$$ ":" -- (Parse.$$$ "[" |-- Parse.list1 Parse.string --| Parse.$$$ "]")
|
walther@60158
|
209 |
>> (fn _ => Toplevel.keep (fn _ => ignore (writeln ""))));
|
walther@60158
|
210 |
val _ =
|
walther@60158
|
211 |
Outer_Syntax.command @{command_keyword Solution} "Solution dummy"
|
walther@60158
|
212 |
(Parse.$$$ ":" >> (fn _ => Toplevel.keep (fn _ => ignore (writeln ""))));
|
walther@60158
|
213 |
\<close> ML \<open>
|
walther@60158
|
214 |
\<close> ML \<open>
|
walther@60156
|
215 |
\<close> text \<open> NEWS 2014
|
walther@60156
|
216 |
* ML antiquotation @ {here} refers to its source position, which is
|
walther@60156
|
217 |
occasionally useful for experimentation and diagnostic purposes.
|
walther@60156
|
218 |
\<close> ML \<open>
|
walther@60156
|
219 |
@{here}(*val it = {offset=8, end_offset=12, id=-4402}: Position.T*)
|
walther@60151
|
220 |
\<close> ML \<open>
|
walther@60132
|
221 |
\<close>
|
walther@60103
|
222 |
|
walther@60153
|
223 |
subsection \<open>test runs with test-Example\<close>
|
walther@60151
|
224 |
(**)
|
walther@60151
|
225 |
Example \<open>/usr/local/isabisac/src/Tools/isac/Examples/exp_Statics_Biegel_Timischl_7-70\<close>
|
walther@60150
|
226 |
|
walther@60156
|
227 |
Problem ("Biegelinie", ["Biegelinien"])
|
walther@60156
|
228 |
(*1 collapse* )
|
walther@60161
|
229 |
Specification:
|
walther@60157
|
230 |
(*2 collapse*)
|
walther@60150
|
231 |
Model:
|
walther@60161
|
232 |
Given: "Traegerlaenge " "Streckenlast " (*Bad context for command "Given"\<^here> -- using reset state*)
|
walther@60158
|
233 |
Where: "q_0 ist_integrierbar_auf {| 0, L |}" "0 < L"
|
walther@60158
|
234 |
Find: "Biegelinie "
|
walther@60150
|
235 |
Relate: "Randbedingungen "
|
walther@60158
|
236 |
References:
|
walther@60156
|
237 |
(*3 collapse*)
|
walther@60162
|
238 |
RTheory: "" (*Bad context for command "RTheory"\<^here> -- using reset state*)
|
walther@60150
|
239 |
RProblem: ["", ""]
|
walther@60150
|
240 |
RMethod: ["", ""]
|
walther@60156
|
241 |
(*3 collapse*)
|
walther@60157
|
242 |
(*2 collapse*)
|
walther@60150
|
243 |
Solution:
|
walther@60161
|
244 |
( * 1 collapse*)
|
walther@60150
|
245 |
(*
|
walther@60150
|
246 |
compare click on above Given: "Traegerlaenge ", "Streckenlast "
|
walther@60150
|
247 |
with click on from \<open>0 < d\<close> in SPARK/../Greatest_Common_Divisorthy
|
walther@60150
|
248 |
*)
|
walther@60150
|
249 |
|
walther@60157
|
250 |
subsection \<open><Output> BY CLICK ON Problem..Given: Position, command-range?\<close>
|
walther@60159
|
251 |
subsubsection \<open>on Problem\<close>
|
walther@60157
|
252 |
text \<open>
|
walther@60157
|
253 |
-----------------v BEGIN ---------------vv END OF -----v
|
walther@60157
|
254 |
Token ((Pos ((0, 9, 10), [_]), Pos ((0, 10, 0), [_])), (, _),
|
walther@60157
|
255 |
Token ((Pos ((0, 10, 22), [_]), Pos ((0, 22, 0), [_])), "Biegelinie", _), //INCLUDING ""
|
walther@60157
|
256 |
Token ((Pos ((0, 22, 23), [_]), Pos ((0, 23, 0), [_])), ,, _),
|
walther@60157
|
257 |
Token ((Pos ((0, 24, 25), [_]), Pos ((0, 25, 0), [_])), [, _),
|
walther@60157
|
258 |
Token ((Pos ((0, 25, 38), [_]), Pos ((0, 38, 0), [_])), "Biegelinien", _),
|
walther@60157
|
259 |
Token ((Pos ((0, 38, 39), [_]), Pos ((0, 39, 0), [_])), ], _),
|
walther@60157
|
260 |
Token ((Pos ((0, 39, 40), [_]), Pos ((0, 40, 0), [_])), ), _)
|
walther@60157
|
261 |
{a = "//--- Spark_Commands.init_specify", headline =
|
walther@60157
|
262 |
(((("(", "Biegelinie"), ","), ["Biegelinien"]), ")")} (line 119 of "~~/src/Tools/isac/BridgeJEdit/preliminary.sml")
|
walther@60157
|
263 |
\<close>
|
walther@60159
|
264 |
subsubsection \<open>on Specification:\<close>
|
walther@60159
|
265 |
text \<open>
|
walther@60159
|
266 |
-----------------vv BEGIN ---------------vv END OF -----v
|
walther@60159
|
267 |
Token ((Pos ((0, 14, 15), [_]), Pos ((0, 15, 0), [_])), :, _)
|
walther@60159
|
268 |
Bad context for command "Specification" -- using reset state
|
walther@60159
|
269 |
\<close>
|
walther@60159
|
270 |
subsubsection \<open>on Model:\<close>
|
walther@60159
|
271 |
text \<open>
|
walther@60159
|
272 |
-----------------v BEGIN --------------v END OF -----v
|
walther@60159
|
273 |
Token ((Pos ((0, 6, 7), [_]), Pos ((0, 7, 0), [_])), :, _)
|
walther@60159
|
274 |
\<close>
|
walther@60159
|
275 |
subsubsection \<open>on Given:\<close>
|
walther@60157
|
276 |
text \<open>COMPARE Greatest_Common_Divisor.thy
|
walther@60157
|
277 |
subsubsection \<open>click on "from \<open>0 < d\<close>"\<close>
|
walther@60157
|
278 |
|
walther@60157
|
279 |
line * offset * end_offset
|
walther@60157
|
280 |
Symbol_Pos.text * Position.range)* (kind * string) * slot
|
walther@60157
|
281 |
-----------------------------------------------------------------------------------
|
walther@60157
|
282 |
Token ((Pos ((0, 6, 7), [_]), Pos ((0, 7, 0), [_])), :, _),
|
walther@60157
|
283 |
Token ((Pos ((0, 8, 24), [_]), Pos ((0, 24, 0), [_])), "Traegerlaenge ", _),
|
walther@60157
|
284 |
Token ((Pos ((0, 25, 40), [_]), Pos ((0, 40, 0), [_])), "Streckenlast ", _),
|
walther@60159
|
285 |
---------------------------------------------------------- ?WHY 2nd TURN..
|
walther@60159
|
286 |
Token ((Pos ((0, 6, 7), [_]), Pos ((0, 7, 0), [_])), :, _),
|
walther@60159
|
287 |
Token ((Pos ((0, 8, 24), [_]), Pos ((0, 24, 0), [_])), "Traegerlaenge ", _),
|
walther@60159
|
288 |
Token ((Pos ((0, 25, 40), [_]), Pos ((0, 40, 0), [_])), "Streckenlast ", _),
|
walther@60159
|
289 |
Token ((Pos ((0, 40, 0), [_]), Pos ((0, 0, 0), [_])), , _)
|
walther@60157
|
290 |
\<close>
|
walther@60159
|
291 |
subsubsection \<open>on Where:\<close>
|
walther@60159
|
292 |
text \<open>
|
walther@60159
|
293 |
toks=
|
walther@60159
|
294 |
Token ((Pos ((0, 6, 7), [_]), Pos ((0, 7, 0), [_])), :, _),
|
walther@60159
|
295 |
Token ((Pos ((0, 8, 45), [_]), Pos ((0, 45, 0), [_])), "q_0 ist_integrierbar_auf {| 0, L |}", _),
|
walther@60159
|
296 |
Token ((Pos ((0, 46, 53), [_]), Pos ((0, 53, 0), [_])), "0 < L", _)
|
walther@60159
|
297 |
toks=
|
walther@60159
|
298 |
Token ((Pos ((0, 6, 7), [_]), Pos ((0, 7, 0), [_])), :, _),
|
walther@60159
|
299 |
Token ((Pos ((0, 8, 45), [_]), Pos ((0, 45, 0), [_])), "q_0 ist_integrierbar_auf {| 0, L |}", _),
|
walther@60159
|
300 |
Token ((Pos ((0, 46, 53), [_]), Pos ((0, 53, 0), [_])), "0 < L", _),
|
walther@60159
|
301 |
Token ((Pos ((0, 53, 0), [_]), Pos ((0, 0, 0), [_])), , _)
|
walther@60159
|
302 |
\<close>
|
walther@60157
|
303 |
subsubsection \<open>on Find:\<close>
|
walther@60157
|
304 |
text \<open>
|
walther@60157
|
305 |
toks=
|
walther@60157
|
306 |
Token ((Pos ((0, 5, 6), [_]), Pos ((0, 6, 0), [_])), :, _),
|
walther@60157
|
307 |
Token ((Pos ((0, 7, 20), [_]), Pos ((0, 20, 0), [_])), "Biegelinie ", _)
|
walther@60157
|
308 |
toks=
|
walther@60157
|
309 |
Token ((Pos ((0, 5, 6), [_]), Pos ((0, 6, 0), [_])), :, _),
|
walther@60157
|
310 |
Token ((Pos ((0, 7, 20), [_]), Pos ((0, 20, 0), [_])), "Biegelinie ", _),
|
walther@60159
|
311 |
Token ((Pos ((0, 20, 0), [_]), Pos ((0, 0, 0), [_])), , _)
|
walther@60157
|
312 |
\<close>
|
walther@60157
|
313 |
subsubsection \<open>on Relate:\<close>
|
walther@60157
|
314 |
text \<open>
|
walther@60157
|
315 |
toks=
|
walther@60157
|
316 |
Token ((Pos ((0, 7, 8), [_]), Pos ((0, 8, 0), [_])), :, _),
|
walther@60159
|
317 |
Token ((Pos ((0, 9, 27), [_]), Pos ((0, 27, 0), [_])), "Randbedingungen ", _)
|
walther@60159
|
318 |
toks=
|
walther@60159
|
319 |
Token ((Pos ((0, 7, 8), [_]), Pos ((0, 8, 0), [_])), :, _),
|
walther@60157
|
320 |
Token ((Pos ((0, 9, 27), [_]), Pos ((0, 27, 0), [_])), "Randbedingungen ", _),
|
walther@60159
|
321 |
Token ((Pos ((0, 27, 0), [_]), Pos ((0, 0, 0), [_])), , _)
|
walther@60157
|
322 |
\<close>
|
walther@60159
|
323 |
subsubsection \<open>on References, RTheory, RProblem, RMethod, Solution:\<close>
|
walther@60159
|
324 |
text \<open>
|
walther@60159
|
325 |
NO OUTPUT
|
walther@60159
|
326 |
\<close>
|
walther@60157
|
327 |
|
walther@60157
|
328 |
|
walther@60157
|
329 |
subsection \<open><Output> BY CLICK ON Problem..Solution: session Isac\<close>
|
walther@60157
|
330 |
subsubsection \<open>(1)AFTER session Isac (after ./zcoding-to-test.sh)\<close>
|
walther@60116
|
331 |
text \<open>
|
walther@60150
|
332 |
Comparison of the two subsections below:
|
walther@60150
|
333 |
(1) <Output> AFTER session Isac (after ./zcoding-to-test.sh) WITH click on Problem..Specification:
|
walther@60150
|
334 |
((WHILE click ON Example SHOWS NO ERROR))
|
walther@60150
|
335 |
# headline = ..(1) == (2) ..PARSED + Specification
|
walther@60150
|
336 |
# i_model = Inc ..IN 4 ELEMENTS, (1) == (2) ..?!? FROM PARSED ?!?
|
walther@60150
|
337 |
# o_model = COMPLETE WITH 7 ELEMENTS ..FROM Example
|
walther@60150
|
338 |
# refs = ("Biegelinie", ["Biegelinien"], ["IntegrierenUndKonstanteBestimmen2"])..FROM References
|
walther@60107
|
339 |
|
walther@60150
|
340 |
(2) <Output> WITHOUT session Isac (after ./ztest-to-coding.sh) WITH click on Problem..Specification:
|
walther@60150
|
341 |
((WHILE click ON Example SHOWS !!! ERROR))
|
walther@60150
|
342 |
# headline = ..(1) == (2) ..PARSED + Specification
|
walther@60150
|
343 |
# i_model = Inc ..IN 4 ELEMENTS, (1) == (2) ..?!? FROM PARSED ?!?
|
walther@60150
|
344 |
# o_model = [] ..NO Example
|
walther@60150
|
345 |
# refs = ("Biegelinie", ["Biegelinien"], ["empty_meth_id"]) ..FROM headline ONLY
|
walther@60102
|
346 |
\<close>
|
walther@60129
|
347 |
|
walther@60150
|
348 |
subsubsection \<open>(2) WITHOUT session Isac (AFTER ./ztest-to-coding.sh)\<close>
|
walther@60150
|
349 |
text \<open>
|
walther@60156
|
350 |
{a = "//--- Spark_Commands.init_specify", headline =
|
walther@60150
|
351 |
(((((("(", "Biegelinie"), ","), ["Biegelinien"]), ")"),
|
walther@60150
|
352 |
((((("Specification", ":"),
|
walther@60150
|
353 |
((((((((((((((("Model", (("", ""), "")), ":"), "Given"), ":"), ["<markup>", "<markup>"]),
|
walther@60150
|
354 |
"Where"),
|
walther@60150
|
355 |
":"),
|
walther@60150
|
356 |
["<markup>", "<markup>"]),
|
walther@60150
|
357 |
"Find"),
|
walther@60150
|
358 |
":"),
|
walther@60150
|
359 |
"<markup>"),
|
walther@60150
|
360 |
"Relate"),
|
walther@60150
|
361 |
":"),
|
walther@60150
|
362 |
["<markup>"]),
|
walther@60150
|
363 |
(("References", ":"),
|
walther@60150
|
364 |
(((((((("RTheory", ":"), ""), "RProblem"), ":"), ["", ""]), "RMethod"), ":"), ["", ""])))),
|
walther@60150
|
365 |
"Solution"),
|
walther@60150
|
366 |
":"),
|
walther@60150
|
367 |
[])),
|
walther@60150
|
368 |
"")}
|
walther@60156
|
369 |
{a = "init_specify", i_model =
|
walther@60150
|
370 |
[(0, [], false, "#Given",
|
walther@60150
|
371 |
Inc ((Const ("Biegelinie.Traegerlaenge", "real \<Rightarrow> una"), []), (Const ("empty", "??.'a"), []))),
|
walther@60150
|
372 |
(0, [], false, "#Given",
|
walther@60150
|
373 |
Inc ((Const ("Biegelinie.Streckenlast", "real \<Rightarrow> una"), []), (Const ("empty", "??.'a"), []))),
|
walther@60150
|
374 |
(0, [], false, "#Find",
|
walther@60150
|
375 |
Inc ((Const ("Biegelinie.Biegelinie", "(real \<Rightarrow> real) \<Rightarrow> una"), []),
|
walther@60150
|
376 |
(Const ("empty", "??.'a"), []))),
|
walther@60150
|
377 |
(0, [], false, "#Relate",
|
walther@60150
|
378 |
Inc ((Const ("Biegelinie.Randbedingungen", "bool list \<Rightarrow> una"), []),
|
walther@60150
|
379 |
(Const ("empty", "??.'a"), [])))],
|
walther@60150
|
380 |
o_model = [], refs = ("Biegelinie", ["Biegelinien"], ["empty_meth_id"])}
|
walther@60150
|
381 |
### Proof_Context.gen_fixes
|
walther@60150
|
382 |
### Proof_Context.gen_fixes
|
walther@60150
|
383 |
### Proof_Context.gen_fixes
|
walther@60150
|
384 |
### Syntax_Phases.check_terms
|
walther@60150
|
385 |
### Syntax_Phases.check_typs
|
walther@60150
|
386 |
### Syntax_Phases.check_typs
|
walther@60150
|
387 |
### Syntax_Phases.check_typs
|
walther@60150
|
388 |
## calling Output.report
|
walther@60150
|
389 |
#### Syntax_Phases.check_props
|
walther@60150
|
390 |
### Syntax_Phases.check_terms
|
walther@60150
|
391 |
### Syntax_Phases.check_typs
|
walther@60150
|
392 |
### Syntax_Phases.check_typs
|
walther@60150
|
393 |
## calling Output.report
|
walther@60150
|
394 |
#### Syntax_Phases.check_props
|
walther@60150
|
395 |
### Syntax_Phases.check_terms
|
walther@60150
|
396 |
### Syntax_Phases.check_typs
|
walther@60150
|
397 |
### Syntax_Phases.check_typs
|
walther@60150
|
398 |
## calling Output.report
|
walther@60150
|
399 |
#### Syntax_Phases.check_props
|
walther@60150
|
400 |
### Syntax_Phases.check_terms
|
walther@60150
|
401 |
### Syntax_Phases.check_typs
|
walther@60150
|
402 |
### Syntax_Phases.check_typs
|
walther@60150
|
403 |
## calling Output.report
|
walther@60150
|
404 |
#### Syntax_Phases.check_props
|
walther@60150
|
405 |
### Syntax_Phases.check_terms
|
walther@60150
|
406 |
### Syntax_Phases.check_typs
|
walther@60150
|
407 |
### Syntax_Phases.check_typs
|
walther@60150
|
408 |
## calling Output.report
|
walther@60150
|
409 |
#### Syntax_Phases.check_props
|
walther@60150
|
410 |
### Syntax_Phases.check_terms
|
walther@60150
|
411 |
### Syntax_Phases.check_typs
|
walther@60150
|
412 |
### Syntax_Phases.check_typs
|
walther@60150
|
413 |
## calling Output.report
|
walther@60150
|
414 |
#### Syntax_Phases.check_props
|
walther@60150
|
415 |
### Syntax_Phases.check_terms
|
walther@60150
|
416 |
### Syntax_Phases.check_typs
|
walther@60150
|
417 |
### Syntax_Phases.check_typs
|
walther@60150
|
418 |
## calling Output.report
|
walther@60150
|
419 |
#### Syntax_Phases.check_props
|
walther@60150
|
420 |
### Syntax_Phases.check_terms
|
walther@60150
|
421 |
### Syntax_Phases.check_typs
|
walther@60150
|
422 |
### Syntax_Phases.check_typs
|
walther@60150
|
423 |
## calling Output.report
|
walther@60150
|
424 |
#### Syntax_Phases.check_props
|
walther@60150
|
425 |
### Syntax_Phases.check_terms
|
walther@60150
|
426 |
### Syntax_Phases.check_typs
|
walther@60150
|
427 |
### Syntax_Phases.check_typs
|
walther@60150
|
428 |
## calling Output.report
|
walther@60150
|
429 |
#### Syntax_Phases.check_props
|
walther@60150
|
430 |
### Syntax_Phases.check_terms
|
walther@60150
|
431 |
### Syntax_Phases.check_typs
|
walther@60150
|
432 |
### Syntax_Phases.check_typs
|
walther@60150
|
433 |
## calling Output.report
|
walther@60150
|
434 |
#### Syntax_Phases.check_props
|
walther@60150
|
435 |
### Syntax_Phases.check_terms
|
walther@60150
|
436 |
### Syntax_Phases.check_typs
|
walther@60150
|
437 |
### Syntax_Phases.check_typs
|
walther@60150
|
438 |
## calling Output.report
|
walther@60150
|
439 |
#### Syntax_Phases.check_props
|
walther@60150
|
440 |
### Syntax_Phases.check_terms
|
walther@60150
|
441 |
### Syntax_Phases.check_typs
|
walther@60150
|
442 |
### Syntax_Phases.check_typs
|
walther@60150
|
443 |
## calling Output.report
|
walther@60150
|
444 |
#### Syntax_Phases.check_props
|
walther@60150
|
445 |
### Syntax_Phases.check_terms
|
walther@60150
|
446 |
### Syntax_Phases.check_typs
|
walther@60150
|
447 |
### Syntax_Phases.check_typs
|
walther@60150
|
448 |
## calling Output.report
|
walther@60150
|
449 |
#### Syntax_Phases.check_props
|
walther@60150
|
450 |
### Syntax_Phases.check_terms
|
walther@60150
|
451 |
### Syntax_Phases.check_typs
|
walther@60150
|
452 |
### Syntax_Phases.check_typs
|
walther@60150
|
453 |
## calling Output.report
|
walther@60150
|
454 |
#### Syntax_Phases.check_props
|
walther@60150
|
455 |
### Syntax_Phases.check_terms
|
walther@60150
|
456 |
### Syntax_Phases.check_typs
|
walther@60150
|
457 |
### Syntax_Phases.check_typs
|
walther@60150
|
458 |
## calling Output.report
|
walther@60150
|
459 |
#### Syntax_Phases.check_props
|
walther@60150
|
460 |
### Syntax_Phases.check_terms
|
walther@60150
|
461 |
### Syntax_Phases.check_typs
|
walther@60150
|
462 |
### Syntax_Phases.check_typs
|
walther@60150
|
463 |
## calling Output.report
|
walther@60150
|
464 |
#### Syntax_Phases.check_props
|
walther@60150
|
465 |
### Syntax_Phases.check_terms
|
walther@60150
|
466 |
### Syntax_Phases.check_typs
|
walther@60150
|
467 |
### Syntax_Phases.check_typs
|
walther@60150
|
468 |
## calling Output.report
|
walther@60150
|
469 |
#### Syntax_Phases.check_props
|
walther@60150
|
470 |
### Syntax_Phases.check_terms
|
walther@60150
|
471 |
### Syntax_Phases.check_typs
|
walther@60150
|
472 |
### Syntax_Phases.check_typs
|
walther@60150
|
473 |
## calling Output.report
|
walther@60150
|
474 |
#### Syntax_Phases.check_props
|
walther@60150
|
475 |
### Syntax_Phases.check_terms
|
walther@60150
|
476 |
### Syntax_Phases.check_typs
|
walther@60150
|
477 |
### Syntax_Phases.check_typs
|
walther@60150
|
478 |
## calling Output.report
|
walther@60150
|
479 |
#### Syntax_Phases.check_props
|
walther@60150
|
480 |
### Syntax_Phases.check_terms
|
walther@60150
|
481 |
### Syntax_Phases.check_typs
|
walther@60150
|
482 |
### Syntax_Phases.check_typs
|
walther@60150
|
483 |
## calling Output.report
|
walther@60150
|
484 |
#### Syntax_Phases.check_props
|
walther@60150
|
485 |
### Syntax_Phases.check_terms
|
walther@60150
|
486 |
### Syntax_Phases.check_typs
|
walther@60150
|
487 |
### Syntax_Phases.check_typs
|
walther@60150
|
488 |
## calling Output.report
|
walther@60150
|
489 |
#### Syntax_Phases.check_props
|
walther@60150
|
490 |
### Syntax_Phases.check_terms
|
walther@60150
|
491 |
### Syntax_Phases.check_typs
|
walther@60150
|
492 |
### Syntax_Phases.check_typs
|
walther@60150
|
493 |
## calling Output.report
|
walther@60150
|
494 |
#### Syntax_Phases.check_props
|
walther@60150
|
495 |
### Syntax_Phases.check_terms
|
walther@60150
|
496 |
### Syntax_Phases.check_typs
|
walther@60150
|
497 |
### Syntax_Phases.check_typs
|
walther@60150
|
498 |
### Syntax_Phases.check_typs
|
walther@60150
|
499 |
## calling Output.report
|
walther@60150
|
500 |
#### Syntax_Phases.check_props
|
walther@60150
|
501 |
### Syntax_Phases.check_terms
|
walther@60150
|
502 |
### Syntax_Phases.check_typs
|
walther@60150
|
503 |
### Syntax_Phases.check_typs
|
walther@60150
|
504 |
### Syntax_Phases.check_typs
|
walther@60150
|
505 |
## calling Output.report
|
walther@60150
|
506 |
### Syntax_Phases.check_terms
|
walther@60150
|
507 |
### Syntax_Phases.check_typs
|
walther@60150
|
508 |
### Syntax_Phases.check_typs
|
walther@60150
|
509 |
### Syntax_Phases.check_typs
|
walther@60150
|
510 |
## calling Output.report
|
walther@60150
|
511 |
### Syntax_Phases.check_terms
|
walther@60150
|
512 |
### Syntax_Phases.check_typs
|
walther@60150
|
513 |
### Syntax_Phases.check_typs
|
walther@60150
|
514 |
### Syntax_Phases.check_typs
|
walther@60150
|
515 |
## calling Output.report
|
walther@60150
|
516 |
### Syntax_Phases.check_terms
|
walther@60150
|
517 |
### Syntax_Phases.check_typs
|
walther@60150
|
518 |
### Syntax_Phases.check_typs
|
walther@60150
|
519 |
### Syntax_Phases.check_typs
|
walther@60150
|
520 |
## calling Output.report
|
walther@60150
|
521 |
### Syntax_Phases.check_terms
|
walther@60150
|
522 |
### Syntax_Phases.check_typs
|
walther@60150
|
523 |
### Syntax_Phases.check_typs
|
walther@60150
|
524 |
### Syntax_Phases.check_typs
|
walther@60150
|
525 |
## calling Output.report
|
walther@60150
|
526 |
### Syntax_Phases.check_terms
|
walther@60150
|
527 |
### Syntax_Phases.check_typs
|
walther@60150
|
528 |
### Syntax_Phases.check_typs
|
walther@60150
|
529 |
### Syntax_Phases.check_typs
|
walther@60150
|
530 |
## calling Output.report
|
walther@60150
|
531 |
### Proof_Context.gen_fixes
|
walther@60150
|
532 |
### Proof_Context.gen_fixes
|
walther@60129
|
533 |
\<close>
|
walther@60104
|
534 |
|
walther@60148
|
535 |
section \<open>Notes: adapt spark_vc to Problem using Naproche as model\<close>
|
walther@60123
|
536 |
|
walther@60123
|
537 |
subsection \<open>survey on steps of investigation\<close>
|
walther@60119
|
538 |
text \<open>
|
walther@60132
|
539 |
We stopped step 3.4 going down from Outer_Syntax.local_theory_to_proof into proof.
|
walther@60132
|
540 |
Now we go the other way: Naproche checks the input via the Isabelle/server
|
walther@60132
|
541 |
and outputs highlighting, semantic annotations and errors via PIDE ---
|
walther@60132
|
542 |
and we investigate the output.
|
walther@60133
|
543 |
|
walther@60133
|
544 |
Investigation of Naproche showed, that annotations are ONLY sent bY
|
walther@60133
|
545 |
Output.report: string list -> unit, where string holds markup.
|
walther@60134
|
546 |
For Output.report @ {print} is NOT available, so we trace all respective CALLS.
|
walther@60134
|
547 |
However, NO @ {print} available in src/Pure is reached by "spark_vc procedure_g_c_d_4",
|
walther@60134
|
548 |
so tracing is done by writeln (which breaks build between Main and Complex_Main
|
walther@60134
|
549 |
by writing longer strings, see Pure/General/output.ML).
|
walther@60134
|
550 |
|
walther@60134
|
551 |
Tracing is implemented in (1) Isabelle_Naproche and in (2) isabisac in parallel;
|
walther@60134
|
552 |
(1) requires only Pure, thus is built quicker, but does NOT handle proofs within ML
|
walther@60134
|
553 |
(2) requires HOL.SPARK, there is full proof handling, but this is complex.
|
walther@60134
|
554 |
|
walther@60134
|
555 |
Tracing the calls of Output.report shows some properties of handling proofs,
|
walther@60134
|
556 |
see text in SPARK/Examples/Gcd/Greatest_Common_Divisor.thy.
|
walther@60119
|
557 |
\<close>
|
walther@60119
|
558 |
|
walther@60151
|
559 |
end(* HERE SEVERAL ERRORS SHOW UP, CAUSED FROM ABOVE..
|
walther@60151
|
560 |
"(1) outcomment before creating session Isac" ABOVE OTHERWISE YOU HAVE..
|
walther@60151
|
561 |
Bad context for command "end"\<^here> -- using reset state
|
walther@60151
|
562 |
Found the end of the theory, but the last SPARK environment is still open.
|
walther@60151
|
563 |
"(2) outcomment before creating session Isac" ABOVE OTHERWISE YOU HAVE..
|
walther@60157
|
564 |
ERROR:
|
walther@60151
|
565 |
Bad context for command "end"\<^here> -- using reset state*)
|