From 913485114bc9131e01021a8f1c9264670f55a3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Facundo=20Dom=C3=ADnguez?= Date: Tue, 15 Oct 2024 16:52:19 +0000 Subject: [PATCH] Fix deANF to avoid inlining non-anf bindings --- src/Language/Fixpoint/Solver/PLE.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Language/Fixpoint/Solver/PLE.hs b/src/Language/Fixpoint/Solver/PLE.hs index 8806a2779..7f4124494 100644 --- a/src/Language/Fixpoint/Solver/PLE.hs +++ b/src/Language/Fixpoint/Solver/PLE.hs @@ -688,7 +688,8 @@ isExprRewritable _ = False deANF :: ICtx -> Expr -> Expr deANF ctx = inlineInExpr (`HashMap.Lazy.lookup` undoANF id bindEnv) where - bindEnv = HashMap.Lazy.unions $ map HashMap.Lazy.fromList $ icANFs ctx + bindEnv = HashMap.Lazy.filterWithKey (\sym _ -> anfPrefix `isPrefixOfSym` sym) + $ HashMap.Lazy.unions $ map HashMap.Lazy.fromList $ icANFs ctx -- | -- Adds to the monad state all the subexpressions that have been rewritten