-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpec.lean
More file actions
26 lines (22 loc) · 1018 Bytes
/
Copy pathSpec.lean
File metadata and controls
26 lines (22 loc) · 1018 Bytes
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
import Project.ExpSmall.Bounds
import Project.ExpSmall.Execution
import Project.ExpSmall.AnnotationMatches
namespace Project.ExpSmall.Spec
open Wasm CodeLib.IEEE64
def RealErrorSpecFor (m : Wasm.Module) : Prop :=
∀ (env : HostEnv Unit) (initial : Store Unit) (x : UInt64),
Finite x → -1 ≤ value x → value x ≤ 0 →
TerminatesWith env m 2 initial [.i64 x]
(fun final values => final = initial ∧
values = [.i64 (polynomial x), .i64 0] ∧
Finite (polynomial x) ∧ 0 < value (polynomial x) ∧
|value (polynomial x) - Real.exp (value x)| ≤ 1 / 4000)
theorem expSmall_real_error : RealErrorSpecFor Project.ExpSmall.module := by
intro env initial x hx hl hu
refine TerminatesWith.mono (expSmall_exact env initial x) ?_
rintro final values ⟨rfl, rfl⟩
have hs := expSmall_success x hl hu
have hn := polynomial_positive x hx hl hu
exact ⟨rfl, by rw [hs.1, hs.2], hn.1, hn.2.1, hn.2.2.2⟩
#print axioms expSmall_real_error
end Project.ExpSmall.Spec