-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompcert.flocq.Core.Fcore_FIX.html
161 lines (127 loc) · 16.7 KB
/
compcert.flocq.Core.Fcore_FIX.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="coqdoc.css" rel="stylesheet" type="text/css" />
<title>compcert.flocq.Core.Fcore_FIX</title>
</head>
<body>
<div id="page">
<div id="header">
</div>
<div id="main">
<h1 class="libtitle">Library compcert.flocq.Core.Fcore_FIX</h1>
<div class="code">
</div>
<div class="doc">
This file is part of the Flocq formalization of floating-point
arithmetic in Coq: http://flocq.gforge.inria.fr/
<div class="paragraph"> </div>
Copyright (C) 2010-2013 Sylvie Boldo
<br />
Copyright (C) 2010-2013 Guillaume Melquiond
<div class="paragraph"> </div>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
<div class="paragraph"> </div>
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
COPYING file for more details.
<div class="paragraph"> </div>
<a name="lab27"></a><h1 class="section">Fixed-point format</h1>
</div>
<div class="code">
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="compcert.flocq.Core.Fcore_Raux.html#"><span class="id" title="library">Fcore_Raux</span></a>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="compcert.flocq.Core.Fcore_defs.html#"><span class="id" title="library">Fcore_defs</span></a>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="compcert.flocq.Core.Fcore_rnd.html#"><span class="id" title="library">Fcore_rnd</span></a>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="compcert.flocq.Core.Fcore_generic_fmt.html#"><span class="id" title="library">Fcore_generic_fmt</span></a>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="compcert.flocq.Core.Fcore_ulp.html#"><span class="id" title="library">Fcore_ulp</span></a>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="compcert.flocq.Core.Fcore_rnd_ne.html#"><span class="id" title="library">Fcore_rnd_ne</span></a>.<br/>
<br/>
<span class="id" title="keyword">Section</span> <a name="RND_FIX"><span class="id" title="section">RND_FIX</span></a>.<br/>
<br/>
<span class="id" title="keyword">Variable</span> <span class="id" title="keyword">beta</span> : <a class="idref" href="compcert.flocq.Core.Fcore_Zaux.html#radix"><span class="id" title="record">radix</span></a>.<br/>
<br/>
<span class="id" title="keyword">Notation</span> <a name="bpow"><span class="id" title="abbreviation">bpow</span></a> := (<a class="idref" href="compcert.flocq.Core.Fcore_Raux.html#bpow"><span class="id" title="definition">bpow</span></a> <span class="id" title="keyword">beta</span>).<br/>
<br/>
<span class="id" title="keyword">Variable</span> <a name="RND_FIX.emin"><span class="id" title="variable">emin</span></a> : <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.Numbers.BinNums.html#Z"><span class="id" title="inductive">Z</span></a>.<br/>
<br/>
<span class="id" title="keyword">Definition</span> <a name="FIX_format"><span class="id" title="definition">FIX_format</span></a> (<span class="id" title="var">x</span> : <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.Reals.Rdefinitions.html#R"><span class="id" title="axiom">R</span></a>) :=<br/>
<a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.Init.Logic.html#84eb6d2849dbf3581b1c0c05add5f2d8"><span class="id" title="notation">∃</span></a> <span class="id" title="var">f</span> : <a class="idref" href="compcert.flocq.Core.Fcore_defs.html#float"><span class="id" title="record">float</span></a> <span class="id" title="keyword">beta</span><a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.Init.Logic.html#84eb6d2849dbf3581b1c0c05add5f2d8"><span class="id" title="notation">,</span></a><br/>
<a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#x"><span class="id" title="variable">x</span></a> <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.Init.Logic.html#1c39bf18749e5cc609e83c0a0ba5a372"><span class="id" title="notation">=</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_defs.html#F2R"><span class="id" title="definition">F2R</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#f"><span class="id" title="variable">f</span></a> <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.Init.Logic.html#d82a7d96d3659d805ffe732283716822"><span class="id" title="notation">∧</span></a> (<a class="idref" href="compcert.flocq.Core.Fcore_defs.html#Fexp"><span class="id" title="projection">Fexp</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#f"><span class="id" title="variable">f</span></a> <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.Init.Logic.html#1c39bf18749e5cc609e83c0a0ba5a372"><span class="id" title="notation">=</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#RND_FIX.emin"><span class="id" title="variable">emin</span></a>)%<span class="id" title="var">Z</span>.<br/>
<br/>
<span class="id" title="keyword">Definition</span> <a name="FIX_exp"><span class="id" title="definition">FIX_exp</span></a> (<span class="id" title="var">e</span> : <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.Numbers.BinNums.html#Z"><span class="id" title="inductive">Z</span></a>) := <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#RND_FIX.emin"><span class="id" title="variable">emin</span></a>.<br/>
<br/>
</div>
<div class="doc">
Properties of the FIX format
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Global Instance</span> <a name="FIX_exp_valid"><span class="id" title="instance">FIX_exp_valid</span></a> : <a class="idref" href="compcert.flocq.Core.Fcore_generic_fmt.html#Valid_exp"><span class="id" title="class">Valid_exp</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_exp"><span class="id" title="definition">FIX_exp</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">k</span>.<br/>
<span class="id" title="tactic">unfold</span> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_exp"><span class="id" title="definition">FIX_exp</span></a>.<br/>
<span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intros</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="var">now</span> <span class="id" title="tactic">apply</span> <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.ZArith.Zorder.html#Zlt_le_weak"><span class="id" title="abbreviation">Zlt_le_weak</span></a>.<br/>
<span class="id" title="tactic">split</span>.<br/>
<span class="id" title="tactic">apply</span> <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.ZArith.Zorder.html#Zle_refl"><span class="id" title="abbreviation">Zle_refl</span></a>.<br/>
<span class="id" title="var">now</span> <span class="id" title="tactic">intros</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Theorem</span> <a name="generic_format_FIX"><span class="id" title="lemma">generic_format_FIX</span></a> :<br/>
<span class="id" title="keyword">∀</span> <span class="id" title="var">x</span>, <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_format"><span class="id" title="definition">FIX_format</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#x"><span class="id" title="variable">x</span></a> <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.Init.Logic.html#d43e996736952df71ebeeae74d10a287"><span class="id" title="notation">→</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_generic_fmt.html#generic_format"><span class="id" title="definition">generic_format</span></a> <span class="id" title="keyword">beta</span> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_exp"><span class="id" title="definition">FIX_exp</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#x"><span class="id" title="variable">x</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">x</span> ((<span class="id" title="var">xm</span>, <span class="id" title="var">xe</span>), (<span class="id" title="var">Hx1</span>, <span class="id" title="var">Hx2</span>)).<br/>
<span class="id" title="tactic">rewrite</span> <span class="id" title="var">Hx1</span>.<br/>
<span class="id" title="var">now</span> <span class="id" title="tactic">apply</span> <a class="idref" href="compcert.flocq.Core.Fcore_generic_fmt.html#generic_format_canonic"><span class="id" title="lemma">generic_format_canonic</span></a>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Theorem</span> <a name="FIX_format_generic"><span class="id" title="lemma">FIX_format_generic</span></a> :<br/>
<span class="id" title="keyword">∀</span> <span class="id" title="var">x</span>, <a class="idref" href="compcert.flocq.Core.Fcore_generic_fmt.html#generic_format"><span class="id" title="definition">generic_format</span></a> <span class="id" title="keyword">beta</span> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_exp"><span class="id" title="definition">FIX_exp</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#x"><span class="id" title="variable">x</span></a> <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.Init.Logic.html#d43e996736952df71ebeeae74d10a287"><span class="id" title="notation">→</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_format"><span class="id" title="definition">FIX_format</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#x"><span class="id" title="variable">x</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">x</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">rewrite</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">eexists</span> ; <span class="id" title="tactic">repeat</span> <span class="id" title="tactic">split</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Theorem</span> <a name="FIX_format_satisfies_any"><span class="id" title="lemma">FIX_format_satisfies_any</span></a> :<br/>
<a class="idref" href="compcert.flocq.Core.Fcore_rnd.html#satisfies_any"><span class="id" title="inductive">satisfies_any</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_format"><span class="id" title="definition">FIX_format</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">refine</span> (<a class="idref" href="compcert.flocq.Core.Fcore_rnd.html#satisfies_any_eq"><span class="id" title="lemma">satisfies_any_eq</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> (<a class="idref" href="compcert.flocq.Core.Fcore_generic_fmt.html#generic_format_satisfies_any"><span class="id" title="lemma">generic_format_satisfies_any</span></a> <span class="id" title="keyword">beta</span> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_exp"><span class="id" title="definition">FIX_exp</span></a>)).<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">x</span>.<br/>
<span class="id" title="tactic">split</span>.<br/>
<span class="id" title="tactic">apply</span> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_format_generic"><span class="id" title="lemma">FIX_format_generic</span></a>.<br/>
<span class="id" title="tactic">apply</span> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#generic_format_FIX"><span class="id" title="lemma">generic_format_FIX</span></a>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Global Instance</span> <a name="FIX_exp_monotone"><span class="id" title="instance">FIX_exp_monotone</span></a> : <a class="idref" href="compcert.flocq.Core.Fcore_generic_fmt.html#Monotone_exp"><span class="id" title="class">Monotone_exp</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_exp"><span class="id" title="definition">FIX_exp</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">ex</span> <span class="id" title="var">ey</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">apply</span> <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.ZArith.Zorder.html#Zle_refl"><span class="id" title="abbreviation">Zle_refl</span></a>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Theorem</span> <a name="ulp_FIX"><span class="id" title="lemma">ulp_FIX</span></a>: <span class="id" title="keyword">∀</span> <span class="id" title="var">x</span>, <a class="idref" href="compcert.flocq.Core.Fcore_ulp.html#ulp"><span class="id" title="definition">ulp</span></a> <span class="id" title="keyword">beta</span> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_exp"><span class="id" title="definition">FIX_exp</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#x"><span class="id" title="variable">x</span></a> <a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.Init.Logic.html#1c39bf18749e5cc609e83c0a0ba5a372"><span class="id" title="notation">=</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#bpow"><span class="id" title="abbreviation">bpow</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#RND_FIX.emin"><span class="id" title="variable">emin</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">x</span>; <span class="id" title="tactic">unfold</span> <a class="idref" href="compcert.flocq.Core.Fcore_ulp.html#ulp"><span class="id" title="definition">ulp</span></a>.<br/>
<span class="id" title="tactic">case</span> <a class="idref" href="compcert.flocq.Core.Fcore_Raux.html#Req_bool_spec"><span class="id" title="lemma">Req_bool_spec</span></a>; <span class="id" title="tactic">intros</span> <span class="id" title="var">Zx</span>.<br/>
<span class="id" title="tactic">case</span> (<a class="idref" href="compcert.flocq.Core.Fcore_ulp.html#negligible_exp_spec"><span class="id" title="lemma">negligible_exp_spec</span></a> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_exp"><span class="id" title="definition">FIX_exp</span></a>).<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">T</span>; <span class="id" title="tactic">specialize</span> (<span class="id" title="var">T</span> (<a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#RND_FIX.emin"><span class="id" title="variable">emin</span></a><a class="idref" href="http://coq.inria.fr/distrib/8.6/stdlib/Coq.ZArith.BinInt.html#239a40728d107295b3cb2c790f57f9e9"><span class="id" title="notation">-</span></a>1)%<span class="id" title="var">Z</span>); <span class="id" title="var">contradict</span> <span class="id" title="var">T</span>.<br/>
<span class="id" title="tactic">unfold</span> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#FIX_exp"><span class="id" title="definition">FIX_exp</span></a>; <span class="id" title="tactic">omega</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">n</span> <span class="id" title="var">_</span>; <span class="id" title="tactic">reflexivity</span>.<br/>
<span class="id" title="tactic">reflexivity</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">End</span> <a class="idref" href="compcert.flocq.Core.Fcore_FIX.html#RND_FIX"><span class="id" title="section">RND_FIX</span></a>.<br/>
</div>
</div>
<div id="footer">
<hr/><a href="index.html">Index</a><hr/>This page has been generated by <a href="http://coq.inria.fr/">coqdoc</a>
</div>
</div>
</body>
</html>