diff options
| -rw-r--r-- | src/toFromInterp_lib_bitlist.ml | 26 | ||||
| -rw-r--r-- | src/toFromInterp_lib_mword.ml | 22 |
2 files changed, 24 insertions, 24 deletions
diff --git a/src/toFromInterp_lib_bitlist.ml b/src/toFromInterp_lib_bitlist.ml index 13912722..3d6c63b0 100644 --- a/src/toFromInterp_lib_bitlist.ml +++ b/src/toFromInterp_lib_bitlist.ml @@ -106,19 +106,6 @@ let zvectorToInterpValue typq_'n typq_'ord typq_'a v = let vectorFromInterpValue = zvectorFromInterpValue let vectorToInterpValue = zvectorToInterpValue -let zbitvectorFromInterpValue typq_'n typq_'ord v = match v with - | V_vector vs -> - assert (Big_int.of_int (List.length vs) = typq_'n); - vs - | _ -> failwith "invalid interpreter value for vector" - -let zbitvectorToInterpValue typq_'n typq_'ord v = - assert (Big_int.of_int (List.length v) = typq_'n); - V_vector v - -let bitvectorFromInterpValue = zvectorFromInterpValue -let bitvectorToInterpValue = zvectorToInterpValue - let zbitFromInterpValue v = match v with | V_bit b -> (match b with | Sail_lib.B0 -> BitT.b0 @@ -133,6 +120,19 @@ let zbitToInterpValue v = V_bit (match v with let bitFromInterpValue = zbitFromInterpValue let bitToInterpValue = zbitToInterpValue +let zbitvectorFromInterpValue typq_'n typq_'ord v = match v with + | V_vector vs -> + assert (Big_int.of_int (List.length vs) = typq_'n); + List.map bitFromInterpValue vs + | _ -> failwith "invalid interpreter value for vector" + +let zbitvectorToInterpValue typq_'n typq_'ord v = + assert (Big_int.of_int (List.length v) = typq_'n); + V_vector (List.map bitToInterpValue v) + +let bitvectorFromInterpValue = zvectorFromInterpValue +let bitvectorToInterpValue = zvectorToInterpValue + let optionFromInterpValue typq_'a v = match v with | V_ctor ("None", [v0]) -> None | V_ctor ("Some", [v0]) -> Some (typq_'a v0) diff --git a/src/toFromInterp_lib_mword.ml b/src/toFromInterp_lib_mword.ml index d983a6ba..816ae136 100644 --- a/src/toFromInterp_lib_mword.ml +++ b/src/toFromInterp_lib_mword.ml @@ -104,28 +104,28 @@ let zvectorToInterpValue typq_'n typq_'ord typq_'a v = let vectorFromInterpValue = zvectorFromInterpValue let vectorToInterpValue = zvectorToInterpValue +let zbitFromInterpValue v = match v with + | V_bit b -> b + | _ -> failwith "invalid interpreter value for bit" + +let zbitToInterpValue v = V_bit v + +let bitFromInterpValue = zbitFromInterpValue +let bitToInterpValue = zbitToInterpValue + let zbitvectorFromInterpValue typq_'n typq_'ord v = match v with | V_vector vs -> assert (Big_int.of_int (List.length vs) = typq_'n); - vs + List.map bitFromInterpValue vs | _ -> failwith "invalid interpreter value for vector" let zbitvectorToInterpValue typq_'n typq_'ord v = assert (Big_int.of_int (List.length v) = typq_'n); - V_vector v + V_vector (List.map bitToInterpValue v) let bitvectorFromInterpValue = zvectorFromInterpValue let bitvectorToInterpValue = zvectorToInterpValue -let zbitFromInterpValue v = match v with - | V_bit b -> b - | _ -> failwith "invalid interpreter value for bit" - -let zbitToInterpValue v = V_bit v - -let bitFromInterpValue = zbitFromInterpValue -let bitToInterpValue = zbitToInterpValue - let optionFromInterpValue typq_'a v = match v with | V_ctor ("None", [v0]) -> None | V_ctor ("Some", [v0]) -> Some (typq_'a v0) |
