8.06/3.58 YES 9.67/4.08 proof of /export/starexec/sandbox/benchmark/theBenchmark.hs 9.67/4.08 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 9.67/4.08 9.67/4.08 9.67/4.08 H-Termination with start terms of the given HASKELL could be proven: 9.67/4.08 9.67/4.08 (0) HASKELL 9.67/4.08 (1) BR [EQUIVALENT, 0 ms] 9.67/4.08 (2) HASKELL 9.67/4.08 (3) COR [EQUIVALENT, 0 ms] 9.67/4.08 (4) HASKELL 9.67/4.08 (5) Narrow [SOUND, 0 ms] 9.67/4.08 (6) QDP 9.67/4.08 (7) QDPSizeChangeProof [EQUIVALENT, 0 ms] 9.67/4.08 (8) YES 9.67/4.08 9.67/4.08 9.67/4.08 ---------------------------------------- 9.67/4.08 9.67/4.08 (0) 9.67/4.08 Obligation: 9.67/4.08 mainModule Main 9.67/4.08 module Main where { 9.67/4.08 import qualified Prelude; 9.67/4.08 data List a = Cons a (List a) | Nil ; 9.67/4.08 9.67/4.08 data MyBool = MyTrue | MyFalse ; 9.67/4.08 9.67/4.08 data Tup2 a b = Tup2 a b ; 9.67/4.08 9.67/4.08 break :: (a -> MyBool) -> List a -> Tup2 (List a) (List a); 9.67/4.08 break p = span (pt not p); 9.67/4.08 9.67/4.08 not :: MyBool -> MyBool; 9.67/4.08 not MyTrue = MyFalse; 9.67/4.08 not MyFalse = MyTrue; 9.67/4.08 9.67/4.08 otherwise :: MyBool; 9.67/4.08 otherwise = MyTrue; 9.67/4.08 9.67/4.08 pt :: (b -> a) -> (c -> b) -> c -> a; 9.67/4.08 pt f g x = f (g x); 9.67/4.08 9.67/4.08 span :: (a -> MyBool) -> List a -> Tup2 (List a) (List a); 9.67/4.08 span p Nil = span3 p Nil; 9.67/4.08 span p (Cons vv vw) = span2 p (Cons vv vw); 9.67/4.08 9.67/4.08 span2 p (Cons vv vw) = span2Span1 p vw p vv vw (p vv); 9.67/4.08 9.67/4.08 span2Span0 wx wy p vv vw MyTrue = Tup2 Nil (Cons vv vw); 9.67/4.08 9.67/4.08 span2Span1 wx wy p vv vw MyTrue = Tup2 (Cons vv (span2Ys wx wy)) (span2Zs wx wy); 9.67/4.08 span2Span1 wx wy p vv vw MyFalse = span2Span0 wx wy p vv vw otherwise; 9.67/4.08 9.67/4.08 span2Vu43 wx wy = span wx wy; 9.67/4.08 9.67/4.08 span2Ys wx wy = span2Ys0 wx wy (span2Vu43 wx wy); 9.67/4.08 9.67/4.08 span2Ys0 wx wy (Tup2 ys vx) = ys; 9.67/4.08 9.67/4.08 span2Zs wx wy = span2Zs0 wx wy (span2Vu43 wx wy); 9.67/4.08 9.67/4.08 span2Zs0 wx wy (Tup2 vy zs) = zs; 9.67/4.08 9.67/4.08 span3 p Nil = Tup2 Nil Nil; 9.67/4.08 span3 wv ww = span2 wv ww; 9.67/4.08 9.67/4.08 } 9.67/4.08 9.67/4.08 ---------------------------------------- 9.67/4.08 9.67/4.08 (1) BR (EQUIVALENT) 9.67/4.08 Replaced joker patterns by fresh variables and removed binding patterns. 9.67/4.08 ---------------------------------------- 9.67/4.08 9.67/4.08 (2) 9.67/4.08 Obligation: 9.67/4.08 mainModule Main 9.67/4.08 module Main where { 9.67/4.08 import qualified Prelude; 9.67/4.08 data List a = Cons a (List a) | Nil ; 9.67/4.08 9.67/4.08 data MyBool = MyTrue | MyFalse ; 9.67/4.08 9.67/4.08 data Tup2 b a = Tup2 b a ; 9.67/4.08 9.67/4.08 break :: (a -> MyBool) -> List a -> Tup2 (List a) (List a); 9.67/4.08 break p = span (pt not p); 9.67/4.08 9.67/4.08 not :: MyBool -> MyBool; 9.67/4.08 not MyTrue = MyFalse; 9.67/4.08 not MyFalse = MyTrue; 9.67/4.08 9.67/4.08 otherwise :: MyBool; 9.67/4.08 otherwise = MyTrue; 9.67/4.08 9.67/4.08 pt :: (c -> a) -> (b -> c) -> b -> a; 9.67/4.08 pt f g x = f (g x); 9.67/4.08 9.67/4.08 span :: (a -> MyBool) -> List a -> Tup2 (List a) (List a); 9.67/4.08 span p Nil = span3 p Nil; 9.67/4.08 span p (Cons vv vw) = span2 p (Cons vv vw); 9.67/4.08 9.67/4.08 span2 p (Cons vv vw) = span2Span1 p vw p vv vw (p vv); 9.67/4.08 9.67/4.08 span2Span0 wx wy p vv vw MyTrue = Tup2 Nil (Cons vv vw); 9.67/4.08 9.67/4.08 span2Span1 wx wy p vv vw MyTrue = Tup2 (Cons vv (span2Ys wx wy)) (span2Zs wx wy); 9.67/4.08 span2Span1 wx wy p vv vw MyFalse = span2Span0 wx wy p vv vw otherwise; 9.67/4.08 9.67/4.08 span2Vu43 wx wy = span wx wy; 9.67/4.08 9.67/4.08 span2Ys wx wy = span2Ys0 wx wy (span2Vu43 wx wy); 9.67/4.08 9.67/4.08 span2Ys0 wx wy (Tup2 ys vx) = ys; 9.67/4.08 9.67/4.08 span2Zs wx wy = span2Zs0 wx wy (span2Vu43 wx wy); 9.67/4.08 9.67/4.08 span2Zs0 wx wy (Tup2 vy zs) = zs; 9.67/4.08 9.67/4.08 span3 p Nil = Tup2 Nil Nil; 9.67/4.08 span3 wv ww = span2 wv ww; 9.67/4.08 9.67/4.08 } 9.67/4.08 9.67/4.08 ---------------------------------------- 9.67/4.08 9.67/4.08 (3) COR (EQUIVALENT) 9.67/4.08 Cond Reductions: 9.67/4.08 The following Function with conditions 9.67/4.08 "undefined |Falseundefined; 9.67/4.08 " 9.67/4.08 is transformed to 9.67/4.08 "undefined = undefined1; 9.67/4.08 " 9.67/4.08 "undefined0 True = undefined; 9.67/4.08 " 9.67/4.08 "undefined1 = undefined0 False; 9.67/4.08 " 9.67/4.08 9.67/4.08 ---------------------------------------- 9.67/4.08 9.67/4.08 (4) 9.67/4.08 Obligation: 9.67/4.08 mainModule Main 9.67/4.08 module Main where { 9.67/4.08 import qualified Prelude; 9.67/4.08 data List a = Cons a (List a) | Nil ; 9.67/4.08 9.67/4.08 data MyBool = MyTrue | MyFalse ; 9.67/4.08 9.67/4.08 data Tup2 a b = Tup2 a b ; 9.67/4.08 9.67/4.08 break :: (a -> MyBool) -> List a -> Tup2 (List a) (List a); 9.67/4.08 break p = span (pt not p); 9.67/4.08 9.67/4.08 not :: MyBool -> MyBool; 9.67/4.08 not MyTrue = MyFalse; 9.67/4.08 not MyFalse = MyTrue; 9.67/4.08 9.67/4.08 otherwise :: MyBool; 9.67/4.08 otherwise = MyTrue; 9.67/4.08 9.67/4.08 pt :: (b -> a) -> (c -> b) -> c -> a; 9.67/4.08 pt f g x = f (g x); 9.67/4.08 9.67/4.08 span :: (a -> MyBool) -> List a -> Tup2 (List a) (List a); 9.67/4.08 span p Nil = span3 p Nil; 9.67/4.08 span p (Cons vv vw) = span2 p (Cons vv vw); 9.67/4.08 9.67/4.08 span2 p (Cons vv vw) = span2Span1 p vw p vv vw (p vv); 9.67/4.08 9.67/4.08 span2Span0 wx wy p vv vw MyTrue = Tup2 Nil (Cons vv vw); 9.67/4.08 9.67/4.08 span2Span1 wx wy p vv vw MyTrue = Tup2 (Cons vv (span2Ys wx wy)) (span2Zs wx wy); 9.67/4.08 span2Span1 wx wy p vv vw MyFalse = span2Span0 wx wy p vv vw otherwise; 9.67/4.08 9.67/4.08 span2Vu43 wx wy = span wx wy; 9.67/4.08 9.67/4.08 span2Ys wx wy = span2Ys0 wx wy (span2Vu43 wx wy); 9.67/4.08 9.67/4.08 span2Ys0 wx wy (Tup2 ys vx) = ys; 9.67/4.08 9.67/4.08 span2Zs wx wy = span2Zs0 wx wy (span2Vu43 wx wy); 9.67/4.08 9.67/4.08 span2Zs0 wx wy (Tup2 vy zs) = zs; 9.67/4.08 9.67/4.08 span3 p Nil = Tup2 Nil Nil; 9.67/4.08 span3 wv ww = span2 wv ww; 9.67/4.08 9.67/4.08 } 9.67/4.08 9.67/4.08 ---------------------------------------- 9.67/4.08 9.67/4.08 (5) Narrow (SOUND) 9.67/4.08 Haskell To QDPs 9.67/4.08 9.67/4.08 digraph dp_graph { 9.67/4.08 node [outthreshold=100, inthreshold=100];1[label="break",fontsize=16,color="grey",shape="box"];1 -> 3[label="",style="dashed", color="grey", weight=3]; 9.67/4.08 3[label="break wz3",fontsize=16,color="grey",shape="box"];3 -> 4[label="",style="dashed", color="grey", weight=3]; 9.67/4.08 4[label="break wz3 wz4",fontsize=16,color="black",shape="triangle"];4 -> 5[label="",style="solid", color="black", weight=3]; 9.67/4.08 5[label="span (pt not wz3) wz4",fontsize=16,color="burlywood",shape="triangle"];43[label="wz4/Cons wz40 wz41",fontsize=10,color="white",style="solid",shape="box"];5 -> 43[label="",style="solid", color="burlywood", weight=9]; 9.67/4.08 43 -> 6[label="",style="solid", color="burlywood", weight=3]; 9.67/4.08 44[label="wz4/Nil",fontsize=10,color="white",style="solid",shape="box"];5 -> 44[label="",style="solid", color="burlywood", weight=9]; 9.67/4.08 44 -> 7[label="",style="solid", color="burlywood", weight=3]; 9.67/4.08 6[label="span (pt not wz3) (Cons wz40 wz41)",fontsize=16,color="black",shape="box"];6 -> 8[label="",style="solid", color="black", weight=3]; 9.67/4.08 7[label="span (pt not wz3) Nil",fontsize=16,color="black",shape="box"];7 -> 9[label="",style="solid", color="black", weight=3]; 9.67/4.08 8[label="span2 (pt not wz3) (Cons wz40 wz41)",fontsize=16,color="black",shape="box"];8 -> 10[label="",style="solid", color="black", weight=3]; 9.67/4.08 9[label="span3 (pt not wz3) Nil",fontsize=16,color="black",shape="box"];9 -> 11[label="",style="solid", color="black", weight=3]; 9.67/4.08 10[label="span2Span1 (pt not wz3) wz41 (pt not wz3) wz40 wz41 (pt not wz3 wz40)",fontsize=16,color="black",shape="box"];10 -> 12[label="",style="solid", color="black", weight=3]; 9.67/4.08 11[label="Tup2 Nil Nil",fontsize=16,color="green",shape="box"];12 -> 13[label="",style="dashed", color="red", weight=0]; 9.67/4.08 12[label="span2Span1 (pt not wz3) wz41 (pt not wz3) wz40 wz41 (not (wz3 wz40))",fontsize=16,color="magenta"];12 -> 14[label="",style="dashed", color="magenta", weight=3]; 9.67/4.08 14[label="wz3 wz40",fontsize=16,color="green",shape="box"];14 -> 18[label="",style="dashed", color="green", weight=3]; 9.67/4.08 13[label="span2Span1 (pt not wz3) wz41 (pt not wz3) wz40 wz41 (not wz5)",fontsize=16,color="burlywood",shape="triangle"];45[label="wz5/MyTrue",fontsize=10,color="white",style="solid",shape="box"];13 -> 45[label="",style="solid", color="burlywood", weight=9]; 9.67/4.08 45 -> 16[label="",style="solid", color="burlywood", weight=3]; 9.67/4.08 46[label="wz5/MyFalse",fontsize=10,color="white",style="solid",shape="box"];13 -> 46[label="",style="solid", color="burlywood", weight=9]; 9.67/4.08 46 -> 17[label="",style="solid", color="burlywood", weight=3]; 9.67/4.08 18[label="wz40",fontsize=16,color="green",shape="box"];16[label="span2Span1 (pt not wz3) wz41 (pt not wz3) wz40 wz41 (not MyTrue)",fontsize=16,color="black",shape="box"];16 -> 19[label="",style="solid", color="black", weight=3]; 9.67/4.08 17[label="span2Span1 (pt not wz3) wz41 (pt not wz3) wz40 wz41 (not MyFalse)",fontsize=16,color="black",shape="box"];17 -> 20[label="",style="solid", color="black", weight=3]; 9.67/4.08 19[label="span2Span1 (pt not wz3) wz41 (pt not wz3) wz40 wz41 MyFalse",fontsize=16,color="black",shape="box"];19 -> 21[label="",style="solid", color="black", weight=3]; 9.67/4.08 20[label="span2Span1 (pt not wz3) wz41 (pt not wz3) wz40 wz41 MyTrue",fontsize=16,color="black",shape="box"];20 -> 22[label="",style="solid", color="black", weight=3]; 9.67/4.08 21[label="span2Span0 (pt not wz3) wz41 (pt not wz3) wz40 wz41 otherwise",fontsize=16,color="black",shape="box"];21 -> 23[label="",style="solid", color="black", weight=3]; 9.67/4.08 22[label="Tup2 (Cons wz40 (span2Ys (pt not wz3) wz41)) (span2Zs (pt not wz3) wz41)",fontsize=16,color="green",shape="box"];22 -> 24[label="",style="dashed", color="green", weight=3]; 9.67/4.08 22 -> 25[label="",style="dashed", color="green", weight=3]; 9.67/4.08 23[label="span2Span0 (pt not wz3) wz41 (pt not wz3) wz40 wz41 MyTrue",fontsize=16,color="black",shape="box"];23 -> 26[label="",style="solid", color="black", weight=3]; 9.67/4.08 24[label="span2Ys (pt not wz3) wz41",fontsize=16,color="black",shape="box"];24 -> 27[label="",style="solid", color="black", weight=3]; 9.67/4.08 25[label="span2Zs (pt not wz3) wz41",fontsize=16,color="black",shape="box"];25 -> 28[label="",style="solid", color="black", weight=3]; 9.67/4.08 26[label="Tup2 Nil (Cons wz40 wz41)",fontsize=16,color="green",shape="box"];27 -> 31[label="",style="dashed", color="red", weight=0]; 9.67/4.08 27[label="span2Ys0 (pt not wz3) wz41 (span2Vu43 (pt not wz3) wz41)",fontsize=16,color="magenta"];27 -> 32[label="",style="dashed", color="magenta", weight=3]; 9.67/4.08 28 -> 36[label="",style="dashed", color="red", weight=0]; 9.67/4.08 28[label="span2Zs0 (pt not wz3) wz41 (span2Vu43 (pt not wz3) wz41)",fontsize=16,color="magenta"];28 -> 37[label="",style="dashed", color="magenta", weight=3]; 9.67/4.08 32[label="span2Vu43 (pt not wz3) wz41",fontsize=16,color="black",shape="triangle"];32 -> 34[label="",style="solid", color="black", weight=3]; 9.67/4.08 31[label="span2Ys0 (pt not wz3) wz41 wz6",fontsize=16,color="burlywood",shape="triangle"];47[label="wz6/Tup2 wz60 wz61",fontsize=10,color="white",style="solid",shape="box"];31 -> 47[label="",style="solid", color="burlywood", weight=9]; 9.67/4.08 47 -> 35[label="",style="solid", color="burlywood", weight=3]; 9.67/4.08 37 -> 32[label="",style="dashed", color="red", weight=0]; 9.67/4.08 37[label="span2Vu43 (pt not wz3) wz41",fontsize=16,color="magenta"];36[label="span2Zs0 (pt not wz3) wz41 wz7",fontsize=16,color="burlywood",shape="triangle"];48[label="wz7/Tup2 wz70 wz71",fontsize=10,color="white",style="solid",shape="box"];36 -> 48[label="",style="solid", color="burlywood", weight=9]; 9.67/4.08 48 -> 39[label="",style="solid", color="burlywood", weight=3]; 9.67/4.08 34 -> 5[label="",style="dashed", color="red", weight=0]; 9.67/4.08 34[label="span (pt not wz3) wz41",fontsize=16,color="magenta"];34 -> 40[label="",style="dashed", color="magenta", weight=3]; 9.67/4.08 35[label="span2Ys0 (pt not wz3) wz41 (Tup2 wz60 wz61)",fontsize=16,color="black",shape="box"];35 -> 41[label="",style="solid", color="black", weight=3]; 9.67/4.08 39[label="span2Zs0 (pt not wz3) wz41 (Tup2 wz70 wz71)",fontsize=16,color="black",shape="box"];39 -> 42[label="",style="solid", color="black", weight=3]; 9.67/4.08 40[label="wz41",fontsize=16,color="green",shape="box"];41[label="wz60",fontsize=16,color="green",shape="box"];42[label="wz71",fontsize=16,color="green",shape="box"];} 9.67/4.08 9.67/4.08 ---------------------------------------- 9.67/4.08 9.67/4.08 (6) 9.67/4.08 Obligation: 9.67/4.08 Q DP problem: 9.67/4.08 The TRS P consists of the following rules: 9.67/4.08 9.67/4.08 new_span2Vu43(wz3, wz41, h) -> new_span(wz3, wz41, h) 9.67/4.08 new_span(wz3, Cons(wz40, wz41), h) -> new_span2Span1(wz3, wz41, wz40, h) 9.67/4.08 new_span2Span1(wz3, wz41, wz40, h) -> new_span(wz3, wz41, h) 9.67/4.08 new_span2Span1(wz3, wz41, wz40, h) -> new_span2Vu43(wz3, wz41, h) 9.67/4.08 9.67/4.08 R is empty. 9.67/4.08 Q is empty. 9.67/4.08 We have to consider all minimal (P,Q,R)-chains. 9.67/4.08 ---------------------------------------- 9.67/4.08 9.67/4.08 (7) QDPSizeChangeProof (EQUIVALENT) 9.67/4.08 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.67/4.08 9.67/4.08 From the DPs we obtained the following set of size-change graphs: 9.67/4.08 *new_span(wz3, Cons(wz40, wz41), h) -> new_span2Span1(wz3, wz41, wz40, h) 9.67/4.08 The graph contains the following edges 1 >= 1, 2 > 2, 2 > 3, 3 >= 4 9.67/4.08 9.67/4.08 9.67/4.08 *new_span2Span1(wz3, wz41, wz40, h) -> new_span2Vu43(wz3, wz41, h) 9.67/4.08 The graph contains the following edges 1 >= 1, 2 >= 2, 4 >= 3 9.67/4.08 9.67/4.08 9.67/4.08 *new_span2Span1(wz3, wz41, wz40, h) -> new_span(wz3, wz41, h) 9.67/4.08 The graph contains the following edges 1 >= 1, 2 >= 2, 4 >= 3 9.67/4.08 9.67/4.08 9.67/4.08 *new_span2Vu43(wz3, wz41, h) -> new_span(wz3, wz41, h) 9.67/4.08 The graph contains the following edges 1 >= 1, 2 >= 2, 3 >= 3 9.67/4.08 9.67/4.08 9.67/4.08 ---------------------------------------- 9.67/4.08 9.67/4.08 (8) 9.67/4.08 YES 9.95/4.12 EOF