7.86/3.63 YES 9.88/4.18 proof of /export/starexec/sandbox/benchmark/theBenchmark.hs 9.88/4.18 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 9.88/4.18 9.88/4.18 9.88/4.18 H-Termination with start terms of the given HASKELL could be proven: 9.88/4.18 9.88/4.18 (0) HASKELL 9.88/4.18 (1) BR [EQUIVALENT, 0 ms] 9.88/4.18 (2) HASKELL 9.88/4.18 (3) COR [EQUIVALENT, 0 ms] 9.88/4.18 (4) HASKELL 9.88/4.18 (5) Narrow [SOUND, 0 ms] 9.88/4.18 (6) QDP 9.88/4.18 (7) QDPSizeChangeProof [EQUIVALENT, 0 ms] 9.88/4.18 (8) YES 9.88/4.18 9.88/4.18 9.88/4.18 ---------------------------------------- 9.88/4.18 9.88/4.18 (0) 9.88/4.18 Obligation: 9.88/4.18 mainModule Main 9.88/4.18 module Main where { 9.88/4.18 import qualified Prelude; 9.88/4.18 data List a = Cons a (List a) | Nil ; 9.88/4.18 9.88/4.18 data MyBool = MyTrue | MyFalse ; 9.88/4.18 9.88/4.18 data Ordering = LT | EQ | GT ; 9.88/4.18 9.88/4.18 foldl :: (b -> a -> b) -> b -> List a -> b; 9.88/4.18 foldl f z Nil = z; 9.88/4.18 foldl f z (Cons x xs) = foldl f (f z x) xs; 9.88/4.18 9.88/4.18 foldl1 :: (a -> a -> a) -> List a -> a; 9.88/4.18 foldl1 f (Cons x xs) = foldl f x xs; 9.88/4.18 9.88/4.18 ltEsOrdering :: Ordering -> Ordering -> MyBool; 9.88/4.18 ltEsOrdering LT LT = MyTrue; 9.88/4.18 ltEsOrdering LT EQ = MyTrue; 9.88/4.18 ltEsOrdering LT GT = MyTrue; 9.88/4.18 ltEsOrdering EQ LT = MyFalse; 9.88/4.18 ltEsOrdering EQ EQ = MyTrue; 9.88/4.18 ltEsOrdering EQ GT = MyTrue; 9.88/4.18 ltEsOrdering GT LT = MyFalse; 9.88/4.18 ltEsOrdering GT EQ = MyFalse; 9.88/4.18 ltEsOrdering GT GT = MyTrue; 9.88/4.18 9.88/4.18 max0 x y MyTrue = x; 9.88/4.18 9.88/4.18 max1 x y MyTrue = y; 9.88/4.18 max1 x y MyFalse = max0 x y otherwise; 9.88/4.18 9.88/4.18 max2 x y = max1 x y (ltEsOrdering x y); 9.88/4.18 9.88/4.18 maxOrdering :: Ordering -> Ordering -> Ordering; 9.88/4.18 maxOrdering x y = max2 x y; 9.88/4.18 9.88/4.18 maximumOrdering :: List Ordering -> Ordering; 9.88/4.18 maximumOrdering = foldl1 maxOrdering; 9.88/4.18 9.88/4.18 otherwise :: MyBool; 9.88/4.18 otherwise = MyTrue; 9.88/4.18 9.88/4.18 } 9.88/4.18 9.88/4.18 ---------------------------------------- 9.88/4.18 9.88/4.18 (1) BR (EQUIVALENT) 9.88/4.18 Replaced joker patterns by fresh variables and removed binding patterns. 9.88/4.18 ---------------------------------------- 9.88/4.18 9.88/4.18 (2) 9.88/4.18 Obligation: 9.88/4.18 mainModule Main 9.88/4.18 module Main where { 9.88/4.18 import qualified Prelude; 9.88/4.18 data List a = Cons a (List a) | Nil ; 9.88/4.18 9.88/4.18 data MyBool = MyTrue | MyFalse ; 9.88/4.18 9.88/4.18 data Ordering = LT | EQ | GT ; 9.88/4.18 9.88/4.18 foldl :: (a -> b -> a) -> a -> List b -> a; 9.88/4.18 foldl f z Nil = z; 9.88/4.18 foldl f z (Cons x xs) = foldl f (f z x) xs; 9.88/4.18 9.88/4.18 foldl1 :: (a -> a -> a) -> List a -> a; 9.88/4.18 foldl1 f (Cons x xs) = foldl f x xs; 9.88/4.18 9.88/4.18 ltEsOrdering :: Ordering -> Ordering -> MyBool; 9.88/4.18 ltEsOrdering LT LT = MyTrue; 9.88/4.18 ltEsOrdering LT EQ = MyTrue; 9.88/4.18 ltEsOrdering LT GT = MyTrue; 9.88/4.18 ltEsOrdering EQ LT = MyFalse; 9.88/4.18 ltEsOrdering EQ EQ = MyTrue; 9.88/4.18 ltEsOrdering EQ GT = MyTrue; 9.88/4.18 ltEsOrdering GT LT = MyFalse; 9.88/4.18 ltEsOrdering GT EQ = MyFalse; 9.88/4.18 ltEsOrdering GT GT = MyTrue; 9.88/4.18 9.88/4.18 max0 x y MyTrue = x; 9.88/4.18 9.88/4.18 max1 x y MyTrue = y; 9.88/4.18 max1 x y MyFalse = max0 x y otherwise; 9.88/4.18 9.88/4.18 max2 x y = max1 x y (ltEsOrdering x y); 9.88/4.18 9.88/4.18 maxOrdering :: Ordering -> Ordering -> Ordering; 9.88/4.18 maxOrdering x y = max2 x y; 9.88/4.18 9.88/4.18 maximumOrdering :: List Ordering -> Ordering; 9.88/4.18 maximumOrdering = foldl1 maxOrdering; 9.88/4.18 9.88/4.18 otherwise :: MyBool; 9.88/4.18 otherwise = MyTrue; 9.88/4.18 9.88/4.18 } 9.88/4.18 9.88/4.18 ---------------------------------------- 9.88/4.18 9.88/4.18 (3) COR (EQUIVALENT) 9.88/4.18 Cond Reductions: 9.88/4.18 The following Function with conditions 9.88/4.18 "undefined |Falseundefined; 9.88/4.18 " 9.88/4.18 is transformed to 9.88/4.18 "undefined = undefined1; 9.88/4.18 " 9.88/4.18 "undefined0 True = undefined; 9.88/4.18 " 9.88/4.18 "undefined1 = undefined0 False; 9.88/4.18 " 9.88/4.18 9.88/4.18 ---------------------------------------- 9.88/4.18 9.88/4.18 (4) 9.88/4.18 Obligation: 9.88/4.18 mainModule Main 9.88/4.18 module Main where { 9.88/4.18 import qualified Prelude; 9.88/4.18 data List a = Cons a (List a) | Nil ; 9.88/4.18 9.88/4.18 data MyBool = MyTrue | MyFalse ; 9.88/4.18 9.88/4.18 data Ordering = LT | EQ | GT ; 9.88/4.18 9.88/4.18 foldl :: (a -> b -> a) -> a -> List b -> a; 9.88/4.18 foldl f z Nil = z; 9.88/4.18 foldl f z (Cons x xs) = foldl f (f z x) xs; 9.88/4.18 9.88/4.18 foldl1 :: (a -> a -> a) -> List a -> a; 9.88/4.18 foldl1 f (Cons x xs) = foldl f x xs; 9.88/4.18 9.88/4.18 ltEsOrdering :: Ordering -> Ordering -> MyBool; 9.88/4.18 ltEsOrdering LT LT = MyTrue; 9.88/4.18 ltEsOrdering LT EQ = MyTrue; 9.88/4.18 ltEsOrdering LT GT = MyTrue; 9.88/4.18 ltEsOrdering EQ LT = MyFalse; 9.88/4.18 ltEsOrdering EQ EQ = MyTrue; 9.88/4.18 ltEsOrdering EQ GT = MyTrue; 9.88/4.18 ltEsOrdering GT LT = MyFalse; 9.88/4.18 ltEsOrdering GT EQ = MyFalse; 9.88/4.18 ltEsOrdering GT GT = MyTrue; 9.88/4.18 9.88/4.18 max0 x y MyTrue = x; 9.88/4.18 9.88/4.18 max1 x y MyTrue = y; 9.88/4.18 max1 x y MyFalse = max0 x y otherwise; 9.88/4.18 9.88/4.18 max2 x y = max1 x y (ltEsOrdering x y); 9.88/4.18 9.88/4.18 maxOrdering :: Ordering -> Ordering -> Ordering; 9.88/4.18 maxOrdering x y = max2 x y; 9.88/4.18 9.88/4.18 maximumOrdering :: List Ordering -> Ordering; 9.88/4.18 maximumOrdering = foldl1 maxOrdering; 9.88/4.18 9.88/4.18 otherwise :: MyBool; 9.88/4.18 otherwise = MyTrue; 9.88/4.18 9.88/4.18 } 9.88/4.18 9.88/4.18 ---------------------------------------- 9.88/4.18 9.88/4.18 (5) Narrow (SOUND) 9.88/4.18 Haskell To QDPs 9.88/4.18 9.88/4.18 digraph dp_graph { 9.88/4.18 node [outthreshold=100, inthreshold=100];1[label="maximumOrdering",fontsize=16,color="grey",shape="box"];1 -> 3[label="",style="dashed", color="grey", weight=3]; 9.88/4.18 3[label="maximumOrdering vx3",fontsize=16,color="black",shape="triangle"];3 -> 4[label="",style="solid", color="black", weight=3]; 9.88/4.18 4[label="foldl1 maxOrdering vx3",fontsize=16,color="burlywood",shape="box"];53[label="vx3/Cons vx30 vx31",fontsize=10,color="white",style="solid",shape="box"];4 -> 53[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 53 -> 5[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 54[label="vx3/Nil",fontsize=10,color="white",style="solid",shape="box"];4 -> 54[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 54 -> 6[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 5[label="foldl1 maxOrdering (Cons vx30 vx31)",fontsize=16,color="black",shape="box"];5 -> 7[label="",style="solid", color="black", weight=3]; 9.88/4.18 6[label="foldl1 maxOrdering Nil",fontsize=16,color="black",shape="box"];6 -> 8[label="",style="solid", color="black", weight=3]; 9.88/4.18 7[label="foldl maxOrdering vx30 vx31",fontsize=16,color="burlywood",shape="triangle"];55[label="vx31/Cons vx310 vx311",fontsize=10,color="white",style="solid",shape="box"];7 -> 55[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 55 -> 9[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 56[label="vx31/Nil",fontsize=10,color="white",style="solid",shape="box"];7 -> 56[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 56 -> 10[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 8[label="error []",fontsize=16,color="red",shape="box"];9[label="foldl maxOrdering vx30 (Cons vx310 vx311)",fontsize=16,color="black",shape="box"];9 -> 11[label="",style="solid", color="black", weight=3]; 9.88/4.18 10[label="foldl maxOrdering vx30 Nil",fontsize=16,color="black",shape="box"];10 -> 12[label="",style="solid", color="black", weight=3]; 9.88/4.18 11 -> 7[label="",style="dashed", color="red", weight=0]; 9.88/4.18 11[label="foldl maxOrdering (maxOrdering vx30 vx310) vx311",fontsize=16,color="magenta"];11 -> 13[label="",style="dashed", color="magenta", weight=3]; 9.88/4.18 11 -> 14[label="",style="dashed", color="magenta", weight=3]; 9.88/4.18 12[label="vx30",fontsize=16,color="green",shape="box"];13[label="maxOrdering vx30 vx310",fontsize=16,color="black",shape="box"];13 -> 15[label="",style="solid", color="black", weight=3]; 9.88/4.18 14[label="vx311",fontsize=16,color="green",shape="box"];15[label="max2 vx30 vx310",fontsize=16,color="black",shape="box"];15 -> 16[label="",style="solid", color="black", weight=3]; 9.88/4.18 16[label="max1 vx30 vx310 (ltEsOrdering vx30 vx310)",fontsize=16,color="burlywood",shape="box"];57[label="vx30/LT",fontsize=10,color="white",style="solid",shape="box"];16 -> 57[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 57 -> 17[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 58[label="vx30/EQ",fontsize=10,color="white",style="solid",shape="box"];16 -> 58[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 58 -> 18[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 59[label="vx30/GT",fontsize=10,color="white",style="solid",shape="box"];16 -> 59[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 59 -> 19[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 17[label="max1 LT vx310 (ltEsOrdering LT vx310)",fontsize=16,color="burlywood",shape="box"];60[label="vx310/LT",fontsize=10,color="white",style="solid",shape="box"];17 -> 60[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 60 -> 20[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 61[label="vx310/EQ",fontsize=10,color="white",style="solid",shape="box"];17 -> 61[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 61 -> 21[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 62[label="vx310/GT",fontsize=10,color="white",style="solid",shape="box"];17 -> 62[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 62 -> 22[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 18[label="max1 EQ vx310 (ltEsOrdering EQ vx310)",fontsize=16,color="burlywood",shape="box"];63[label="vx310/LT",fontsize=10,color="white",style="solid",shape="box"];18 -> 63[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 63 -> 23[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 64[label="vx310/EQ",fontsize=10,color="white",style="solid",shape="box"];18 -> 64[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 64 -> 24[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 65[label="vx310/GT",fontsize=10,color="white",style="solid",shape="box"];18 -> 65[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 65 -> 25[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 19[label="max1 GT vx310 (ltEsOrdering GT vx310)",fontsize=16,color="burlywood",shape="box"];66[label="vx310/LT",fontsize=10,color="white",style="solid",shape="box"];19 -> 66[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 66 -> 26[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 67[label="vx310/EQ",fontsize=10,color="white",style="solid",shape="box"];19 -> 67[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 67 -> 27[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 68[label="vx310/GT",fontsize=10,color="white",style="solid",shape="box"];19 -> 68[label="",style="solid", color="burlywood", weight=9]; 9.88/4.18 68 -> 28[label="",style="solid", color="burlywood", weight=3]; 9.88/4.18 20[label="max1 LT LT (ltEsOrdering LT LT)",fontsize=16,color="black",shape="box"];20 -> 29[label="",style="solid", color="black", weight=3]; 9.88/4.18 21[label="max1 LT EQ (ltEsOrdering LT EQ)",fontsize=16,color="black",shape="box"];21 -> 30[label="",style="solid", color="black", weight=3]; 9.88/4.18 22[label="max1 LT GT (ltEsOrdering LT GT)",fontsize=16,color="black",shape="box"];22 -> 31[label="",style="solid", color="black", weight=3]; 9.88/4.18 23[label="max1 EQ LT (ltEsOrdering EQ LT)",fontsize=16,color="black",shape="box"];23 -> 32[label="",style="solid", color="black", weight=3]; 9.88/4.18 24[label="max1 EQ EQ (ltEsOrdering EQ EQ)",fontsize=16,color="black",shape="box"];24 -> 33[label="",style="solid", color="black", weight=3]; 9.88/4.18 25[label="max1 EQ GT (ltEsOrdering EQ GT)",fontsize=16,color="black",shape="box"];25 -> 34[label="",style="solid", color="black", weight=3]; 9.88/4.18 26[label="max1 GT LT (ltEsOrdering GT LT)",fontsize=16,color="black",shape="box"];26 -> 35[label="",style="solid", color="black", weight=3]; 9.88/4.18 27[label="max1 GT EQ (ltEsOrdering GT EQ)",fontsize=16,color="black",shape="box"];27 -> 36[label="",style="solid", color="black", weight=3]; 9.88/4.18 28[label="max1 GT GT (ltEsOrdering GT GT)",fontsize=16,color="black",shape="box"];28 -> 37[label="",style="solid", color="black", weight=3]; 9.88/4.18 29[label="max1 LT LT MyTrue",fontsize=16,color="black",shape="box"];29 -> 38[label="",style="solid", color="black", weight=3]; 9.88/4.18 30[label="max1 LT EQ MyTrue",fontsize=16,color="black",shape="box"];30 -> 39[label="",style="solid", color="black", weight=3]; 9.88/4.18 31[label="max1 LT GT MyTrue",fontsize=16,color="black",shape="box"];31 -> 40[label="",style="solid", color="black", weight=3]; 9.88/4.18 32[label="max1 EQ LT MyFalse",fontsize=16,color="black",shape="box"];32 -> 41[label="",style="solid", color="black", weight=3]; 9.88/4.18 33[label="max1 EQ EQ MyTrue",fontsize=16,color="black",shape="box"];33 -> 42[label="",style="solid", color="black", weight=3]; 9.88/4.18 34[label="max1 EQ GT MyTrue",fontsize=16,color="black",shape="box"];34 -> 43[label="",style="solid", color="black", weight=3]; 9.88/4.18 35[label="max1 GT LT MyFalse",fontsize=16,color="black",shape="box"];35 -> 44[label="",style="solid", color="black", weight=3]; 9.88/4.18 36[label="max1 GT EQ MyFalse",fontsize=16,color="black",shape="box"];36 -> 45[label="",style="solid", color="black", weight=3]; 9.88/4.18 37[label="max1 GT GT MyTrue",fontsize=16,color="black",shape="box"];37 -> 46[label="",style="solid", color="black", weight=3]; 9.88/4.18 38[label="LT",fontsize=16,color="green",shape="box"];39[label="EQ",fontsize=16,color="green",shape="box"];40[label="GT",fontsize=16,color="green",shape="box"];41[label="max0 EQ LT otherwise",fontsize=16,color="black",shape="box"];41 -> 47[label="",style="solid", color="black", weight=3]; 9.88/4.18 42[label="EQ",fontsize=16,color="green",shape="box"];43[label="GT",fontsize=16,color="green",shape="box"];44[label="max0 GT LT otherwise",fontsize=16,color="black",shape="box"];44 -> 48[label="",style="solid", color="black", weight=3]; 9.88/4.18 45[label="max0 GT EQ otherwise",fontsize=16,color="black",shape="box"];45 -> 49[label="",style="solid", color="black", weight=3]; 9.88/4.18 46[label="GT",fontsize=16,color="green",shape="box"];47[label="max0 EQ LT MyTrue",fontsize=16,color="black",shape="box"];47 -> 50[label="",style="solid", color="black", weight=3]; 9.88/4.18 48[label="max0 GT LT MyTrue",fontsize=16,color="black",shape="box"];48 -> 51[label="",style="solid", color="black", weight=3]; 9.88/4.18 49[label="max0 GT EQ MyTrue",fontsize=16,color="black",shape="box"];49 -> 52[label="",style="solid", color="black", weight=3]; 9.88/4.18 50[label="EQ",fontsize=16,color="green",shape="box"];51[label="GT",fontsize=16,color="green",shape="box"];52[label="GT",fontsize=16,color="green",shape="box"];} 9.88/4.18 9.88/4.18 ---------------------------------------- 9.88/4.18 9.88/4.18 (6) 9.88/4.18 Obligation: 9.88/4.18 Q DP problem: 9.88/4.18 The TRS P consists of the following rules: 9.88/4.18 9.88/4.18 new_foldl(vx30, Cons(vx310, vx311)) -> new_foldl(new_max1(vx30, vx310), vx311) 9.88/4.18 9.88/4.18 The TRS R consists of the following rules: 9.88/4.18 9.88/4.18 new_max1(LT, LT) -> LT 9.88/4.18 new_max1(LT, EQ) -> EQ 9.88/4.18 new_max1(EQ, LT) -> EQ 9.88/4.18 new_max1(EQ, GT) -> GT 9.88/4.18 new_max1(GT, EQ) -> GT 9.88/4.18 new_max1(LT, GT) -> GT 9.88/4.18 new_max1(GT, LT) -> GT 9.88/4.18 new_max1(GT, GT) -> GT 9.88/4.18 new_max1(EQ, EQ) -> EQ 9.88/4.18 9.88/4.18 The set Q consists of the following terms: 9.88/4.18 9.88/4.18 new_max1(GT, GT) 9.88/4.18 new_max1(LT, EQ) 9.88/4.18 new_max1(EQ, LT) 9.88/4.18 new_max1(EQ, EQ) 9.88/4.18 new_max1(EQ, GT) 9.88/4.18 new_max1(GT, EQ) 9.88/4.18 new_max1(LT, GT) 9.88/4.18 new_max1(GT, LT) 9.88/4.18 new_max1(LT, LT) 9.88/4.18 9.88/4.18 We have to consider all minimal (P,Q,R)-chains. 9.88/4.18 ---------------------------------------- 9.88/4.18 9.88/4.18 (7) QDPSizeChangeProof (EQUIVALENT) 9.88/4.18 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.88/4.18 9.88/4.18 From the DPs we obtained the following set of size-change graphs: 9.88/4.18 *new_foldl(vx30, Cons(vx310, vx311)) -> new_foldl(new_max1(vx30, vx310), vx311) 9.88/4.18 The graph contains the following edges 2 > 2 9.88/4.18 9.88/4.18 9.88/4.18 ---------------------------------------- 9.88/4.18 9.88/4.18 (8) 9.88/4.18 YES 9.96/4.24 EOF