File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
src/Language/Haskell/Liquid/Transforms Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -384,13 +384,23 @@ toPredApp p = go . Misc.mapFst opSym . splitArgs $ p
384384 = PAnd <$> mapM coreToLg [e1, e2]
385385 | f == symbol (" ==>" :: String )
386386 = PImp <$> coreToLg e1 <*> coreToLg e2
387- go (Just f, es )
387+ go (Just f, [es] )
388388 | f == symbol (" or" :: String )
389- = POr <$> mapM coreToLg es
389+ = POr . deList <$> coreToLg es
390390 | f == symbol (" and" :: String )
391- = PAnd <$> mapM coreToLg es
391+ = PAnd . deList <$> coreToLg es
392392 go (_, _)
393393 = toLogicApp p
394+
395+ deList :: Expr -> [Expr ]
396+ deList (EApp (EApp (EVar cons) e) es)
397+ | cons == symbol (" GHC.Types.:" :: String )
398+ = e: deList es
399+ deList (EVar nil)
400+ | nil == symbol (" GHC.Types.[]" :: String )
401+ = []
402+ deList e
403+ = [e]
394404
395405toLogicApp :: C. CoreExpr -> LogicM Expr
396406toLogicApp e = do
Original file line number Diff line number Diff line change 1+ {-@ LIQUID " --reflect" @- }
2+
3+ {- @ reflect rAnd @-}
4+ rAnd :: Bool
5+ rAnd = and [True ,False ,True ]
6+
7+ {- @ reflect rOr @-}
8+ rOr :: Bool
9+ rOr = or [True ,False ,True ]
10+
You can’t perform that action at this time.
0 commit comments