1
+ (* *
2
+ Connect FloVer's idealized machine semantics to 64-bit
3
+ IEEE-754 floating-point semantics
4
+ **)
1
5
open machine_ieeeTheory binary_ieeeTheory lift_ieeeTheory realTheory RealArith;
2
6
open MachineTypeTheory ExpressionsTheory RealSimpsTheory FloverTactics
3
7
CertificateCheckerTheory FPRangeValidatorTheory IntervalValidationTheory
@@ -9,7 +13,8 @@ open preambleFloVer;
9
13
10
14
val _ = new_theory " IEEE_connection" ;
11
15
12
- val _ = temp_overload_on(" abs" ,``real$abs``);
16
+ Overload abs[local ] = “real$abs”
17
+
13
18
val _ = diminish_srw_ss [" RMULCANON_ss" ," RMULRELNORM_ss" ]
14
19
15
20
(* * FloVer assumes rounding with ties to even, thus we exprlicitly define
@@ -295,30 +300,41 @@ Proof
295
300
\\ `w2n c0 = 2047 ` by fs[] \\ fs[]
296
301
\\ TOP_CASE_TAC \\ fs[minValue_pos_def, minExponentPos_def]
297
302
\\ fs[REAL_ABS_MUL, POW_M1]
298
- >- (`44942328371557897693232629769725618340449424473557664318357520289433168951375240783177119330601884005280028469967848339414697442203604155623211857659868531094441973356216371319075554900311523529863270738021251442209537670585615720368478277635206809290837627671146574559986811484619929076208839082406056034304 ⁻¹ <= inv 1 `
299
- by (irule REAL_INV_LE_ANTIMONO_IMPR \\ fs[])
300
- \\ fs[pow_simp1, REAL_DIV_LZERO, ABS_1, REAL_OF_NUM_POW, abs]
301
- \\ `179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216 < inv 1 `
302
- by (irule REAL_LTE_TRANS \\ asm_exists_tac \\ fs[])
303
- \\ fs[REAL_INV1])
303
+ >- (
304
+ qpat_x_assum ‘_ < inv _’ mp_tac
305
+ \\ qmatch_goalsub_abbrev_tac ‘_ < inv cst1 ⇒ _’
306
+ \\ strip_tac
307
+ \\ `inv cst1 <= inv 1 `
308
+ by (unabbrev_all_tac \\ irule REAL_INV_LE_ANTIMONO_IMPR \\ fs[])
309
+ \\ fs[pow_simp1, REAL_DIV_LZERO, ABS_1, REAL_OF_NUM_POW, abs]
310
+ \\ qpat_x_assum ‘_ < inv cst1’ mp_tac
311
+ \\ qmatch_goalsub_abbrev_tac ‘cst2 < inv cst1’ \\ strip_tac
312
+ \\ `cst2 < inv 1 `
313
+ by (unabbrev_all_tac \\ irule REAL_LTE_TRANS \\ asm_exists_tac \\ fs[])
314
+ \\ unabbrev_all_tac \\ fs[REAL_INV1])
304
315
\\ Cases_on `c1` \\ fs[]
305
316
\\ `1 < abs (1 + &n / 4503599627370496 )`
306
- by (
307
- fs[abs]
308
- \\ `0 :real <= 1 + &n / 4503599627370496 `
309
- by (irule REAL_LE_TRANS
310
- \\ qexists_tac `1 ` \\ fs[]
311
- \\ irule REAL_LE_DIV \\ fs[])
312
- \\ fs[]
313
- \\ once_rewrite_tac [GSYM REAL_ADD_RID]
314
- \\ once_rewrite_tac [GSYM REAL_ADD_ASSOC]
315
- \\ fs[]
316
- \\ irule REAL_LT_DIV \\ fs[])
317
- \\ `44942328371557897693232629769725618340449424473557664318357520289433168951375240783177119330601884005280028469967848339414697442203604155623211857659868531094441973356216371319075554900311523529863270738021251442209537670585615720368478277635206809290837627671146574559986811484619929076208839082406056034304 ⁻¹ <= inv 1 `
318
- by (irule REAL_INV_LE_ANTIMONO_IMPR \\ fs[])
317
+ by (fs[abs]
318
+ \\ `0 :real <= 1 + &n / 4503599627370496 `
319
+ by (irule REAL_LE_TRANS
320
+ \\ qexists_tac `1 ` \\ fs[]
321
+ \\ irule REAL_LE_DIV \\ fs[])
322
+ \\ fs[]
323
+ \\ once_rewrite_tac [GSYM REAL_ADD_RID]
324
+ \\ once_rewrite_tac [GSYM REAL_ADD_ASSOC]
325
+ \\ fs[]
326
+ \\ irule REAL_LT_DIV \\ fs[])
327
+ \\ qpat_x_assum ‘_ < inv _’ mp_tac
328
+ \\ qmatch_goalsub_abbrev_tac ‘_ < inv cst1 ⇒ _’
329
+ \\ `inv cst1 <= inv 1 `
330
+ by (unabbrev_all_tac \\ irule REAL_INV_LE_ANTIMONO_IMPR \\ fs[])
331
+ \\ strip_tac
319
332
\\ fs[pow_simp1, REAL_DIV_LZERO, ABS_1, REAL_OF_NUM_POW, abs]
320
- \\ `179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216 < inv 1 `
321
- by (irule REAL_LTE_TRANS \\ once_rewrite_tac[CONJ_COMM]
333
+ \\ qpat_x_assum ‘_ < inv cst1’ mp_tac
334
+ \\ qmatch_goalsub_abbrev_tac ‘(cst2 * _) < inv cst1’
335
+ \\ strip_tac
336
+ \\ `cst2 < inv 1 `
337
+ by (unabbrev_all_tac \\ irule REAL_LTE_TRANS \\ once_rewrite_tac[CONJ_COMM]
322
338
\\ rewrite_tac[REAL_INV1] \\ asm_exists_tac \\ fs[]
323
339
\\ qmatch_goalsub_abbrev_tac `cst1 < cst2`
324
340
\\ `0 <= (1 :real) + &n / 4503599627370496 `
@@ -332,7 +348,7 @@ Proof
332
348
\\ once_rewrite_tac [GSYM REAL_MUL_ASSOC] \\ irule REAL_LT_LMUL_IMP
333
349
\\ fs[]
334
350
\\ unabbrev_all_tac \\ fs[])
335
- \\ fs[REAL_INV1]
351
+ \\ unabbrev_all_tac \\ fs[REAL_INV1]
336
352
QED
337
353
338
354
Theorem validValue_gives_float_value:
0 commit comments