-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathrealOps.lem
42 lines (34 loc) · 1005 Bytes
/
realOps.lem
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
(*
Definition of real-valued operations
*)
open import Pervasives
open import Lib
open import {hol} `realTheory`
open import {hol} `transcTheory`
open import {hol} `machine_ieeeTheory`
type real_cmp = Real_Less | Real_LessEqual | Real_Greater | Real_GreaterEqual | Real_Equal
type real_uop = Real_Abs | Real_Neg | Real_Sqrt
type real_bop = Real_Add | Real_Sub | Real_Mul | Real_Div
val real_cmp : real_cmp -> real -> real -> bool
let real_cmp fop = match fop with
| Real_Less -> (<)
| Real_LessEqual -> (<=)
| Real_Greater -> (>)
| Real_GreaterEqual -> (>=)
| Real_Equal -> (=)
end
val real_uop : real_uop -> real -> real
let real_uop fop = match fop with
| Real_Abs -> abs
| Real_Neg -> (~)
| Real_Sqrt -> realSqrt
end
val real_bop : real_bop -> real -> real -> real
let real_bop fop = match fop with
| Real_Add -> (+)
| Real_Sub -> (-)
| Real_Mul -> ( * )
| Real_Div -> (/)
end
val float2real : word64 -> real
declare hol target_rep function float2real = `fp64_to_real`