summaryrefslogtreecommitdiff
path: root/lib/vector_inc.sail
diff options
context:
space:
mode:
authorBrian Campbell2018-05-29 16:34:55 +0100
committerBrian Campbell2018-06-08 15:03:37 +0100
commitd911024d83b1f70bcc99b949e6c8eeac03851911 (patch)
tree5d7734acddc8b42413b28fa079c95f7afb4dc4ae /lib/vector_inc.sail
parenta6f319a2f176fbde6020fc508bb0f319a0b225e5 (diff)
Fill in most Coq built-ins
Diffstat (limited to 'lib/vector_inc.sail')
-rw-r--r--lib/vector_inc.sail17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/vector_inc.sail b/lib/vector_inc.sail
index c45fec6b..b13e053c 100644
--- a/lib/vector_inc.sail
+++ b/lib/vector_inc.sail
@@ -10,7 +10,8 @@ val "eq_bit" : (bit, bit) -> bool
val eq_bits = {
ocaml: "eq_list",
lem: "eq_vec",
- c: "eq_bits"
+ c: "eq_bits",
+ coq: "eq_vec"
} : forall 'n. (vector('n, inc, bit), vector('n, inc, bit)) -> bool
overload operator == = {eq_bit, eq_bits}
@@ -20,7 +21,8 @@ val bitvector_length = {coq: "length_mword", _:"length"} : forall 'n. bits('n) -
val vector_length = {
ocaml: "length",
lem: "length_list",
- c: "length"
+ c: "length",
+ coq: "length_list"
} : forall 'n ('a : Type). vector('n, inc, 'a) -> atom('n)
overload length = {bitvector_length, vector_length}
@@ -46,7 +48,7 @@ function mask(len, v) = if len <= length(v) then truncate(v, len) else zero_exte
overload operator ^ = {mask}
-val bitvector_concat = {ocaml: "append", lem: "concat_vec", c: "append"} : forall ('n : Int) ('m : Int).
+val bitvector_concat = {ocaml: "append", lem: "concat_vec", c: "append", coq: "concat_vec"} : forall ('n : Int) ('m : Int).
(bits('n), bits('m)) -> bits('n + 'm)
overload append = {bitvector_concat}
@@ -83,14 +85,16 @@ overload operator + = {add_bits, add_bits_int}
val vector_subrange = {
ocaml: "subrange",
lem: "subrange_vec_inc",
- c: "vector_subrange"
+ c: "vector_subrange",
+ coq: "subrange_vec_inc"
} : forall ('n : Int) ('m : Int) ('o : Int), 'o <= 'm <= 'n.
(bits('n), atom('m), atom('o)) -> bits('m - ('o - 1))
val vector_update_subrange = {
ocaml: "update_subrange",
lem: "update_subrange_vec_inc",
- c: "vector_update_subrange"
+ c: "vector_update_subrange",
+ coq: "update_subrange_vec_inc"
} : forall 'n 'm 'o. (bits('n), atom('m), atom('o), bits('m - ('o - 1))) -> bits('n)
// Some ARM specific builtins
@@ -110,7 +114,8 @@ val unsigned = {
ocaml: "uint",
lem: "uint",
interpreter: "uint",
- c: "sail_uint"
+ c: "sail_uint",
+ coq: "uint"
} : forall 'n. bits('n) -> range(0, 2 ^ 'n - 1)
val signed = "sint" : forall 'n. bits('n) -> range(- (2 ^ ('n - 1)), 2 ^ ('n - 1) - 1)