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