{-@ LIQUID "--no-totality" @-} module Foo where import Language.Haskell.Liquid.Prelude {-@ mycmp :: forall
Bool, q :: a -> Bool>. {x::a
, y::a ] -> [a Bool, q :: a -> Bool>.
{x::a , y::a -> a |- a <: {v:a | x <= y} }
Ord a =>
[a
] -> Bool @-}
mycmp :: Ord a => [a] -> [a] -> Bool
mycmp (x:_) (_:y:_) = liquidAssert (x <= y) True
{-@ mycmp' :: forall
|- a <: {v:a | x <= y} }
Ord a =>
a
-> Bool @-}
mycmp' :: Ord a => a -> a -> Bool
mycmp' x y = liquidAssert (x <= y) True
bar :: Bool
bar = let w = choose 0 in
let x = w + 1 in
let y = w - 1 in
let z = w + 2 in
mycmp [x, y, x, z] [z, x, z]
bar' :: Bool
bar' = let w = choose 0 in
let x = w + 1 in
let y = w - 1 in
let z = w + 2 in
mycmp' z y