10.57/4.44 YES 12.46/4.98 proof of /export/starexec/sandbox/benchmark/theBenchmark.hs 12.46/4.98 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 12.46/4.98 12.46/4.98 12.46/4.98 H-Termination with start terms of the given HASKELL could be proven: 12.46/4.98 12.46/4.98 (0) HASKELL 12.46/4.98 (1) CR [EQUIVALENT, 0 ms] 12.46/4.98 (2) HASKELL 12.46/4.98 (3) BR [EQUIVALENT, 0 ms] 12.46/4.98 (4) HASKELL 12.46/4.98 (5) COR [EQUIVALENT, 13 ms] 12.46/4.98 (6) HASKELL 12.46/4.98 (7) Narrow [SOUND, 0 ms] 12.46/4.98 (8) QDP 12.46/4.98 (9) QDPSizeChangeProof [EQUIVALENT, 0 ms] 12.46/4.98 (10) YES 12.46/4.98 12.46/4.98 12.46/4.98 ---------------------------------------- 12.46/4.98 12.46/4.98 (0) 12.46/4.98 Obligation: 12.46/4.98 mainModule Main 12.46/4.98 module Maybe where { 12.46/4.98 import qualified List; 12.46/4.98 import qualified Main; 12.46/4.98 import qualified Prelude; 12.46/4.98 } 12.46/4.98 module List where { 12.46/4.98 import qualified Main; 12.46/4.98 import qualified Maybe; 12.46/4.98 import qualified Prelude; 12.46/4.98 insert :: Ord a => a -> [a] -> [a]; 12.46/4.98 insert e ls = insertBy compare e ls; 12.46/4.98 12.46/4.98 insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]; 12.46/4.98 insertBy _ x [] = x : []; 12.46/4.98 insertBy cmp x ys@(y : ys') = case cmp x y of { 12.46/4.98 GT-> y : insertBy cmp x ys'; 12.46/4.98 _-> x : ys; 12.46/4.98 } ; 12.46/4.98 12.46/4.98 } 12.46/4.98 module Main where { 12.46/4.98 import qualified List; 12.46/4.98 import qualified Maybe; 12.46/4.98 import qualified Prelude; 12.46/4.98 } 12.46/4.98 12.46/4.98 ---------------------------------------- 12.46/4.98 12.46/4.98 (1) CR (EQUIVALENT) 12.46/4.98 Case Reductions: 12.46/4.98 The following Case expression 12.46/4.98 "case cmp x y of { 12.46/4.98 GT -> y : insertBy cmp x ys'; 12.46/4.98 _ -> x : ys} 12.46/4.98 " 12.46/4.98 is transformed to 12.46/4.98 "insertBy0 y cmp x ys' ys GT = y : insertBy cmp x ys'; 12.46/4.98 insertBy0 y cmp x ys' ys _ = x : ys; 12.46/4.98 " 12.46/4.98 12.46/4.98 ---------------------------------------- 12.46/4.98 12.46/4.98 (2) 12.46/4.98 Obligation: 12.46/4.98 mainModule Main 12.46/4.98 module Maybe where { 12.46/4.98 import qualified List; 12.46/4.98 import qualified Main; 12.46/4.98 import qualified Prelude; 12.46/4.98 } 12.46/4.98 module List where { 12.46/4.98 import qualified Main; 12.46/4.98 import qualified Maybe; 12.46/4.98 import qualified Prelude; 12.46/4.98 insert :: Ord a => a -> [a] -> [a]; 12.46/4.98 insert e ls = insertBy compare e ls; 12.46/4.98 12.46/4.98 insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]; 12.46/4.98 insertBy _ x [] = x : []; 12.46/4.98 insertBy cmp x ys@(y : ys') = insertBy0 y cmp x ys' ys (cmp x y); 12.46/4.98 12.46/4.98 insertBy0 y cmp x ys' ys GT = y : insertBy cmp x ys'; 12.46/4.98 insertBy0 y cmp x ys' ys _ = x : ys; 12.46/4.98 12.46/4.98 } 12.46/4.98 module Main where { 12.46/4.98 import qualified List; 12.46/4.98 import qualified Maybe; 12.46/4.98 import qualified Prelude; 12.46/4.98 } 12.46/4.98 12.46/4.98 ---------------------------------------- 12.46/4.98 12.46/4.98 (3) BR (EQUIVALENT) 12.46/4.98 Replaced joker patterns by fresh variables and removed binding patterns. 12.46/4.98 12.46/4.98 Binding Reductions: 12.46/4.98 The bind variable of the following binding Pattern 12.46/4.98 "ys@(wu : wv)" 12.46/4.98 is replaced by the following term 12.46/4.98 "wu : wv" 12.46/4.98 12.46/4.98 ---------------------------------------- 12.46/4.98 12.46/4.98 (4) 12.46/4.98 Obligation: 12.46/4.98 mainModule Main 12.46/4.98 module Maybe where { 12.46/4.98 import qualified List; 12.46/4.98 import qualified Main; 12.46/4.98 import qualified Prelude; 12.46/4.98 } 12.46/4.98 module List where { 12.46/4.98 import qualified Main; 12.46/4.98 import qualified Maybe; 12.46/4.98 import qualified Prelude; 12.46/4.98 insert :: Ord a => a -> [a] -> [a]; 12.46/4.98 insert e ls = insertBy compare e ls; 12.46/4.98 12.46/4.98 insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]; 12.46/4.98 insertBy vz x [] = x : []; 12.46/4.98 insertBy cmp x (wu : wv) = insertBy0 wu cmp x wv (wu : wv) (cmp x wu); 12.46/4.98 12.46/4.98 insertBy0 y cmp x ys' ys GT = y : insertBy cmp x ys'; 12.46/4.98 insertBy0 y cmp x ys' ys vy = x : ys; 12.46/4.98 12.46/4.98 } 12.46/4.98 module Main where { 12.46/4.98 import qualified List; 12.46/4.98 import qualified Maybe; 12.46/4.98 import qualified Prelude; 12.46/4.98 } 12.46/4.98 12.46/4.98 ---------------------------------------- 12.46/4.98 12.46/4.98 (5) COR (EQUIVALENT) 12.46/4.98 Cond Reductions: 12.46/4.98 The following Function with conditions 12.46/4.98 "compare x y|x == yEQ|x <= yLT|otherwiseGT; 12.46/4.98 " 12.46/4.98 is transformed to 12.46/4.98 "compare x y = compare3 x y; 12.46/4.98 " 12.46/4.98 "compare2 x y True = EQ; 12.46/4.98 compare2 x y False = compare1 x y (x <= y); 12.46/4.98 " 12.46/4.98 "compare0 x y True = GT; 12.46/4.98 " 12.46/4.98 "compare1 x y True = LT; 12.46/4.98 compare1 x y False = compare0 x y otherwise; 12.46/4.98 " 12.46/4.98 "compare3 x y = compare2 x y (x == y); 12.46/4.98 " 12.46/4.98 The following Function with conditions 12.46/4.98 "undefined |Falseundefined; 12.46/4.98 " 12.46/4.98 is transformed to 12.46/4.98 "undefined = undefined1; 12.46/4.98 " 12.46/4.98 "undefined0 True = undefined; 12.46/4.98 " 12.46/4.98 "undefined1 = undefined0 False; 12.46/4.98 " 12.46/4.98 12.46/4.98 ---------------------------------------- 12.46/4.98 12.46/4.98 (6) 12.46/4.98 Obligation: 12.46/4.98 mainModule Main 12.46/4.98 module Maybe where { 12.46/4.98 import qualified List; 12.46/4.98 import qualified Main; 12.46/4.98 import qualified Prelude; 12.46/4.98 } 12.46/4.98 module List where { 12.46/4.98 import qualified Main; 12.46/4.98 import qualified Maybe; 12.46/4.98 import qualified Prelude; 12.46/4.98 insert :: Ord a => a -> [a] -> [a]; 12.46/4.98 insert e ls = insertBy compare e ls; 12.46/4.98 12.46/4.98 insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]; 12.46/4.98 insertBy vz x [] = x : []; 12.46/4.98 insertBy cmp x (wu : wv) = insertBy0 wu cmp x wv (wu : wv) (cmp x wu); 12.46/4.98 12.46/4.98 insertBy0 y cmp x ys' ys GT = y : insertBy cmp x ys'; 12.46/4.98 insertBy0 y cmp x ys' ys vy = x : ys; 12.46/4.98 12.46/4.98 } 12.46/4.98 module Main where { 12.46/4.98 import qualified List; 12.46/4.98 import qualified Maybe; 12.46/4.98 import qualified Prelude; 12.46/4.98 } 12.46/4.98 12.46/4.98 ---------------------------------------- 12.46/4.98 12.46/4.98 (7) Narrow (SOUND) 12.46/4.98 Haskell To QDPs 12.46/4.98 12.46/4.98 digraph dp_graph { 12.46/4.98 node [outthreshold=100, inthreshold=100];1[label="List.insert",fontsize=16,color="grey",shape="box"];1 -> 3[label="",style="dashed", color="grey", weight=3]; 12.46/4.98 3[label="List.insert ww3",fontsize=16,color="grey",shape="box"];3 -> 4[label="",style="dashed", color="grey", weight=3]; 12.46/4.98 4[label="List.insert ww3 ww4",fontsize=16,color="black",shape="triangle"];4 -> 5[label="",style="solid", color="black", weight=3]; 12.46/4.98 5[label="List.insertBy compare ww3 ww4",fontsize=16,color="burlywood",shape="triangle"];39[label="ww4/ww40 : ww41",fontsize=10,color="white",style="solid",shape="box"];5 -> 39[label="",style="solid", color="burlywood", weight=9]; 12.46/4.98 39 -> 6[label="",style="solid", color="burlywood", weight=3]; 12.46/4.98 40[label="ww4/[]",fontsize=10,color="white",style="solid",shape="box"];5 -> 40[label="",style="solid", color="burlywood", weight=9]; 12.46/4.98 40 -> 7[label="",style="solid", color="burlywood", weight=3]; 12.46/4.98 6[label="List.insertBy compare ww3 (ww40 : ww41)",fontsize=16,color="black",shape="box"];6 -> 8[label="",style="solid", color="black", weight=3]; 12.46/4.98 7[label="List.insertBy compare ww3 []",fontsize=16,color="black",shape="box"];7 -> 9[label="",style="solid", color="black", weight=3]; 12.46/4.98 8[label="List.insertBy0 ww40 compare ww3 ww41 (ww40 : ww41) (compare ww3 ww40)",fontsize=16,color="black",shape="box"];8 -> 10[label="",style="solid", color="black", weight=3]; 12.46/4.98 9[label="ww3 : []",fontsize=16,color="green",shape="box"];10[label="List.insertBy0 ww40 compare ww3 ww41 (ww40 : ww41) (compare3 ww3 ww40)",fontsize=16,color="black",shape="box"];10 -> 11[label="",style="solid", color="black", weight=3]; 12.46/4.98 11[label="List.insertBy0 ww40 compare ww3 ww41 (ww40 : ww41) (compare2 ww3 ww40 (ww3 == ww40))",fontsize=16,color="burlywood",shape="box"];41[label="ww3/False",fontsize=10,color="white",style="solid",shape="box"];11 -> 41[label="",style="solid", color="burlywood", weight=9]; 12.46/4.98 41 -> 12[label="",style="solid", color="burlywood", weight=3]; 12.46/4.98 42[label="ww3/True",fontsize=10,color="white",style="solid",shape="box"];11 -> 42[label="",style="solid", color="burlywood", weight=9]; 12.46/4.98 42 -> 13[label="",style="solid", color="burlywood", weight=3]; 12.46/4.98 12[label="List.insertBy0 ww40 compare False ww41 (ww40 : ww41) (compare2 False ww40 (False == ww40))",fontsize=16,color="burlywood",shape="box"];43[label="ww40/False",fontsize=10,color="white",style="solid",shape="box"];12 -> 43[label="",style="solid", color="burlywood", weight=9]; 12.46/4.98 43 -> 14[label="",style="solid", color="burlywood", weight=3]; 12.46/4.98 44[label="ww40/True",fontsize=10,color="white",style="solid",shape="box"];12 -> 44[label="",style="solid", color="burlywood", weight=9]; 12.46/4.98 44 -> 15[label="",style="solid", color="burlywood", weight=3]; 12.46/4.98 13[label="List.insertBy0 ww40 compare True ww41 (ww40 : ww41) (compare2 True ww40 (True == ww40))",fontsize=16,color="burlywood",shape="box"];45[label="ww40/False",fontsize=10,color="white",style="solid",shape="box"];13 -> 45[label="",style="solid", color="burlywood", weight=9]; 12.46/4.98 45 -> 16[label="",style="solid", color="burlywood", weight=3]; 12.46/4.98 46[label="ww40/True",fontsize=10,color="white",style="solid",shape="box"];13 -> 46[label="",style="solid", color="burlywood", weight=9]; 12.46/4.98 46 -> 17[label="",style="solid", color="burlywood", weight=3]; 12.46/4.98 14[label="List.insertBy0 False compare False ww41 (False : ww41) (compare2 False False (False == False))",fontsize=16,color="black",shape="box"];14 -> 18[label="",style="solid", color="black", weight=3]; 12.46/4.98 15[label="List.insertBy0 True compare False ww41 (True : ww41) (compare2 False True (False == True))",fontsize=16,color="black",shape="box"];15 -> 19[label="",style="solid", color="black", weight=3]; 12.46/4.98 16[label="List.insertBy0 False compare True ww41 (False : ww41) (compare2 True False (True == False))",fontsize=16,color="black",shape="box"];16 -> 20[label="",style="solid", color="black", weight=3]; 12.46/4.98 17[label="List.insertBy0 True compare True ww41 (True : ww41) (compare2 True True (True == True))",fontsize=16,color="black",shape="box"];17 -> 21[label="",style="solid", color="black", weight=3]; 12.46/4.98 18[label="List.insertBy0 False compare False ww41 (False : ww41) (compare2 False False True)",fontsize=16,color="black",shape="box"];18 -> 22[label="",style="solid", color="black", weight=3]; 12.46/4.98 19[label="List.insertBy0 True compare False ww41 (True : ww41) (compare2 False True False)",fontsize=16,color="black",shape="box"];19 -> 23[label="",style="solid", color="black", weight=3]; 12.46/4.98 20[label="List.insertBy0 False compare True ww41 (False : ww41) (compare2 True False False)",fontsize=16,color="black",shape="box"];20 -> 24[label="",style="solid", color="black", weight=3]; 12.46/4.98 21[label="List.insertBy0 True compare True ww41 (True : ww41) (compare2 True True True)",fontsize=16,color="black",shape="box"];21 -> 25[label="",style="solid", color="black", weight=3]; 12.46/4.98 22[label="List.insertBy0 False compare False ww41 (False : ww41) EQ",fontsize=16,color="black",shape="box"];22 -> 26[label="",style="solid", color="black", weight=3]; 12.46/4.98 23[label="List.insertBy0 True compare False ww41 (True : ww41) (compare1 False True (False <= True))",fontsize=16,color="black",shape="box"];23 -> 27[label="",style="solid", color="black", weight=3]; 12.46/4.98 24[label="List.insertBy0 False compare True ww41 (False : ww41) (compare1 True False (True <= False))",fontsize=16,color="black",shape="box"];24 -> 28[label="",style="solid", color="black", weight=3]; 12.46/4.98 25[label="List.insertBy0 True compare True ww41 (True : ww41) EQ",fontsize=16,color="black",shape="box"];25 -> 29[label="",style="solid", color="black", weight=3]; 12.46/4.98 26[label="False : False : ww41",fontsize=16,color="green",shape="box"];27[label="List.insertBy0 True compare False ww41 (True : ww41) (compare1 False True True)",fontsize=16,color="black",shape="box"];27 -> 30[label="",style="solid", color="black", weight=3]; 12.46/4.98 28[label="List.insertBy0 False compare True ww41 (False : ww41) (compare1 True False False)",fontsize=16,color="black",shape="box"];28 -> 31[label="",style="solid", color="black", weight=3]; 12.46/4.98 29[label="True : True : ww41",fontsize=16,color="green",shape="box"];30[label="List.insertBy0 True compare False ww41 (True : ww41) LT",fontsize=16,color="black",shape="box"];30 -> 32[label="",style="solid", color="black", weight=3]; 12.46/4.98 31[label="List.insertBy0 False compare True ww41 (False : ww41) (compare0 True False otherwise)",fontsize=16,color="black",shape="box"];31 -> 33[label="",style="solid", color="black", weight=3]; 12.46/4.98 32[label="False : True : ww41",fontsize=16,color="green",shape="box"];33[label="List.insertBy0 False compare True ww41 (False : ww41) (compare0 True False True)",fontsize=16,color="black",shape="box"];33 -> 34[label="",style="solid", color="black", weight=3]; 12.46/4.98 34[label="List.insertBy0 False compare True ww41 (False : ww41) GT",fontsize=16,color="black",shape="box"];34 -> 35[label="",style="solid", color="black", weight=3]; 12.46/4.98 35[label="False : List.insertBy compare True ww41",fontsize=16,color="green",shape="box"];35 -> 36[label="",style="dashed", color="green", weight=3]; 12.46/4.98 36 -> 5[label="",style="dashed", color="red", weight=0]; 12.46/4.98 36[label="List.insertBy compare True ww41",fontsize=16,color="magenta"];36 -> 37[label="",style="dashed", color="magenta", weight=3]; 12.46/4.98 36 -> 38[label="",style="dashed", color="magenta", weight=3]; 12.46/4.98 37[label="ww41",fontsize=16,color="green",shape="box"];38[label="True",fontsize=16,color="green",shape="box"];} 12.46/4.98 12.46/4.98 ---------------------------------------- 12.46/4.98 12.46/4.98 (8) 12.46/4.98 Obligation: 12.46/4.98 Q DP problem: 12.46/4.98 The TRS P consists of the following rules: 12.46/4.98 12.46/4.98 new_insertBy(True, :(False, ww41)) -> new_insertBy(True, ww41) 12.46/4.98 12.46/4.98 R is empty. 12.46/4.98 Q is empty. 12.46/4.98 We have to consider all minimal (P,Q,R)-chains. 12.46/4.98 ---------------------------------------- 12.46/4.98 12.46/4.98 (9) QDPSizeChangeProof (EQUIVALENT) 12.46/4.98 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. 12.46/4.98 12.46/4.98 From the DPs we obtained the following set of size-change graphs: 12.46/4.98 *new_insertBy(True, :(False, ww41)) -> new_insertBy(True, ww41) 12.46/4.98 The graph contains the following edges 1 >= 1, 2 > 2 12.46/4.98 12.46/4.98 12.46/4.98 ---------------------------------------- 12.46/4.98 12.46/4.98 (10) 12.46/4.98 YES 12.67/5.07 EOF