8.02/3.62 YES 9.71/4.13 proof of /export/starexec/sandbox/benchmark/theBenchmark.hs 9.71/4.13 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 9.71/4.13 9.71/4.13 9.71/4.13 H-Termination with start terms of the given HASKELL could be proven: 9.71/4.13 9.71/4.13 (0) HASKELL 9.71/4.13 (1) BR [EQUIVALENT, 0 ms] 9.71/4.13 (2) HASKELL 9.71/4.13 (3) COR [EQUIVALENT, 0 ms] 9.71/4.13 (4) HASKELL 9.71/4.13 (5) Narrow [SOUND, 0 ms] 9.71/4.13 (6) AND 9.71/4.13 (7) QDP 9.71/4.13 (8) QDPSizeChangeProof [EQUIVALENT, 0 ms] 9.71/4.13 (9) YES 9.71/4.13 (10) QDP 9.71/4.13 (11) QDPSizeChangeProof [EQUIVALENT, 0 ms] 9.71/4.13 (12) YES 9.71/4.13 9.71/4.13 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (0) 9.71/4.13 Obligation: 9.71/4.13 mainModule Main 9.71/4.13 module Main where { 9.71/4.13 import qualified Prelude; 9.71/4.13 data MyInt = Pos Main.Nat | Neg Main.Nat ; 9.71/4.13 9.71/4.13 data Main.Nat = Succ Main.Nat | Zero ; 9.71/4.13 9.71/4.13 flip :: (b -> a -> c) -> a -> b -> c; 9.71/4.13 flip f x y = f y x; 9.71/4.13 9.71/4.13 msMyInt :: MyInt -> MyInt -> MyInt; 9.71/4.13 msMyInt = primMinusInt; 9.71/4.13 9.71/4.13 primMinusInt :: MyInt -> MyInt -> MyInt; 9.71/4.13 primMinusInt (Main.Pos x) (Main.Neg y) = Main.Pos (primPlusNat x y); 9.71/4.13 primMinusInt (Main.Neg x) (Main.Pos y) = Main.Neg (primPlusNat x y); 9.71/4.13 primMinusInt (Main.Neg x) (Main.Neg y) = primMinusNat y x; 9.71/4.13 primMinusInt (Main.Pos x) (Main.Pos y) = primMinusNat x y; 9.71/4.13 9.71/4.13 primMinusNat :: Main.Nat -> Main.Nat -> MyInt; 9.71/4.13 primMinusNat Main.Zero Main.Zero = Main.Pos Main.Zero; 9.71/4.13 primMinusNat Main.Zero (Main.Succ y) = Main.Neg (Main.Succ y); 9.71/4.13 primMinusNat (Main.Succ x) Main.Zero = Main.Pos (Main.Succ x); 9.71/4.13 primMinusNat (Main.Succ x) (Main.Succ y) = primMinusNat x y; 9.71/4.13 9.71/4.13 primPlusNat :: Main.Nat -> Main.Nat -> Main.Nat; 9.71/4.13 primPlusNat Main.Zero Main.Zero = Main.Zero; 9.71/4.13 primPlusNat Main.Zero (Main.Succ y) = Main.Succ y; 9.71/4.13 primPlusNat (Main.Succ x) Main.Zero = Main.Succ x; 9.71/4.13 primPlusNat (Main.Succ x) (Main.Succ y) = Main.Succ (Main.Succ (primPlusNat x y)); 9.71/4.13 9.71/4.13 subtractMyInt :: MyInt -> MyInt -> MyInt; 9.71/4.13 subtractMyInt = flip msMyInt; 9.71/4.13 9.71/4.13 } 9.71/4.13 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (1) BR (EQUIVALENT) 9.71/4.13 Replaced joker patterns by fresh variables and removed binding patterns. 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (2) 9.71/4.13 Obligation: 9.71/4.13 mainModule Main 9.71/4.13 module Main where { 9.71/4.13 import qualified Prelude; 9.71/4.13 data MyInt = Pos Main.Nat | Neg Main.Nat ; 9.71/4.13 9.71/4.13 data Main.Nat = Succ Main.Nat | Zero ; 9.71/4.13 9.71/4.13 flip :: (b -> a -> c) -> a -> b -> c; 9.71/4.13 flip f x y = f y x; 9.71/4.13 9.71/4.13 msMyInt :: MyInt -> MyInt -> MyInt; 9.71/4.13 msMyInt = primMinusInt; 9.71/4.13 9.71/4.13 primMinusInt :: MyInt -> MyInt -> MyInt; 9.71/4.13 primMinusInt (Main.Pos x) (Main.Neg y) = Main.Pos (primPlusNat x y); 9.71/4.13 primMinusInt (Main.Neg x) (Main.Pos y) = Main.Neg (primPlusNat x y); 9.71/4.13 primMinusInt (Main.Neg x) (Main.Neg y) = primMinusNat y x; 9.71/4.13 primMinusInt (Main.Pos x) (Main.Pos y) = primMinusNat x y; 9.71/4.13 9.71/4.13 primMinusNat :: Main.Nat -> Main.Nat -> MyInt; 9.71/4.13 primMinusNat Main.Zero Main.Zero = Main.Pos Main.Zero; 9.71/4.13 primMinusNat Main.Zero (Main.Succ y) = Main.Neg (Main.Succ y); 9.71/4.13 primMinusNat (Main.Succ x) Main.Zero = Main.Pos (Main.Succ x); 9.71/4.13 primMinusNat (Main.Succ x) (Main.Succ y) = primMinusNat x y; 9.71/4.13 9.71/4.13 primPlusNat :: Main.Nat -> Main.Nat -> Main.Nat; 9.71/4.13 primPlusNat Main.Zero Main.Zero = Main.Zero; 9.71/4.13 primPlusNat Main.Zero (Main.Succ y) = Main.Succ y; 9.71/4.13 primPlusNat (Main.Succ x) Main.Zero = Main.Succ x; 9.71/4.13 primPlusNat (Main.Succ x) (Main.Succ y) = Main.Succ (Main.Succ (primPlusNat x y)); 9.71/4.13 9.71/4.13 subtractMyInt :: MyInt -> MyInt -> MyInt; 9.71/4.13 subtractMyInt = flip msMyInt; 9.71/4.13 9.71/4.13 } 9.71/4.13 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (3) COR (EQUIVALENT) 9.71/4.13 Cond Reductions: 9.71/4.13 The following Function with conditions 9.71/4.13 "undefined |Falseundefined; 9.71/4.13 " 9.71/4.13 is transformed to 9.71/4.13 "undefined = undefined1; 9.71/4.13 " 9.71/4.13 "undefined0 True = undefined; 9.71/4.13 " 9.71/4.13 "undefined1 = undefined0 False; 9.71/4.13 " 9.71/4.13 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (4) 9.71/4.13 Obligation: 9.71/4.13 mainModule Main 9.71/4.13 module Main where { 9.71/4.13 import qualified Prelude; 9.71/4.13 data MyInt = Pos Main.Nat | Neg Main.Nat ; 9.71/4.13 9.71/4.13 data Main.Nat = Succ Main.Nat | Zero ; 9.71/4.13 9.71/4.13 flip :: (b -> a -> c) -> a -> b -> c; 9.71/4.13 flip f x y = f y x; 9.71/4.13 9.71/4.13 msMyInt :: MyInt -> MyInt -> MyInt; 9.71/4.13 msMyInt = primMinusInt; 9.71/4.13 9.71/4.13 primMinusInt :: MyInt -> MyInt -> MyInt; 9.71/4.13 primMinusInt (Main.Pos x) (Main.Neg y) = Main.Pos (primPlusNat x y); 9.71/4.13 primMinusInt (Main.Neg x) (Main.Pos y) = Main.Neg (primPlusNat x y); 9.71/4.13 primMinusInt (Main.Neg x) (Main.Neg y) = primMinusNat y x; 9.71/4.13 primMinusInt (Main.Pos x) (Main.Pos y) = primMinusNat x y; 9.71/4.13 9.71/4.13 primMinusNat :: Main.Nat -> Main.Nat -> MyInt; 9.71/4.13 primMinusNat Main.Zero Main.Zero = Main.Pos Main.Zero; 9.71/4.13 primMinusNat Main.Zero (Main.Succ y) = Main.Neg (Main.Succ y); 9.71/4.13 primMinusNat (Main.Succ x) Main.Zero = Main.Pos (Main.Succ x); 9.71/4.13 primMinusNat (Main.Succ x) (Main.Succ y) = primMinusNat x y; 9.71/4.13 9.71/4.13 primPlusNat :: Main.Nat -> Main.Nat -> Main.Nat; 9.71/4.13 primPlusNat Main.Zero Main.Zero = Main.Zero; 9.71/4.13 primPlusNat Main.Zero (Main.Succ y) = Main.Succ y; 9.71/4.13 primPlusNat (Main.Succ x) Main.Zero = Main.Succ x; 9.71/4.13 primPlusNat (Main.Succ x) (Main.Succ y) = Main.Succ (Main.Succ (primPlusNat x y)); 9.71/4.13 9.71/4.13 subtractMyInt :: MyInt -> MyInt -> MyInt; 9.71/4.13 subtractMyInt = flip msMyInt; 9.71/4.13 9.71/4.13 } 9.71/4.13 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (5) Narrow (SOUND) 9.71/4.13 Haskell To QDPs 9.71/4.13 9.71/4.13 digraph dp_graph { 9.71/4.13 node [outthreshold=100, inthreshold=100];1[label="subtractMyInt",fontsize=16,color="grey",shape="box"];1 -> 3[label="",style="dashed", color="grey", weight=3]; 9.71/4.13 3[label="subtractMyInt vx3",fontsize=16,color="grey",shape="box"];3 -> 4[label="",style="dashed", color="grey", weight=3]; 9.71/4.13 4[label="subtractMyInt vx3 vx4",fontsize=16,color="black",shape="triangle"];4 -> 5[label="",style="solid", color="black", weight=3]; 9.71/4.13 5[label="flip msMyInt vx3 vx4",fontsize=16,color="black",shape="box"];5 -> 6[label="",style="solid", color="black", weight=3]; 9.71/4.13 6[label="msMyInt vx4 vx3",fontsize=16,color="black",shape="box"];6 -> 7[label="",style="solid", color="black", weight=3]; 9.71/4.13 7[label="primMinusInt vx4 vx3",fontsize=16,color="burlywood",shape="box"];49[label="vx4/Pos vx40",fontsize=10,color="white",style="solid",shape="box"];7 -> 49[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 49 -> 8[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 50[label="vx4/Neg vx40",fontsize=10,color="white",style="solid",shape="box"];7 -> 50[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 50 -> 9[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 8[label="primMinusInt (Pos vx40) vx3",fontsize=16,color="burlywood",shape="box"];51[label="vx3/Pos vx30",fontsize=10,color="white",style="solid",shape="box"];8 -> 51[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 51 -> 10[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 52[label="vx3/Neg vx30",fontsize=10,color="white",style="solid",shape="box"];8 -> 52[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 52 -> 11[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 9[label="primMinusInt (Neg vx40) vx3",fontsize=16,color="burlywood",shape="box"];53[label="vx3/Pos vx30",fontsize=10,color="white",style="solid",shape="box"];9 -> 53[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 53 -> 12[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 54[label="vx3/Neg vx30",fontsize=10,color="white",style="solid",shape="box"];9 -> 54[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 54 -> 13[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 10[label="primMinusInt (Pos vx40) (Pos vx30)",fontsize=16,color="black",shape="box"];10 -> 14[label="",style="solid", color="black", weight=3]; 9.71/4.13 11[label="primMinusInt (Pos vx40) (Neg vx30)",fontsize=16,color="black",shape="box"];11 -> 15[label="",style="solid", color="black", weight=3]; 9.71/4.13 12[label="primMinusInt (Neg vx40) (Pos vx30)",fontsize=16,color="black",shape="box"];12 -> 16[label="",style="solid", color="black", weight=3]; 9.71/4.13 13[label="primMinusInt (Neg vx40) (Neg vx30)",fontsize=16,color="black",shape="box"];13 -> 17[label="",style="solid", color="black", weight=3]; 9.71/4.13 14[label="primMinusNat vx40 vx30",fontsize=16,color="burlywood",shape="triangle"];55[label="vx40/Succ vx400",fontsize=10,color="white",style="solid",shape="box"];14 -> 55[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 55 -> 18[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 56[label="vx40/Zero",fontsize=10,color="white",style="solid",shape="box"];14 -> 56[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 56 -> 19[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 15[label="Pos (primPlusNat vx40 vx30)",fontsize=16,color="green",shape="box"];15 -> 20[label="",style="dashed", color="green", weight=3]; 9.71/4.13 16[label="Neg (primPlusNat vx40 vx30)",fontsize=16,color="green",shape="box"];16 -> 21[label="",style="dashed", color="green", weight=3]; 9.71/4.13 17 -> 14[label="",style="dashed", color="red", weight=0]; 9.71/4.13 17[label="primMinusNat vx30 vx40",fontsize=16,color="magenta"];17 -> 22[label="",style="dashed", color="magenta", weight=3]; 9.71/4.13 17 -> 23[label="",style="dashed", color="magenta", weight=3]; 9.71/4.13 18[label="primMinusNat (Succ vx400) vx30",fontsize=16,color="burlywood",shape="box"];57[label="vx30/Succ vx300",fontsize=10,color="white",style="solid",shape="box"];18 -> 57[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 57 -> 24[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 58[label="vx30/Zero",fontsize=10,color="white",style="solid",shape="box"];18 -> 58[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 58 -> 25[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 19[label="primMinusNat Zero vx30",fontsize=16,color="burlywood",shape="box"];59[label="vx30/Succ vx300",fontsize=10,color="white",style="solid",shape="box"];19 -> 59[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 59 -> 26[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 60[label="vx30/Zero",fontsize=10,color="white",style="solid",shape="box"];19 -> 60[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 60 -> 27[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 20[label="primPlusNat vx40 vx30",fontsize=16,color="burlywood",shape="triangle"];61[label="vx40/Succ vx400",fontsize=10,color="white",style="solid",shape="box"];20 -> 61[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 61 -> 28[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 62[label="vx40/Zero",fontsize=10,color="white",style="solid",shape="box"];20 -> 62[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 62 -> 29[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 21 -> 20[label="",style="dashed", color="red", weight=0]; 9.71/4.13 21[label="primPlusNat vx40 vx30",fontsize=16,color="magenta"];21 -> 30[label="",style="dashed", color="magenta", weight=3]; 9.71/4.13 21 -> 31[label="",style="dashed", color="magenta", weight=3]; 9.71/4.13 22[label="vx40",fontsize=16,color="green",shape="box"];23[label="vx30",fontsize=16,color="green",shape="box"];24[label="primMinusNat (Succ vx400) (Succ vx300)",fontsize=16,color="black",shape="box"];24 -> 32[label="",style="solid", color="black", weight=3]; 9.71/4.13 25[label="primMinusNat (Succ vx400) Zero",fontsize=16,color="black",shape="box"];25 -> 33[label="",style="solid", color="black", weight=3]; 9.71/4.13 26[label="primMinusNat Zero (Succ vx300)",fontsize=16,color="black",shape="box"];26 -> 34[label="",style="solid", color="black", weight=3]; 9.71/4.13 27[label="primMinusNat Zero Zero",fontsize=16,color="black",shape="box"];27 -> 35[label="",style="solid", color="black", weight=3]; 9.71/4.13 28[label="primPlusNat (Succ vx400) vx30",fontsize=16,color="burlywood",shape="box"];63[label="vx30/Succ vx300",fontsize=10,color="white",style="solid",shape="box"];28 -> 63[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 63 -> 36[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 64[label="vx30/Zero",fontsize=10,color="white",style="solid",shape="box"];28 -> 64[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 64 -> 37[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 29[label="primPlusNat Zero vx30",fontsize=16,color="burlywood",shape="box"];65[label="vx30/Succ vx300",fontsize=10,color="white",style="solid",shape="box"];29 -> 65[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 65 -> 38[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 66[label="vx30/Zero",fontsize=10,color="white",style="solid",shape="box"];29 -> 66[label="",style="solid", color="burlywood", weight=9]; 9.71/4.13 66 -> 39[label="",style="solid", color="burlywood", weight=3]; 9.71/4.13 30[label="vx40",fontsize=16,color="green",shape="box"];31[label="vx30",fontsize=16,color="green",shape="box"];32 -> 14[label="",style="dashed", color="red", weight=0]; 9.71/4.13 32[label="primMinusNat vx400 vx300",fontsize=16,color="magenta"];32 -> 40[label="",style="dashed", color="magenta", weight=3]; 9.71/4.13 32 -> 41[label="",style="dashed", color="magenta", weight=3]; 9.71/4.13 33[label="Pos (Succ vx400)",fontsize=16,color="green",shape="box"];34[label="Neg (Succ vx300)",fontsize=16,color="green",shape="box"];35[label="Pos Zero",fontsize=16,color="green",shape="box"];36[label="primPlusNat (Succ vx400) (Succ vx300)",fontsize=16,color="black",shape="box"];36 -> 42[label="",style="solid", color="black", weight=3]; 9.71/4.13 37[label="primPlusNat (Succ vx400) Zero",fontsize=16,color="black",shape="box"];37 -> 43[label="",style="solid", color="black", weight=3]; 9.71/4.13 38[label="primPlusNat Zero (Succ vx300)",fontsize=16,color="black",shape="box"];38 -> 44[label="",style="solid", color="black", weight=3]; 9.71/4.13 39[label="primPlusNat Zero Zero",fontsize=16,color="black",shape="box"];39 -> 45[label="",style="solid", color="black", weight=3]; 9.71/4.13 40[label="vx300",fontsize=16,color="green",shape="box"];41[label="vx400",fontsize=16,color="green",shape="box"];42[label="Succ (Succ (primPlusNat vx400 vx300))",fontsize=16,color="green",shape="box"];42 -> 46[label="",style="dashed", color="green", weight=3]; 9.71/4.13 43[label="Succ vx400",fontsize=16,color="green",shape="box"];44[label="Succ vx300",fontsize=16,color="green",shape="box"];45[label="Zero",fontsize=16,color="green",shape="box"];46 -> 20[label="",style="dashed", color="red", weight=0]; 9.71/4.13 46[label="primPlusNat vx400 vx300",fontsize=16,color="magenta"];46 -> 47[label="",style="dashed", color="magenta", weight=3]; 9.71/4.13 46 -> 48[label="",style="dashed", color="magenta", weight=3]; 9.71/4.13 47[label="vx400",fontsize=16,color="green",shape="box"];48[label="vx300",fontsize=16,color="green",shape="box"];} 9.71/4.13 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (6) 9.71/4.13 Complex Obligation (AND) 9.71/4.13 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (7) 9.71/4.13 Obligation: 9.71/4.13 Q DP problem: 9.71/4.13 The TRS P consists of the following rules: 9.71/4.13 9.71/4.13 new_primPlusNat(Main.Succ(vx400), Main.Succ(vx300)) -> new_primPlusNat(vx400, vx300) 9.71/4.13 9.71/4.13 R is empty. 9.71/4.13 Q is empty. 9.71/4.13 We have to consider all minimal (P,Q,R)-chains. 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (8) QDPSizeChangeProof (EQUIVALENT) 9.71/4.13 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.71/4.13 9.71/4.13 From the DPs we obtained the following set of size-change graphs: 9.71/4.13 *new_primPlusNat(Main.Succ(vx400), Main.Succ(vx300)) -> new_primPlusNat(vx400, vx300) 9.71/4.13 The graph contains the following edges 1 > 1, 2 > 2 9.71/4.13 9.71/4.13 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (9) 9.71/4.13 YES 9.71/4.13 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (10) 9.71/4.13 Obligation: 9.71/4.13 Q DP problem: 9.71/4.13 The TRS P consists of the following rules: 9.71/4.13 9.71/4.13 new_primMinusNat(Main.Succ(vx400), Main.Succ(vx300)) -> new_primMinusNat(vx400, vx300) 9.71/4.13 9.71/4.13 R is empty. 9.71/4.13 Q is empty. 9.71/4.13 We have to consider all minimal (P,Q,R)-chains. 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (11) QDPSizeChangeProof (EQUIVALENT) 9.71/4.13 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.71/4.13 9.71/4.13 From the DPs we obtained the following set of size-change graphs: 9.71/4.13 *new_primMinusNat(Main.Succ(vx400), Main.Succ(vx300)) -> new_primMinusNat(vx400, vx300) 9.71/4.13 The graph contains the following edges 1 > 1, 2 > 2 9.71/4.13 9.71/4.13 9.71/4.13 ---------------------------------------- 9.71/4.13 9.71/4.13 (12) 9.71/4.13 YES 9.99/4.24 EOF