From 2e6fa8f266d9a3a71a91be2bd21eece3d3dac7b3 Mon Sep 17 00:00:00 2001
From: Patrick Baudin <patrick.baudin@cea.fr>
Date: Tue, 11 Jan 2022 16:38:21 +0100
Subject: [PATCH] [WP] fixes eq_concat

---
 src/plugins/wp/Vlist.ml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/plugins/wp/Vlist.ml b/src/plugins/wp/Vlist.ml
index c46c6b226ae..b893ad839ae 100644
--- a/src/plugins/wp/Vlist.ml
+++ b/src/plugins/wp/Vlist.ml
@@ -180,7 +180,8 @@ let rec leftmost a ms =
   match F.repr a with
   | L.Fun( concat , e :: es ) when concat == f_concat ->
       leftmost e (es@ms)
-  | L.Fun( repeat , [ u ; n ] ) when repeat == f_repeat && Cint.is_positive_or_null n ->
+  | L.Fun( repeat , [ u ; n ] ) when repeat == f_repeat &&
+                                     (F.decide (F.e_lt F.e_zero n)) ->
       leftmost u (v_repeat u (F.e_sub n F.e_one) :: ms)
   | _ -> a , ms
 
@@ -191,7 +192,8 @@ let rec rightmost ms a =
         | [] -> ms , a
         | e::es -> rightmost (ms @ List.rev es) e
       end
-  | L.Fun( repeat , [ u ; n ] ) when repeat == f_repeat && Cint.is_positive_or_null n ->
+  | L.Fun( repeat , [ u ; n ] ) when repeat == f_repeat &&
+                                     (F.decide (F.e_lt F.e_zero n)) ->
       rightmost (ms @ [v_repeat u (F.e_sub n F.e_one)]) u
   | _ -> ms , a
 
-- 
GitLab