| author | huffman | 
| Tue, 12 Dec 2006 00:02:54 +0100 | |
| changeset 21776 | e65109e168f3 | 
| parent 20254 | 58b71535ed00 | 
| child 24075 | 366d4d234814 | 
| permissions | -rw-r--r-- | 
| 14309 | 1  | 
(* Title: HOL/Hyperreal/hypreal_arith.ML  | 
| 10751 | 2  | 
ID: $Id$  | 
3  | 
Author: Tobias Nipkow, TU Muenchen  | 
|
4  | 
Copyright 1999 TU Muenchen  | 
|
5  | 
||
| 14352 | 6  | 
Simprocs for common factor cancellation & Rational coefficient handling  | 
7  | 
||
8  | 
Instantiation of the generic linear arithmetic package for type hypreal.  | 
|
| 10751 | 9  | 
*)  | 
10  | 
||
11  | 
local  | 
|
12  | 
||
| 
20254
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
13  | 
val simps = [thm "star_of_zero",  | 
| 
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
14  | 
thm "star_of_one",  | 
| 
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
15  | 
thm "star_of_number_of",  | 
| 
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
16  | 
thm "star_of_add",  | 
| 
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
17  | 
thm "star_of_minus",  | 
| 
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
18  | 
thm "star_of_diff",  | 
| 
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
19  | 
thm "star_of_mult"]  | 
| 
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
20  | 
|
| 
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
21  | 
val real_inj_thms = [thm "star_of_le" RS iffD2,  | 
| 
17318
 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 
huffman 
parents: 
15923 
diff
changeset
 | 
22  | 
thm "star_of_less" RS iffD2,  | 
| 
20254
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
23  | 
thm "star_of_eq" RS iffD2]  | 
| 14369 | 24  | 
|
| 10751 | 25  | 
in  | 
26  | 
||
| 
20254
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
27  | 
val hyprealT = Type ("StarDef.star", [HOLogic.realT]);
 | 
| 
14387
 
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
 
paulson 
parents: 
14370 
diff
changeset
 | 
28  | 
|
| 14352 | 29  | 
val fast_hypreal_arith_simproc =  | 
| 
20254
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
30  | 
Simplifier.simproc (the_context ())  | 
| 14352 | 31  | 
"fast_hypreal_arith"  | 
32  | 
["(m::hypreal) < n", "(m::hypreal) <= n", "(m::hypreal) = n"]  | 
|
33  | 
Fast_Arith.lin_arith_prover;  | 
|
34  | 
||
| 10751 | 35  | 
val hypreal_arith_setup =  | 
| 18708 | 36  | 
  Fast_Arith.map_data (fn {add_mono_thms, mult_mono_thms, inj_thms, lessD, neqE, simpset} =>
 | 
| 14369 | 37  | 
   {add_mono_thms = add_mono_thms,
 | 
| 15184 | 38  | 
mult_mono_thms = mult_mono_thms,  | 
| 
20254
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
39  | 
inj_thms = real_inj_thms @ inj_thms,  | 
| 14352 | 40  | 
lessD = lessD, (*Can't change LA_Data_Ref.lessD: the hypreals are dense!*)  | 
| 15923 | 41  | 
neqE = neqE,  | 
| 
20254
 
58b71535ed00
lin_arith_prover splits certain operators (e.g. min, max, abs)
 
webertj 
parents: 
18708 
diff
changeset
 | 
42  | 
simpset = simpset addsimps simps}) #>  | 
| 18708 | 43  | 
  arith_inj_const ("StarDef.star_of", HOLogic.realT --> hyprealT) #>
 | 
44  | 
(fn thy => (change_simpset_of thy (fn ss => ss addsimprocs [fast_hypreal_arith_simproc]); thy));  | 
|
| 10751 | 45  | 
|
46  | 
end;  |