<NME> isort_erase.hs
<BEF> ADDFILE
<MSG> Merge pull request #1943 from ucsd-progsys/withproof

Erase proofs in withProof
<DFF> @@ -0,0 +1,33 @@
+{-@ LIQUID "--reflection" @-}
+{-@ LIQUID "--ple"        @-}
+
+module Isort_erase where 
+
+import Prelude hiding (id, sum)
+import Language.Haskell.Liquid.ProofCombinators
+import Data.Set (Set)
+import qualified Data.Set as Set
+
+data List = Emp | Cons Int List
+
+{-@ reflect isSorted @-}
+isSorted :: List -> Bool
+isSorted Emp = True
+isSorted (Cons x xs) = case xs of
+                        Emp -> True
+                        Cons x1 xs1 -> (x <= x1) && (isSorted xs)
+
+
+{-@ reflect insert @-}
+{-@ insert :: x:Int -> {xs:List | isSorted xs} -> {xs:List | isSorted xs} @-}
+insert :: Int -> List -> List 
+insert x Emp     = Cons x Emp
+insert x (Cons y ys)
+  | x <= y        = Cons x (Cons y ys)
+  | otherwise     = (Cons y (insert x ys)) `withProof` (lem_ins y x ys) 
+
+{-@ lem_ins :: y:Int -> {x:Int | y < x} -> {ys:List | isSorted (Cons y ys)} -> {isSorted (Cons y (insert x ys))} @-}
+lem_ins :: Int -> Int -> List -> Bool
+lem_ins y x Emp = True
+lem_ins y x (Cons y1 ys) = if y1 < x then lem_ins y1 x ys else True
+

{'addition_count': 33, 'commit_subject': 'Merge pull request #1943 from ucsd-progsys/withproof', 'deletion_count': 0, 'file_extension': '.hs', 'lang': 'hs', 'license': 'bsd-3-clause', 'repo_name': 'ucsd-progsys/liquidhaskell'}