From a97acdb92bce7c13e9731254bc9dc66671d6f806 Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Thu, 27 Jun 2019 14:29:43 +0100 Subject: Coq: less constrained version of slice for ARM model --- lib/coq/Sail2_operators_mwords.v | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lib') diff --git a/lib/coq/Sail2_operators_mwords.v b/lib/coq/Sail2_operators_mwords.v index 9b5888c7..739a22d0 100644 --- a/lib/coq/Sail2_operators_mwords.v +++ b/lib/coq/Sail2_operators_mwords.v @@ -499,5 +499,33 @@ Definition set_slice_int len n lo (v : mword len) : Z := (int_of_mword true (update_subrange_vec_dec bs hi lo v)) else n. +(* Variant of bitvector slicing for the ARM model with few constraints *) +Definition slice {m} (v : mword m) lo len `{ArithFact (0 <= len)} : mword len := + if sumbool_of_bool (orb (len =? 0) (lo =? m) + then if sumbool_of_bool (lo