From e083553d9e10cc59caaff34635f9e9fd7193cad4 Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Sun, 19 May 2019 18:39:56 +0100 Subject: Coq: add signed bitvector to integer function that doesn't need >0 constraint --- lib/coq/Sail2_operators_mwords.v | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') 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. -- cgit v1.2.3