neuper@37906
|
1 |
(* simplification of terms
|
neuper@37906
|
2 |
author: Walther Neuper 050912
|
neuper@37906
|
3 |
(c) due to copyright terms
|
neuper@37906
|
4 |
|
neuper@37947
|
5 |
use"Knowledge/Simplify.ML";
|
neuper@37906
|
6 |
use"Simplify.ML";
|
neuper@37906
|
7 |
*)
|
neuper@37906
|
8 |
|
neuper@37906
|
9 |
|
neuper@37906
|
10 |
(** interface isabelle -- isac **)
|
neuper@37906
|
11 |
|
neuper@37906
|
12 |
theory' := overwritel (!theory', [("Simplify.thy",Simplify.thy)]);
|
neuper@37906
|
13 |
|
neuper@37906
|
14 |
(** problems **)
|
neuper@37906
|
15 |
|
neuper@37906
|
16 |
store_pbt
|
neuper@37906
|
17 |
(prep_pbt Simplify.thy "pbl_simp" [] e_pblID
|
neuper@37906
|
18 |
(["simplification"],
|
neuper@37906
|
19 |
[("#Given" ,["term t_"]),
|
neuper@37906
|
20 |
("#Find" ,["normalform n_"])
|
neuper@37906
|
21 |
],
|
neuper@37906
|
22 |
append_rls "e_rls" e_rls [(*for preds in where_*)],
|
neuper@37926
|
23 |
SOME "Simplify t_",
|
neuper@37906
|
24 |
[]));
|
neuper@37906
|
25 |
|
neuper@37906
|
26 |
store_pbt
|
neuper@37906
|
27 |
(prep_pbt Simplify.thy "pbl_vereinfache" [] e_pblID
|
neuper@37906
|
28 |
(["vereinfachen"],
|
neuper@37906
|
29 |
[("#Given" ,["term t_"]),
|
neuper@37906
|
30 |
("#Find" ,["normalform n_"])
|
neuper@37906
|
31 |
],
|
neuper@37906
|
32 |
append_rls "e_rls" e_rls [(*for preds in where_*)],
|
neuper@37926
|
33 |
SOME "Vereinfache t_",
|
neuper@37906
|
34 |
[]));
|
neuper@37906
|
35 |
|
neuper@37906
|
36 |
(** methods **)
|
neuper@37906
|
37 |
|
neuper@37906
|
38 |
store_met
|
neuper@37906
|
39 |
(prep_met Simplify.thy "met_simp" [] e_metID
|
neuper@37906
|
40 |
(["simplification"],
|
neuper@37906
|
41 |
[("#Given" ,["term t_"]),
|
neuper@37906
|
42 |
("#Find" ,["normalform n_"])
|
neuper@37906
|
43 |
],
|
neuper@37906
|
44 |
{rew_ord'="tless_true",
|
neuper@37906
|
45 |
rls'= e_rls,
|
neuper@37906
|
46 |
calc = [],
|
neuper@37906
|
47 |
srls = e_rls,
|
neuper@37906
|
48 |
prls=e_rls,
|
neuper@37906
|
49 |
crls = e_rls, nrls = e_rls},
|
neuper@37906
|
50 |
"empty_script"
|
neuper@37906
|
51 |
));
|
neuper@37906
|
52 |
|
neuper@37906
|
53 |
(** CAS-command **)
|
neuper@37906
|
54 |
|
neuper@37906
|
55 |
(*.function for handling the cas-input "Simplify (2*a + 3*a)":
|
neuper@37906
|
56 |
make a model which is already in ptree-internal format.*)
|
neuper@37906
|
57 |
(* val (h,argl) = strip_comb (str2term "Simplify (2*a + 3*a)");
|
neuper@37906
|
58 |
val (h,argl) = strip_comb ((term_of o the o (parse thy))
|
neuper@37906
|
59 |
"Simplify (2*a + 3*a)");
|
neuper@37906
|
60 |
*)
|
neuper@37906
|
61 |
fun argl2dtss t =
|
neuper@37906
|
62 |
[((term_of o the o (parse thy)) "term", t),
|
neuper@37906
|
63 |
((term_of o the o (parse thy)) "normalform",
|
neuper@37906
|
64 |
[(term_of o the o (parse thy)) "N"])
|
neuper@37906
|
65 |
]
|
neuper@37906
|
66 |
| argl2dtss _ = raise error "Simplify.ML: wrong argument for argl2dtss";
|
neuper@37906
|
67 |
|
neuper@37906
|
68 |
castab :=
|
neuper@37906
|
69 |
overwritel (!castab,
|
neuper@37906
|
70 |
[((term_of o the o (parse thy)) "Simplify",
|
neuper@37906
|
71 |
(("Isac.thy", ["simplification"], ["no_met"]),
|
neuper@37906
|
72 |
argl2dtss)),
|
neuper@37906
|
73 |
((term_of o the o (parse thy)) "Vereinfache",
|
neuper@37906
|
74 |
(("Isac.thy", ["vereinfachen"], ["no_met"]),
|
neuper@37906
|
75 |
argl2dtss))
|
neuper@37906
|
76 |
]);
|