1 (* simplification of terms
2 author: Walther Neuper 050912
3 (c) due to copyright terms
6 theory Simplify imports Atools begin
10 (*descriptions in the related problem*)
12 normalform :: "real => una"
15 Simplify :: "real => real" (*"Simplify (1+2a+3+4a)*)
16 Vereinfache :: "real => real" (*"Vereinfache (1+2a+3+4a)*)
19 SimplifyScript :: "[real, real] => real"
20 ("((Script SimplifyScript (_ =))// (_))" 9)
27 (prep_pbt thy "pbl_simp" [] e_pblID
29 [("#Given" ,["TERM t_t"]),
30 ("#Find" ,["normalform n_n"])
32 append_rls "e_rls" e_rls [(*for preds in where_*)],
37 (prep_pbt thy "pbl_vereinfache" [] e_pblID
39 [("#Given" ,["TERM t_t"]),
40 ("#Find" ,["normalform n_n"])
42 append_rls "e_rls" e_rls [(*for preds in where_*)],
43 SOME "Vereinfache t_t",
49 (prep_met thy "met_tsimp" [] e_metID
51 [("#Given" ,["TERM t_t"]),
52 ("#Find" ,["normalform n_n"])
54 {rew_ord'="tless_true",
59 crls = e_rls, nrls = e_rls},
65 (*.function for handling the cas-input "Simplify (2*a + 3*a)":
66 make a model which is already in ptree-internal format.*)
67 (* val (h,argl) = strip_comb (str2term "Simplify (2*a + 3*a)");
68 val (h,argl) = strip_comb ((term_of o the o (parse (theory "Simplify")))
69 "Simplify (2*a + 3*a)");
72 [((term_of o the o (parse thy)) "TERM", t),
73 ((term_of o the o (parse thy)) "normalform",
74 [(term_of o the o (parse thy)) "N"])
76 | argl2dtss _ = error "Simplify.ML: wrong argument for argl2dtss";
80 [((term_of o the o (parse thy)) "Simplify",
81 (("Isac", ["simplification"], ["no_met"]),
83 ((term_of o the o (parse thy)) "Vereinfache",
84 (("Isac", ["vereinfachen"], ["no_met"]),