summaryrefslogtreecommitdiff
path: root/lib/coq
diff options
context:
space:
mode:
authorBrian Campbell2019-05-19 18:39:56 +0100
committerBrian Campbell2019-05-19 18:40:26 +0100
commite083553d9e10cc59caaff34635f9e9fd7193cad4 (patch)
treef1856b04015d44a99ae439f28bedca7296387b65 /lib/coq
parentbaf7c57218b37618c5ede4ec72d3c79e9c14cd51 (diff)
Coq: add signed bitvector to integer function that doesn't need >0 constraint
Diffstat (limited to 'lib/coq')
-rw-r--r--lib/coq/Sail2_operators_mwords.v3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/coq/Sail2_operators_mwords.v b/lib/coq/Sail2_operators_mwords.v
index 5a5f130c..cca52c1d 100644
--- a/lib/coq/Sail2_operators_mwords.v
+++ b/lib/coq/Sail2_operators_mwords.v
@@ -291,6 +291,9 @@ rewrite <- Z.lt_le_pred.
auto.
Defined.
+Definition sint0 {a} `{ArithFact (a >= 0)} (x : mword a) : Z :=
+ if sumbool_of_bool (Z.eqb a 0) then 0 else projT1 (sint x).
+
Lemma length_list_pos : forall {A} {l:list A}, length_list l >= 0.
unfold length_list.
auto with zarith.