paulson@14365
|
1 |
(* Title: HOL/Real/rat_arith0.ML
|
paulson@14365
|
2 |
ID: $Id$
|
paulson@14365
|
3 |
Author: Lawrence C Paulson
|
paulson@14365
|
4 |
Copyright 2004 University of Cambridge
|
paulson@14365
|
5 |
|
paulson@14365
|
6 |
Simprocs for common factor cancellation & Rational coefficient handling
|
paulson@14365
|
7 |
|
paulson@14365
|
8 |
Instantiation of the generic linear arithmetic package for type rat.
|
paulson@14365
|
9 |
*)
|
paulson@14365
|
10 |
|
paulson@14365
|
11 |
(*FIXME DELETE*)
|
paulson@14365
|
12 |
val rat_mult_strict_left_mono =
|
paulson@14365
|
13 |
read_instantiate_sg(sign_of (the_context())) [("a","?a::rat")] mult_strict_left_mono;
|
paulson@14365
|
14 |
|
paulson@14365
|
15 |
val rat_mult_left_mono =
|
paulson@14365
|
16 |
read_instantiate_sg(sign_of (the_context())) [("a","?a::rat")] mult_left_mono;
|
paulson@14365
|
17 |
|
paulson@14365
|
18 |
|
paulson@14365
|
19 |
val rat_number_of_def = thm "rat_number_of_def";
|
paulson@14365
|
20 |
val diff_rat_def = thm "diff_rat_def";
|
paulson@14365
|
21 |
|
paulson@14365
|
22 |
val rat_numeral_0_eq_0 = thm "rat_numeral_0_eq_0";
|
paulson@14365
|
23 |
val rat_numeral_1_eq_1 = thm "rat_numeral_1_eq_1";
|
paulson@14365
|
24 |
val add_rat_number_of = thm "add_rat_number_of";
|
paulson@14365
|
25 |
val minus_rat_number_of = thm "minus_rat_number_of";
|
paulson@14365
|
26 |
val diff_rat_number_of = thm "diff_rat_number_of";
|
paulson@14365
|
27 |
val mult_rat_number_of = thm "mult_rat_number_of";
|
paulson@14365
|
28 |
val rat_mult_2 = thm "rat_mult_2";
|
paulson@14365
|
29 |
val rat_mult_2_right = thm "rat_mult_2_right";
|
paulson@14365
|
30 |
val eq_rat_number_of = thm "eq_rat_number_of";
|
paulson@14365
|
31 |
val less_rat_number_of = thm "less_rat_number_of";
|
paulson@14365
|
32 |
val rat_minus_1_eq_m1 = thm "rat_minus_1_eq_m1";
|
paulson@14365
|
33 |
val rat_mult_minus1 = thm "rat_mult_minus1";
|
paulson@14365
|
34 |
val rat_mult_minus1_right = thm "rat_mult_minus1_right";
|
paulson@14365
|
35 |
val rat_add_number_of_left = thm "rat_add_number_of_left";
|
paulson@14365
|
36 |
val rat_mult_number_of_left = thm "rat_mult_number_of_left";
|
paulson@14365
|
37 |
val rat_add_number_of_diff1 = thm "rat_add_number_of_diff1";
|
paulson@14365
|
38 |
val rat_add_number_of_diff2 = thm "rat_add_number_of_diff2";
|
paulson@14365
|
39 |
|
paulson@14365
|
40 |
val rat_add_0_left = thm "rat_add_0_left";
|
paulson@14365
|
41 |
val rat_add_0_right = thm "rat_add_0_right";
|
paulson@14365
|
42 |
val rat_mult_1_left = thm "rat_mult_1_left";
|
paulson@14365
|
43 |
val rat_mult_1_right = thm "rat_mult_1_right";
|
paulson@14365
|
44 |
|
paulson@14365
|
45 |
(*Maps 0 to Numeral0 and 1 to Numeral1 and -(Numeral1) to -1*)
|
paulson@14365
|
46 |
val rat_numeral_ss =
|
paulson@14365
|
47 |
HOL_ss addsimps [rat_numeral_0_eq_0 RS sym, rat_numeral_1_eq_1 RS sym,
|
paulson@14365
|
48 |
rat_minus_1_eq_m1];
|
paulson@14365
|
49 |
|
paulson@14365
|
50 |
fun rename_numerals th =
|
paulson@14365
|
51 |
asm_full_simplify rat_numeral_ss (Thm.transfer (the_context ()) th);
|
paulson@14365
|
52 |
|
paulson@14365
|
53 |
|
paulson@14365
|
54 |
structure Rat_Numeral_Simprocs =
|
paulson@14365
|
55 |
struct
|
paulson@14365
|
56 |
|
paulson@14365
|
57 |
(*Maps 0 to Numeral0 and 1 to Numeral1 so that arithmetic in simprocs
|
paulson@14365
|
58 |
isn't complicated by the abstract 0 and 1.*)
|
paulson@14365
|
59 |
val numeral_syms = [rat_numeral_0_eq_0 RS sym, rat_numeral_1_eq_1 RS sym];
|
paulson@14365
|
60 |
|
paulson@14365
|
61 |
(*Utilities*)
|
paulson@14365
|
62 |
|
paulson@14365
|
63 |
val ratT = Type("Rational.rat", []);
|
paulson@14365
|
64 |
|
paulson@14365
|
65 |
fun mk_numeral n = HOLogic.number_of_const ratT $ HOLogic.mk_bin n;
|
paulson@14365
|
66 |
|
paulson@14365
|
67 |
(*Decodes a binary rat constant, or 0, 1*)
|
paulson@14365
|
68 |
val dest_numeral = Int_Numeral_Simprocs.dest_numeral;
|
paulson@14365
|
69 |
val find_first_numeral = Int_Numeral_Simprocs.find_first_numeral;
|
paulson@14365
|
70 |
|
paulson@14365
|
71 |
val zero = mk_numeral 0;
|
paulson@14365
|
72 |
val mk_plus = HOLogic.mk_binop "op +";
|
paulson@14365
|
73 |
|
paulson@14365
|
74 |
val uminus_const = Const ("uminus", ratT --> ratT);
|
paulson@14365
|
75 |
|
paulson@14365
|
76 |
(*Thus mk_sum[t] yields t+0; longer sums don't have a trailing zero*)
|
paulson@14365
|
77 |
fun mk_sum [] = zero
|
paulson@14365
|
78 |
| mk_sum [t,u] = mk_plus (t, u)
|
paulson@14365
|
79 |
| mk_sum (t :: ts) = mk_plus (t, mk_sum ts);
|
paulson@14365
|
80 |
|
paulson@14365
|
81 |
(*this version ALWAYS includes a trailing zero*)
|
paulson@14365
|
82 |
fun long_mk_sum [] = zero
|
paulson@14365
|
83 |
| long_mk_sum (t :: ts) = mk_plus (t, mk_sum ts);
|
paulson@14365
|
84 |
|
paulson@14365
|
85 |
val dest_plus = HOLogic.dest_bin "op +" ratT;
|
paulson@14365
|
86 |
|
paulson@14365
|
87 |
(*decompose additions AND subtractions as a sum*)
|
paulson@14365
|
88 |
fun dest_summing (pos, Const ("op +", _) $ t $ u, ts) =
|
paulson@14365
|
89 |
dest_summing (pos, t, dest_summing (pos, u, ts))
|
paulson@14365
|
90 |
| dest_summing (pos, Const ("op -", _) $ t $ u, ts) =
|
paulson@14365
|
91 |
dest_summing (pos, t, dest_summing (not pos, u, ts))
|
paulson@14365
|
92 |
| dest_summing (pos, t, ts) =
|
paulson@14365
|
93 |
if pos then t::ts else uminus_const$t :: ts;
|
paulson@14365
|
94 |
|
paulson@14365
|
95 |
fun dest_sum t = dest_summing (true, t, []);
|
paulson@14365
|
96 |
|
paulson@14365
|
97 |
val mk_diff = HOLogic.mk_binop "op -";
|
paulson@14365
|
98 |
val dest_diff = HOLogic.dest_bin "op -" ratT;
|
paulson@14365
|
99 |
|
paulson@14365
|
100 |
val one = mk_numeral 1;
|
paulson@14365
|
101 |
val mk_times = HOLogic.mk_binop "op *";
|
paulson@14365
|
102 |
|
paulson@14365
|
103 |
fun mk_prod [] = one
|
paulson@14365
|
104 |
| mk_prod [t] = t
|
paulson@14365
|
105 |
| mk_prod (t :: ts) = if t = one then mk_prod ts
|
paulson@14365
|
106 |
else mk_times (t, mk_prod ts);
|
paulson@14365
|
107 |
|
paulson@14365
|
108 |
val dest_times = HOLogic.dest_bin "op *" ratT;
|
paulson@14365
|
109 |
|
paulson@14365
|
110 |
fun dest_prod t =
|
paulson@14365
|
111 |
let val (t,u) = dest_times t
|
paulson@14365
|
112 |
in dest_prod t @ dest_prod u end
|
paulson@14365
|
113 |
handle TERM _ => [t];
|
paulson@14365
|
114 |
|
paulson@14365
|
115 |
(*DON'T do the obvious simplifications; that would create special cases*)
|
paulson@14365
|
116 |
fun mk_coeff (k, ts) = mk_times (mk_numeral k, ts);
|
paulson@14365
|
117 |
|
paulson@14365
|
118 |
(*Express t as a product of (possibly) a numeral with other sorted terms*)
|
paulson@14365
|
119 |
fun dest_coeff sign (Const ("uminus", _) $ t) = dest_coeff (~sign) t
|
paulson@14365
|
120 |
| dest_coeff sign t =
|
paulson@14365
|
121 |
let val ts = sort Term.term_ord (dest_prod t)
|
paulson@14365
|
122 |
val (n, ts') = find_first_numeral [] ts
|
paulson@14365
|
123 |
handle TERM _ => (1, ts)
|
paulson@14365
|
124 |
in (sign*n, mk_prod ts') end;
|
paulson@14365
|
125 |
|
paulson@14365
|
126 |
(*Find first coefficient-term THAT MATCHES u*)
|
paulson@14365
|
127 |
fun find_first_coeff past u [] = raise TERM("find_first_coeff", [])
|
paulson@14365
|
128 |
| find_first_coeff past u (t::terms) =
|
paulson@14365
|
129 |
let val (n,u') = dest_coeff 1 t
|
paulson@14365
|
130 |
in if u aconv u' then (n, rev past @ terms)
|
paulson@14365
|
131 |
else find_first_coeff (t::past) u terms
|
paulson@14365
|
132 |
end
|
paulson@14365
|
133 |
handle TERM _ => find_first_coeff (t::past) u terms;
|
paulson@14365
|
134 |
|
paulson@14365
|
135 |
|
paulson@14365
|
136 |
(*Simplify Numeral0+n, n+Numeral0, Numeral1*n, n*Numeral1*)
|
paulson@14365
|
137 |
val add_0s = map rename_numerals [rat_add_0_left, rat_add_0_right];
|
paulson@14365
|
138 |
val mult_1s = map rename_numerals [rat_mult_1_left, rat_mult_1_right] @
|
paulson@14365
|
139 |
[rat_mult_minus1, rat_mult_minus1_right];
|
paulson@14365
|
140 |
|
paulson@14365
|
141 |
(*To perform binary arithmetic*)
|
paulson@14365
|
142 |
val bin_simps =
|
paulson@14365
|
143 |
[rat_numeral_0_eq_0 RS sym, rat_numeral_1_eq_1 RS sym,
|
paulson@14365
|
144 |
add_rat_number_of, rat_add_number_of_left, minus_rat_number_of,
|
paulson@14365
|
145 |
diff_rat_number_of, mult_rat_number_of, rat_mult_number_of_left] @
|
paulson@14365
|
146 |
bin_arith_simps @ bin_rel_simps;
|
paulson@14365
|
147 |
|
paulson@14365
|
148 |
(*Binary arithmetic BUT NOT ADDITION since it may collapse adjacent terms
|
paulson@14365
|
149 |
during re-arrangement*)
|
paulson@14365
|
150 |
val non_add_bin_simps =
|
paulson@14365
|
151 |
bin_simps \\ [rat_add_number_of_left, add_rat_number_of];
|
paulson@14365
|
152 |
|
paulson@14365
|
153 |
(*To evaluate binary negations of coefficients*)
|
paulson@14365
|
154 |
val rat_minus_simps = NCons_simps @
|
paulson@14365
|
155 |
[rat_minus_1_eq_m1, minus_rat_number_of,
|
paulson@14365
|
156 |
bin_minus_1, bin_minus_0, bin_minus_Pls, bin_minus_Min,
|
paulson@14365
|
157 |
bin_pred_1, bin_pred_0, bin_pred_Pls, bin_pred_Min];
|
paulson@14365
|
158 |
|
paulson@14365
|
159 |
(*To let us treat subtraction as addition*)
|
paulson@14365
|
160 |
val diff_simps = [diff_rat_def, minus_add_distrib, minus_minus];
|
paulson@14365
|
161 |
|
paulson@14365
|
162 |
(*to extract again any uncancelled minuses*)
|
paulson@14365
|
163 |
val rat_minus_from_mult_simps =
|
paulson@14365
|
164 |
[minus_minus, minus_mult_left RS sym, minus_mult_right RS sym];
|
paulson@14365
|
165 |
|
paulson@14365
|
166 |
(*combine unary minus with numeric literals, however nested within a product*)
|
paulson@14365
|
167 |
val rat_mult_minus_simps =
|
paulson@14365
|
168 |
[mult_assoc, minus_mult_left, minus_mult_commute];
|
paulson@14365
|
169 |
|
paulson@14365
|
170 |
(*Apply the given rewrite (if present) just once*)
|
paulson@14365
|
171 |
fun trans_tac None = all_tac
|
paulson@14365
|
172 |
| trans_tac (Some th) = ALLGOALS (rtac (th RS trans));
|
paulson@14365
|
173 |
|
paulson@14365
|
174 |
(*Final simplification: cancel + and * *)
|
paulson@14365
|
175 |
val simplify_meta_eq =
|
paulson@14365
|
176 |
Int_Numeral_Simprocs.simplify_meta_eq
|
paulson@14365
|
177 |
[add_0, add_0_right,
|
paulson@14365
|
178 |
mult_zero_left, mult_zero_right, mult_1, mult_1_right];
|
paulson@14365
|
179 |
|
paulson@14365
|
180 |
fun prep_simproc (name, pats, proc) =
|
paulson@14365
|
181 |
Simplifier.simproc (Theory.sign_of (the_context ())) name pats proc;
|
paulson@14365
|
182 |
|
paulson@14365
|
183 |
structure CancelNumeralsCommon =
|
paulson@14365
|
184 |
struct
|
paulson@14365
|
185 |
val mk_sum = mk_sum
|
paulson@14365
|
186 |
val dest_sum = dest_sum
|
paulson@14365
|
187 |
val mk_coeff = mk_coeff
|
paulson@14365
|
188 |
val dest_coeff = dest_coeff 1
|
paulson@14365
|
189 |
val find_first_coeff = find_first_coeff []
|
paulson@14365
|
190 |
val trans_tac = trans_tac
|
paulson@14365
|
191 |
val norm_tac =
|
paulson@14365
|
192 |
ALLGOALS (simp_tac (HOL_ss addsimps add_0s@mult_1s@diff_simps@
|
paulson@14365
|
193 |
rat_minus_simps@add_ac))
|
paulson@14365
|
194 |
THEN ALLGOALS (simp_tac (HOL_ss addsimps non_add_bin_simps@rat_mult_minus_simps))
|
paulson@14365
|
195 |
THEN ALLGOALS
|
paulson@14365
|
196 |
(simp_tac (HOL_ss addsimps rat_minus_from_mult_simps@
|
paulson@14365
|
197 |
add_ac@mult_ac))
|
paulson@14365
|
198 |
val numeral_simp_tac = ALLGOALS (simp_tac (HOL_ss addsimps add_0s@bin_simps))
|
paulson@14365
|
199 |
val simplify_meta_eq = simplify_meta_eq
|
paulson@14365
|
200 |
end;
|
paulson@14365
|
201 |
|
paulson@14365
|
202 |
|
paulson@14365
|
203 |
structure EqCancelNumerals = CancelNumeralsFun
|
paulson@14365
|
204 |
(open CancelNumeralsCommon
|
paulson@14365
|
205 |
val prove_conv = Bin_Simprocs.prove_conv
|
paulson@14365
|
206 |
val mk_bal = HOLogic.mk_eq
|
paulson@14365
|
207 |
val dest_bal = HOLogic.dest_bin "op =" ratT
|
paulson@14365
|
208 |
val bal_add1 = eq_add_iff1 RS trans
|
paulson@14365
|
209 |
val bal_add2 = eq_add_iff2 RS trans
|
paulson@14365
|
210 |
);
|
paulson@14365
|
211 |
|
paulson@14365
|
212 |
structure LessCancelNumerals = CancelNumeralsFun
|
paulson@14365
|
213 |
(open CancelNumeralsCommon
|
paulson@14365
|
214 |
val prove_conv = Bin_Simprocs.prove_conv
|
paulson@14365
|
215 |
val mk_bal = HOLogic.mk_binrel "op <"
|
paulson@14365
|
216 |
val dest_bal = HOLogic.dest_bin "op <" ratT
|
paulson@14365
|
217 |
val bal_add1 = less_add_iff1 RS trans
|
paulson@14365
|
218 |
val bal_add2 = less_add_iff2 RS trans
|
paulson@14365
|
219 |
);
|
paulson@14365
|
220 |
|
paulson@14365
|
221 |
structure LeCancelNumerals = CancelNumeralsFun
|
paulson@14365
|
222 |
(open CancelNumeralsCommon
|
paulson@14365
|
223 |
val prove_conv = Bin_Simprocs.prove_conv
|
paulson@14365
|
224 |
val mk_bal = HOLogic.mk_binrel "op <="
|
paulson@14365
|
225 |
val dest_bal = HOLogic.dest_bin "op <=" ratT
|
paulson@14365
|
226 |
val bal_add1 = le_add_iff1 RS trans
|
paulson@14365
|
227 |
val bal_add2 = le_add_iff2 RS trans
|
paulson@14365
|
228 |
);
|
paulson@14365
|
229 |
|
paulson@14365
|
230 |
val cancel_numerals =
|
paulson@14365
|
231 |
map prep_simproc
|
paulson@14365
|
232 |
[("rateq_cancel_numerals",
|
paulson@14365
|
233 |
["(l::rat) + m = n", "(l::rat) = m + n",
|
paulson@14365
|
234 |
"(l::rat) - m = n", "(l::rat) = m - n",
|
paulson@14365
|
235 |
"(l::rat) * m = n", "(l::rat) = m * n"],
|
paulson@14365
|
236 |
EqCancelNumerals.proc),
|
paulson@14365
|
237 |
("ratless_cancel_numerals",
|
paulson@14365
|
238 |
["(l::rat) + m < n", "(l::rat) < m + n",
|
paulson@14365
|
239 |
"(l::rat) - m < n", "(l::rat) < m - n",
|
paulson@14365
|
240 |
"(l::rat) * m < n", "(l::rat) < m * n"],
|
paulson@14365
|
241 |
LessCancelNumerals.proc),
|
paulson@14365
|
242 |
("ratle_cancel_numerals",
|
paulson@14365
|
243 |
["(l::rat) + m <= n", "(l::rat) <= m + n",
|
paulson@14365
|
244 |
"(l::rat) - m <= n", "(l::rat) <= m - n",
|
paulson@14365
|
245 |
"(l::rat) * m <= n", "(l::rat) <= m * n"],
|
paulson@14365
|
246 |
LeCancelNumerals.proc)];
|
paulson@14365
|
247 |
|
paulson@14365
|
248 |
|
paulson@14365
|
249 |
structure CombineNumeralsData =
|
paulson@14365
|
250 |
struct
|
paulson@14365
|
251 |
val add = op + : int*int -> int
|
paulson@14365
|
252 |
val mk_sum = long_mk_sum (*to work for e.g. 2*x + 3*x *)
|
paulson@14365
|
253 |
val dest_sum = dest_sum
|
paulson@14365
|
254 |
val mk_coeff = mk_coeff
|
paulson@14365
|
255 |
val dest_coeff = dest_coeff 1
|
paulson@14365
|
256 |
val left_distrib = combine_common_factor RS trans
|
paulson@14365
|
257 |
val prove_conv = Bin_Simprocs.prove_conv_nohyps
|
paulson@14365
|
258 |
val trans_tac = trans_tac
|
paulson@14365
|
259 |
val norm_tac =
|
paulson@14365
|
260 |
ALLGOALS (simp_tac (HOL_ss addsimps numeral_syms@add_0s@mult_1s@
|
paulson@14365
|
261 |
diff_simps@rat_minus_simps@add_ac))
|
paulson@14365
|
262 |
THEN ALLGOALS (simp_tac (HOL_ss addsimps non_add_bin_simps@rat_mult_minus_simps))
|
paulson@14365
|
263 |
THEN ALLGOALS (simp_tac (HOL_ss addsimps rat_minus_from_mult_simps@
|
paulson@14365
|
264 |
add_ac@mult_ac))
|
paulson@14365
|
265 |
val numeral_simp_tac = ALLGOALS
|
paulson@14365
|
266 |
(simp_tac (HOL_ss addsimps add_0s@bin_simps))
|
paulson@14365
|
267 |
val simplify_meta_eq =
|
paulson@14365
|
268 |
Int_Numeral_Simprocs.simplify_meta_eq (add_0s@mult_1s)
|
paulson@14365
|
269 |
end;
|
paulson@14365
|
270 |
|
paulson@14365
|
271 |
structure CombineNumerals = CombineNumeralsFun(CombineNumeralsData);
|
paulson@14365
|
272 |
|
paulson@14365
|
273 |
val combine_numerals =
|
paulson@14365
|
274 |
prep_simproc ("rat_combine_numerals", ["(i::rat) + j", "(i::rat) - j"], CombineNumerals.proc);
|
paulson@14365
|
275 |
|
paulson@14365
|
276 |
|
paulson@14365
|
277 |
(** Declarations for ExtractCommonTerm **)
|
paulson@14365
|
278 |
|
paulson@14365
|
279 |
(*this version ALWAYS includes a trailing one*)
|
paulson@14365
|
280 |
fun long_mk_prod [] = one
|
paulson@14365
|
281 |
| long_mk_prod (t :: ts) = mk_times (t, mk_prod ts);
|
paulson@14365
|
282 |
|
paulson@14365
|
283 |
(*Find first term that matches u*)
|
paulson@14365
|
284 |
fun find_first past u [] = raise TERM("find_first", [])
|
paulson@14365
|
285 |
| find_first past u (t::terms) =
|
paulson@14365
|
286 |
if u aconv t then (rev past @ terms)
|
paulson@14365
|
287 |
else find_first (t::past) u terms
|
paulson@14365
|
288 |
handle TERM _ => find_first (t::past) u terms;
|
paulson@14365
|
289 |
|
paulson@14365
|
290 |
(*Final simplification: cancel + and * *)
|
paulson@14365
|
291 |
fun cancel_simplify_meta_eq cancel_th th =
|
paulson@14365
|
292 |
Int_Numeral_Simprocs.simplify_meta_eq
|
paulson@14365
|
293 |
[rat_mult_1_left, rat_mult_1_right]
|
paulson@14365
|
294 |
(([th, cancel_th]) MRS trans);
|
paulson@14365
|
295 |
|
paulson@14365
|
296 |
(*** Making constant folding work for 0 and 1 too ***)
|
paulson@14365
|
297 |
|
paulson@14365
|
298 |
structure RatAbstractNumeralsData =
|
paulson@14365
|
299 |
struct
|
paulson@14365
|
300 |
val dest_eq = HOLogic.dest_eq o HOLogic.dest_Trueprop o concl_of
|
paulson@14365
|
301 |
val is_numeral = Bin_Simprocs.is_numeral
|
paulson@14365
|
302 |
val numeral_0_eq_0 = rat_numeral_0_eq_0
|
paulson@14365
|
303 |
val numeral_1_eq_1 = rat_numeral_1_eq_1
|
paulson@14365
|
304 |
val prove_conv = Bin_Simprocs.prove_conv_nohyps_novars
|
paulson@14365
|
305 |
fun norm_tac simps = ALLGOALS (simp_tac (HOL_ss addsimps simps))
|
paulson@14365
|
306 |
val simplify_meta_eq = Bin_Simprocs.simplify_meta_eq
|
paulson@14365
|
307 |
end
|
paulson@14365
|
308 |
|
paulson@14365
|
309 |
structure RatAbstractNumerals = AbstractNumeralsFun (RatAbstractNumeralsData)
|
paulson@14365
|
310 |
|
paulson@14365
|
311 |
(*For addition, we already have rules for the operand 0.
|
paulson@14365
|
312 |
Multiplication is omitted because there are already special rules for
|
paulson@14365
|
313 |
both 0 and 1 as operands. Unary minus is trivial, just have - 1 = -1.
|
paulson@14365
|
314 |
For the others, having three patterns is a compromise between just having
|
paulson@14365
|
315 |
one (many spurious calls) and having nine (just too many!) *)
|
paulson@14365
|
316 |
val eval_numerals =
|
paulson@14365
|
317 |
map prep_simproc
|
paulson@14365
|
318 |
[("rat_add_eval_numerals",
|
paulson@14365
|
319 |
["(m::rat) + 1", "(m::rat) + number_of v"],
|
paulson@14365
|
320 |
RatAbstractNumerals.proc add_rat_number_of),
|
paulson@14365
|
321 |
("rat_diff_eval_numerals",
|
paulson@14365
|
322 |
["(m::rat) - 1", "(m::rat) - number_of v"],
|
paulson@14365
|
323 |
RatAbstractNumerals.proc diff_rat_number_of),
|
paulson@14365
|
324 |
("rat_eq_eval_numerals",
|
paulson@14365
|
325 |
["(m::rat) = 0", "(m::rat) = 1", "(m::rat) = number_of v"],
|
paulson@14365
|
326 |
RatAbstractNumerals.proc eq_rat_number_of),
|
paulson@14365
|
327 |
("rat_less_eval_numerals",
|
paulson@14365
|
328 |
["(m::rat) < 0", "(m::rat) < 1", "(m::rat) < number_of v"],
|
paulson@14365
|
329 |
RatAbstractNumerals.proc less_rat_number_of),
|
paulson@14365
|
330 |
("rat_le_eval_numerals",
|
paulson@14365
|
331 |
["(m::rat) <= 0", "(m::rat) <= 1", "(m::rat) <= number_of v"],
|
paulson@14365
|
332 |
RatAbstractNumerals.proc le_number_of_eq_not_less)]
|
paulson@14365
|
333 |
|
paulson@14365
|
334 |
end;
|
paulson@14365
|
335 |
|
paulson@14365
|
336 |
|
paulson@14365
|
337 |
Addsimprocs Rat_Numeral_Simprocs.eval_numerals;
|
paulson@14365
|
338 |
Addsimprocs Rat_Numeral_Simprocs.cancel_numerals;
|
paulson@14365
|
339 |
Addsimprocs [Rat_Numeral_Simprocs.combine_numerals];
|
paulson@14365
|
340 |
|
paulson@14365
|
341 |
|
paulson@14365
|
342 |
|
paulson@14365
|
343 |
(** Constant folding for rat plus and times **)
|
paulson@14365
|
344 |
|
paulson@14365
|
345 |
(*We do not need
|
paulson@14365
|
346 |
structure Rat_Plus_Assoc = Assoc_Fold (Rat_Plus_Assoc_Data);
|
paulson@14365
|
347 |
because combine_numerals does the same thing*)
|
paulson@14365
|
348 |
|
paulson@14365
|
349 |
structure Rat_Times_Assoc_Data : ASSOC_FOLD_DATA =
|
paulson@14365
|
350 |
struct
|
paulson@14365
|
351 |
val ss = HOL_ss
|
paulson@14365
|
352 |
val eq_reflection = eq_reflection
|
paulson@14365
|
353 |
val sg_ref = Sign.self_ref (Theory.sign_of (the_context ()))
|
paulson@14365
|
354 |
val T = Rat_Numeral_Simprocs.ratT
|
paulson@14365
|
355 |
val plus = Const ("op *", [Rat_Numeral_Simprocs.ratT,Rat_Numeral_Simprocs.ratT] ---> Rat_Numeral_Simprocs.ratT)
|
paulson@14365
|
356 |
val add_ac = mult_ac
|
paulson@14365
|
357 |
end;
|
paulson@14365
|
358 |
|
paulson@14365
|
359 |
structure Rat_Times_Assoc = Assoc_Fold (Rat_Times_Assoc_Data);
|
paulson@14365
|
360 |
|
paulson@14365
|
361 |
Addsimprocs [Rat_Times_Assoc.conv];
|
paulson@14365
|
362 |
|
paulson@14365
|
363 |
|
paulson@14365
|
364 |
(****Common factor cancellation****)
|
paulson@14365
|
365 |
|
paulson@14365
|
366 |
(*To quote from Provers/Arith/cancel_numeral_factor.ML:
|
paulson@14365
|
367 |
|
paulson@14365
|
368 |
This simproc Cancels common coefficients in balanced expressions:
|
paulson@14365
|
369 |
|
paulson@14365
|
370 |
u*#m ~~ u'*#m' == #n*u ~~ #n'*u'
|
paulson@14365
|
371 |
|
paulson@14365
|
372 |
where ~~ is an appropriate balancing operation (e.g. =, <=, <, div, /)
|
paulson@14365
|
373 |
and d = gcd(m,m') and n=m/d and n'=m'/d.
|
paulson@14365
|
374 |
*)
|
paulson@14365
|
375 |
|
paulson@14365
|
376 |
local
|
paulson@14365
|
377 |
open Rat_Numeral_Simprocs
|
paulson@14365
|
378 |
in
|
paulson@14365
|
379 |
|
paulson@14365
|
380 |
val rel_rat_number_of = [eq_rat_number_of, less_rat_number_of,
|
paulson@14365
|
381 |
le_number_of_eq_not_less]
|
paulson@14365
|
382 |
|
paulson@14365
|
383 |
structure CancelNumeralFactorCommon =
|
paulson@14365
|
384 |
struct
|
paulson@14365
|
385 |
val mk_coeff = mk_coeff
|
paulson@14365
|
386 |
val dest_coeff = dest_coeff 1
|
paulson@14365
|
387 |
val trans_tac = trans_tac
|
paulson@14365
|
388 |
val norm_tac =
|
paulson@14365
|
389 |
ALLGOALS (simp_tac (HOL_ss addsimps rat_minus_from_mult_simps @ mult_1s))
|
paulson@14365
|
390 |
THEN ALLGOALS (simp_tac (HOL_ss addsimps bin_simps@rat_mult_minus_simps))
|
paulson@14365
|
391 |
THEN ALLGOALS (simp_tac (HOL_ss addsimps mult_ac))
|
paulson@14365
|
392 |
val numeral_simp_tac =
|
paulson@14365
|
393 |
ALLGOALS (simp_tac (HOL_ss addsimps rel_rat_number_of@bin_simps))
|
paulson@14365
|
394 |
val simplify_meta_eq = simplify_meta_eq
|
paulson@14365
|
395 |
end
|
paulson@14365
|
396 |
|
paulson@14365
|
397 |
structure DivCancelNumeralFactor = CancelNumeralFactorFun
|
paulson@14365
|
398 |
(open CancelNumeralFactorCommon
|
paulson@14365
|
399 |
val prove_conv = Bin_Simprocs.prove_conv
|
paulson@14365
|
400 |
val mk_bal = HOLogic.mk_binop "HOL.divide"
|
paulson@14365
|
401 |
val dest_bal = HOLogic.dest_bin "HOL.divide" Rat_Numeral_Simprocs.ratT
|
paulson@14365
|
402 |
val cancel = mult_divide_cancel_left RS trans
|
paulson@14365
|
403 |
val neg_exchanges = false
|
paulson@14365
|
404 |
)
|
paulson@14365
|
405 |
|
paulson@14365
|
406 |
structure EqCancelNumeralFactor = CancelNumeralFactorFun
|
paulson@14365
|
407 |
(open CancelNumeralFactorCommon
|
paulson@14365
|
408 |
val prove_conv = Bin_Simprocs.prove_conv
|
paulson@14365
|
409 |
val mk_bal = HOLogic.mk_eq
|
paulson@14365
|
410 |
val dest_bal = HOLogic.dest_bin "op =" Rat_Numeral_Simprocs.ratT
|
paulson@14365
|
411 |
val cancel = mult_cancel_left RS trans
|
paulson@14365
|
412 |
val neg_exchanges = false
|
paulson@14365
|
413 |
)
|
paulson@14365
|
414 |
|
paulson@14365
|
415 |
structure LessCancelNumeralFactor = CancelNumeralFactorFun
|
paulson@14365
|
416 |
(open CancelNumeralFactorCommon
|
paulson@14365
|
417 |
val prove_conv = Bin_Simprocs.prove_conv
|
paulson@14365
|
418 |
val mk_bal = HOLogic.mk_binrel "op <"
|
paulson@14365
|
419 |
val dest_bal = HOLogic.dest_bin "op <" Rat_Numeral_Simprocs.ratT
|
paulson@14365
|
420 |
val cancel = mult_less_cancel_left RS trans
|
paulson@14365
|
421 |
val neg_exchanges = true
|
paulson@14365
|
422 |
)
|
paulson@14365
|
423 |
|
paulson@14365
|
424 |
structure LeCancelNumeralFactor = CancelNumeralFactorFun
|
paulson@14365
|
425 |
(open CancelNumeralFactorCommon
|
paulson@14365
|
426 |
val prove_conv = Bin_Simprocs.prove_conv
|
paulson@14365
|
427 |
val mk_bal = HOLogic.mk_binrel "op <="
|
paulson@14365
|
428 |
val dest_bal = HOLogic.dest_bin "op <=" Rat_Numeral_Simprocs.ratT
|
paulson@14365
|
429 |
val cancel = mult_le_cancel_left RS trans
|
paulson@14365
|
430 |
val neg_exchanges = true
|
paulson@14365
|
431 |
)
|
paulson@14365
|
432 |
|
paulson@14365
|
433 |
val rat_cancel_numeral_factors_relations =
|
paulson@14365
|
434 |
map prep_simproc
|
paulson@14365
|
435 |
[("rateq_cancel_numeral_factor",
|
paulson@14365
|
436 |
["(l::rat) * m = n", "(l::rat) = m * n"],
|
paulson@14365
|
437 |
EqCancelNumeralFactor.proc),
|
paulson@14365
|
438 |
("ratless_cancel_numeral_factor",
|
paulson@14365
|
439 |
["(l::rat) * m < n", "(l::rat) < m * n"],
|
paulson@14365
|
440 |
LessCancelNumeralFactor.proc),
|
paulson@14365
|
441 |
("ratle_cancel_numeral_factor",
|
paulson@14365
|
442 |
["(l::rat) * m <= n", "(l::rat) <= m * n"],
|
paulson@14365
|
443 |
LeCancelNumeralFactor.proc)]
|
paulson@14365
|
444 |
|
paulson@14365
|
445 |
val rat_cancel_numeral_factors_divide = prep_simproc
|
paulson@14365
|
446 |
("ratdiv_cancel_numeral_factor",
|
paulson@14365
|
447 |
["((l::rat) * m) / n", "(l::rat) / (m * n)",
|
paulson@14365
|
448 |
"((number_of v)::rat) / (number_of w)"],
|
paulson@14365
|
449 |
DivCancelNumeralFactor.proc)
|
paulson@14365
|
450 |
|
paulson@14365
|
451 |
val rat_cancel_numeral_factors =
|
paulson@14365
|
452 |
rat_cancel_numeral_factors_relations @
|
paulson@14365
|
453 |
[rat_cancel_numeral_factors_divide]
|
paulson@14365
|
454 |
|
paulson@14365
|
455 |
end;
|
paulson@14365
|
456 |
|
paulson@14365
|
457 |
Addsimprocs rat_cancel_numeral_factors;
|
paulson@14365
|
458 |
|
paulson@14365
|
459 |
|
paulson@14365
|
460 |
(*examples:
|
paulson@14365
|
461 |
print_depth 22;
|
paulson@14365
|
462 |
set timing;
|
paulson@14365
|
463 |
set trace_simp;
|
paulson@14365
|
464 |
fun test s = (Goal s; by (Simp_tac 1));
|
paulson@14365
|
465 |
|
paulson@14365
|
466 |
test "0 <= (y::rat) * -2";
|
paulson@14365
|
467 |
test "9*x = 12 * (y::rat)";
|
paulson@14365
|
468 |
test "(9*x) / (12 * (y::rat)) = z";
|
paulson@14365
|
469 |
test "9*x < 12 * (y::rat)";
|
paulson@14365
|
470 |
test "9*x <= 12 * (y::rat)";
|
paulson@14365
|
471 |
|
paulson@14365
|
472 |
test "-99*x = 132 * (y::rat)";
|
paulson@14365
|
473 |
test "(-99*x) / (132 * (y::rat)) = z";
|
paulson@14365
|
474 |
test "-99*x < 132 * (y::rat)";
|
paulson@14365
|
475 |
test "-99*x <= 132 * (y::rat)";
|
paulson@14365
|
476 |
|
paulson@14365
|
477 |
test "999*x = -396 * (y::rat)";
|
paulson@14365
|
478 |
test "(999*x) / (-396 * (y::rat)) = z";
|
paulson@14365
|
479 |
test "999*x < -396 * (y::rat)";
|
paulson@14365
|
480 |
test "999*x <= -396 * (y::rat)";
|
paulson@14365
|
481 |
|
paulson@14365
|
482 |
test "(- ((2::rat) * x) <= 2 * y)";
|
paulson@14365
|
483 |
test "-99*x = -81 * (y::rat)";
|
paulson@14365
|
484 |
test "(-99*x) / (-81 * (y::rat)) = z";
|
paulson@14365
|
485 |
test "-99*x <= -81 * (y::rat)";
|
paulson@14365
|
486 |
test "-99*x < -81 * (y::rat)";
|
paulson@14365
|
487 |
|
paulson@14365
|
488 |
test "-2 * x = -1 * (y::rat)";
|
paulson@14365
|
489 |
test "-2 * x = -(y::rat)";
|
paulson@14365
|
490 |
test "(-2 * x) / (-1 * (y::rat)) = z";
|
paulson@14365
|
491 |
test "-2 * x < -(y::rat)";
|
paulson@14365
|
492 |
test "-2 * x <= -1 * (y::rat)";
|
paulson@14365
|
493 |
test "-x < -23 * (y::rat)";
|
paulson@14365
|
494 |
test "-x <= -23 * (y::rat)";
|
paulson@14365
|
495 |
*)
|
paulson@14365
|
496 |
|
paulson@14365
|
497 |
|
paulson@14365
|
498 |
(** Declarations for ExtractCommonTerm **)
|
paulson@14365
|
499 |
|
paulson@14365
|
500 |
local
|
paulson@14365
|
501 |
open Rat_Numeral_Simprocs
|
paulson@14365
|
502 |
in
|
paulson@14365
|
503 |
|
paulson@14365
|
504 |
structure CancelFactorCommon =
|
paulson@14365
|
505 |
struct
|
paulson@14365
|
506 |
val mk_sum = long_mk_prod
|
paulson@14365
|
507 |
val dest_sum = dest_prod
|
paulson@14365
|
508 |
val mk_coeff = mk_coeff
|
paulson@14365
|
509 |
val dest_coeff = dest_coeff
|
paulson@14365
|
510 |
val find_first = find_first []
|
paulson@14365
|
511 |
val trans_tac = trans_tac
|
paulson@14365
|
512 |
val norm_tac = ALLGOALS (simp_tac (HOL_ss addsimps mult_1s@mult_ac))
|
paulson@14365
|
513 |
end;
|
paulson@14365
|
514 |
|
paulson@14365
|
515 |
structure EqCancelFactor = ExtractCommonTermFun
|
paulson@14365
|
516 |
(open CancelFactorCommon
|
paulson@14365
|
517 |
val prove_conv = Bin_Simprocs.prove_conv
|
paulson@14365
|
518 |
val mk_bal = HOLogic.mk_eq
|
paulson@14365
|
519 |
val dest_bal = HOLogic.dest_bin "op =" Rat_Numeral_Simprocs.ratT
|
paulson@14365
|
520 |
val simplify_meta_eq = cancel_simplify_meta_eq mult_cancel_left
|
paulson@14365
|
521 |
);
|
paulson@14365
|
522 |
|
paulson@14365
|
523 |
|
paulson@14365
|
524 |
structure DivideCancelFactor = ExtractCommonTermFun
|
paulson@14365
|
525 |
(open CancelFactorCommon
|
paulson@14365
|
526 |
val prove_conv = Bin_Simprocs.prove_conv
|
paulson@14365
|
527 |
val mk_bal = HOLogic.mk_binop "HOL.divide"
|
paulson@14365
|
528 |
val dest_bal = HOLogic.dest_bin "HOL.divide" Rat_Numeral_Simprocs.ratT
|
paulson@14365
|
529 |
val simplify_meta_eq = cancel_simplify_meta_eq mult_divide_cancel_eq_if
|
paulson@14365
|
530 |
);
|
paulson@14365
|
531 |
|
paulson@14365
|
532 |
val rat_cancel_factor =
|
paulson@14365
|
533 |
map prep_simproc
|
paulson@14365
|
534 |
[("rat_eq_cancel_factor", ["(l::rat) * m = n", "(l::rat) = m * n"], EqCancelFactor.proc),
|
paulson@14365
|
535 |
("rat_divide_cancel_factor", ["((l::rat) * m) / n", "(l::rat) / (m * n)"],
|
paulson@14365
|
536 |
DivideCancelFactor.proc)];
|
paulson@14365
|
537 |
|
paulson@14365
|
538 |
end;
|
paulson@14365
|
539 |
|
paulson@14365
|
540 |
Addsimprocs rat_cancel_factor;
|
paulson@14365
|
541 |
|
paulson@14365
|
542 |
|
paulson@14365
|
543 |
(*examples:
|
paulson@14365
|
544 |
print_depth 22;
|
paulson@14365
|
545 |
set timing;
|
paulson@14365
|
546 |
set trace_simp;
|
paulson@14365
|
547 |
fun test s = (Goal s; by (Asm_simp_tac 1));
|
paulson@14365
|
548 |
|
paulson@14365
|
549 |
test "x*k = k*(y::rat)";
|
paulson@14365
|
550 |
test "k = k*(y::rat)";
|
paulson@14365
|
551 |
test "a*(b*c) = (b::rat)";
|
paulson@14365
|
552 |
test "a*(b*c) = d*(b::rat)*(x*a)";
|
paulson@14365
|
553 |
|
paulson@14365
|
554 |
|
paulson@14365
|
555 |
test "(x*k) / (k*(y::rat)) = (uu::rat)";
|
paulson@14365
|
556 |
test "(k) / (k*(y::rat)) = (uu::rat)";
|
paulson@14365
|
557 |
test "(a*(b*c)) / ((b::rat)) = (uu::rat)";
|
paulson@14365
|
558 |
test "(a*(b*c)) / (d*(b::rat)*(x*a)) = (uu::rat)";
|
paulson@14365
|
559 |
|
paulson@14365
|
560 |
(*FIXME: what do we do about this?*)
|
paulson@14365
|
561 |
test "a*(b*c)/(y*z) = d*(b::rat)*(x*a)/z";
|
paulson@14365
|
562 |
*)
|
paulson@14365
|
563 |
|
paulson@14365
|
564 |
|
paulson@14365
|
565 |
|
paulson@14365
|
566 |
(****Instantiation of the generic linear arithmetic package****)
|
paulson@14365
|
567 |
|
paulson@14365
|
568 |
|
paulson@14365
|
569 |
local
|
paulson@14365
|
570 |
|
paulson@14365
|
571 |
(* reduce contradictory <= to False *)
|
paulson@14365
|
572 |
val add_rules =
|
paulson@14365
|
573 |
[order_less_irrefl, rat_numeral_0_eq_0, rat_numeral_1_eq_1,
|
paulson@14365
|
574 |
rat_minus_1_eq_m1,
|
paulson@14365
|
575 |
add_rat_number_of, minus_rat_number_of, diff_rat_number_of,
|
paulson@14369
|
576 |
mult_rat_number_of, eq_rat_number_of, less_rat_number_of];
|
paulson@14365
|
577 |
|
paulson@14365
|
578 |
val simprocs = [Rat_Times_Assoc.conv, Rat_Numeral_Simprocs.combine_numerals,
|
paulson@14365
|
579 |
rat_cancel_numeral_factors_divide]@
|
paulson@14365
|
580 |
Rat_Numeral_Simprocs.cancel_numerals @
|
paulson@14365
|
581 |
Rat_Numeral_Simprocs.eval_numerals;
|
paulson@14365
|
582 |
|
paulson@14365
|
583 |
val mono_ss = simpset() addsimps
|
paulson@14365
|
584 |
[add_mono,add_strict_mono,add_less_le_mono,add_le_less_mono];
|
paulson@14365
|
585 |
|
paulson@14368
|
586 |
val add_mono_thms_ordered_field =
|
paulson@14365
|
587 |
map (fn s => prove_goal (the_context ()) s
|
paulson@14365
|
588 |
(fn prems => [cut_facts_tac prems 1, asm_simp_tac mono_ss 1]))
|
paulson@14368
|
589 |
["(i < j) & (k = l) ==> i + k < j + (l::'a::ordered_field)",
|
paulson@14368
|
590 |
"(i = j) & (k < l) ==> i + k < j + (l::'a::ordered_field)",
|
paulson@14368
|
591 |
"(i < j) & (k <= l) ==> i + k < j + (l::'a::ordered_field)",
|
paulson@14368
|
592 |
"(i <= j) & (k < l) ==> i + k < j + (l::'a::ordered_field)",
|
paulson@14368
|
593 |
"(i < j) & (k < l) ==> i + k < j + (l::'a::ordered_field)"];
|
paulson@14365
|
594 |
|
paulson@14365
|
595 |
fun cvar(th,_ $ (_ $ _ $ var)) = cterm_of (#sign(rep_thm th)) var;
|
paulson@14365
|
596 |
|
paulson@14365
|
597 |
val rat_mult_mono_thms =
|
paulson@14365
|
598 |
[(rat_mult_strict_left_mono,
|
paulson@14365
|
599 |
cvar(rat_mult_strict_left_mono, hd(tl(prems_of rat_mult_strict_left_mono)))),
|
paulson@14365
|
600 |
(rat_mult_left_mono,
|
paulson@14365
|
601 |
cvar(rat_mult_left_mono, hd(tl(prems_of rat_mult_left_mono))))]
|
paulson@14365
|
602 |
|
paulson@14365
|
603 |
val simps = [True_implies_equals,
|
paulson@14369
|
604 |
inst "a" "(number_of ?v)" right_distrib,
|
paulson@14369
|
605 |
divide_1, times_divide_eq_right, times_divide_eq_left,
|
paulson@14378
|
606 |
of_int_0, of_int_1, of_int_add, of_int_minus, of_int_diff,
|
paulson@14378
|
607 |
of_int_mult, of_int_of_nat_eq, rat_number_of_def];
|
paulson@14365
|
608 |
|
paulson@14365
|
609 |
in
|
paulson@14365
|
610 |
|
paulson@14369
|
611 |
val fast_rat_arith_simproc = Simplifier.simproc (Theory.sign_of(the_context()))
|
paulson@14365
|
612 |
"fast_rat_arith" ["(m::rat) < n","(m::rat) <= n", "(m::rat) = n"]
|
paulson@14365
|
613 |
Fast_Arith.lin_arith_prover;
|
paulson@14365
|
614 |
|
paulson@14378
|
615 |
val nat_inj_thms = [of_nat_le_iff RS iffD2, of_nat_less_iff RS iffD2,
|
paulson@14378
|
616 |
of_nat_eq_iff RS iffD2];
|
paulson@14378
|
617 |
|
paulson@14378
|
618 |
val int_inj_thms = [of_int_le_iff RS iffD2, of_int_less_iff RS iffD2,
|
paulson@14378
|
619 |
of_int_eq_iff RS iffD2];
|
paulson@14365
|
620 |
|
paulson@14365
|
621 |
val rat_arith_setup =
|
paulson@14365
|
622 |
[Fast_Arith.map_data (fn {add_mono_thms, mult_mono_thms, inj_thms, lessD, simpset} =>
|
paulson@14368
|
623 |
{add_mono_thms = add_mono_thms @ add_mono_thms_ordered_field,
|
paulson@14365
|
624 |
mult_mono_thms = mult_mono_thms @ rat_mult_mono_thms,
|
paulson@14369
|
625 |
inj_thms = int_inj_thms @ inj_thms,
|
paulson@14365
|
626 |
lessD = lessD, (*Can't change LA_Data_Ref.lessD: the rats are dense!*)
|
paulson@14365
|
627 |
simpset = simpset addsimps add_rules
|
paulson@14365
|
628 |
addsimps simps
|
paulson@14365
|
629 |
addsimprocs simprocs}),
|
paulson@14378
|
630 |
arith_inj_const("IntDef.of_nat", HOLogic.natT --> Rat_Numeral_Simprocs.ratT),
|
paulson@14378
|
631 |
arith_inj_const("IntDef.of_int", HOLogic.intT --> Rat_Numeral_Simprocs.ratT),
|
paulson@14365
|
632 |
arith_discrete ("Rational.rat",false),
|
paulson@14365
|
633 |
Simplifier.change_simpset_of (op addsimprocs) [fast_rat_arith_simproc]];
|
paulson@14365
|
634 |
|
paulson@14365
|
635 |
|
paulson@14365
|
636 |
end;
|
paulson@14365
|
637 |
|
paulson@14365
|
638 |
|