7.92/3.54 YES 9.84/4.08 proof of /export/starexec/sandbox/benchmark/theBenchmark.hs 9.84/4.08 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 9.84/4.08 9.84/4.08 9.84/4.08 H-Termination with start terms of the given HASKELL could be proven: 9.84/4.08 9.84/4.08 (0) HASKELL 9.84/4.08 (1) BR [EQUIVALENT, 0 ms] 9.84/4.08 (2) HASKELL 9.84/4.08 (3) COR [EQUIVALENT, 0 ms] 9.84/4.08 (4) HASKELL 9.84/4.08 (5) Narrow [SOUND, 0 ms] 9.84/4.08 (6) QDP 9.84/4.08 (7) QDPSizeChangeProof [EQUIVALENT, 0 ms] 9.84/4.08 (8) YES 9.84/4.08 9.84/4.08 9.84/4.08 ---------------------------------------- 9.84/4.08 9.84/4.08 (0) 9.84/4.08 Obligation: 9.84/4.08 mainModule Main 9.84/4.08 module Main where { 9.84/4.08 import qualified Prelude; 9.84/4.08 import qualified Queue; 9.84/4.08 } 9.84/4.08 module Queue where { 9.84/4.08 import qualified Main; 9.84/4.08 import qualified Prelude; 9.84/4.08 data Queue a = Q [a] [a] [a] ; 9.84/4.08 9.84/4.08 deQueue :: Queue a -> Maybe (a,Queue a); 9.84/4.08 deQueue (Q [] _ _) = Nothing; 9.84/4.08 deQueue (Q (x : xs) ys xs') = Just (x,makeQ xs ys xs'); 9.84/4.08 9.84/4.08 listToQueue :: [a] -> Queue a; 9.84/4.08 listToQueue xs = Q xs [] xs; 9.84/4.08 9.84/4.08 makeQ :: [a] -> [a] -> [a] -> Queue a; 9.84/4.08 makeQ xs ys [] = listToQueue (rotate xs ys []); 9.84/4.08 makeQ xs ys (_ : xs') = Q xs ys xs'; 9.84/4.08 9.84/4.08 rotate :: [a] -> [a] -> [a] -> [a]; 9.84/4.08 rotate [] (y : _) zs = y : zs; 9.84/4.08 rotate (x : xs) (y : ys) zs = x : rotate xs ys (y : zs); 9.84/4.08 9.84/4.08 } 9.84/4.08 9.84/4.08 ---------------------------------------- 9.84/4.08 9.84/4.08 (1) BR (EQUIVALENT) 9.84/4.08 Replaced joker patterns by fresh variables and removed binding patterns. 9.84/4.08 ---------------------------------------- 9.84/4.08 9.84/4.08 (2) 9.84/4.08 Obligation: 9.84/4.08 mainModule Main 9.84/4.08 module Main where { 9.84/4.08 import qualified Prelude; 9.84/4.08 import qualified Queue; 9.84/4.08 } 9.84/4.08 module Queue where { 9.84/4.08 import qualified Main; 9.84/4.08 import qualified Prelude; 9.84/4.08 data Queue a = Q [a] [a] [a] ; 9.84/4.08 9.84/4.08 deQueue :: Queue a -> Maybe (a,Queue a); 9.84/4.08 deQueue (Q [] vy vz) = Nothing; 9.84/4.08 deQueue (Q (x : xs) ys xs') = Just (x,makeQ xs ys xs'); 9.84/4.08 9.84/4.08 listToQueue :: [a] -> Queue a; 9.84/4.08 listToQueue xs = Q xs [] xs; 9.84/4.08 9.84/4.08 makeQ :: [a] -> [a] -> [a] -> Queue a; 9.84/4.08 makeQ xs ys [] = listToQueue (rotate xs ys []); 9.84/4.08 makeQ xs ys (wu : xs') = Q xs ys xs'; 9.84/4.08 9.84/4.08 rotate :: [a] -> [a] -> [a] -> [a]; 9.84/4.08 rotate [] (y : vx) zs = y : zs; 9.84/4.08 rotate (x : xs) (y : ys) zs = x : rotate xs ys (y : zs); 9.84/4.08 9.84/4.08 } 9.84/4.08 9.84/4.08 ---------------------------------------- 9.84/4.08 9.84/4.08 (3) COR (EQUIVALENT) 9.84/4.08 Cond Reductions: 9.84/4.08 The following Function with conditions 9.84/4.08 "undefined |Falseundefined; 9.84/4.08 " 9.84/4.08 is transformed to 9.84/4.08 "undefined = undefined1; 9.84/4.08 " 9.84/4.08 "undefined0 True = undefined; 9.84/4.08 " 9.84/4.08 "undefined1 = undefined0 False; 9.84/4.08 " 9.84/4.08 9.84/4.08 ---------------------------------------- 9.84/4.08 9.84/4.08 (4) 9.84/4.08 Obligation: 9.84/4.08 mainModule Main 9.84/4.08 module Main where { 9.84/4.08 import qualified Prelude; 9.84/4.08 import qualified Queue; 9.84/4.08 } 9.84/4.08 module Queue where { 9.84/4.08 import qualified Main; 9.84/4.08 import qualified Prelude; 9.84/4.08 data Queue a = Q [a] [a] [a] ; 9.84/4.08 9.84/4.08 deQueue :: Queue a -> Maybe (a,Queue a); 9.84/4.08 deQueue (Q [] vy vz) = Nothing; 9.84/4.08 deQueue (Q (x : xs) ys xs') = Just (x,makeQ xs ys xs'); 9.84/4.08 9.84/4.08 listToQueue :: [a] -> Queue a; 9.84/4.08 listToQueue xs = Q xs [] xs; 9.84/4.08 9.84/4.08 makeQ :: [a] -> [a] -> [a] -> Queue a; 9.84/4.08 makeQ xs ys [] = listToQueue (rotate xs ys []); 9.84/4.08 makeQ xs ys (wu : xs') = Q xs ys xs'; 9.84/4.08 9.84/4.08 rotate :: [a] -> [a] -> [a] -> [a]; 9.84/4.08 rotate [] (y : vx) zs = y : zs; 9.84/4.08 rotate (x : xs) (y : ys) zs = x : rotate xs ys (y : zs); 9.84/4.08 9.84/4.08 } 9.84/4.08 9.84/4.08 ---------------------------------------- 9.84/4.08 9.84/4.08 (5) Narrow (SOUND) 9.84/4.08 Haskell To QDPs 9.84/4.08 9.84/4.08 digraph dp_graph { 9.84/4.08 node [outthreshold=100, inthreshold=100];1[label="Queue.deQueue",fontsize=16,color="grey",shape="box"];1 -> 3[label="",style="dashed", color="grey", weight=3]; 9.84/4.08 3[label="Queue.deQueue wv3",fontsize=16,color="burlywood",shape="triangle"];168[label="wv3/Queue.Q wv30 wv31 wv32",fontsize=10,color="white",style="solid",shape="box"];3 -> 168[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 168 -> 4[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 4[label="Queue.deQueue (Queue.Q wv30 wv31 wv32)",fontsize=16,color="burlywood",shape="box"];169[label="wv30/wv300 : wv301",fontsize=10,color="white",style="solid",shape="box"];4 -> 169[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 169 -> 5[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 170[label="wv30/[]",fontsize=10,color="white",style="solid",shape="box"];4 -> 170[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 170 -> 6[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 5[label="Queue.deQueue (Queue.Q (wv300 : wv301) wv31 wv32)",fontsize=16,color="black",shape="box"];5 -> 7[label="",style="solid", color="black", weight=3]; 9.84/4.08 6[label="Queue.deQueue (Queue.Q [] wv31 wv32)",fontsize=16,color="black",shape="box"];6 -> 8[label="",style="solid", color="black", weight=3]; 9.84/4.08 7[label="Just (wv300,Queue.makeQ wv301 wv31 wv32)",fontsize=16,color="green",shape="box"];7 -> 9[label="",style="dashed", color="green", weight=3]; 9.84/4.08 8[label="Nothing",fontsize=16,color="green",shape="box"];9[label="Queue.makeQ wv301 wv31 wv32",fontsize=16,color="burlywood",shape="box"];171[label="wv32/wv320 : wv321",fontsize=10,color="white",style="solid",shape="box"];9 -> 171[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 171 -> 10[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 172[label="wv32/[]",fontsize=10,color="white",style="solid",shape="box"];9 -> 172[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 172 -> 11[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 10[label="Queue.makeQ wv301 wv31 (wv320 : wv321)",fontsize=16,color="black",shape="box"];10 -> 12[label="",style="solid", color="black", weight=3]; 9.84/4.08 11[label="Queue.makeQ wv301 wv31 []",fontsize=16,color="black",shape="box"];11 -> 13[label="",style="solid", color="black", weight=3]; 9.84/4.08 12[label="Queue.Q wv301 wv31 wv321",fontsize=16,color="green",shape="box"];13[label="Queue.listToQueue (Queue.rotate wv301 wv31 [])",fontsize=16,color="black",shape="box"];13 -> 14[label="",style="solid", color="black", weight=3]; 9.84/4.08 14[label="Queue.Q (Queue.rotate wv301 wv31 []) [] (Queue.rotate wv301 wv31 [])",fontsize=16,color="green",shape="box"];14 -> 15[label="",style="dashed", color="green", weight=3]; 9.84/4.08 14 -> 16[label="",style="dashed", color="green", weight=3]; 9.84/4.08 15[label="Queue.rotate wv301 wv31 []",fontsize=16,color="burlywood",shape="triangle"];173[label="wv301/wv3010 : wv3011",fontsize=10,color="white",style="solid",shape="box"];15 -> 173[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 173 -> 17[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 174[label="wv301/[]",fontsize=10,color="white",style="solid",shape="box"];15 -> 174[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 174 -> 18[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 16 -> 15[label="",style="dashed", color="red", weight=0]; 9.84/4.08 16[label="Queue.rotate wv301 wv31 []",fontsize=16,color="magenta"];17[label="Queue.rotate (wv3010 : wv3011) wv31 []",fontsize=16,color="burlywood",shape="box"];175[label="wv31/wv310 : wv311",fontsize=10,color="white",style="solid",shape="box"];17 -> 175[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 175 -> 19[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 176[label="wv31/[]",fontsize=10,color="white",style="solid",shape="box"];17 -> 176[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 176 -> 20[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 18[label="Queue.rotate [] wv31 []",fontsize=16,color="burlywood",shape="box"];177[label="wv31/wv310 : wv311",fontsize=10,color="white",style="solid",shape="box"];18 -> 177[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 177 -> 21[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 178[label="wv31/[]",fontsize=10,color="white",style="solid",shape="box"];18 -> 178[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 178 -> 22[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 19[label="Queue.rotate (wv3010 : wv3011) (wv310 : wv311) []",fontsize=16,color="black",shape="box"];19 -> 23[label="",style="solid", color="black", weight=3]; 9.84/4.08 20[label="Queue.rotate (wv3010 : wv3011) [] []",fontsize=16,color="black",shape="box"];20 -> 24[label="",style="solid", color="black", weight=3]; 9.84/4.08 21[label="Queue.rotate [] (wv310 : wv311) []",fontsize=16,color="black",shape="box"];21 -> 25[label="",style="solid", color="black", weight=3]; 9.84/4.08 22[label="Queue.rotate [] [] []",fontsize=16,color="black",shape="box"];22 -> 26[label="",style="solid", color="black", weight=3]; 9.84/4.08 23[label="wv3010 : Queue.rotate wv3011 wv311 (wv310 : [])",fontsize=16,color="green",shape="box"];23 -> 27[label="",style="dashed", color="green", weight=3]; 9.84/4.08 24[label="error []",fontsize=16,color="red",shape="box"];25[label="wv310 : []",fontsize=16,color="green",shape="box"];26[label="error []",fontsize=16,color="red",shape="box"];27 -> 116[label="",style="dashed", color="red", weight=0]; 9.84/4.08 27[label="Queue.rotate wv3011 wv311 (wv310 : [])",fontsize=16,color="magenta"];27 -> 117[label="",style="dashed", color="magenta", weight=3]; 9.84/4.08 27 -> 118[label="",style="dashed", color="magenta", weight=3]; 9.84/4.08 27 -> 119[label="",style="dashed", color="magenta", weight=3]; 9.84/4.08 27 -> 120[label="",style="dashed", color="magenta", weight=3]; 9.84/4.08 117[label="wv3011",fontsize=16,color="green",shape="box"];118[label="wv310",fontsize=16,color="green",shape="box"];119[label="[]",fontsize=16,color="green",shape="box"];120[label="wv311",fontsize=16,color="green",shape="box"];116[label="Queue.rotate wv5 wv6 (wv7 : wv8)",fontsize=16,color="burlywood",shape="triangle"];179[label="wv5/wv50 : wv51",fontsize=10,color="white",style="solid",shape="box"];116 -> 179[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 179 -> 153[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 180[label="wv5/[]",fontsize=10,color="white",style="solid",shape="box"];116 -> 180[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 180 -> 154[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 153[label="Queue.rotate (wv50 : wv51) wv6 (wv7 : wv8)",fontsize=16,color="burlywood",shape="box"];181[label="wv6/wv60 : wv61",fontsize=10,color="white",style="solid",shape="box"];153 -> 181[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 181 -> 155[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 182[label="wv6/[]",fontsize=10,color="white",style="solid",shape="box"];153 -> 182[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 182 -> 156[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 154[label="Queue.rotate [] wv6 (wv7 : wv8)",fontsize=16,color="burlywood",shape="box"];183[label="wv6/wv60 : wv61",fontsize=10,color="white",style="solid",shape="box"];154 -> 183[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 183 -> 157[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 184[label="wv6/[]",fontsize=10,color="white",style="solid",shape="box"];154 -> 184[label="",style="solid", color="burlywood", weight=9]; 9.84/4.08 184 -> 158[label="",style="solid", color="burlywood", weight=3]; 9.84/4.08 155[label="Queue.rotate (wv50 : wv51) (wv60 : wv61) (wv7 : wv8)",fontsize=16,color="black",shape="box"];155 -> 159[label="",style="solid", color="black", weight=3]; 9.84/4.08 156[label="Queue.rotate (wv50 : wv51) [] (wv7 : wv8)",fontsize=16,color="black",shape="box"];156 -> 160[label="",style="solid", color="black", weight=3]; 9.84/4.08 157[label="Queue.rotate [] (wv60 : wv61) (wv7 : wv8)",fontsize=16,color="black",shape="box"];157 -> 161[label="",style="solid", color="black", weight=3]; 9.84/4.08 158[label="Queue.rotate [] [] (wv7 : wv8)",fontsize=16,color="black",shape="box"];158 -> 162[label="",style="solid", color="black", weight=3]; 9.84/4.08 159[label="wv50 : Queue.rotate wv51 wv61 (wv60 : wv7 : wv8)",fontsize=16,color="green",shape="box"];159 -> 163[label="",style="dashed", color="green", weight=3]; 9.84/4.08 160[label="error []",fontsize=16,color="red",shape="box"];161[label="wv60 : wv7 : wv8",fontsize=16,color="green",shape="box"];162[label="error []",fontsize=16,color="red",shape="box"];163 -> 116[label="",style="dashed", color="red", weight=0]; 9.84/4.08 163[label="Queue.rotate wv51 wv61 (wv60 : wv7 : wv8)",fontsize=16,color="magenta"];163 -> 164[label="",style="dashed", color="magenta", weight=3]; 9.84/4.08 163 -> 165[label="",style="dashed", color="magenta", weight=3]; 9.84/4.08 163 -> 166[label="",style="dashed", color="magenta", weight=3]; 9.84/4.08 163 -> 167[label="",style="dashed", color="magenta", weight=3]; 9.84/4.08 164[label="wv51",fontsize=16,color="green",shape="box"];165[label="wv60",fontsize=16,color="green",shape="box"];166[label="wv7 : wv8",fontsize=16,color="green",shape="box"];167[label="wv61",fontsize=16,color="green",shape="box"];} 9.84/4.08 9.84/4.08 ---------------------------------------- 9.84/4.08 9.84/4.08 (6) 9.84/4.08 Obligation: 9.84/4.08 Q DP problem: 9.84/4.08 The TRS P consists of the following rules: 9.84/4.08 9.84/4.08 new_rotate(:(wv50, wv51), :(wv60, wv61), wv7, wv8, h) -> new_rotate(wv51, wv61, wv60, :(wv7, wv8), h) 9.84/4.08 9.84/4.08 R is empty. 9.84/4.08 Q is empty. 9.84/4.08 We have to consider all minimal (P,Q,R)-chains. 9.84/4.08 ---------------------------------------- 9.84/4.08 9.84/4.08 (7) QDPSizeChangeProof (EQUIVALENT) 9.84/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.84/4.08 9.84/4.08 From the DPs we obtained the following set of size-change graphs: 9.84/4.08 *new_rotate(:(wv50, wv51), :(wv60, wv61), wv7, wv8, h) -> new_rotate(wv51, wv61, wv60, :(wv7, wv8), h) 9.84/4.08 The graph contains the following edges 1 > 1, 2 > 2, 2 > 3, 5 >= 5 9.84/4.08 9.84/4.08 9.84/4.08 ---------------------------------------- 9.84/4.08 9.84/4.08 (8) 9.84/4.08 YES 9.91/4.13 EOF