1 (* Title: Tools/isac/BridgeJEdit/preliminary.sml
2 Author: Walther Neuper, JKU Linz
3 (c) due to copyright terms
5 Preliminary code for start transition Libisabelle -- PIDE.
6 Will be distributed to several structures, most of which do not yet exist.
9 signature PRELIMINARY =
11 val store_and_show: Formalise.T list -> theory -> theory;
12 val load_formalisation: (Fdl_Lexer.T list -> ParseC.form_model_refs * 'a) ->
13 (theory -> Token.file list * theory) * 'c -> theory -> theory
15 (* ---- for tests only: shifted from below to remove the Warning "unused" at fun.def. --------- *)
16 (*/-------------------------------------------------------- ! aktivate for Test_Isac BEGIN ---\* )
17 ( *\--- ! aktivate for Test_Isac END ----------------------------------------------------------/*)
20 structure Refs_Data = Theory_Data
23 val empty : T = References.empty
25 fun merge (_, refs) = refs
27 structure OMod_Data = Theory_Data
32 fun merge (_, o_model) = o_model
34 structure Ctxt_Data = Theory_Data
36 type T = Proof.context
37 val empty : T = ContextC.empty
39 fun merge (_, ctxt) = ctxt
43 structure Preliminary(**): PRELIMINARY(**) =
47 fun store_and_show formalise thy =
49 (**)val file_read_correct = case formalise of xxx as
50 [(["Traegerlaenge L", "Streckenlast q_0", "Biegelinie y", "Randbedingungen [y 0 = (0::real), y L = 0, M_b 0 = 0, M_b L = 0]", "FunktionsVariable x", "GleichungsVariablen [c, c_2, c_3, c_4]", "AbleitungBiegelinie dy"],
51 ("Biegelinie", ["Biegelinien"], ["IntegrierenUndKonstanteBestimmen2"]))] => hd xxx
52 | _ => error "magic failed: handling file exp_Statics_Biegel_Timischl_7-70.str failed"
54 val formalise = hd formalise (*we expect only one Formalise.T in the list*)
55 val (hdlPIDE, _, refs, o_model, var_type_ctxt) = Step_Specify.initialisePIDE formalise
56 (* ^^ TODO remove with cleanup in nxt_specify_init_calc *)
58 TODO: present "Problem hdlPIDE" via PIDE
63 |> OMod_Data.put o_model
64 |> Ctxt_Data.put var_type_ctxt
68 fun load_formalisation parser (files, _) thy =
70 val ([{lines, pos, ...}: Token.file], thy') = files thy;
73 (ParseC.read_out_formalise (fst (parser (fst (ParseC.tokenize_formalise pos (cat_lines lines))))))
77 fun load_formalisation parse (files, _) thy =
79 val ([{lines, pos, ...}: Token.file], thy') = files thy;
82 |> ParseC.tokenize_formalise pos
86 |> ParseC.read_out_formalise
88 (** )val _ = @{print} {a = "### load_formalisation \<rightarrow>", formalise = formalise}( **)