2 imports "Isac.Build_Isac"
5 ML \<open>open ML_System\<close>
7 (*/-------------------------------------------------------- ! aktivate for Test_Isac BEGIN ---\*)
8 (* these vvv test, if funs are intermediately opened in structure
9 in case of errors here consider ~~/xtest-to-coding.sh *)
12 open Test_Code; CalcTreeTEST;
13 open LItool; arguments_from_model;
21 open Error_Pattern_Def;
23 open Ctree; append_problem;
29 open Auto_Prog; rule2stac;
36 open Solve; (* NONE *)
37 open ContextC; transfer_asms_from_to;
38 open Tactic; (* NONE *)
41 open P_Model; (* NONE *)
46 open Rule_Set; Sequence;
53 (*\--- ! aktivate for Test_Isac END ----------------------------------------------------------/*)
55 ML_file "BaseDefinitions/libraryC.sml"
57 section \<open>code for copy & paste ===============================================================\<close>
59 "~~~~~ fun xxx , args:"; val () = ();
60 "~~~~~ and xxx , args:"; val () = ();
61 "~~~~~ fun xxx \<longrightarrow>fun yyy \<longrightarrow>fun zzz , return:"; val () = ();
62 (*if*) (*then*); (*else*); (*case*) (*of*); (*return from xxx*);
64 ^ "xxx" (*+*) (*!for return!*) (*isa*) (*REP*) (**)
65 (*/------------------- step into XXXXX -----------------------------------------------------\*)
66 (*-------------------- stop step into XXXXX -------------------------------------------------*)
67 (*\------------------- step into XXXXX -----------------------------------------------------/*)
68 (*-------------------- contiue step into XXXXX ----------------------------------------------*)
69 (*/------------------- check entry to XXXXX ------------------------------------------------\*)
70 (*\------------------- check entry to XXXXX ------------------------------------------------/*)
71 (*/------------------- check within XXXXX --------------------------------------------------\*)
72 (*\------------------- check within XXXXX --------------------------------------------------/*)
73 (*/------------------- check result of XXXXX -----------------------------------------------\*)
74 (*\------------------- check result of XXXXX -----------------------------------------------/*)
76 (*/------------------- build new fun XXXXX -------------------------------------------------\*)
77 (*\------------------- build new fun XXXXX -------------------------------------------------/*)
85 declare [[show_types]]
86 declare [[show_sorts]]
87 find_theorems "?a <= ?a"
93 ML_command \<open>Pretty.writeln prt\<close>
94 declare [[ML_print_depth = 999]]
95 declare [[ML_exception_trace]]
98 section \<open>=============== test prove_vc for Problem + sprak_vc (KEEP!) ======================\<close>
100 (* requires startup with ./zcoding-to-test.sh ..*)
101 Example \<open>~~/src/Tools/isac/Examples/exp_Statics_Biegel_Timischl_7-70\<close>
103 spark_open \<open>~~/src/HOL/SPARK/Examples/Gcd/greatest_common_divisor/g_c_d\<close>
104 (*..Problem adds to spark..*)
105 Problem (*procedure_g_c_d_4*)("Biegelinie", ["Biegelinien"])
109 Given: "Traegerlaenge ", "Streckenlast "
110 Where: "q_0 ist_integrierbar_auf {| 0, L |}", "0 < L"
112 Relate: "Randbedingungen "
124 AT ABOVE "ML" WE HAVE:
125 Bad context for command "ML"\<^here> -- using reset state
126 ..CAUSED BY INSUFFICIENT SEQUENCE OF SPARK keywords here in this test sequence,
127 BUT spark_open + Problem ABOVE SHOWS NO ERROR -- THAT IS WHAT WE WANT DURING ADAPTATION!
130 (*//--------- SPARK keywords do work IF THERE IS NO spark_open ABOVE.. ----------------------\\* )
132 spark_proof_functions gcd = "gcd :: int \<Rightarrow> int \<Rightarrow> int"
136 spark_open \<open>~~/src/HOL/SPARK/Examples/Gcd/greatest_common_divisor/g_c_d\<close>
138 The following verification conditions remain to be proved:
143 spark_vc procedure_g_c_d_4 (*Bad context for command "spark_vc"\<^here> -- using reset state*)
145 spark_vc procedure_g_c_d_11
149 ( *Bad path binding: "$ISABELLE_HOME/src/HOL/SPARK/Examples/Gcd/greatest_common_divisor/g_c_d.prv"*)
151 ( *\\--------- SPARK keywords do work IF THERE IS NO spark_open ABOVE.. ----------------------//*)
153 subsection \<open>result Problem 1: got data from Example\<close>
157 {a = "//--- Spark_Commands.prove_vc", o_model =
158 [(1, [1], "#Given", Const ("Biegelinie.Traegerlaenge", "real \<Rightarrow> una"), [Free ("L", "real")]), (2, [1], "#Given", Const ("Biegelinie.Streckenlast", "real \<Rightarrow> una"), [Free ("q_0", "real")]),
159 (3, [1], "#Find", Const ("Biegelinie.Biegelinie", "(real \<Rightarrow> real) \<Rightarrow> una"), [Free ("y", "real \<Rightarrow> real")]),
160 (4, [1], "#Relate", Const ("Biegelinie.Randbedingungen", "bool list \<Rightarrow> una"),
161 [Const ("List.list.Cons", "bool \<Rightarrow> bool list \<Rightarrow> bool list") $ (Const ("HOL.eq", "real \<Rightarrow> real \<Rightarrow> bool") $ (Free ("y", "real \<Rightarrow> real") $ Free ("0", "real")) $ Free ("0", "real")) $
162 Const ("List.list.Nil", "bool list"),
163 Const ("List.list.Cons", "bool \<Rightarrow> bool list \<Rightarrow> bool list") $ (Const ("HOL.eq", "real \<Rightarrow> real \<Rightarrow> bool") $ (Free ("y", "real \<Rightarrow> real") $ Free ("L", "real")) $ Free ("0", "real")) $
164 Const ("List.list.Nil", "bool list"),
165 Const ("List.list.Cons", "bool \<Rightarrow> bool list \<Rightarrow> bool list") $ (Const ("HOL.eq", "real \<Rightarrow> real \<Rightarrow> bool") $ (Const ("Biegelinie.M'_b", "real \<Rightarrow> real") $ Free ("0", "real")) $ Free ("0", "real")) $
166 Const ("List.list.Nil", "bool list"),
167 Const ("List.list.Cons", "bool \<Rightarrow> bool list \<Rightarrow> bool list") $ (Const ("HOL.eq", "real \<Rightarrow> real \<Rightarrow> bool") $ (Const ("Biegelinie.M'_b", "real \<Rightarrow> real") $ Free ("L", "real")) $ Free ("0", "real")) $
168 Const ("List.list.Nil", "bool list")]),
169 (5, [1], "#undef", Const ("Biegelinie.FunktionsVariable", "real \<Rightarrow> una"), [Free ("x", "real")]),
170 (6, [1], "#undef", Const ("Biegelinie.GleichungsVariablen", "real list \<Rightarrow> una"),
171 [Const ("List.list.Cons", "real \<Rightarrow> real list \<Rightarrow> real list") $ Free ("c", "real") $ Const ("List.list.Nil", "real list"),
172 Const ("List.list.Cons", "real \<Rightarrow> real list \<Rightarrow> real list") $ Free ("c_2", "real") $ Const ("List.list.Nil", "real list"),
173 Const ("List.list.Cons", "real \<Rightarrow> real list \<Rightarrow> real list") $ Free ("c_3", "real") $ Const ("List.list.Nil", "real list"),
174 Const ("List.list.Cons", "real \<Rightarrow> real list \<Rightarrow> real list") $ Free ("c_4", "real") $ Const ("List.list.Nil", "real list")]),
175 (7, [1], "#undef", Const ("Biegelinie.AbleitungBiegelinie", "(real \<Rightarrow> real) \<Rightarrow> una"), [Free ("dy", "real \<Rightarrow> real")])],
176 refs = ("Biegelinie", ["Biegelinien"], ["IntegrierenUndKonstanteBestimmen2"])} (line 654 of "~~/src/Tools/isac/BridgeJEdit/Calculation.thy")
180 subsection \<open>result Problem 2: initial Specification parsed\<close>
182 Note: this kind of parsing is inappropriate with respect to integration:
183 the Position.T are dropped, so no feedback can be allocated.
187 ### Private_Output.report keyword1
188 {a = "//--- Spark_Commands.prove_vc", headline =
189 (((((("(", "Biegelinie"), ","), ["Biegelinien"]), ")"),
190 ((((("Specification", ":"),
191 ((((((((((((((("Model", (("", ""), "")), ":"), "Given"), ":"), ["<markup>", "<markup>"]), "Where"), ":"),
192 ["<markup>", "<markup>"]),
199 (("References", ":"), (((((((("RTheory", ":"), ""), "RProblem"), ":"), ["", ""]), "RMethod"), ":"), ["", ""])))),
203 "")} (line 677 of "~~/src/Tools/isac/BridgeJEdit/Calculation.thy")
204 {a = "prove_vc", i_model =
205 [(0, [], false, "#Given", Inc ((Const ("Biegelinie.Traegerlaenge", "real \<Rightarrow> una"), []), (Const ("empty", "??.'a"), []))),
206 (0, [], false, "#Given", Inc ((Const ("Biegelinie.Streckenlast", "real \<Rightarrow> una"), []), (Const ("empty", "??.'a"), []))),
207 (0, [], false, "#Find", Inc ((Const ("Biegelinie.Biegelinie", "(real \<Rightarrow> real) \<Rightarrow> una"), []), (Const ("empty", "??.'a"), []))),
208 (0, [], false, "#Relate",
209 Inc ((Const ("Biegelinie.Randbedingungen", "bool list \<Rightarrow> una"), []), (Const ("empty", "??.'a"), [])))],
211 [(1, [1], "#Given", Const ("Biegelinie.Traegerlaenge", "real \<Rightarrow> una"), [Free ("L", "real")]),
212 (2, [1], "#Given", Const ("Biegelinie.Streckenlast", "real \<Rightarrow> una"), [Free ("q_0", "real")]),
213 (3, [1], "#Find", Const ("Biegelinie.Biegelinie", "(real \<Rightarrow> real) \<Rightarrow> una"), [Free ("y", "real \<Rightarrow> real")]),
214 (4, [1], "#Relate", Const ("Biegelinie.Randbedingungen", "bool list \<Rightarrow> una"),
215 [Const ("List.list.Cons", "bool \<Rightarrow> bool list \<Rightarrow> bool list") $
216 (Const ("HOL.eq", "real \<Rightarrow> real \<Rightarrow> bool") $ (Free ("y", "real \<Rightarrow> real") $ Free ("0", "real")) $ Free ("0", "real")) $
217 Const ("List.list.Nil", "bool list"),
218 Const ("List.list.Cons", "bool \<Rightarrow> bool list \<Rightarrow> bool list") $
219 (Const ("HOL.eq", "real \<Rightarrow> real \<Rightarrow> bool") $ (Free ("y", "real \<Rightarrow> real") $ Free ("L", "real")) $ Free ("0", "real")) $
220 Const ("List.list.Nil", "bool list"),
221 Const ("List.list.Cons", "bool \<Rightarrow> bool list \<Rightarrow> bool list") $
222 (Const ("HOL.eq", "real \<Rightarrow> real \<Rightarrow> bool") $ (Const ("Biegelinie.M'_b", "real \<Rightarrow> real") $ Free ("0", "real")) $
223 Free ("0", "real")) $
224 Const ("List.list.Nil", "bool list"),
225 Const ("List.list.Cons", "bool \<Rightarrow> bool list \<Rightarrow> bool list") $
226 (Const ("HOL.eq", "real \<Rightarrow> real \<Rightarrow> bool") $ (Const ("Biegelinie.M'_b", "real \<Rightarrow> real") $ Free ("L", "real")) $
227 Free ("0", "real")) $
228 Const ("List.list.Nil", "bool list")]),
229 (5, [1], "#undef", Const ("Biegelinie.FunktionsVariable", "real \<Rightarrow> una"), [Free ("x", "real")]),
230 (6, [1], "#undef", Const ("Biegelinie.GleichungsVariablen", "real list \<Rightarrow> una"),
231 [Const ("List.list.Cons", "real \<Rightarrow> real list \<Rightarrow> real list") $ Free ("c", "real") $ Const ("List.list.Nil", "real list"),
232 Const ("List.list.Cons", "real \<Rightarrow> real list \<Rightarrow> real list") $ Free ("c_2", "real") $ Const ("List.list.Nil", "real list"),
233 Const ("List.list.Cons", "real \<Rightarrow> real list \<Rightarrow> real list") $ Free ("c_3", "real") $ Const ("List.list.Nil", "real list"),
234 Const ("List.list.Cons", "real \<Rightarrow> real list \<Rightarrow> real list") $ Free ("c_4", "real") $ Const ("List.list.Nil", "real list")]),
235 (7, [1], "#undef", Const ("Biegelinie.AbleitungBiegelinie", "(real \<Rightarrow> real) \<Rightarrow> una"), [Free ("dy", "real \<Rightarrow> real")])],
237 ("Biegelinie", ["Biegelinien"],
238 ["IntegrierenUndKonstanteBestimmen2"])} (line 690 of "~~/src/Tools/isac/BridgeJEdit/Calculation.thy")
239 ### Private_Output.report
240 ### Syntax_Phases.check_typs
242 ### Syntax_Phases.check_terms
246 section \<open>===================================================================================\<close>
253 section \<open>===================================================================================\<close>
260 section \<open>===================================================================================\<close>
267 section \<open>code for copy & paste ===============================================================\<close>
269 "~~~~~ fun xxx , args:"; val () = ();
270 "~~~~~ and xxx , args:"; val () = ();
271 "~~~~~ from xxx to yyy return val:"; val ((*yyy*)) = ((*xxx*));
272 (*if*) (*then*); (*else*); (*case*) (*of*); (*return value*);