9.69/4.39 YES 11.78/4.96 proof of /export/starexec/sandbox2/benchmark/theBenchmark.hs 11.78/4.96 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 11.78/4.96 11.78/4.96 11.78/4.96 H-Termination with start terms of the given HASKELL could be proven: 11.78/4.96 11.78/4.96 (0) HASKELL 11.78/4.96 (1) CR [EQUIVALENT, 0 ms] 11.78/4.96 (2) HASKELL 11.78/4.96 (3) BR [EQUIVALENT, 0 ms] 11.78/4.96 (4) HASKELL 11.78/4.96 (5) COR [EQUIVALENT, 0 ms] 11.78/4.96 (6) HASKELL 11.78/4.96 (7) Narrow [EQUIVALENT, 0 ms] 11.78/4.96 (8) YES 11.78/4.96 11.78/4.96 11.78/4.96 ---------------------------------------- 11.78/4.96 11.78/4.96 (0) 11.78/4.96 Obligation: 11.78/4.96 mainModule Main 11.78/4.96 module FiniteMap where { 11.78/4.96 import qualified Main; 11.78/4.96 import qualified Maybe; 11.78/4.96 import qualified Prelude; 11.78/4.96 data FiniteMap b a = EmptyFM | Branch b a Int (FiniteMap b a) (FiniteMap b a) ; 11.78/4.96 11.78/4.96 instance (Eq a, Eq b) => Eq FiniteMap a b where { 11.78/4.96 } 11.78/4.96 lookupFM :: Ord a => FiniteMap a b -> a -> Maybe b; 11.78/4.96 lookupFM EmptyFM key = Nothing; 11.78/4.96 lookupFM (Branch key elt _ fm_l fm_r) key_to_find | key_to_find < key = lookupFM fm_l key_to_find 11.78/4.96 | key_to_find > key = lookupFM fm_r key_to_find 11.78/4.96 | otherwise = Just elt; 11.78/4.96 11.78/4.96 lookupWithDefaultFM :: Ord b => FiniteMap b a -> a -> b -> a; 11.78/4.96 lookupWithDefaultFM fm deflt key = case lookupFM fm key of { 11.78/4.96 Nothing-> deflt; 11.78/4.96 Just elt-> elt; 11.78/4.96 } ; 11.78/4.96 11.78/4.96 } 11.78/4.96 module Maybe where { 11.78/4.96 import qualified FiniteMap; 11.78/4.96 import qualified Main; 11.78/4.96 import qualified Prelude; 11.78/4.96 } 11.78/4.96 module Main where { 11.78/4.96 import qualified FiniteMap; 11.78/4.96 import qualified Maybe; 11.78/4.96 import qualified Prelude; 11.78/4.96 } 11.78/4.96 11.78/4.96 ---------------------------------------- 11.78/4.96 11.78/4.96 (1) CR (EQUIVALENT) 11.78/4.96 Case Reductions: 11.78/4.96 The following Case expression 11.78/4.96 "case lookupFM fm key of { 11.78/4.96 Nothing -> deflt; 11.78/4.96 Just elt -> elt} 11.78/4.96 " 11.78/4.96 is transformed to 11.78/4.96 "lookupWithDefaultFM0 deflt Nothing = deflt; 11.78/4.96 lookupWithDefaultFM0 deflt (Just elt) = elt; 11.78/4.96 " 11.78/4.96 11.78/4.96 ---------------------------------------- 11.78/4.96 11.78/4.96 (2) 11.78/4.96 Obligation: 11.78/4.96 mainModule Main 11.78/4.96 module FiniteMap where { 11.78/4.96 import qualified Main; 11.78/4.96 import qualified Maybe; 11.78/4.96 import qualified Prelude; 11.78/4.96 data FiniteMap b a = EmptyFM | Branch b a Int (FiniteMap b a) (FiniteMap b a) ; 11.78/4.96 11.78/4.96 instance (Eq a, Eq b) => Eq FiniteMap b a where { 11.78/4.96 } 11.78/4.96 lookupFM :: Ord b => FiniteMap b a -> b -> Maybe a; 11.78/4.96 lookupFM EmptyFM key = Nothing; 11.78/4.96 lookupFM (Branch key elt _ fm_l fm_r) key_to_find | key_to_find < key = lookupFM fm_l key_to_find 11.78/4.96 | key_to_find > key = lookupFM fm_r key_to_find 11.78/4.96 | otherwise = Just elt; 11.78/4.96 11.78/4.96 lookupWithDefaultFM :: Ord b => FiniteMap b a -> a -> b -> a; 11.78/4.96 lookupWithDefaultFM fm deflt key = lookupWithDefaultFM0 deflt (lookupFM fm key); 11.78/4.96 11.78/4.96 lookupWithDefaultFM0 deflt Nothing = deflt; 11.78/4.96 lookupWithDefaultFM0 deflt (Just elt) = elt; 11.78/4.96 11.78/4.96 } 11.78/4.96 module Maybe where { 11.78/4.96 import qualified FiniteMap; 11.78/4.96 import qualified Main; 11.78/4.96 import qualified Prelude; 11.78/4.96 } 11.78/4.96 module Main where { 11.78/4.96 import qualified FiniteMap; 11.78/4.96 import qualified Maybe; 11.78/4.96 import qualified Prelude; 11.78/4.96 } 11.78/4.96 11.78/4.96 ---------------------------------------- 11.78/4.96 11.78/4.96 (3) BR (EQUIVALENT) 11.78/4.96 Replaced joker patterns by fresh variables and removed binding patterns. 11.78/4.96 ---------------------------------------- 11.78/4.96 11.78/4.96 (4) 11.78/4.96 Obligation: 11.78/4.96 mainModule Main 11.78/4.96 module FiniteMap where { 11.78/4.96 import qualified Main; 11.78/4.96 import qualified Maybe; 11.78/4.96 import qualified Prelude; 11.78/4.96 data FiniteMap b a = EmptyFM | Branch b a Int (FiniteMap b a) (FiniteMap b a) ; 11.78/4.96 11.78/4.96 instance (Eq a, Eq b) => Eq FiniteMap a b where { 11.78/4.96 } 11.78/4.96 lookupFM :: Ord b => FiniteMap b a -> b -> Maybe a; 11.78/4.96 lookupFM EmptyFM key = Nothing; 11.78/4.96 lookupFM (Branch key elt vy fm_l fm_r) key_to_find | key_to_find < key = lookupFM fm_l key_to_find 11.78/4.96 | key_to_find > key = lookupFM fm_r key_to_find 11.78/4.96 | otherwise = Just elt; 11.78/4.96 11.78/4.96 lookupWithDefaultFM :: Ord b => FiniteMap b a -> a -> b -> a; 11.78/4.96 lookupWithDefaultFM fm deflt key = lookupWithDefaultFM0 deflt (lookupFM fm key); 11.78/4.96 11.78/4.96 lookupWithDefaultFM0 deflt Nothing = deflt; 11.78/4.96 lookupWithDefaultFM0 deflt (Just elt) = elt; 11.78/4.96 11.78/4.96 } 11.78/4.96 module Maybe where { 11.78/4.96 import qualified FiniteMap; 11.78/4.96 import qualified Main; 11.78/4.96 import qualified Prelude; 11.78/4.96 } 11.78/4.96 module Main where { 11.78/4.96 import qualified FiniteMap; 11.78/4.96 import qualified Maybe; 11.78/4.96 import qualified Prelude; 11.78/4.96 } 11.78/4.96 11.78/4.96 ---------------------------------------- 11.78/4.96 11.78/4.96 (5) COR (EQUIVALENT) 11.78/4.96 Cond Reductions: 11.78/4.96 The following Function with conditions 11.78/4.96 "undefined |Falseundefined; 11.78/4.96 " 11.78/4.96 is transformed to 11.78/4.96 "undefined = undefined1; 11.78/4.96 " 11.78/4.96 "undefined0 True = undefined; 11.78/4.96 " 11.78/4.96 "undefined1 = undefined0 False; 11.78/4.96 " 11.78/4.96 The following Function with conditions 11.78/4.96 "lookupFM EmptyFM key = Nothing; 11.78/4.96 lookupFM (Branch key elt vy fm_l fm_r) key_to_find|key_to_find < keylookupFM fm_l key_to_find|key_to_find > keylookupFM fm_r key_to_find|otherwiseJust elt; 11.78/4.96 " 11.78/4.96 is transformed to 11.78/4.96 "lookupFM EmptyFM key = lookupFM4 EmptyFM key; 11.78/4.96 lookupFM (Branch key elt vy fm_l fm_r) key_to_find = lookupFM3 (Branch key elt vy fm_l fm_r) key_to_find; 11.78/4.96 " 11.78/4.96 "lookupFM2 key elt vy fm_l fm_r key_to_find True = lookupFM fm_l key_to_find; 11.78/4.96 lookupFM2 key elt vy fm_l fm_r key_to_find False = lookupFM1 key elt vy fm_l fm_r key_to_find (key_to_find > key); 11.78/4.96 " 11.78/4.96 "lookupFM1 key elt vy fm_l fm_r key_to_find True = lookupFM fm_r key_to_find; 11.78/4.96 lookupFM1 key elt vy fm_l fm_r key_to_find False = lookupFM0 key elt vy fm_l fm_r key_to_find otherwise; 11.78/4.96 " 11.78/4.96 "lookupFM0 key elt vy fm_l fm_r key_to_find True = Just elt; 11.78/4.96 " 11.78/4.96 "lookupFM3 (Branch key elt vy fm_l fm_r) key_to_find = lookupFM2 key elt vy fm_l fm_r key_to_find (key_to_find < key); 11.78/4.96 " 11.78/4.96 "lookupFM4 EmptyFM key = Nothing; 11.78/4.96 lookupFM4 wv ww = lookupFM3 wv ww; 11.78/4.96 " 11.78/4.96 11.78/4.96 ---------------------------------------- 11.78/4.96 11.78/4.96 (6) 11.78/4.96 Obligation: 11.78/4.96 mainModule Main 11.78/4.96 module FiniteMap where { 11.78/4.96 import qualified Main; 11.78/4.96 import qualified Maybe; 11.78/4.96 import qualified Prelude; 11.78/4.96 data FiniteMap a b = EmptyFM | Branch a b Int (FiniteMap a b) (FiniteMap a b) ; 11.78/4.96 11.78/4.96 instance (Eq a, Eq b) => Eq FiniteMap a b where { 11.78/4.96 } 11.78/4.96 lookupFM :: Ord b => FiniteMap b a -> b -> Maybe a; 11.78/4.96 lookupFM EmptyFM key = lookupFM4 EmptyFM key; 11.78/4.96 lookupFM (Branch key elt vy fm_l fm_r) key_to_find = lookupFM3 (Branch key elt vy fm_l fm_r) key_to_find; 11.78/4.96 11.78/4.96 lookupFM0 key elt vy fm_l fm_r key_to_find True = Just elt; 11.78/4.96 11.78/4.96 lookupFM1 key elt vy fm_l fm_r key_to_find True = lookupFM fm_r key_to_find; 11.78/4.96 lookupFM1 key elt vy fm_l fm_r key_to_find False = lookupFM0 key elt vy fm_l fm_r key_to_find otherwise; 11.78/4.96 11.78/4.96 lookupFM2 key elt vy fm_l fm_r key_to_find True = lookupFM fm_l key_to_find; 11.78/4.96 lookupFM2 key elt vy fm_l fm_r key_to_find False = lookupFM1 key elt vy fm_l fm_r key_to_find (key_to_find > key); 11.78/4.96 11.78/4.96 lookupFM3 (Branch key elt vy fm_l fm_r) key_to_find = lookupFM2 key elt vy fm_l fm_r key_to_find (key_to_find < key); 11.78/4.96 11.78/4.96 lookupFM4 EmptyFM key = Nothing; 11.78/4.96 lookupFM4 wv ww = lookupFM3 wv ww; 11.78/4.96 11.78/4.96 lookupWithDefaultFM :: Ord a => FiniteMap a b -> b -> a -> b; 11.78/4.96 lookupWithDefaultFM fm deflt key = lookupWithDefaultFM0 deflt (lookupFM fm key); 11.78/4.96 11.78/4.96 lookupWithDefaultFM0 deflt Nothing = deflt; 11.78/4.96 lookupWithDefaultFM0 deflt (Just elt) = elt; 11.78/4.96 11.78/4.96 } 11.78/4.96 module Maybe where { 11.78/4.96 import qualified FiniteMap; 11.78/4.96 import qualified Main; 11.78/4.96 import qualified Prelude; 11.78/4.96 } 11.78/4.96 module Main where { 11.78/4.96 import qualified FiniteMap; 11.78/4.96 import qualified Maybe; 11.78/4.96 import qualified Prelude; 11.78/4.96 } 11.78/4.96 11.78/4.96 ---------------------------------------- 11.78/4.96 11.78/4.96 (7) Narrow (EQUIVALENT) 11.78/4.96 Haskell To QDPs 11.78/4.96 11.78/4.96 digraph dp_graph { 11.78/4.96 node [outthreshold=100, inthreshold=100];1[label="FiniteMap.lookupWithDefaultFM",fontsize=16,color="grey",shape="box"];1 -> 3[label="",style="dashed", color="grey", weight=3]; 11.78/4.96 3[label="FiniteMap.lookupWithDefaultFM wx3",fontsize=16,color="grey",shape="box"];3 -> 4[label="",style="dashed", color="grey", weight=3]; 11.78/4.96 4[label="FiniteMap.lookupWithDefaultFM wx3 wx4",fontsize=16,color="grey",shape="box"];4 -> 5[label="",style="dashed", color="grey", weight=3]; 11.78/4.96 5[label="FiniteMap.lookupWithDefaultFM wx3 wx4 wx5",fontsize=16,color="black",shape="triangle"];5 -> 6[label="",style="solid", color="black", weight=3]; 11.78/4.96 6[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM wx3 wx5)",fontsize=16,color="burlywood",shape="box"];27[label="wx3/FiniteMap.EmptyFM",fontsize=10,color="white",style="solid",shape="box"];6 -> 27[label="",style="solid", color="burlywood", weight=9]; 11.78/4.96 27 -> 7[label="",style="solid", color="burlywood", weight=3]; 11.78/4.96 28[label="wx3/FiniteMap.Branch wx30 wx31 wx32 wx33 wx34",fontsize=10,color="white",style="solid",shape="box"];6 -> 28[label="",style="solid", color="burlywood", weight=9]; 11.78/4.96 28 -> 8[label="",style="solid", color="burlywood", weight=3]; 11.78/4.96 7[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM FiniteMap.EmptyFM wx5)",fontsize=16,color="black",shape="box"];7 -> 9[label="",style="solid", color="black", weight=3]; 11.78/4.96 8[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM (FiniteMap.Branch wx30 wx31 wx32 wx33 wx34) wx5)",fontsize=16,color="black",shape="box"];8 -> 10[label="",style="solid", color="black", weight=3]; 11.78/4.96 9[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM4 FiniteMap.EmptyFM wx5)",fontsize=16,color="black",shape="box"];9 -> 11[label="",style="solid", color="black", weight=3]; 11.78/4.96 10[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM3 (FiniteMap.Branch wx30 wx31 wx32 wx33 wx34) wx5)",fontsize=16,color="black",shape="box"];10 -> 12[label="",style="solid", color="black", weight=3]; 11.78/4.96 11[label="FiniteMap.lookupWithDefaultFM0 wx4 Nothing",fontsize=16,color="black",shape="box"];11 -> 13[label="",style="solid", color="black", weight=3]; 11.78/4.96 12[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM2 wx30 wx31 wx32 wx33 wx34 wx5 (wx5 < wx30))",fontsize=16,color="black",shape="box"];12 -> 14[label="",style="solid", color="black", weight=3]; 11.78/4.96 13[label="wx4",fontsize=16,color="green",shape="box"];14[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM2 wx30 wx31 wx32 wx33 wx34 wx5 (compare wx5 wx30 == LT))",fontsize=16,color="burlywood",shape="box"];29[label="wx5/()",fontsize=10,color="white",style="solid",shape="box"];14 -> 29[label="",style="solid", color="burlywood", weight=9]; 11.78/4.96 29 -> 15[label="",style="solid", color="burlywood", weight=3]; 11.78/4.96 15[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM2 wx30 wx31 wx32 wx33 wx34 () (compare () wx30 == LT))",fontsize=16,color="burlywood",shape="box"];30[label="wx30/()",fontsize=10,color="white",style="solid",shape="box"];15 -> 30[label="",style="solid", color="burlywood", weight=9]; 11.78/4.96 30 -> 16[label="",style="solid", color="burlywood", weight=3]; 11.78/4.96 16[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM2 () wx31 wx32 wx33 wx34 () (compare () () == LT))",fontsize=16,color="black",shape="box"];16 -> 17[label="",style="solid", color="black", weight=3]; 11.78/4.96 17[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM2 () wx31 wx32 wx33 wx34 () (EQ == LT))",fontsize=16,color="black",shape="box"];17 -> 18[label="",style="solid", color="black", weight=3]; 11.78/4.96 18[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM2 () wx31 wx32 wx33 wx34 () False)",fontsize=16,color="black",shape="box"];18 -> 19[label="",style="solid", color="black", weight=3]; 11.78/4.96 19[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM1 () wx31 wx32 wx33 wx34 () (() > ()))",fontsize=16,color="black",shape="box"];19 -> 20[label="",style="solid", color="black", weight=3]; 11.78/4.96 20[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM1 () wx31 wx32 wx33 wx34 () (compare () () == GT))",fontsize=16,color="black",shape="box"];20 -> 21[label="",style="solid", color="black", weight=3]; 11.78/4.96 21[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM1 () wx31 wx32 wx33 wx34 () (EQ == GT))",fontsize=16,color="black",shape="box"];21 -> 22[label="",style="solid", color="black", weight=3]; 11.78/4.96 22[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM1 () wx31 wx32 wx33 wx34 () False)",fontsize=16,color="black",shape="box"];22 -> 23[label="",style="solid", color="black", weight=3]; 11.78/4.96 23[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM0 () wx31 wx32 wx33 wx34 () otherwise)",fontsize=16,color="black",shape="box"];23 -> 24[label="",style="solid", color="black", weight=3]; 11.78/4.96 24[label="FiniteMap.lookupWithDefaultFM0 wx4 (FiniteMap.lookupFM0 () wx31 wx32 wx33 wx34 () True)",fontsize=16,color="black",shape="box"];24 -> 25[label="",style="solid", color="black", weight=3]; 11.78/4.96 25[label="FiniteMap.lookupWithDefaultFM0 wx4 (Just wx31)",fontsize=16,color="black",shape="box"];25 -> 26[label="",style="solid", color="black", weight=3]; 11.78/4.96 26[label="wx31",fontsize=16,color="green",shape="box"];} 11.78/4.96 11.78/4.96 ---------------------------------------- 11.78/4.96 11.78/4.96 (8) 11.78/4.96 YES 11.80/5.00 EOF