From 8ef45ec594c01e8a1a9e5c71176a7283ac3a8620 Mon Sep 17 00:00:00 2001 From: Iavor Diatchki Date: Mon, 5 Aug 2024 16:41:30 -0700 Subject: [PATCH] Remove repeated negations --- backend/cn/lib/simplify.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/cn/lib/simplify.ml b/backend/cn/lib/simplify.ml index 7fdce1c67..ebe08da2b 100644 --- a/backend/cn/lib/simplify.ml +++ b/backend/cn/lib/simplify.ml @@ -379,6 +379,8 @@ module IndexTerms = struct let a = aux a in (match (op, IT.term a) with | Not, Const (Bool b) -> bool_ (not b) the_loc + | Not, Unop (Not, x) -> x + | Negate, Unop (Negate,x) -> x | Negate, Const (Z z) -> z_ (Z.neg z) the_loc | Negate, Const (Bits ((sign, width), z)) -> num_lit_ (Z.neg z) (BT.Bits (sign, width)) the_loc