8.05/3.59 YES 10.11/4.17 proof of /export/starexec/sandbox/benchmark/theBenchmark.hs 10.11/4.17 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 10.11/4.17 10.11/4.17 10.11/4.17 H-Termination with start terms of the given HASKELL could be proven: 10.11/4.17 10.11/4.17 (0) HASKELL 10.11/4.17 (1) BR [EQUIVALENT, 0 ms] 10.11/4.17 (2) HASKELL 10.11/4.17 (3) COR [EQUIVALENT, 0 ms] 10.11/4.17 (4) HASKELL 10.11/4.17 (5) Narrow [SOUND, 0 ms] 10.11/4.17 (6) QDP 10.11/4.17 (7) TransformationProof [EQUIVALENT, 0 ms] 10.11/4.17 (8) QDP 10.11/4.17 (9) DependencyGraphProof [EQUIVALENT, 0 ms] 10.11/4.17 (10) QDP 10.11/4.17 (11) UsableRulesProof [EQUIVALENT, 0 ms] 10.11/4.17 (12) QDP 10.11/4.17 (13) QReductionProof [EQUIVALENT, 0 ms] 10.11/4.17 (14) QDP 10.11/4.17 (15) QDPSizeChangeProof [EQUIVALENT, 0 ms] 10.11/4.17 (16) YES 10.11/4.17 10.11/4.17 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (0) 10.11/4.17 Obligation: 10.11/4.17 mainModule Main 10.11/4.17 module Main where { 10.11/4.17 import qualified Prelude; 10.11/4.17 data List a = Cons a (List a) | Nil ; 10.11/4.17 10.11/4.17 data MyBool = MyTrue | MyFalse ; 10.11/4.17 10.11/4.17 data MyInt = Pos Main.Nat | Neg Main.Nat ; 10.11/4.17 10.11/4.17 data Main.Nat = Succ Main.Nat | Zero ; 10.11/4.17 10.11/4.17 data Ordering = LT | EQ | GT ; 10.11/4.17 10.11/4.17 compareMyInt :: MyInt -> MyInt -> Ordering; 10.11/4.17 compareMyInt = primCmpInt; 10.11/4.17 10.11/4.17 esEsOrdering :: Ordering -> Ordering -> MyBool; 10.11/4.17 esEsOrdering LT LT = MyTrue; 10.11/4.17 esEsOrdering LT EQ = MyFalse; 10.11/4.17 esEsOrdering LT GT = MyFalse; 10.11/4.17 esEsOrdering EQ LT = MyFalse; 10.11/4.17 esEsOrdering EQ EQ = MyTrue; 10.11/4.17 esEsOrdering EQ GT = MyFalse; 10.11/4.17 esEsOrdering GT LT = MyFalse; 10.11/4.17 esEsOrdering GT EQ = MyFalse; 10.11/4.17 esEsOrdering GT GT = MyTrue; 10.11/4.17 10.11/4.17 fsEsOrdering :: Ordering -> Ordering -> MyBool; 10.11/4.17 fsEsOrdering x y = not (esEsOrdering x y); 10.11/4.17 10.11/4.17 ltEsMyInt :: MyInt -> MyInt -> MyBool; 10.11/4.17 ltEsMyInt x y = fsEsOrdering (compareMyInt x y) GT; 10.11/4.17 10.11/4.17 msMyInt :: MyInt -> MyInt -> MyInt; 10.11/4.17 msMyInt = primMinusInt; 10.11/4.17 10.11/4.17 not :: MyBool -> MyBool; 10.11/4.17 not MyTrue = MyFalse; 10.11/4.17 not MyFalse = MyTrue; 10.11/4.17 10.11/4.17 primCmpInt :: MyInt -> MyInt -> Ordering; 10.11/4.17 primCmpInt (Main.Pos Main.Zero) (Main.Pos Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Pos Main.Zero) (Main.Neg Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Neg Main.Zero) (Main.Pos Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Neg Main.Zero) (Main.Neg Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Pos x) (Main.Pos y) = primCmpNat x y; 10.11/4.17 primCmpInt (Main.Pos x) (Main.Neg y) = GT; 10.11/4.17 primCmpInt (Main.Neg x) (Main.Pos y) = LT; 10.11/4.17 primCmpInt (Main.Neg x) (Main.Neg y) = primCmpNat y x; 10.11/4.17 10.11/4.17 primCmpNat :: Main.Nat -> Main.Nat -> Ordering; 10.11/4.17 primCmpNat Main.Zero Main.Zero = EQ; 10.11/4.17 primCmpNat Main.Zero (Main.Succ y) = LT; 10.11/4.17 primCmpNat (Main.Succ x) Main.Zero = GT; 10.11/4.17 primCmpNat (Main.Succ x) (Main.Succ y) = primCmpNat x y; 10.11/4.17 10.11/4.17 primMinusInt :: MyInt -> MyInt -> MyInt; 10.11/4.17 primMinusInt (Main.Pos x) (Main.Neg y) = Main.Pos (primPlusNat x y); 10.11/4.17 primMinusInt (Main.Neg x) (Main.Pos y) = Main.Neg (primPlusNat x y); 10.11/4.17 primMinusInt (Main.Neg x) (Main.Neg y) = primMinusNat y x; 10.11/4.17 primMinusInt (Main.Pos x) (Main.Pos y) = primMinusNat x y; 10.11/4.17 10.11/4.17 primMinusNat :: Main.Nat -> Main.Nat -> MyInt; 10.11/4.17 primMinusNat Main.Zero Main.Zero = Main.Pos Main.Zero; 10.11/4.17 primMinusNat Main.Zero (Main.Succ y) = Main.Neg (Main.Succ y); 10.11/4.17 primMinusNat (Main.Succ x) Main.Zero = Main.Pos (Main.Succ x); 10.11/4.17 primMinusNat (Main.Succ x) (Main.Succ y) = primMinusNat x y; 10.11/4.17 10.11/4.17 primPlusNat :: Main.Nat -> Main.Nat -> Main.Nat; 10.11/4.17 primPlusNat Main.Zero Main.Zero = Main.Zero; 10.11/4.17 primPlusNat Main.Zero (Main.Succ y) = Main.Succ y; 10.11/4.17 primPlusNat (Main.Succ x) Main.Zero = Main.Succ x; 10.11/4.17 primPlusNat (Main.Succ x) (Main.Succ y) = Main.Succ (Main.Succ (primPlusNat x y)); 10.11/4.17 10.11/4.17 take :: MyInt -> List a -> List a; 10.11/4.17 take n vv = take3 n vv; 10.11/4.17 take vw Nil = take1 vw Nil; 10.11/4.17 take n (Cons x xs) = take0 n (Cons x xs); 10.11/4.17 10.11/4.17 take0 n (Cons x xs) = Cons x (take (msMyInt n (Main.Pos (Main.Succ Main.Zero))) xs); 10.11/4.17 10.11/4.17 take1 vw Nil = Nil; 10.11/4.17 take1 vz wu = take0 vz wu; 10.11/4.17 10.11/4.17 take2 n vv MyTrue = Nil; 10.11/4.17 take2 n vv MyFalse = take1 n vv; 10.11/4.17 10.11/4.17 take3 n vv = take2 n vv (ltEsMyInt n (Main.Pos Main.Zero)); 10.11/4.17 take3 wv ww = take1 wv ww; 10.11/4.17 10.11/4.17 } 10.11/4.17 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (1) BR (EQUIVALENT) 10.11/4.17 Replaced joker patterns by fresh variables and removed binding patterns. 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (2) 10.11/4.17 Obligation: 10.11/4.17 mainModule Main 10.11/4.17 module Main where { 10.11/4.17 import qualified Prelude; 10.11/4.17 data List a = Cons a (List a) | Nil ; 10.11/4.17 10.11/4.17 data MyBool = MyTrue | MyFalse ; 10.11/4.17 10.11/4.17 data MyInt = Pos Main.Nat | Neg Main.Nat ; 10.11/4.17 10.11/4.17 data Main.Nat = Succ Main.Nat | Zero ; 10.11/4.17 10.11/4.17 data Ordering = LT | EQ | GT ; 10.11/4.17 10.11/4.17 compareMyInt :: MyInt -> MyInt -> Ordering; 10.11/4.17 compareMyInt = primCmpInt; 10.11/4.17 10.11/4.17 esEsOrdering :: Ordering -> Ordering -> MyBool; 10.11/4.17 esEsOrdering LT LT = MyTrue; 10.11/4.17 esEsOrdering LT EQ = MyFalse; 10.11/4.17 esEsOrdering LT GT = MyFalse; 10.11/4.17 esEsOrdering EQ LT = MyFalse; 10.11/4.17 esEsOrdering EQ EQ = MyTrue; 10.11/4.17 esEsOrdering EQ GT = MyFalse; 10.11/4.17 esEsOrdering GT LT = MyFalse; 10.11/4.17 esEsOrdering GT EQ = MyFalse; 10.11/4.17 esEsOrdering GT GT = MyTrue; 10.11/4.17 10.11/4.17 fsEsOrdering :: Ordering -> Ordering -> MyBool; 10.11/4.17 fsEsOrdering x y = not (esEsOrdering x y); 10.11/4.17 10.11/4.17 ltEsMyInt :: MyInt -> MyInt -> MyBool; 10.11/4.17 ltEsMyInt x y = fsEsOrdering (compareMyInt x y) GT; 10.11/4.17 10.11/4.17 msMyInt :: MyInt -> MyInt -> MyInt; 10.11/4.17 msMyInt = primMinusInt; 10.11/4.17 10.11/4.17 not :: MyBool -> MyBool; 10.11/4.17 not MyTrue = MyFalse; 10.11/4.17 not MyFalse = MyTrue; 10.11/4.17 10.11/4.17 primCmpInt :: MyInt -> MyInt -> Ordering; 10.11/4.17 primCmpInt (Main.Pos Main.Zero) (Main.Pos Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Pos Main.Zero) (Main.Neg Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Neg Main.Zero) (Main.Pos Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Neg Main.Zero) (Main.Neg Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Pos x) (Main.Pos y) = primCmpNat x y; 10.11/4.17 primCmpInt (Main.Pos x) (Main.Neg y) = GT; 10.11/4.17 primCmpInt (Main.Neg x) (Main.Pos y) = LT; 10.11/4.17 primCmpInt (Main.Neg x) (Main.Neg y) = primCmpNat y x; 10.11/4.17 10.11/4.17 primCmpNat :: Main.Nat -> Main.Nat -> Ordering; 10.11/4.17 primCmpNat Main.Zero Main.Zero = EQ; 10.11/4.17 primCmpNat Main.Zero (Main.Succ y) = LT; 10.11/4.17 primCmpNat (Main.Succ x) Main.Zero = GT; 10.11/4.17 primCmpNat (Main.Succ x) (Main.Succ y) = primCmpNat x y; 10.11/4.17 10.11/4.17 primMinusInt :: MyInt -> MyInt -> MyInt; 10.11/4.17 primMinusInt (Main.Pos x) (Main.Neg y) = Main.Pos (primPlusNat x y); 10.11/4.17 primMinusInt (Main.Neg x) (Main.Pos y) = Main.Neg (primPlusNat x y); 10.11/4.17 primMinusInt (Main.Neg x) (Main.Neg y) = primMinusNat y x; 10.11/4.17 primMinusInt (Main.Pos x) (Main.Pos y) = primMinusNat x y; 10.11/4.17 10.11/4.17 primMinusNat :: Main.Nat -> Main.Nat -> MyInt; 10.11/4.17 primMinusNat Main.Zero Main.Zero = Main.Pos Main.Zero; 10.11/4.17 primMinusNat Main.Zero (Main.Succ y) = Main.Neg (Main.Succ y); 10.11/4.17 primMinusNat (Main.Succ x) Main.Zero = Main.Pos (Main.Succ x); 10.11/4.17 primMinusNat (Main.Succ x) (Main.Succ y) = primMinusNat x y; 10.11/4.17 10.11/4.17 primPlusNat :: Main.Nat -> Main.Nat -> Main.Nat; 10.11/4.17 primPlusNat Main.Zero Main.Zero = Main.Zero; 10.11/4.17 primPlusNat Main.Zero (Main.Succ y) = Main.Succ y; 10.11/4.17 primPlusNat (Main.Succ x) Main.Zero = Main.Succ x; 10.11/4.17 primPlusNat (Main.Succ x) (Main.Succ y) = Main.Succ (Main.Succ (primPlusNat x y)); 10.11/4.17 10.11/4.17 take :: MyInt -> List a -> List a; 10.11/4.17 take n vv = take3 n vv; 10.11/4.17 take vw Nil = take1 vw Nil; 10.11/4.17 take n (Cons x xs) = take0 n (Cons x xs); 10.11/4.17 10.11/4.17 take0 n (Cons x xs) = Cons x (take (msMyInt n (Main.Pos (Main.Succ Main.Zero))) xs); 10.11/4.17 10.11/4.17 take1 vw Nil = Nil; 10.11/4.17 take1 vz wu = take0 vz wu; 10.11/4.17 10.11/4.17 take2 n vv MyTrue = Nil; 10.11/4.17 take2 n vv MyFalse = take1 n vv; 10.11/4.17 10.11/4.17 take3 n vv = take2 n vv (ltEsMyInt n (Main.Pos Main.Zero)); 10.11/4.17 take3 wv ww = take1 wv ww; 10.11/4.17 10.11/4.17 } 10.11/4.17 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (3) COR (EQUIVALENT) 10.11/4.17 Cond Reductions: 10.11/4.17 The following Function with conditions 10.11/4.17 "undefined |Falseundefined; 10.11/4.17 " 10.11/4.17 is transformed to 10.11/4.17 "undefined = undefined1; 10.11/4.17 " 10.11/4.17 "undefined0 True = undefined; 10.11/4.17 " 10.11/4.17 "undefined1 = undefined0 False; 10.11/4.17 " 10.11/4.17 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (4) 10.11/4.17 Obligation: 10.11/4.17 mainModule Main 10.11/4.17 module Main where { 10.11/4.17 import qualified Prelude; 10.11/4.17 data List a = Cons a (List a) | Nil ; 10.11/4.17 10.11/4.17 data MyBool = MyTrue | MyFalse ; 10.11/4.17 10.11/4.17 data MyInt = Pos Main.Nat | Neg Main.Nat ; 10.11/4.17 10.11/4.17 data Main.Nat = Succ Main.Nat | Zero ; 10.11/4.17 10.11/4.17 data Ordering = LT | EQ | GT ; 10.11/4.17 10.11/4.17 compareMyInt :: MyInt -> MyInt -> Ordering; 10.11/4.17 compareMyInt = primCmpInt; 10.11/4.17 10.11/4.17 esEsOrdering :: Ordering -> Ordering -> MyBool; 10.11/4.17 esEsOrdering LT LT = MyTrue; 10.11/4.17 esEsOrdering LT EQ = MyFalse; 10.11/4.17 esEsOrdering LT GT = MyFalse; 10.11/4.17 esEsOrdering EQ LT = MyFalse; 10.11/4.17 esEsOrdering EQ EQ = MyTrue; 10.11/4.17 esEsOrdering EQ GT = MyFalse; 10.11/4.17 esEsOrdering GT LT = MyFalse; 10.11/4.17 esEsOrdering GT EQ = MyFalse; 10.11/4.17 esEsOrdering GT GT = MyTrue; 10.11/4.17 10.11/4.17 fsEsOrdering :: Ordering -> Ordering -> MyBool; 10.11/4.17 fsEsOrdering x y = not (esEsOrdering x y); 10.11/4.17 10.11/4.17 ltEsMyInt :: MyInt -> MyInt -> MyBool; 10.11/4.17 ltEsMyInt x y = fsEsOrdering (compareMyInt x y) GT; 10.11/4.17 10.11/4.17 msMyInt :: MyInt -> MyInt -> MyInt; 10.11/4.17 msMyInt = primMinusInt; 10.11/4.17 10.11/4.17 not :: MyBool -> MyBool; 10.11/4.17 not MyTrue = MyFalse; 10.11/4.17 not MyFalse = MyTrue; 10.11/4.17 10.11/4.17 primCmpInt :: MyInt -> MyInt -> Ordering; 10.11/4.17 primCmpInt (Main.Pos Main.Zero) (Main.Pos Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Pos Main.Zero) (Main.Neg Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Neg Main.Zero) (Main.Pos Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Neg Main.Zero) (Main.Neg Main.Zero) = EQ; 10.11/4.17 primCmpInt (Main.Pos x) (Main.Pos y) = primCmpNat x y; 10.11/4.17 primCmpInt (Main.Pos x) (Main.Neg y) = GT; 10.11/4.17 primCmpInt (Main.Neg x) (Main.Pos y) = LT; 10.11/4.17 primCmpInt (Main.Neg x) (Main.Neg y) = primCmpNat y x; 10.11/4.17 10.11/4.17 primCmpNat :: Main.Nat -> Main.Nat -> Ordering; 10.11/4.17 primCmpNat Main.Zero Main.Zero = EQ; 10.11/4.17 primCmpNat Main.Zero (Main.Succ y) = LT; 10.11/4.17 primCmpNat (Main.Succ x) Main.Zero = GT; 10.11/4.17 primCmpNat (Main.Succ x) (Main.Succ y) = primCmpNat x y; 10.11/4.17 10.11/4.17 primMinusInt :: MyInt -> MyInt -> MyInt; 10.11/4.17 primMinusInt (Main.Pos x) (Main.Neg y) = Main.Pos (primPlusNat x y); 10.11/4.17 primMinusInt (Main.Neg x) (Main.Pos y) = Main.Neg (primPlusNat x y); 10.11/4.17 primMinusInt (Main.Neg x) (Main.Neg y) = primMinusNat y x; 10.11/4.17 primMinusInt (Main.Pos x) (Main.Pos y) = primMinusNat x y; 10.11/4.17 10.11/4.17 primMinusNat :: Main.Nat -> Main.Nat -> MyInt; 10.11/4.17 primMinusNat Main.Zero Main.Zero = Main.Pos Main.Zero; 10.11/4.17 primMinusNat Main.Zero (Main.Succ y) = Main.Neg (Main.Succ y); 10.11/4.17 primMinusNat (Main.Succ x) Main.Zero = Main.Pos (Main.Succ x); 10.11/4.17 primMinusNat (Main.Succ x) (Main.Succ y) = primMinusNat x y; 10.11/4.17 10.11/4.17 primPlusNat :: Main.Nat -> Main.Nat -> Main.Nat; 10.11/4.17 primPlusNat Main.Zero Main.Zero = Main.Zero; 10.11/4.17 primPlusNat Main.Zero (Main.Succ y) = Main.Succ y; 10.11/4.17 primPlusNat (Main.Succ x) Main.Zero = Main.Succ x; 10.11/4.17 primPlusNat (Main.Succ x) (Main.Succ y) = Main.Succ (Main.Succ (primPlusNat x y)); 10.11/4.17 10.11/4.17 take :: MyInt -> List a -> List a; 10.11/4.17 take n vv = take3 n vv; 10.11/4.17 take vw Nil = take1 vw Nil; 10.11/4.17 take n (Cons x xs) = take0 n (Cons x xs); 10.11/4.17 10.11/4.17 take0 n (Cons x xs) = Cons x (take (msMyInt n (Main.Pos (Main.Succ Main.Zero))) xs); 10.11/4.17 10.11/4.17 take1 vw Nil = Nil; 10.11/4.17 take1 vz wu = take0 vz wu; 10.11/4.17 10.11/4.17 take2 n vv MyTrue = Nil; 10.11/4.17 take2 n vv MyFalse = take1 n vv; 10.11/4.17 10.11/4.17 take3 n vv = take2 n vv (ltEsMyInt n (Main.Pos Main.Zero)); 10.11/4.17 take3 wv ww = take1 wv ww; 10.11/4.17 10.11/4.17 } 10.11/4.17 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (5) Narrow (SOUND) 10.11/4.17 Haskell To QDPs 10.11/4.17 10.11/4.17 digraph dp_graph { 10.11/4.17 node [outthreshold=100, inthreshold=100];1[label="take",fontsize=16,color="grey",shape="box"];1 -> 3[label="",style="dashed", color="grey", weight=3]; 10.11/4.17 3[label="take wx3",fontsize=16,color="grey",shape="box"];3 -> 4[label="",style="dashed", color="grey", weight=3]; 10.11/4.17 4[label="take wx3 wx4",fontsize=16,color="black",shape="triangle"];4 -> 5[label="",style="solid", color="black", weight=3]; 10.11/4.17 5[label="take3 wx3 wx4",fontsize=16,color="black",shape="box"];5 -> 6[label="",style="solid", color="black", weight=3]; 10.11/4.17 6[label="take2 wx3 wx4 (ltEsMyInt wx3 (Pos Zero))",fontsize=16,color="black",shape="box"];6 -> 7[label="",style="solid", color="black", weight=3]; 10.11/4.17 7[label="take2 wx3 wx4 (fsEsOrdering (compareMyInt wx3 (Pos Zero)) GT)",fontsize=16,color="black",shape="box"];7 -> 8[label="",style="solid", color="black", weight=3]; 10.11/4.17 8[label="take2 wx3 wx4 (not (esEsOrdering (compareMyInt wx3 (Pos Zero)) GT))",fontsize=16,color="black",shape="box"];8 -> 9[label="",style="solid", color="black", weight=3]; 10.11/4.17 9[label="take2 wx3 wx4 (not (esEsOrdering (primCmpInt wx3 (Pos Zero)) GT))",fontsize=16,color="burlywood",shape="box"];48[label="wx3/Pos wx30",fontsize=10,color="white",style="solid",shape="box"];9 -> 48[label="",style="solid", color="burlywood", weight=9]; 10.11/4.17 48 -> 10[label="",style="solid", color="burlywood", weight=3]; 10.11/4.17 49[label="wx3/Neg wx30",fontsize=10,color="white",style="solid",shape="box"];9 -> 49[label="",style="solid", color="burlywood", weight=9]; 10.11/4.17 49 -> 11[label="",style="solid", color="burlywood", weight=3]; 10.11/4.17 10[label="take2 (Pos wx30) wx4 (not (esEsOrdering (primCmpInt (Pos wx30) (Pos Zero)) GT))",fontsize=16,color="burlywood",shape="box"];50[label="wx30/Succ wx300",fontsize=10,color="white",style="solid",shape="box"];10 -> 50[label="",style="solid", color="burlywood", weight=9]; 10.11/4.17 50 -> 12[label="",style="solid", color="burlywood", weight=3]; 10.11/4.17 51[label="wx30/Zero",fontsize=10,color="white",style="solid",shape="box"];10 -> 51[label="",style="solid", color="burlywood", weight=9]; 10.11/4.17 51 -> 13[label="",style="solid", color="burlywood", weight=3]; 10.11/4.17 11[label="take2 (Neg wx30) wx4 (not (esEsOrdering (primCmpInt (Neg wx30) (Pos Zero)) GT))",fontsize=16,color="burlywood",shape="box"];52[label="wx30/Succ wx300",fontsize=10,color="white",style="solid",shape="box"];11 -> 52[label="",style="solid", color="burlywood", weight=9]; 10.11/4.17 52 -> 14[label="",style="solid", color="burlywood", weight=3]; 10.11/4.17 53[label="wx30/Zero",fontsize=10,color="white",style="solid",shape="box"];11 -> 53[label="",style="solid", color="burlywood", weight=9]; 10.11/4.17 53 -> 15[label="",style="solid", color="burlywood", weight=3]; 10.11/4.17 12[label="take2 (Pos (Succ wx300)) wx4 (not (esEsOrdering (primCmpInt (Pos (Succ wx300)) (Pos Zero)) GT))",fontsize=16,color="black",shape="box"];12 -> 16[label="",style="solid", color="black", weight=3]; 10.11/4.17 13[label="take2 (Pos Zero) wx4 (not (esEsOrdering (primCmpInt (Pos Zero) (Pos Zero)) GT))",fontsize=16,color="black",shape="box"];13 -> 17[label="",style="solid", color="black", weight=3]; 10.11/4.17 14[label="take2 (Neg (Succ wx300)) wx4 (not (esEsOrdering (primCmpInt (Neg (Succ wx300)) (Pos Zero)) GT))",fontsize=16,color="black",shape="box"];14 -> 18[label="",style="solid", color="black", weight=3]; 10.11/4.17 15[label="take2 (Neg Zero) wx4 (not (esEsOrdering (primCmpInt (Neg Zero) (Pos Zero)) GT))",fontsize=16,color="black",shape="box"];15 -> 19[label="",style="solid", color="black", weight=3]; 10.11/4.17 16[label="take2 (Pos (Succ wx300)) wx4 (not (esEsOrdering (primCmpNat (Succ wx300) Zero) GT))",fontsize=16,color="black",shape="box"];16 -> 20[label="",style="solid", color="black", weight=3]; 10.11/4.17 17[label="take2 (Pos Zero) wx4 (not (esEsOrdering EQ GT))",fontsize=16,color="black",shape="box"];17 -> 21[label="",style="solid", color="black", weight=3]; 10.11/4.17 18[label="take2 (Neg (Succ wx300)) wx4 (not (esEsOrdering LT GT))",fontsize=16,color="black",shape="box"];18 -> 22[label="",style="solid", color="black", weight=3]; 10.11/4.17 19[label="take2 (Neg Zero) wx4 (not (esEsOrdering EQ GT))",fontsize=16,color="black",shape="box"];19 -> 23[label="",style="solid", color="black", weight=3]; 10.11/4.17 20[label="take2 (Pos (Succ wx300)) wx4 (not (esEsOrdering GT GT))",fontsize=16,color="black",shape="box"];20 -> 24[label="",style="solid", color="black", weight=3]; 10.11/4.17 21[label="take2 (Pos Zero) wx4 (not MyFalse)",fontsize=16,color="black",shape="box"];21 -> 25[label="",style="solid", color="black", weight=3]; 10.11/4.17 22[label="take2 (Neg (Succ wx300)) wx4 (not MyFalse)",fontsize=16,color="black",shape="box"];22 -> 26[label="",style="solid", color="black", weight=3]; 10.11/4.17 23[label="take2 (Neg Zero) wx4 (not MyFalse)",fontsize=16,color="black",shape="box"];23 -> 27[label="",style="solid", color="black", weight=3]; 10.11/4.17 24[label="take2 (Pos (Succ wx300)) wx4 (not MyTrue)",fontsize=16,color="black",shape="box"];24 -> 28[label="",style="solid", color="black", weight=3]; 10.11/4.17 25[label="take2 (Pos Zero) wx4 MyTrue",fontsize=16,color="black",shape="box"];25 -> 29[label="",style="solid", color="black", weight=3]; 10.11/4.17 26[label="take2 (Neg (Succ wx300)) wx4 MyTrue",fontsize=16,color="black",shape="box"];26 -> 30[label="",style="solid", color="black", weight=3]; 10.11/4.17 27[label="take2 (Neg Zero) wx4 MyTrue",fontsize=16,color="black",shape="box"];27 -> 31[label="",style="solid", color="black", weight=3]; 10.11/4.17 28[label="take2 (Pos (Succ wx300)) wx4 MyFalse",fontsize=16,color="black",shape="box"];28 -> 32[label="",style="solid", color="black", weight=3]; 10.11/4.17 29[label="Nil",fontsize=16,color="green",shape="box"];30[label="Nil",fontsize=16,color="green",shape="box"];31[label="Nil",fontsize=16,color="green",shape="box"];32[label="take1 (Pos (Succ wx300)) wx4",fontsize=16,color="burlywood",shape="box"];54[label="wx4/Cons wx40 wx41",fontsize=10,color="white",style="solid",shape="box"];32 -> 54[label="",style="solid", color="burlywood", weight=9]; 10.11/4.17 54 -> 33[label="",style="solid", color="burlywood", weight=3]; 10.11/4.17 55[label="wx4/Nil",fontsize=10,color="white",style="solid",shape="box"];32 -> 55[label="",style="solid", color="burlywood", weight=9]; 10.11/4.17 55 -> 34[label="",style="solid", color="burlywood", weight=3]; 10.11/4.17 33[label="take1 (Pos (Succ wx300)) (Cons wx40 wx41)",fontsize=16,color="black",shape="box"];33 -> 35[label="",style="solid", color="black", weight=3]; 10.11/4.17 34[label="take1 (Pos (Succ wx300)) Nil",fontsize=16,color="black",shape="box"];34 -> 36[label="",style="solid", color="black", weight=3]; 10.11/4.17 35[label="take0 (Pos (Succ wx300)) (Cons wx40 wx41)",fontsize=16,color="black",shape="box"];35 -> 37[label="",style="solid", color="black", weight=3]; 10.11/4.17 36[label="Nil",fontsize=16,color="green",shape="box"];37[label="Cons wx40 (take (msMyInt (Pos (Succ wx300)) (Pos (Succ Zero))) wx41)",fontsize=16,color="green",shape="box"];37 -> 38[label="",style="dashed", color="green", weight=3]; 10.11/4.17 38 -> 4[label="",style="dashed", color="red", weight=0]; 10.11/4.17 38[label="take (msMyInt (Pos (Succ wx300)) (Pos (Succ Zero))) wx41",fontsize=16,color="magenta"];38 -> 39[label="",style="dashed", color="magenta", weight=3]; 10.11/4.17 38 -> 40[label="",style="dashed", color="magenta", weight=3]; 10.11/4.17 39[label="wx41",fontsize=16,color="green",shape="box"];40[label="msMyInt (Pos (Succ wx300)) (Pos (Succ Zero))",fontsize=16,color="black",shape="box"];40 -> 41[label="",style="solid", color="black", weight=3]; 10.11/4.17 41[label="primMinusInt (Pos (Succ wx300)) (Pos (Succ Zero))",fontsize=16,color="black",shape="box"];41 -> 42[label="",style="solid", color="black", weight=3]; 10.11/4.17 42[label="primMinusNat (Succ wx300) (Succ Zero)",fontsize=16,color="black",shape="box"];42 -> 43[label="",style="solid", color="black", weight=3]; 10.11/4.17 43[label="primMinusNat wx300 Zero",fontsize=16,color="burlywood",shape="box"];56[label="wx300/Succ wx3000",fontsize=10,color="white",style="solid",shape="box"];43 -> 56[label="",style="solid", color="burlywood", weight=9]; 10.11/4.17 56 -> 44[label="",style="solid", color="burlywood", weight=3]; 10.11/4.17 57[label="wx300/Zero",fontsize=10,color="white",style="solid",shape="box"];43 -> 57[label="",style="solid", color="burlywood", weight=9]; 10.11/4.17 57 -> 45[label="",style="solid", color="burlywood", weight=3]; 10.11/4.17 44[label="primMinusNat (Succ wx3000) Zero",fontsize=16,color="black",shape="box"];44 -> 46[label="",style="solid", color="black", weight=3]; 10.11/4.17 45[label="primMinusNat Zero Zero",fontsize=16,color="black",shape="box"];45 -> 47[label="",style="solid", color="black", weight=3]; 10.11/4.17 46[label="Pos (Succ wx3000)",fontsize=16,color="green",shape="box"];47[label="Pos Zero",fontsize=16,color="green",shape="box"];} 10.11/4.17 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (6) 10.11/4.17 Obligation: 10.11/4.17 Q DP problem: 10.11/4.17 The TRS P consists of the following rules: 10.11/4.17 10.11/4.17 new_take(Main.Pos(Main.Succ(wx300)), Cons(wx40, wx41), h) -> new_take(new_primMinusNat(wx300), wx41, h) 10.11/4.17 10.11/4.17 The TRS R consists of the following rules: 10.11/4.17 10.11/4.17 new_primMinusNat(Main.Succ(wx3000)) -> Main.Pos(Main.Succ(wx3000)) 10.11/4.17 new_primMinusNat(Main.Zero) -> Main.Pos(Main.Zero) 10.11/4.17 10.11/4.17 The set Q consists of the following terms: 10.11/4.17 10.11/4.17 new_primMinusNat(Main.Zero) 10.11/4.17 new_primMinusNat(Main.Succ(x0)) 10.11/4.17 10.11/4.17 We have to consider all minimal (P,Q,R)-chains. 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (7) TransformationProof (EQUIVALENT) 10.11/4.17 By narrowing [LPAR04] the rule new_take(Main.Pos(Main.Succ(wx300)), Cons(wx40, wx41), h) -> new_take(new_primMinusNat(wx300), wx41, h) at position [0] we obtained the following new rules [LPAR04]: 10.11/4.17 10.11/4.17 (new_take(Main.Pos(Main.Succ(Main.Succ(x0))), Cons(y1, y2), y3) -> new_take(Main.Pos(Main.Succ(x0)), y2, y3),new_take(Main.Pos(Main.Succ(Main.Succ(x0))), Cons(y1, y2), y3) -> new_take(Main.Pos(Main.Succ(x0)), y2, y3)) 10.11/4.17 (new_take(Main.Pos(Main.Succ(Main.Zero)), Cons(y1, y2), y3) -> new_take(Main.Pos(Main.Zero), y2, y3),new_take(Main.Pos(Main.Succ(Main.Zero)), Cons(y1, y2), y3) -> new_take(Main.Pos(Main.Zero), y2, y3)) 10.11/4.17 10.11/4.17 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (8) 10.11/4.17 Obligation: 10.11/4.17 Q DP problem: 10.11/4.17 The TRS P consists of the following rules: 10.11/4.17 10.11/4.17 new_take(Main.Pos(Main.Succ(Main.Succ(x0))), Cons(y1, y2), y3) -> new_take(Main.Pos(Main.Succ(x0)), y2, y3) 10.11/4.17 new_take(Main.Pos(Main.Succ(Main.Zero)), Cons(y1, y2), y3) -> new_take(Main.Pos(Main.Zero), y2, y3) 10.11/4.17 10.11/4.17 The TRS R consists of the following rules: 10.11/4.17 10.11/4.17 new_primMinusNat(Main.Succ(wx3000)) -> Main.Pos(Main.Succ(wx3000)) 10.11/4.17 new_primMinusNat(Main.Zero) -> Main.Pos(Main.Zero) 10.11/4.17 10.11/4.17 The set Q consists of the following terms: 10.11/4.17 10.11/4.17 new_primMinusNat(Main.Zero) 10.11/4.17 new_primMinusNat(Main.Succ(x0)) 10.11/4.17 10.11/4.17 We have to consider all minimal (P,Q,R)-chains. 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (9) DependencyGraphProof (EQUIVALENT) 10.11/4.17 The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node. 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (10) 10.11/4.17 Obligation: 10.11/4.17 Q DP problem: 10.11/4.17 The TRS P consists of the following rules: 10.11/4.17 10.11/4.17 new_take(Main.Pos(Main.Succ(Main.Succ(x0))), Cons(y1, y2), y3) -> new_take(Main.Pos(Main.Succ(x0)), y2, y3) 10.11/4.17 10.11/4.17 The TRS R consists of the following rules: 10.11/4.17 10.11/4.17 new_primMinusNat(Main.Succ(wx3000)) -> Main.Pos(Main.Succ(wx3000)) 10.11/4.17 new_primMinusNat(Main.Zero) -> Main.Pos(Main.Zero) 10.11/4.17 10.11/4.17 The set Q consists of the following terms: 10.11/4.17 10.11/4.17 new_primMinusNat(Main.Zero) 10.11/4.17 new_primMinusNat(Main.Succ(x0)) 10.11/4.17 10.11/4.17 We have to consider all minimal (P,Q,R)-chains. 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (11) UsableRulesProof (EQUIVALENT) 10.11/4.17 As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R. 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (12) 10.11/4.17 Obligation: 10.11/4.17 Q DP problem: 10.11/4.17 The TRS P consists of the following rules: 10.11/4.17 10.11/4.17 new_take(Main.Pos(Main.Succ(Main.Succ(x0))), Cons(y1, y2), y3) -> new_take(Main.Pos(Main.Succ(x0)), y2, y3) 10.11/4.17 10.11/4.17 R is empty. 10.11/4.17 The set Q consists of the following terms: 10.11/4.17 10.11/4.17 new_primMinusNat(Main.Zero) 10.11/4.17 new_primMinusNat(Main.Succ(x0)) 10.11/4.17 10.11/4.17 We have to consider all minimal (P,Q,R)-chains. 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (13) QReductionProof (EQUIVALENT) 10.11/4.17 We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN]. 10.11/4.17 10.11/4.17 new_primMinusNat(Main.Zero) 10.11/4.17 new_primMinusNat(Main.Succ(x0)) 10.11/4.17 10.11/4.17 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (14) 10.11/4.17 Obligation: 10.11/4.17 Q DP problem: 10.11/4.17 The TRS P consists of the following rules: 10.11/4.17 10.11/4.17 new_take(Main.Pos(Main.Succ(Main.Succ(x0))), Cons(y1, y2), y3) -> new_take(Main.Pos(Main.Succ(x0)), y2, y3) 10.11/4.17 10.11/4.17 R is empty. 10.11/4.17 Q is empty. 10.11/4.17 We have to consider all minimal (P,Q,R)-chains. 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (15) QDPSizeChangeProof (EQUIVALENT) 10.11/4.17 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. 10.11/4.17 10.11/4.17 From the DPs we obtained the following set of size-change graphs: 10.11/4.17 *new_take(Main.Pos(Main.Succ(Main.Succ(x0))), Cons(y1, y2), y3) -> new_take(Main.Pos(Main.Succ(x0)), y2, y3) 10.11/4.17 The graph contains the following edges 2 > 2, 3 >= 3 10.11/4.17 10.11/4.17 10.11/4.17 ---------------------------------------- 10.11/4.17 10.11/4.17 (16) 10.11/4.17 YES 10.25/4.21 EOF