Skip to content

Commit

Permalink
re-add unsorted equality to type of unpackCString
Browse files Browse the repository at this point in the history
  • Loading branch information
gridaphobe committed Jul 13, 2015
1 parent 18d264f commit 5cb3d80
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/GHC/CString.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import GHC.Prim

GHC.CString.unpackCString#
:: x:GHC.Prim.Addr#
-> {v:String | len v == strLen x}
-> {v:[Char] | v ~~ x && len v == strLen x}
12 changes: 8 additions & 4 deletions src/Language/Haskell/Liquid/ANFTransform.hs
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ normalizeName :: VarEnv Id -> CoreExpr -> DsMW CoreExpr
-- normalizeNameDebug γ e
-- = liftM (tracePpr ("normalizeName" ++ showPpr e)) $ normalizeName γ e

normalizeName _ e@(Lit _)
= normalizeLiteral e

normalizeName _ e@(Tick _ (Lit _))
normalizeName _ e@(Lit l)
| shouldNormalize l
= normalizeLiteral e
| otherwise
= return e

normalizeName γ (Var x)
= return $ Var (lookupWithDefaultVarEnv γ x x)
Expand All @@ -152,6 +152,10 @@ normalizeName γ e
add [NonRec x e']
return $ Var x

shouldNormalize l = case l of
LitInteger _ _ -> True
MachStr _ -> True
_ -> False

add :: [CoreBind] -> DsMW ()
add w = modify $ \s -> s{st_binds = st_binds s++w}
Expand Down
1 change: 1 addition & 0 deletions src/Language/Haskell/Liquid/CoreToLogic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ isUndefined (_, _, e) = isUndefinedExpr e
where
-- auto generated undefined case: (\_ -> (patError @type "error message")) void
isUndefinedExpr (C.App (C.Var x) _) | (show x) `elem` perrors = True
isUndefinedExpr (C.Let _ e) = isUndefinedExpr e
-- otherwise
isUndefinedExpr _ = False

Expand Down

0 comments on commit 5cb3d80

Please sign in to comment.