We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84685ad commit c00c699Copy full SHA for c00c699
what4/src/What4/Expr/Builder.hs
@@ -2301,11 +2301,13 @@ instance IsExprBuilder (ExprBuilder t st fs) where
2301
-- Push some equalities under if/then/else
2302
| SemiRingLiteral _ _ _ <- x
2303
, Just (BaseIte _ _ c a b) <- asApp y
2304
+ , isJust (asBV a) || isJust (asBV b) -- avoid loss of sharing
2305
= join (itePred sym c <$> bvEq sym x a <*> bvEq sym x b)
2306
2307
2308
| Just (BaseIte _ _ c a b) <- asApp x
2309
, SemiRingLiteral _ _ _ <- y
2310
2311
= join (itePred sym c <$> bvEq sym a y <*> bvEq sym b y)
2312
2313
| Just (Some flv) <- inSameBVSemiRing x y
0 commit comments