-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HasCallStack interferes with termination checking #2235
Comments
This seems to happen because transpose
= \ (@a_aUS) ->
let {
$dIP_aV7 :: HasCallStack
[LclId,
Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 300 0}]
$dIP_aV7
= (pushCallStack
(GHC.CString.unpackCString# "myhead"#,
GHC.Stack.Types.SrcLoc
(GHC.CString.unpackCString# "main"#)
(GHC.CString.unpackCString# "HasCallStackTest"#)
(GHC.CString.unpackCString# "test.hs"#)
(GHC.Types.I# 19#)
(GHC.Types.I# 41#)
(GHC.Types.I# 19#)
(GHC.Types.I# 47#))
emptyCallStack)
`cast` (Sym (GHC.Classes.N:IP[0] <"callStack">_N <CallStack>_N)
:: CallStack ~R# (?callStack::CallStack)) } in
\ (ds_d1RB :: Int) (ds_d1RC :: Int) (ds_d1RD :: [[a_aUS]]) ->
src<test.hs:(18,1)-(21,54)>
case ds_d1RB of { GHC.Types.I# ds_d1RN ->
case ds_d1RN of {
... When A normalization transforms this term, it inserts new let declarations before the type binder transpose
= \ (@a) ->
(let {
lq_anf$##7205759403792800809 :: GHC.Prim.Addr#
[LclId]
lq_anf$##7205759403792800809 = "myhead"# }
in let ...
in
\ (@a)
(ds_d1RB :: GHC.Types.Int)
(ds_d1RC :: GHC.Types.Int)
(ds_d1RD :: [[a]]) ->
src<test.hs:(18,1)-(21,54)>
case ds_d1RB of lq_anf$##7205759403792800828
...
) @a and now the termination checker is confused because a type binder occurs at the beginning of the term, and then again after the multiple let declarations. I'm contributing a fix in #2236 to have A normalization produce instead transpose
= \ (@a) ->
let {
lq_anf$##7205759403792800809 :: GHC.Prim.Addr#
[LclId]
lq_anf$##7205759403792800809 = "myhead"# }
in let ...
in
\
(ds_d1RB :: GHC.Types.Int)
(ds_d1RC :: GHC.Types.Int)
(ds_d1RD :: [[a]]) ->
src<test.hs:(18,1)-(21,54)>
case ds_d1RB of lq_anf$##7205759403792800828
... which seems to fix the issue. |
The following file fails to verify
gives the error
A similar error is obtained if the
liquidError
calls are replaced with calls toerror
.I found this when upgrading to
ghc-9.4
in #2234, ashead
starts usingHasCallStack
in the corresponding version ofbase
.The text was updated successfully, but these errors were encountered: