The combination of the following two files crashes LH:
Foo.hs
{-@ LIQUID "--reflection" @-}
module Foo where
import Prelude hiding (last)
{-@ reflect last @-}
{-@ last :: xs:{ [a] | len xs > 0 } -> a @-}
last :: [a] -> a
last [x] = x
last (_ : xs) = last xs
data Foo t = Foo1 -- | Foo2
deriving (Eq, Ord)
{-@ reflect isFoo @-}
isFoo :: Foo t -> Bool
isFoo Foo1 = True
-- isFoo Foo2 = False
{-@ reflect foos @-}
{-@ foos :: Foo t -> [{ v:Foo t | isFoo v }] @-}
foos :: Foo t -> [Foo t]
foos f = if isFoo f then f : [] else []
Bar.hs
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--ple" @-}
module Bar where
import Prelude hiding (last)
import Data.Set
import Foo
{-@ lemma_last_isFoo :: f : Foo t -> { isFoo (last (foos f))} @-}
lemma_last_isFoo :: Foo t -> ()
lemma_last_isFoo f = if isFoo f then () else ()
The combination of the following two files crashes LH:
Foo.hs
Bar.hs
The (prettifed) error is :
The bug crucially depends on having 2 files and importing
Data.Set
, merging the files or removing the import makes it disappear.