diff options
| author | Brian Campbell | 2018-09-13 15:12:28 +0100 |
|---|---|---|
| committer | Brian Campbell | 2018-09-13 15:12:45 +0100 |
| commit | 61abeccf6c37169bc22a1674897caf482195857f (patch) | |
| tree | ec7c94584b50f9af3ccc27148953f291ad4e0ea6 /lib/coq/Sail2_real.v | |
| parent | 3bbda62cb341cc7277fc8c70685ad7d9313e2412 (diff) | |
Coq: real built-ins for AArch64
Diffstat (limited to 'lib/coq/Sail2_real.v')
| -rw-r--r-- | lib/coq/Sail2_real.v | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/coq/Sail2_real.v b/lib/coq/Sail2_real.v new file mode 100644 index 00000000..49023d4c --- /dev/null +++ b/lib/coq/Sail2_real.v @@ -0,0 +1,18 @@ +Require Export Rbase. +Require Import Reals. +Require Export ROrderedType. + +Definition realFromFrac (num denom : Z) : R := Rdiv (IZR num) (IZR denom). + +Definition gteq_real (x y : R) : bool := if Rge_dec x y then true else false. +Definition lteq_real (x y : R) : bool := if Rle_dec x y then true else false. +Definition gt_real (x y : R) : bool := if Rgt_dec x y then true else false. +Definition lt_real (x y : R) : bool := if Rlt_dec x y then true else false. + +(* Export select definitions from outside of Rbase *) +Definition powerRZ := powerRZ. +Definition Rabs := Rabs. + +(* Use flocq definitions, but without making the whole library a dependency. *) +Definition Zfloor (x : R) := (up x - 1)%Z. +Definition Zceil (x : R) := (- Zfloor (- x))%Z. |
