aboutsummaryrefslogtreecommitdiff
path: root/src/Util/BoundedWord.v
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2017-04-01 22:58:27 -0400
committerGravatar Jason Gross <jgross@mit.edu>2017-04-01 22:58:27 -0400
commitd4f6f7373fc1f3a0ba1d1c17547f6d5b556bea5b (patch)
treeb13f8852f07c92b4bf157b8592c85b3bb81d1179 /src/Util/BoundedWord.v
parentd26097a2854ab38d046ca5df22b1732f6eece0eb (diff)
Split off BoundedWord.v from IntegrationTest.v
Diffstat (limited to 'src/Util/BoundedWord.v')
-rw-r--r--src/Util/BoundedWord.v13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Util/BoundedWord.v b/src/Util/BoundedWord.v
new file mode 100644
index 000000000..cfd27a231
--- /dev/null
+++ b/src/Util/BoundedWord.v
@@ -0,0 +1,13 @@
+Require Import Coq.ZArith.ZArith.
+Require Import Crypto.Util.Tuple.
+Require Import Crypto.Util.ZRange.
+Require Import Crypto.Util.FixedWordSizes.
+
+Definition BoundedWord n (bitwidth : nat)
+ (bounds : tuple zrange n) : Type :=
+ { x : tuple (wordT bitwidth) n
+ | is_bounded_by (Some (Z.of_nat bitwidth)) bounds
+ (map wordToZ x)}.
+
+Definition BoundedWordToZ n w b (BW :BoundedWord n w b)
+ : tuple Z n := map wordToZ (proj1_sig BW).