Test_Some.thy + rewrite.sml + poly.sml ok: real_mult_minus1_sym works with is_atom
1 (* Title: "BaseDefinitions/BaseDefinitions.thy"
2 Author: Walther Neuper 190823
3 (c) due to copyright terms
5 Know_Store holds Theory_Data (problems, methods, etc) and requires respective definitions.
7 theory BaseDefinitions imports Know_Store
10 ML_file substitution.sml
12 ML_file environment.sml
17 fun string_of_atom (t as Const ("Num.numeral_class.numeral", _) $ _) = dest_numeral' t
19 | string_of_atom (t as Const ("Groups.one_class.one", _)) = HOLogic.dest_numeral t
20 | string_of_atom (t as Const ("Groups.zero_class.zero", _)) = HOLogic.dest_numeral t
21 | string_of_atom (Const (str, _)) = str
22 | string_of_atom (Free _) = true
23 | string_of_atom (Var _) = true
24 | string_of_atom _ = false;
32 @{term 3}(* = Const ("Num.numeral_class.numeral", _) $ *)
34 fun mk_num_op_num T1 T2 (op_, Top) n1 n2 =
35 Const (op_, Top) $ HOLogic.mk_number T1 n1 $ HOLogic.mk_number T2 n2;
37 mk_num_op_num: typ -> typ -> string * typ -> int -> int -> term
40 (* this function only accepts the most simple monoms vvvvvvvvvv *)
41 fun ist_monom (Free _) = true (* 2, a *)
42 | ist_monom (Const ("Groups.times_class.times", _) $
43 (Const ("Num.numeral_class.numeral", _) $ _) $ Free _) = true
44 | ist_monom (Const ("Groups.times_class.times", _) $ (* 2*a, a*b *)
45 Free _ $ (Const ("Num.numeral_class.numeral", _) $ _)) = false
46 | ist_monom (Const ("Groups.times_class.times", _) $ (* 3*a*b *)
47 (Const ("Groups.times_class.times", _) $
48 (Const ("Num.numeral_class.numeral", _) $ _) $ Free _) $ Free _) = true
49 | ist_monom (Const ("Transcendental.powr", _) $ (* a^2 *)
50 Free _ $ (Const ("Num.numeral_class.numeral", _) $ _)) = true
51 | ist_monom (Const ("Groups.times_class.times", _) $ (* 3*a^2 *)
52 (Const ("Num.numeral_class.numeral", _) $ _) $
53 (Const ("Transcendental.powr", _) $ Free _ $ Free _)) = true
54 | ist_monom _ = false;
56 fun varids (Const ("Num.numeral_class.numeral", _) $ _) = []
57 | varids (Const (s, Type (_,[]))) = [strip_thy s]
58 | varids (Free (s, Type (_,[]))) = [strip_thy s]
59 | varids (Var((s, _),Type (_,[]))) = [strip_thy s]
60 (*| varids (_ (s,"?DUMMY" )) = ..ML-error *)
61 | varids((Const ("Bin.integ_of_bin",_)) $ _)= [](*8.01: superfluous?*)
62 | varids (Abs (a, _, t)) = union op = [a] (varids t)
63 | varids (t1 $ t2) = union op = (varids t1) (varids t2)