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 (*TERM --> Const ("Pure.term", "RealDef.real => prop") (*!!!*) $
13 Free ("ttt", "RealDef.real")
14 term --> Free ("term", "RealDef.real => RealDef.real") $
15 Free ("ttt", "RealDef.real")
16 but 'term' is a keyword in *.thy*)
17 normalform :: "real => una"
20 Simplify :: "real => real" (*"Simplify (1+2a+3+4a)*)
21 Vereinfache :: "real => real" (*"Vereinfache (1+2a+3+4a)*)
24 SimplifyScript :: "[real, real] => real"
25 ("((Script SimplifyScript (_ =))// (_))" 9)
31 setup {* KEStore_Elems.add_pbts
32 [(Specify.prep_pbt thy "pbl_simp" [] Celem.e_pblID
34 [("#Given" ,["Term t_t"]),
35 ("#Find" ,["normalform n_n"])],
36 Celem.append_rls "xxxe_rlsxxx" Celem.e_rls [(*for preds in where_*)], SOME "Simplify t_t", [])),
37 (Specify.prep_pbt thy "pbl_vereinfache" [] Celem.e_pblID
39 [("#Given", ["Term t_t"]),
40 ("#Find", ["normalform n_n"])],
41 Celem.append_rls "xxxe_rlsxxx" Celem.e_rls [(*for preds in where_*)], SOME "Vereinfache t_t", []))] *}
44 setup {* KEStore_Elems.add_mets
45 [Specify.prep_met thy "met_tsimp" [] Celem.e_metID
47 [("#Given" ,["Term t_t"]),
48 ("#Find" ,["normalform n_n"])],
49 {rew_ord'="tless_true", rls'= Celem.e_rls, calc = [], srls = Celem.e_rls, prls=Celem.e_rls, crls = Celem.e_rls,
50 errpats = [], nrls = Celem.e_rls},
58 (*.function for handling the cas-input "Simplify (2*a + 3*a)":
59 make a model which is already in ctree-internal format.*)
60 (* val (h,argl) = strip_comb (str2term "Simplify (2*a + 3*a)");
61 val (h,argl) = strip_comb ((Thm.term_of o the o (parse (Thy_Info_get_theory "Simplify")))
62 "Simplify (2*a + 3*a)");
65 [((Thm.term_of o the o (TermC.parse thy)) "Term", t),
66 ((Thm.term_of o the o (TermC.parse thy)) "normalform",
67 [(Thm.term_of o the o (TermC.parse thy)) "N"])
69 (*| argl2dtss _ = error "Simplify.ML: wrong argument for argl2dtss"*);
71 setup {* KEStore_Elems.add_cas
72 [((Thm.term_of o the o (TermC.parse thy)) "Simplify",
73 (("Isac", ["simplification"], ["no_met"]), argl2dtss)),
74 ((Thm.term_of o the o (TermC.parse thy)) "Vereinfache",
75 (("Isac", ["vereinfachen"], ["no_met"]), argl2dtss))]*}