module Compose where {-@ LIQUID "--no-termination" @-} -- Here p and q of `app` will be instantiated to -- p , q := \v -> i <= v main i = app (check i) i {-@ check :: x:Int -> {v:Int | x <= v} -> () @-} check :: Int -> Int -> () check = undefined {-@ app :: forall
Bool, q :: Int -> Bool>.
{Int }
{x::Int -> ()) -> x:Int <: Int
|- {v:Int| v = x + 1} <: Int
}
(Int
-> () @-}
app :: (Int -> ()) -> Int -> ()
app f x = if p x then app f (x + 1) else f x
p :: a -> Bool
{-@ p :: a -> Bool @-}
p = undefined