7.87/3.53 YES 9.65/4.02 proof of /export/starexec/sandbox2/benchmark/theBenchmark.hs 9.65/4.02 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 9.65/4.02 9.65/4.02 9.65/4.02 H-Termination with start terms of the given HASKELL could be proven: 9.65/4.02 9.65/4.02 (0) HASKELL 9.65/4.02 (1) BR [EQUIVALENT, 0 ms] 9.65/4.02 (2) HASKELL 9.65/4.02 (3) COR [EQUIVALENT, 0 ms] 9.65/4.02 (4) HASKELL 9.65/4.02 (5) Narrow [SOUND, 0 ms] 9.65/4.02 (6) QDP 9.65/4.02 (7) QDPSizeChangeProof [EQUIVALENT, 0 ms] 9.65/4.02 (8) YES 9.65/4.02 9.65/4.02 9.65/4.02 ---------------------------------------- 9.65/4.02 9.65/4.02 (0) 9.65/4.02 Obligation: 9.65/4.02 mainModule Main 9.65/4.02 module Main where { 9.65/4.02 import qualified Prelude; 9.65/4.02 data List a = Cons a (List a) | Nil ; 9.65/4.02 9.65/4.02 data MyBool = MyTrue | MyFalse ; 9.65/4.02 9.65/4.02 data Ordering = LT | EQ | GT ; 9.65/4.02 9.65/4.02 all :: (a -> MyBool) -> List a -> MyBool; 9.65/4.02 all p = pt and (map p); 9.65/4.02 9.65/4.02 and :: List MyBool -> MyBool; 9.65/4.02 and = foldr asAs MyTrue; 9.65/4.02 9.65/4.02 asAs :: MyBool -> MyBool -> MyBool; 9.65/4.02 asAs MyFalse x = MyFalse; 9.65/4.02 asAs MyTrue x = x; 9.65/4.02 9.65/4.02 esEsOrdering :: Ordering -> Ordering -> MyBool; 9.65/4.02 esEsOrdering LT LT = MyTrue; 9.65/4.02 esEsOrdering LT EQ = MyFalse; 9.65/4.02 esEsOrdering LT GT = MyFalse; 9.65/4.02 esEsOrdering EQ LT = MyFalse; 9.65/4.02 esEsOrdering EQ EQ = MyTrue; 9.65/4.02 esEsOrdering EQ GT = MyFalse; 9.65/4.02 esEsOrdering GT LT = MyFalse; 9.65/4.02 esEsOrdering GT EQ = MyFalse; 9.65/4.02 esEsOrdering GT GT = MyTrue; 9.65/4.02 9.65/4.02 foldr :: (a -> b -> b) -> b -> List a -> b; 9.65/4.02 foldr f z Nil = z; 9.65/4.02 foldr f z (Cons x xs) = f x (foldr f z xs); 9.65/4.02 9.65/4.02 fsEsOrdering :: Ordering -> Ordering -> MyBool; 9.65/4.02 fsEsOrdering x y = not (esEsOrdering x y); 9.65/4.02 9.65/4.02 map :: (a -> b) -> List a -> List b; 9.65/4.02 map f Nil = Nil; 9.65/4.02 map f (Cons x xs) = Cons (f x) (map f xs); 9.65/4.02 9.65/4.02 not :: MyBool -> MyBool; 9.65/4.02 not MyTrue = MyFalse; 9.65/4.02 not MyFalse = MyTrue; 9.65/4.02 9.65/4.02 notElemOrdering :: Ordering -> List Ordering -> MyBool; 9.65/4.02 notElemOrdering = pt all fsEsOrdering; 9.65/4.02 9.65/4.02 pt :: (b -> c) -> (a -> b) -> a -> c; 9.65/4.02 pt f g x = f (g x); 9.65/4.02 9.65/4.02 } 9.65/4.02 9.65/4.02 ---------------------------------------- 9.65/4.02 9.65/4.02 (1) BR (EQUIVALENT) 9.65/4.02 Replaced joker patterns by fresh variables and removed binding patterns. 9.65/4.02 ---------------------------------------- 9.65/4.02 9.65/4.02 (2) 9.65/4.02 Obligation: 9.65/4.02 mainModule Main 9.65/4.02 module Main where { 9.65/4.02 import qualified Prelude; 9.65/4.02 data List a = Cons a (List a) | Nil ; 9.65/4.02 9.65/4.02 data MyBool = MyTrue | MyFalse ; 9.65/4.02 9.65/4.02 data Ordering = LT | EQ | GT ; 9.65/4.02 9.65/4.02 all :: (a -> MyBool) -> List a -> MyBool; 9.65/4.02 all p = pt and (map p); 9.65/4.02 9.65/4.02 and :: List MyBool -> MyBool; 9.65/4.02 and = foldr asAs MyTrue; 9.65/4.02 9.65/4.02 asAs :: MyBool -> MyBool -> MyBool; 9.65/4.02 asAs MyFalse x = MyFalse; 9.65/4.02 asAs MyTrue x = x; 9.65/4.02 9.65/4.02 esEsOrdering :: Ordering -> Ordering -> MyBool; 9.65/4.02 esEsOrdering LT LT = MyTrue; 9.65/4.02 esEsOrdering LT EQ = MyFalse; 9.65/4.02 esEsOrdering LT GT = MyFalse; 9.65/4.02 esEsOrdering EQ LT = MyFalse; 9.65/4.02 esEsOrdering EQ EQ = MyTrue; 9.65/4.02 esEsOrdering EQ GT = MyFalse; 9.65/4.02 esEsOrdering GT LT = MyFalse; 9.65/4.02 esEsOrdering GT EQ = MyFalse; 9.65/4.02 esEsOrdering GT GT = MyTrue; 9.65/4.02 9.65/4.02 foldr :: (a -> b -> b) -> b -> List a -> b; 9.65/4.02 foldr f z Nil = z; 9.65/4.02 foldr f z (Cons x xs) = f x (foldr f z xs); 9.65/4.02 9.65/4.02 fsEsOrdering :: Ordering -> Ordering -> MyBool; 9.65/4.02 fsEsOrdering x y = not (esEsOrdering x y); 9.65/4.02 9.65/4.02 map :: (a -> b) -> List a -> List b; 9.65/4.02 map f Nil = Nil; 9.65/4.02 map f (Cons x xs) = Cons (f x) (map f xs); 9.65/4.02 9.65/4.02 not :: MyBool -> MyBool; 9.65/4.02 not MyTrue = MyFalse; 9.65/4.02 not MyFalse = MyTrue; 9.65/4.02 9.65/4.02 notElemOrdering :: Ordering -> List Ordering -> MyBool; 9.65/4.02 notElemOrdering = pt all fsEsOrdering; 9.65/4.02 9.65/4.02 pt :: (c -> b) -> (a -> c) -> a -> b; 9.65/4.02 pt f g x = f (g x); 9.65/4.02 9.65/4.02 } 9.65/4.02 9.65/4.02 ---------------------------------------- 9.65/4.02 9.65/4.02 (3) COR (EQUIVALENT) 9.65/4.02 Cond Reductions: 9.65/4.02 The following Function with conditions 9.65/4.02 "undefined |Falseundefined; 9.65/4.02 " 9.65/4.02 is transformed to 9.65/4.02 "undefined = undefined1; 9.65/4.02 " 9.65/4.02 "undefined0 True = undefined; 9.65/4.02 " 9.65/4.02 "undefined1 = undefined0 False; 9.65/4.02 " 9.65/4.02 9.65/4.02 ---------------------------------------- 9.65/4.02 9.65/4.02 (4) 9.65/4.02 Obligation: 9.65/4.02 mainModule Main 9.65/4.02 module Main where { 9.65/4.02 import qualified Prelude; 9.65/4.02 data List a = Cons a (List a) | Nil ; 9.65/4.02 9.65/4.02 data MyBool = MyTrue | MyFalse ; 9.65/4.02 9.65/4.02 data Ordering = LT | EQ | GT ; 9.65/4.02 9.65/4.02 all :: (a -> MyBool) -> List a -> MyBool; 9.65/4.02 all p = pt and (map p); 9.65/4.02 9.65/4.02 and :: List MyBool -> MyBool; 9.65/4.02 and = foldr asAs MyTrue; 9.65/4.02 9.65/4.02 asAs :: MyBool -> MyBool -> MyBool; 9.65/4.02 asAs MyFalse x = MyFalse; 9.65/4.02 asAs MyTrue x = x; 9.65/4.02 9.65/4.02 esEsOrdering :: Ordering -> Ordering -> MyBool; 9.65/4.02 esEsOrdering LT LT = MyTrue; 9.65/4.02 esEsOrdering LT EQ = MyFalse; 9.65/4.02 esEsOrdering LT GT = MyFalse; 9.65/4.02 esEsOrdering EQ LT = MyFalse; 9.65/4.02 esEsOrdering EQ EQ = MyTrue; 9.65/4.02 esEsOrdering EQ GT = MyFalse; 9.65/4.02 esEsOrdering GT LT = MyFalse; 9.65/4.02 esEsOrdering GT EQ = MyFalse; 9.65/4.02 esEsOrdering GT GT = MyTrue; 9.65/4.02 9.65/4.02 foldr :: (a -> b -> b) -> b -> List a -> b; 9.65/4.02 foldr f z Nil = z; 9.65/4.02 foldr f z (Cons x xs) = f x (foldr f z xs); 9.65/4.02 9.65/4.02 fsEsOrdering :: Ordering -> Ordering -> MyBool; 9.65/4.02 fsEsOrdering x y = not (esEsOrdering x y); 9.65/4.02 9.65/4.02 map :: (a -> b) -> List a -> List b; 9.65/4.02 map f Nil = Nil; 9.65/4.02 map f (Cons x xs) = Cons (f x) (map f xs); 9.65/4.02 9.65/4.02 not :: MyBool -> MyBool; 9.65/4.02 not MyTrue = MyFalse; 9.65/4.02 not MyFalse = MyTrue; 9.65/4.02 9.65/4.02 notElemOrdering :: Ordering -> List Ordering -> MyBool; 9.65/4.02 notElemOrdering = pt all fsEsOrdering; 9.65/4.02 9.65/4.02 pt :: (b -> a) -> (c -> b) -> c -> a; 9.65/4.02 pt f g x = f (g x); 9.65/4.02 9.65/4.02 } 9.65/4.02 9.65/4.02 ---------------------------------------- 9.65/4.02 9.65/4.02 (5) Narrow (SOUND) 9.65/4.02 Haskell To QDPs 9.65/4.02 9.65/4.02 digraph dp_graph { 9.65/4.02 node [outthreshold=100, inthreshold=100];1[label="notElemOrdering",fontsize=16,color="grey",shape="box"];1 -> 3[label="",style="dashed", color="grey", weight=3]; 9.65/4.02 3[label="notElemOrdering vx3",fontsize=16,color="grey",shape="box"];3 -> 4[label="",style="dashed", color="grey", weight=3]; 9.65/4.02 4[label="notElemOrdering vx3 vx4",fontsize=16,color="black",shape="triangle"];4 -> 5[label="",style="solid", color="black", weight=3]; 9.65/4.02 5[label="pt all fsEsOrdering vx3 vx4",fontsize=16,color="black",shape="box"];5 -> 6[label="",style="solid", color="black", weight=3]; 9.65/4.02 6[label="all (fsEsOrdering vx3) vx4",fontsize=16,color="black",shape="box"];6 -> 7[label="",style="solid", color="black", weight=3]; 9.65/4.02 7[label="pt and (map (fsEsOrdering vx3)) vx4",fontsize=16,color="black",shape="box"];7 -> 8[label="",style="solid", color="black", weight=3]; 9.65/4.02 8[label="and (map (fsEsOrdering vx3) vx4)",fontsize=16,color="black",shape="box"];8 -> 9[label="",style="solid", color="black", weight=3]; 9.65/4.02 9[label="foldr asAs MyTrue (map (fsEsOrdering vx3) vx4)",fontsize=16,color="burlywood",shape="triangle"];45[label="vx4/Cons vx40 vx41",fontsize=10,color="white",style="solid",shape="box"];9 -> 45[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 45 -> 10[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 46[label="vx4/Nil",fontsize=10,color="white",style="solid",shape="box"];9 -> 46[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 46 -> 11[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 10[label="foldr asAs MyTrue (map (fsEsOrdering vx3) (Cons vx40 vx41))",fontsize=16,color="black",shape="box"];10 -> 12[label="",style="solid", color="black", weight=3]; 9.65/4.02 11[label="foldr asAs MyTrue (map (fsEsOrdering vx3) Nil)",fontsize=16,color="black",shape="box"];11 -> 13[label="",style="solid", color="black", weight=3]; 9.65/4.02 12[label="foldr asAs MyTrue (Cons (fsEsOrdering vx3 vx40) (map (fsEsOrdering vx3) vx41))",fontsize=16,color="black",shape="box"];12 -> 14[label="",style="solid", color="black", weight=3]; 9.65/4.02 13[label="foldr asAs MyTrue Nil",fontsize=16,color="black",shape="box"];13 -> 15[label="",style="solid", color="black", weight=3]; 9.65/4.02 14 -> 16[label="",style="dashed", color="red", weight=0]; 9.65/4.02 14[label="asAs (fsEsOrdering vx3 vx40) (foldr asAs MyTrue (map (fsEsOrdering vx3) vx41))",fontsize=16,color="magenta"];14 -> 17[label="",style="dashed", color="magenta", weight=3]; 9.65/4.02 15[label="MyTrue",fontsize=16,color="green",shape="box"];17 -> 9[label="",style="dashed", color="red", weight=0]; 9.65/4.02 17[label="foldr asAs MyTrue (map (fsEsOrdering vx3) vx41)",fontsize=16,color="magenta"];17 -> 18[label="",style="dashed", color="magenta", weight=3]; 9.65/4.02 16[label="asAs (fsEsOrdering vx3 vx40) vx5",fontsize=16,color="black",shape="triangle"];16 -> 19[label="",style="solid", color="black", weight=3]; 9.65/4.02 18[label="vx41",fontsize=16,color="green",shape="box"];19[label="asAs (not (esEsOrdering vx3 vx40)) vx5",fontsize=16,color="burlywood",shape="box"];47[label="vx3/LT",fontsize=10,color="white",style="solid",shape="box"];19 -> 47[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 47 -> 20[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 48[label="vx3/EQ",fontsize=10,color="white",style="solid",shape="box"];19 -> 48[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 48 -> 21[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 49[label="vx3/GT",fontsize=10,color="white",style="solid",shape="box"];19 -> 49[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 49 -> 22[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 20[label="asAs (not (esEsOrdering LT vx40)) vx5",fontsize=16,color="burlywood",shape="box"];50[label="vx40/LT",fontsize=10,color="white",style="solid",shape="box"];20 -> 50[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 50 -> 23[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 51[label="vx40/EQ",fontsize=10,color="white",style="solid",shape="box"];20 -> 51[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 51 -> 24[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 52[label="vx40/GT",fontsize=10,color="white",style="solid",shape="box"];20 -> 52[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 52 -> 25[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 21[label="asAs (not (esEsOrdering EQ vx40)) vx5",fontsize=16,color="burlywood",shape="box"];53[label="vx40/LT",fontsize=10,color="white",style="solid",shape="box"];21 -> 53[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 53 -> 26[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 54[label="vx40/EQ",fontsize=10,color="white",style="solid",shape="box"];21 -> 54[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 54 -> 27[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 55[label="vx40/GT",fontsize=10,color="white",style="solid",shape="box"];21 -> 55[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 55 -> 28[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 22[label="asAs (not (esEsOrdering GT vx40)) vx5",fontsize=16,color="burlywood",shape="box"];56[label="vx40/LT",fontsize=10,color="white",style="solid",shape="box"];22 -> 56[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 56 -> 29[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 57[label="vx40/EQ",fontsize=10,color="white",style="solid",shape="box"];22 -> 57[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 57 -> 30[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 58[label="vx40/GT",fontsize=10,color="white",style="solid",shape="box"];22 -> 58[label="",style="solid", color="burlywood", weight=9]; 9.65/4.02 58 -> 31[label="",style="solid", color="burlywood", weight=3]; 9.65/4.02 23[label="asAs (not (esEsOrdering LT LT)) vx5",fontsize=16,color="black",shape="box"];23 -> 32[label="",style="solid", color="black", weight=3]; 9.65/4.02 24[label="asAs (not (esEsOrdering LT EQ)) vx5",fontsize=16,color="black",shape="box"];24 -> 33[label="",style="solid", color="black", weight=3]; 9.65/4.02 25[label="asAs (not (esEsOrdering LT GT)) vx5",fontsize=16,color="black",shape="box"];25 -> 34[label="",style="solid", color="black", weight=3]; 9.65/4.02 26[label="asAs (not (esEsOrdering EQ LT)) vx5",fontsize=16,color="black",shape="box"];26 -> 35[label="",style="solid", color="black", weight=3]; 9.65/4.02 27[label="asAs (not (esEsOrdering EQ EQ)) vx5",fontsize=16,color="black",shape="box"];27 -> 36[label="",style="solid", color="black", weight=3]; 9.65/4.02 28[label="asAs (not (esEsOrdering EQ GT)) vx5",fontsize=16,color="black",shape="box"];28 -> 37[label="",style="solid", color="black", weight=3]; 9.65/4.02 29[label="asAs (not (esEsOrdering GT LT)) vx5",fontsize=16,color="black",shape="box"];29 -> 38[label="",style="solid", color="black", weight=3]; 9.65/4.02 30[label="asAs (not (esEsOrdering GT EQ)) vx5",fontsize=16,color="black",shape="box"];30 -> 39[label="",style="solid", color="black", weight=3]; 9.65/4.02 31[label="asAs (not (esEsOrdering GT GT)) vx5",fontsize=16,color="black",shape="box"];31 -> 40[label="",style="solid", color="black", weight=3]; 9.65/4.02 32[label="asAs (not MyTrue) vx5",fontsize=16,color="black",shape="triangle"];32 -> 41[label="",style="solid", color="black", weight=3]; 9.65/4.02 33[label="asAs (not MyFalse) vx5",fontsize=16,color="black",shape="triangle"];33 -> 42[label="",style="solid", color="black", weight=3]; 9.65/4.02 34 -> 33[label="",style="dashed", color="red", weight=0]; 9.65/4.02 34[label="asAs (not MyFalse) vx5",fontsize=16,color="magenta"];35 -> 33[label="",style="dashed", color="red", weight=0]; 9.65/4.02 35[label="asAs (not MyFalse) vx5",fontsize=16,color="magenta"];36 -> 32[label="",style="dashed", color="red", weight=0]; 9.65/4.02 36[label="asAs (not MyTrue) vx5",fontsize=16,color="magenta"];37 -> 33[label="",style="dashed", color="red", weight=0]; 9.65/4.02 37[label="asAs (not MyFalse) vx5",fontsize=16,color="magenta"];38 -> 33[label="",style="dashed", color="red", weight=0]; 9.65/4.02 38[label="asAs (not MyFalse) vx5",fontsize=16,color="magenta"];39 -> 33[label="",style="dashed", color="red", weight=0]; 9.65/4.02 39[label="asAs (not MyFalse) vx5",fontsize=16,color="magenta"];40 -> 32[label="",style="dashed", color="red", weight=0]; 9.65/4.02 40[label="asAs (not MyTrue) vx5",fontsize=16,color="magenta"];41[label="asAs MyFalse vx5",fontsize=16,color="black",shape="box"];41 -> 43[label="",style="solid", color="black", weight=3]; 9.65/4.02 42[label="asAs MyTrue vx5",fontsize=16,color="black",shape="box"];42 -> 44[label="",style="solid", color="black", weight=3]; 9.65/4.02 43[label="MyFalse",fontsize=16,color="green",shape="box"];44[label="vx5",fontsize=16,color="green",shape="box"];} 9.65/4.02 9.65/4.02 ---------------------------------------- 9.65/4.02 9.65/4.02 (6) 9.65/4.02 Obligation: 9.65/4.02 Q DP problem: 9.65/4.02 The TRS P consists of the following rules: 9.65/4.02 9.65/4.02 new_foldr(vx3, Cons(vx40, vx41)) -> new_foldr(vx3, vx41) 9.65/4.02 9.65/4.02 R is empty. 9.65/4.02 Q is empty. 9.65/4.02 We have to consider all minimal (P,Q,R)-chains. 9.65/4.02 ---------------------------------------- 9.65/4.02 9.65/4.02 (7) QDPSizeChangeProof (EQUIVALENT) 9.65/4.02 By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem. 9.65/4.02 9.65/4.02 From the DPs we obtained the following set of size-change graphs: 9.65/4.02 *new_foldr(vx3, Cons(vx40, vx41)) -> new_foldr(vx3, vx41) 9.65/4.02 The graph contains the following edges 1 >= 1, 2 > 2 9.65/4.02 9.65/4.02 9.65/4.02 ---------------------------------------- 9.65/4.02 9.65/4.02 (8) 9.65/4.02 YES 9.70/4.06 EOF