1 (* simplification of terms
2 author: Walther Neuper 050912
3 (c) due to copyright terms
6 theory Simplify imports Base_Tools 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)*)
27 setup \<open>KEStore_Elems.add_pbts
28 [(Problem.prep_input @{theory} "pbl_simp" [] Problem.id_empty
30 [("#Given" ,["Term t_t"]),
31 ("#Find" ,["normalform n_n"])],
32 Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], SOME "Simplify t_t", [])),
33 (Problem.prep_input @{theory} "pbl_vereinfache" [] Problem.id_empty
35 [("#Given", ["Term t_t"]),
36 ("#Find", ["normalform n_n"])],
37 Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)], SOME "Vereinfache t_t", []))]\<close>
40 setup \<open>KEStore_Elems.add_mets
41 [MethodC.prep_input @{theory} "met_tsimp" [] MethodC.id_empty
43 [("#Given" ,["Term t_t"]),
44 ("#Find" ,["normalform n_n"])],
45 {rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty, crls = Rule_Set.empty,
46 errpats = [], nrls = Rule_Set.empty},
54 (*.function for handling the cas-input "Simplify (2*a + 3*a)":
55 make a model which is already in ctree-internal format.*)
56 (* val (h,argl) = strip_comb (str2term "Simplify (2*a + 3*a)");
57 val (h,argl) = strip_comb ((Thm.term_of o the o (parse (Thy_Info_get_theory "Simplify")))
58 "Simplify (2*a + 3*a)");
61 [((Thm.term_of o the o (TermC.parse @{theory})) "Term", t),
62 ((Thm.term_of o the o (TermC.parse @{theory})) "normalform",
63 [(Thm.term_of o the o (TermC.parse @{theory})) "N"])
65 (*| argl2dtss _ = raise ERROR "Simplify.ML: wrong argument for argl2dtss"*);
67 setup \<open>KEStore_Elems.add_cas
68 [((Thm.term_of o the o (TermC.parse @{theory})) "Simplify",
69 (("Isac_Knowledge", ["simplification"], ["no_met"]), argl2dtss)),
70 ((Thm.term_of o the o (TermC.parse @{theory})) "Vereinfache",
71 (("Isac_Knowledge", ["vereinfachen"], ["no_met"]), argl2dtss))]\<close>