diff options
| author | Thomas Bauereiss | 2017-11-02 14:10:28 +0000 |
|---|---|---|
| committer | Thomas Bauereiss | 2017-11-02 14:10:28 +0000 |
| commit | 28d471755b0882c5c069a95e07ce6bb9352f06b9 (patch) | |
| tree | 61caea55cea5c3c53b63427fc4ac04d82423d7f8 /src/gen_lib | |
| parent | aa35f90fe4e7da4a6bbbe1396c23f9a5795b6909 (diff) | |
| parent | f8107b6b4dc4738d57a1a0c367de72a6d811f4cb (diff) | |
Merge branch 'experiments'
Diffstat (limited to 'src/gen_lib')
| -rw-r--r-- | src/gen_lib/sail_operators_mwords.lem | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gen_lib/sail_operators_mwords.lem b/src/gen_lib/sail_operators_mwords.lem index d4dca80c..8fb55137 100644 --- a/src/gen_lib/sail_operators_mwords.lem +++ b/src/gen_lib/sail_operators_mwords.lem @@ -3,6 +3,16 @@ open import Machine_word open import Sail_impl_base open import Sail_values +(* Translating between a type level number (itself 'n) and an integer *) + +let size_itself_int x = integerFromNat (size_itself x) + +(* NB: the corresponding sail type is forall 'n. atom('n) -> itself('n), + the actual integer is ignored. *) + +val make_the_value : forall 'n. integer -> itself 'n +let inline make_the_value x = the_value + (*** Bit vector operations *) let bitvector_length bs = integerFromNat (word_length bs) |
