7.96/3.56 YES 9.80/4.11 proof of /export/starexec/sandbox/benchmark/theBenchmark.hs 9.80/4.11 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 9.80/4.11 9.80/4.11 9.80/4.11 H-Termination with start terms of the given HASKELL could be proven: 9.80/4.11 9.80/4.11 (0) HASKELL 9.80/4.11 (1) BR [EQUIVALENT, 0 ms] 9.80/4.11 (2) HASKELL 9.80/4.11 (3) COR [EQUIVALENT, 0 ms] 9.80/4.11 (4) HASKELL 9.80/4.11 (5) Narrow [EQUIVALENT, 27 ms] 9.80/4.11 (6) YES 9.80/4.11 9.80/4.11 9.80/4.11 ---------------------------------------- 9.80/4.11 9.80/4.11 (0) 9.80/4.11 Obligation: 9.80/4.11 mainModule Main 9.80/4.11 module Main where { 9.80/4.11 import qualified Prelude; 9.80/4.11 data Main.Char = Char MyInt ; 9.80/4.11 9.80/4.11 data MyInt = Pos Main.Nat | Neg Main.Nat ; 9.80/4.11 9.80/4.11 data Main.Nat = Succ Main.Nat | Zero ; 9.80/4.11 9.80/4.11 flip :: (a -> b -> c) -> b -> a -> c; 9.80/4.11 flip f x y = f y x; 9.80/4.11 9.80/4.11 fromEnumChar :: Main.Char -> MyInt; 9.80/4.11 fromEnumChar = primCharToInt; 9.80/4.11 9.80/4.11 msMyInt :: MyInt -> MyInt -> MyInt; 9.80/4.11 msMyInt = primMinusInt; 9.80/4.11 9.80/4.11 predChar :: Main.Char -> Main.Char; 9.80/4.11 predChar = pt toEnumChar (pt (subtractMyInt (Main.Pos (Main.Succ Main.Zero))) fromEnumChar); 9.80/4.11 9.80/4.11 primCharToInt :: Main.Char -> MyInt; 9.80/4.11 primCharToInt (Main.Char x) = x; 9.80/4.11 9.80/4.11 primIntToChar :: MyInt -> Main.Char; 9.80/4.11 primIntToChar x = Main.Char x; 9.80/4.11 9.80/4.11 primMinusInt :: MyInt -> MyInt -> MyInt; 9.80/4.11 primMinusInt (Main.Pos x) (Main.Neg y) = Main.Pos (primPlusNat x y); 9.80/4.11 primMinusInt (Main.Neg x) (Main.Pos y) = Main.Neg (primPlusNat x y); 9.80/4.11 primMinusInt (Main.Neg x) (Main.Neg y) = primMinusNat y x; 9.80/4.11 primMinusInt (Main.Pos x) (Main.Pos y) = primMinusNat x y; 9.80/4.11 9.80/4.11 primMinusNat :: Main.Nat -> Main.Nat -> MyInt; 9.80/4.11 primMinusNat Main.Zero Main.Zero = Main.Pos Main.Zero; 9.80/4.11 primMinusNat Main.Zero (Main.Succ y) = Main.Neg (Main.Succ y); 9.80/4.11 primMinusNat (Main.Succ x) Main.Zero = Main.Pos (Main.Succ x); 9.80/4.11 primMinusNat (Main.Succ x) (Main.Succ y) = primMinusNat x y; 9.80/4.11 9.80/4.11 primPlusNat :: Main.Nat -> Main.Nat -> Main.Nat; 9.80/4.11 primPlusNat Main.Zero Main.Zero = Main.Zero; 9.80/4.11 primPlusNat Main.Zero (Main.Succ y) = Main.Succ y; 9.80/4.11 primPlusNat (Main.Succ x) Main.Zero = Main.Succ x; 9.80/4.11 primPlusNat (Main.Succ x) (Main.Succ y) = Main.Succ (Main.Succ (primPlusNat x y)); 9.80/4.11 9.80/4.11 pt :: (a -> c) -> (b -> a) -> b -> c; 9.80/4.11 pt f g x = f (g x); 9.80/4.11 9.80/4.11 subtractMyInt :: MyInt -> MyInt -> MyInt; 9.80/4.11 subtractMyInt = flip msMyInt; 9.80/4.11 9.80/4.11 toEnumChar :: MyInt -> Main.Char; 9.80/4.11 toEnumChar = primIntToChar; 9.80/4.11 9.80/4.11 } 9.80/4.11 9.80/4.11 ---------------------------------------- 9.80/4.11 9.80/4.11 (1) BR (EQUIVALENT) 9.80/4.11 Replaced joker patterns by fresh variables and removed binding patterns. 9.80/4.11 ---------------------------------------- 9.80/4.11 9.80/4.11 (2) 9.80/4.11 Obligation: 9.80/4.11 mainModule Main 9.80/4.11 module Main where { 9.80/4.11 import qualified Prelude; 9.80/4.11 data Main.Char = Char MyInt ; 9.80/4.11 9.80/4.11 data MyInt = Pos Main.Nat | Neg Main.Nat ; 9.80/4.11 9.80/4.11 data Main.Nat = Succ Main.Nat | Zero ; 9.80/4.11 9.80/4.11 flip :: (a -> b -> c) -> b -> a -> c; 9.80/4.11 flip f x y = f y x; 9.80/4.11 9.80/4.11 fromEnumChar :: Main.Char -> MyInt; 9.80/4.11 fromEnumChar = primCharToInt; 9.80/4.11 9.80/4.11 msMyInt :: MyInt -> MyInt -> MyInt; 9.80/4.11 msMyInt = primMinusInt; 9.80/4.11 9.80/4.11 predChar :: Main.Char -> Main.Char; 9.80/4.11 predChar = pt toEnumChar (pt (subtractMyInt (Main.Pos (Main.Succ Main.Zero))) fromEnumChar); 9.80/4.11 9.80/4.11 primCharToInt :: Main.Char -> MyInt; 9.80/4.11 primCharToInt (Main.Char x) = x; 9.80/4.11 9.80/4.11 primIntToChar :: MyInt -> Main.Char; 9.80/4.11 primIntToChar x = Main.Char x; 9.80/4.11 9.80/4.11 primMinusInt :: MyInt -> MyInt -> MyInt; 9.80/4.11 primMinusInt (Main.Pos x) (Main.Neg y) = Main.Pos (primPlusNat x y); 9.80/4.11 primMinusInt (Main.Neg x) (Main.Pos y) = Main.Neg (primPlusNat x y); 9.80/4.11 primMinusInt (Main.Neg x) (Main.Neg y) = primMinusNat y x; 9.80/4.11 primMinusInt (Main.Pos x) (Main.Pos y) = primMinusNat x y; 9.80/4.11 9.80/4.11 primMinusNat :: Main.Nat -> Main.Nat -> MyInt; 9.80/4.11 primMinusNat Main.Zero Main.Zero = Main.Pos Main.Zero; 9.80/4.11 primMinusNat Main.Zero (Main.Succ y) = Main.Neg (Main.Succ y); 9.80/4.11 primMinusNat (Main.Succ x) Main.Zero = Main.Pos (Main.Succ x); 9.80/4.11 primMinusNat (Main.Succ x) (Main.Succ y) = primMinusNat x y; 9.80/4.11 9.80/4.11 primPlusNat :: Main.Nat -> Main.Nat -> Main.Nat; 9.80/4.11 primPlusNat Main.Zero Main.Zero = Main.Zero; 9.80/4.11 primPlusNat Main.Zero (Main.Succ y) = Main.Succ y; 9.80/4.11 primPlusNat (Main.Succ x) Main.Zero = Main.Succ x; 9.80/4.11 primPlusNat (Main.Succ x) (Main.Succ y) = Main.Succ (Main.Succ (primPlusNat x y)); 9.80/4.11 9.80/4.11 pt :: (a -> b) -> (c -> a) -> c -> b; 9.80/4.11 pt f g x = f (g x); 9.80/4.11 9.80/4.11 subtractMyInt :: MyInt -> MyInt -> MyInt; 9.80/4.11 subtractMyInt = flip msMyInt; 9.80/4.11 9.80/4.11 toEnumChar :: MyInt -> Main.Char; 9.80/4.11 toEnumChar = primIntToChar; 9.80/4.11 9.80/4.11 } 9.80/4.11 9.80/4.11 ---------------------------------------- 9.80/4.11 9.80/4.11 (3) COR (EQUIVALENT) 9.80/4.11 Cond Reductions: 9.80/4.11 The following Function with conditions 9.80/4.11 "undefined |Falseundefined; 9.80/4.11 " 9.80/4.11 is transformed to 9.80/4.11 "undefined = undefined1; 9.80/4.11 " 9.80/4.11 "undefined0 True = undefined; 9.80/4.11 " 9.80/4.11 "undefined1 = undefined0 False; 9.80/4.11 " 9.80/4.11 9.80/4.11 ---------------------------------------- 9.80/4.11 9.80/4.11 (4) 9.80/4.11 Obligation: 9.80/4.11 mainModule Main 9.80/4.11 module Main where { 9.80/4.11 import qualified Prelude; 9.80/4.11 data Main.Char = Char MyInt ; 9.80/4.11 9.80/4.11 data MyInt = Pos Main.Nat | Neg Main.Nat ; 9.80/4.11 9.80/4.11 data Main.Nat = Succ Main.Nat | Zero ; 9.80/4.11 9.80/4.11 flip :: (b -> c -> a) -> c -> b -> a; 9.80/4.11 flip f x y = f y x; 9.80/4.11 9.80/4.11 fromEnumChar :: Main.Char -> MyInt; 9.80/4.11 fromEnumChar = primCharToInt; 9.80/4.11 9.80/4.11 msMyInt :: MyInt -> MyInt -> MyInt; 9.80/4.11 msMyInt = primMinusInt; 9.80/4.11 9.80/4.11 predChar :: Main.Char -> Main.Char; 9.80/4.11 predChar = pt toEnumChar (pt (subtractMyInt (Main.Pos (Main.Succ Main.Zero))) fromEnumChar); 9.80/4.11 9.80/4.11 primCharToInt :: Main.Char -> MyInt; 9.80/4.11 primCharToInt (Main.Char x) = x; 9.80/4.11 9.80/4.11 primIntToChar :: MyInt -> Main.Char; 9.80/4.11 primIntToChar x = Main.Char x; 9.80/4.11 9.80/4.11 primMinusInt :: MyInt -> MyInt -> MyInt; 9.80/4.11 primMinusInt (Main.Pos x) (Main.Neg y) = Main.Pos (primPlusNat x y); 9.80/4.11 primMinusInt (Main.Neg x) (Main.Pos y) = Main.Neg (primPlusNat x y); 9.80/4.11 primMinusInt (Main.Neg x) (Main.Neg y) = primMinusNat y x; 9.80/4.11 primMinusInt (Main.Pos x) (Main.Pos y) = primMinusNat x y; 9.80/4.11 9.80/4.11 primMinusNat :: Main.Nat -> Main.Nat -> MyInt; 9.80/4.11 primMinusNat Main.Zero Main.Zero = Main.Pos Main.Zero; 9.80/4.11 primMinusNat Main.Zero (Main.Succ y) = Main.Neg (Main.Succ y); 9.80/4.11 primMinusNat (Main.Succ x) Main.Zero = Main.Pos (Main.Succ x); 9.80/4.11 primMinusNat (Main.Succ x) (Main.Succ y) = primMinusNat x y; 9.80/4.11 9.80/4.11 primPlusNat :: Main.Nat -> Main.Nat -> Main.Nat; 9.80/4.11 primPlusNat Main.Zero Main.Zero = Main.Zero; 9.80/4.11 primPlusNat Main.Zero (Main.Succ y) = Main.Succ y; 9.80/4.11 primPlusNat (Main.Succ x) Main.Zero = Main.Succ x; 9.80/4.11 primPlusNat (Main.Succ x) (Main.Succ y) = Main.Succ (Main.Succ (primPlusNat x y)); 9.80/4.11 9.80/4.11 pt :: (a -> b) -> (c -> a) -> c -> b; 9.80/4.11 pt f g x = f (g x); 9.80/4.11 9.80/4.11 subtractMyInt :: MyInt -> MyInt -> MyInt; 9.80/4.11 subtractMyInt = flip msMyInt; 9.80/4.11 9.80/4.11 toEnumChar :: MyInt -> Main.Char; 9.80/4.11 toEnumChar = primIntToChar; 9.80/4.11 9.80/4.11 } 9.80/4.11 9.80/4.11 ---------------------------------------- 9.80/4.11 9.80/4.11 (5) Narrow (EQUIVALENT) 9.80/4.11 Haskell To QDPs 9.80/4.11 9.80/4.11 digraph dp_graph { 9.80/4.11 node [outthreshold=100, inthreshold=100];1[label="predChar",fontsize=16,color="grey",shape="box"];1 -> 3[label="",style="dashed", color="grey", weight=3]; 9.80/4.11 3[label="predChar vx3",fontsize=16,color="black",shape="triangle"];3 -> 4[label="",style="solid", color="black", weight=3]; 9.80/4.11 4[label="pt toEnumChar (pt (subtractMyInt (Pos (Succ Zero))) fromEnumChar) vx3",fontsize=16,color="black",shape="box"];4 -> 5[label="",style="solid", color="black", weight=3]; 9.80/4.11 5[label="toEnumChar (pt (subtractMyInt (Pos (Succ Zero))) fromEnumChar vx3)",fontsize=16,color="black",shape="box"];5 -> 6[label="",style="solid", color="black", weight=3]; 9.80/4.11 6[label="primIntToChar (pt (subtractMyInt (Pos (Succ Zero))) fromEnumChar vx3)",fontsize=16,color="black",shape="box"];6 -> 7[label="",style="solid", color="black", weight=3]; 9.80/4.11 7[label="Char (pt (subtractMyInt (Pos (Succ Zero))) fromEnumChar vx3)",fontsize=16,color="green",shape="box"];7 -> 8[label="",style="dashed", color="green", weight=3]; 9.80/4.11 8[label="pt (subtractMyInt (Pos (Succ Zero))) fromEnumChar vx3",fontsize=16,color="black",shape="box"];8 -> 9[label="",style="solid", color="black", weight=3]; 9.80/4.11 9[label="subtractMyInt (Pos (Succ Zero)) (fromEnumChar vx3)",fontsize=16,color="black",shape="box"];9 -> 10[label="",style="solid", color="black", weight=3]; 9.80/4.11 10[label="flip msMyInt (Pos (Succ Zero)) (fromEnumChar vx3)",fontsize=16,color="black",shape="box"];10 -> 11[label="",style="solid", color="black", weight=3]; 9.80/4.11 11[label="msMyInt (fromEnumChar vx3) (Pos (Succ Zero))",fontsize=16,color="black",shape="box"];11 -> 12[label="",style="solid", color="black", weight=3]; 9.80/4.11 12[label="primMinusInt (fromEnumChar vx3) (Pos (Succ Zero))",fontsize=16,color="black",shape="box"];12 -> 13[label="",style="solid", color="black", weight=3]; 9.80/4.11 13[label="primMinusInt (primCharToInt vx3) (Pos (Succ Zero))",fontsize=16,color="burlywood",shape="box"];38[label="vx3/Char vx30",fontsize=10,color="white",style="solid",shape="box"];13 -> 38[label="",style="solid", color="burlywood", weight=9]; 9.80/4.11 38 -> 14[label="",style="solid", color="burlywood", weight=3]; 9.80/4.11 14[label="primMinusInt (primCharToInt (Char vx30)) (Pos (Succ Zero))",fontsize=16,color="black",shape="box"];14 -> 15[label="",style="solid", color="black", weight=3]; 9.80/4.11 15[label="primMinusInt vx30 (Pos (Succ Zero))",fontsize=16,color="burlywood",shape="box"];39[label="vx30/Pos vx300",fontsize=10,color="white",style="solid",shape="box"];15 -> 39[label="",style="solid", color="burlywood", weight=9]; 9.80/4.11 39 -> 16[label="",style="solid", color="burlywood", weight=3]; 9.80/4.11 40[label="vx30/Neg vx300",fontsize=10,color="white",style="solid",shape="box"];15 -> 40[label="",style="solid", color="burlywood", weight=9]; 9.80/4.11 40 -> 17[label="",style="solid", color="burlywood", weight=3]; 9.80/4.11 16[label="primMinusInt (Pos vx300) (Pos (Succ Zero))",fontsize=16,color="black",shape="box"];16 -> 18[label="",style="solid", color="black", weight=3]; 9.80/4.11 17[label="primMinusInt (Neg vx300) (Pos (Succ Zero))",fontsize=16,color="black",shape="box"];17 -> 19[label="",style="solid", color="black", weight=3]; 9.80/4.11 18[label="primMinusNat vx300 (Succ Zero)",fontsize=16,color="burlywood",shape="box"];41[label="vx300/Succ vx3000",fontsize=10,color="white",style="solid",shape="box"];18 -> 41[label="",style="solid", color="burlywood", weight=9]; 9.80/4.11 41 -> 20[label="",style="solid", color="burlywood", weight=3]; 9.80/4.11 42[label="vx300/Zero",fontsize=10,color="white",style="solid",shape="box"];18 -> 42[label="",style="solid", color="burlywood", weight=9]; 9.80/4.11 42 -> 21[label="",style="solid", color="burlywood", weight=3]; 9.80/4.11 19[label="Neg (primPlusNat vx300 (Succ Zero))",fontsize=16,color="green",shape="box"];19 -> 22[label="",style="dashed", color="green", weight=3]; 9.80/4.11 20[label="primMinusNat (Succ vx3000) (Succ Zero)",fontsize=16,color="black",shape="box"];20 -> 23[label="",style="solid", color="black", weight=3]; 9.80/4.11 21[label="primMinusNat Zero (Succ Zero)",fontsize=16,color="black",shape="box"];21 -> 24[label="",style="solid", color="black", weight=3]; 9.80/4.11 22[label="primPlusNat vx300 (Succ Zero)",fontsize=16,color="burlywood",shape="box"];43[label="vx300/Succ vx3000",fontsize=10,color="white",style="solid",shape="box"];22 -> 43[label="",style="solid", color="burlywood", weight=9]; 9.80/4.11 43 -> 25[label="",style="solid", color="burlywood", weight=3]; 9.80/4.11 44[label="vx300/Zero",fontsize=10,color="white",style="solid",shape="box"];22 -> 44[label="",style="solid", color="burlywood", weight=9]; 9.80/4.11 44 -> 26[label="",style="solid", color="burlywood", weight=3]; 9.80/4.11 23[label="primMinusNat vx3000 Zero",fontsize=16,color="burlywood",shape="box"];45[label="vx3000/Succ vx30000",fontsize=10,color="white",style="solid",shape="box"];23 -> 45[label="",style="solid", color="burlywood", weight=9]; 9.80/4.11 45 -> 27[label="",style="solid", color="burlywood", weight=3]; 9.80/4.11 46[label="vx3000/Zero",fontsize=10,color="white",style="solid",shape="box"];23 -> 46[label="",style="solid", color="burlywood", weight=9]; 9.80/4.11 46 -> 28[label="",style="solid", color="burlywood", weight=3]; 9.80/4.11 24[label="Neg (Succ Zero)",fontsize=16,color="green",shape="box"];25[label="primPlusNat (Succ vx3000) (Succ Zero)",fontsize=16,color="black",shape="box"];25 -> 29[label="",style="solid", color="black", weight=3]; 9.80/4.11 26[label="primPlusNat Zero (Succ Zero)",fontsize=16,color="black",shape="box"];26 -> 30[label="",style="solid", color="black", weight=3]; 9.80/4.11 27[label="primMinusNat (Succ vx30000) Zero",fontsize=16,color="black",shape="box"];27 -> 31[label="",style="solid", color="black", weight=3]; 9.80/4.11 28[label="primMinusNat Zero Zero",fontsize=16,color="black",shape="box"];28 -> 32[label="",style="solid", color="black", weight=3]; 9.80/4.11 29[label="Succ (Succ (primPlusNat vx3000 Zero))",fontsize=16,color="green",shape="box"];29 -> 33[label="",style="dashed", color="green", weight=3]; 9.80/4.11 30[label="Succ Zero",fontsize=16,color="green",shape="box"];31[label="Pos (Succ vx30000)",fontsize=16,color="green",shape="box"];32[label="Pos Zero",fontsize=16,color="green",shape="box"];33[label="primPlusNat vx3000 Zero",fontsize=16,color="burlywood",shape="box"];47[label="vx3000/Succ vx30000",fontsize=10,color="white",style="solid",shape="box"];33 -> 47[label="",style="solid", color="burlywood", weight=9]; 9.80/4.11 47 -> 34[label="",style="solid", color="burlywood", weight=3]; 9.80/4.11 48[label="vx3000/Zero",fontsize=10,color="white",style="solid",shape="box"];33 -> 48[label="",style="solid", color="burlywood", weight=9]; 9.80/4.11 48 -> 35[label="",style="solid", color="burlywood", weight=3]; 9.80/4.11 34[label="primPlusNat (Succ vx30000) Zero",fontsize=16,color="black",shape="box"];34 -> 36[label="",style="solid", color="black", weight=3]; 9.80/4.11 35[label="primPlusNat Zero Zero",fontsize=16,color="black",shape="box"];35 -> 37[label="",style="solid", color="black", weight=3]; 9.80/4.11 36[label="Succ vx30000",fontsize=16,color="green",shape="box"];37[label="Zero",fontsize=16,color="green",shape="box"];} 9.80/4.11 9.80/4.11 ---------------------------------------- 9.80/4.11 9.80/4.11 (6) 9.80/4.11 YES 9.97/4.15 EOF