{#laziness} ============
6: module Laziness where 7: import Language.Haskell.Liquid.Prelude 8: 9: {-@ LIQUID "--no-termination" @-} 10: 11: divide :: Int -> Int -> Int 12: foo :: Int -> Int 13: -- zero :: Int 14: -- diverge :: a -> b
53: {-@ divide :: Int -> {v:Int| v /= 0} -> Int @-} 54: (Int) -> {VV : (Int) | (VV /= 0)} -> (Int)divide (Int)n 0 = {x2 : [(Char)] | false} -> {x1 : (Int) | false}liquidError {x3 : [(Char)] | ((len x3) >= 0) && ((sumLens x3) >= 0)}"div-by-zero!" 55: divide n d = {x2 : (Int) | (x2 == n)}n x1:(Int) -> x2:(Int) -> {x6 : (Int) | (((x1 >= 0) && (x2 >= 0)) => (x6 >= 0)) && (((x1 >= 0) && (x2 >= 1)) => (x6 <= x1)) && (x6 == (x1 / x2))}`div` {x2 : (Int) | (x2 /= 0)}d
72: {-@ foo :: n:Nat -> {v:Nat | v < n} @-} 73: n:{VV : (Int) | (VV >= 0)} -> {VV : (Int) | (VV >= 0) && (VV < n)}foo {VV : (Int) | (VV >= 0)}n 74: | {x3 : (Int) | (x3 == n) && (x3 >= 0)}n x1:{x8 : (Int) | (x8 >= 0) && (x8 <= n)} -> x2:{x8 : (Int) | (x8 >= 0) && (x8 <= n)} -> {x2 : (Bool) | (((Prop x2)) <=> (x1 > x2))}> {x2 : (Int) | (x2 == (0 : int))}0 = {x3 : (Int) | (x3 == n) && (x3 >= 0)}n x1:(Int) -> x2:(Int) -> {x4 : (Int) | (x4 == (x1 - x2))}- {x2 : (Int) | (x2 == (1 : int))}1 75: | otherwise = x1:{x5 : (Int) | (x5 >= 0)} -> {x3 : (Int) | (x3 >= 0) && (x3 < x1)}foo {x3 : (Int) | (x3 == n) && (x3 >= 0)}nLiquidHaskell Lies! -------------------
82: (Int)explode = let {x2 : (Int) | (x2 == (0 : int))}z = {x2 : (Int) | (x2 == (0 : int))}0 83: in (x:{VV : (Int) | (VV == 0) && (VV == 1) && (VV == Laziness.explode) && (VV == z) && (VV > 0) && (VV > Laziness.explode) && (VV > z) && (VV < 0) && (VV < Laziness.explode) && (VV < z)} -> {VV : (Int) | (VV == 0) && (VV == 1) && (VV == Laziness.explode) && (VV == x) && (VV == z) && (VV > 0) && (VV > Laziness.explode) && (VV > x) && (VV > z) && (VV < 0) && (VV < Laziness.explode) && (VV < x) && (VV < z)}\{VV : (Int) | (VV == 0) && (VV == 1) && (VV == Laziness.explode) && (VV == z) && (VV > 0) && (VV > Laziness.explode) && (VV > z) && (VV < 0) && (VV < Laziness.explode) && (VV < z)}x -> ({x2 : (Int) | (x2 == (2013 : int))}2013 (Int) -> {x3 : (Int) | (x3 /= 0)} -> (Int)`divide` {x3 : (Int) | (x3 == z) && (x3 == (0 : int))}z)) (x1:{x5 : (Int) | (x5 >= 0)} -> {x3 : (Int) | (x3 >= 0) && (x3 < x1)}foo {x3 : (Int) | (x3 == z) && (x3 == (0 : int))}z)
103: {- foo :: n:Nat -> {v:Nat | v < n} -} 104: foo n 105: | n > 0 = n - 1 106: | otherwise = foo n 107: 108: explode = let z = 0 109: in (\x -> (2013 `divide` z)) (foo z)
122: {- foo :: n:Nat -> {v:Nat | v < n} -} 123: foo n 124: | n > 0 = n - 1 125: | otherwise = foo n 126: 127: explode = let z = 0 128: in (\x -> (2013 `divide` z)) (foo z)