-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Description
Writing (see full example in https://liquidhaskell.goto.ucsd.edu/index.html#?demo=permalink%2F1758872050_934.hs)
{-@ foldCons :: xs:List a -> { foldr Cons Nil xs = xs } @-}
Crashes with
crash: SMTLIB2 respSat = Error "line 3 column 27651: unknown constant MapFusion.ConsInt declared: (declare-fun MapFusion.Cons (Int (MapFusion.List Int)) (MapFusion.List Int)) "
The reason is that at SMT level (after defunctionalization) foldr expects an "integer" argument and is given the higher order Cons that is not defunctionalized.
Possible solutions:
- Enable the
{-@ LIQUID "--no-adt" @-}flag that treats data constructors simply as functions (and Cons will get defunctionalized). - Replace
Consin the spec with a functionconsthat is defined to be equal toCons. - At serialization replace
Conswith a defunctionalized equivalent (I believe such exist already?). - At serialization eta expand?
From the above 1. and 2. just work, while 3 and 4 would require edits in LH.
clayrat
Metadata
Metadata
Assignees
Labels
No labels