WORST_CASE(Omega(n^1),O(n^1)) proof of /export/starexec/sandbox/benchmark/theBenchmark.trs # AProVE Commit ID: c69e44bd14796315568835c1ffa2502984884775 mhark 20210624 unpublished The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxRelTRS (1) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 583 ms] (2) CpxRelTRS (3) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxWeightedTrs (5) CpxWeightedTrsRenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxWeightedTrs (7) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxTypedWeightedTrs (9) CompletionProof [UPPER BOUND(ID), 0 ms] (10) CpxTypedWeightedCompleteTrs (11) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (12) CpxRNTS (13) CompleteCoflocoProof [FINISHED, 2433 ms] (14) BOUNDS(1, n^1) (15) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] (16) TRS for Loop Detection (17) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] (18) BEST (19) proven lower bound (20) LowerBoundPropagationProof [FINISHED, 0 ms] (21) BOUNDS(n^1, INF) (22) TRS for Loop Detection ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: -'(z0, 0) -> c -'(s(z0), s(z1)) -> c1(-'(z0, z1)) P(s(z0)) -> c2 F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(s(z0), z1)), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(z1, s(z0))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(z0, s(z1))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(s(z1), z0)), -'(s(z1), z0)) The (relative) TRS S consists of the following rules: -(z0, 0) -> z0 -(s(z0), s(z1)) -> -(z0, z1) p(s(z0)) -> z0 f(s(z0), z1) -> f(p(-(s(z0), z1)), p(-(z1, s(z0)))) f(z0, s(z1)) -> f(p(-(z0, s(z1))), p(-(s(z1), z0))) Rewrite Strategy: INNERMOST ---------------------------------------- (1) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: -'(z0, 0) -> c -'(s(z0), s(z1)) -> c1(-'(z0, z1)) P(s(z0)) -> c2 F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(s(z0), z1)), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(z1, s(z0))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(z0, s(z1))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(s(z1), z0)), -'(s(z1), z0)) The (relative) TRS S consists of the following rules: -(z0, 0) -> z0 -(s(z0), s(z1)) -> -(z0, z1) p(s(z0)) -> z0 f(s(z0), z1) -> f(p(-(s(z0), z1)), p(-(z1, s(z0)))) f(z0, s(z1)) -> f(p(-(z0, s(z1))), p(-(s(z1), z0))) Rewrite Strategy: INNERMOST ---------------------------------------- (3) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (4) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: -'(z0, 0) -> c [1] -'(s(z0), s(z1)) -> c1(-'(z0, z1)) [1] P(s(z0)) -> c2 [1] F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(s(z0), z1)), -'(s(z0), z1)) [1] F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(z1, s(z0))), -'(z1, s(z0))) [1] F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(z0, s(z1))), -'(z0, s(z1))) [1] F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(s(z1), z0)), -'(s(z1), z0)) [1] -(z0, 0) -> z0 [0] -(s(z0), s(z1)) -> -(z0, z1) [0] p(s(z0)) -> z0 [0] f(s(z0), z1) -> f(p(-(s(z0), z1)), p(-(z1, s(z0)))) [0] f(z0, s(z1)) -> f(p(-(z0, s(z1))), p(-(s(z1), z0))) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (5) CpxWeightedTrsRenamingProof (BOTH BOUNDS(ID, ID)) Renamed defined symbols to avoid conflicts with arithmetic symbols: - => minus ---------------------------------------- (6) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: -'(z0, 0) -> c [1] -'(s(z0), s(z1)) -> c1(-'(z0, z1)) [1] P(s(z0)) -> c2 [1] F(s(z0), z1) -> c3(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), P(minus(s(z0), z1)), -'(s(z0), z1)) [1] F(s(z0), z1) -> c4(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), P(minus(z1, s(z0))), -'(z1, s(z0))) [1] F(z0, s(z1)) -> c5(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), P(minus(z0, s(z1))), -'(z0, s(z1))) [1] F(z0, s(z1)) -> c6(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), P(minus(s(z1), z0)), -'(s(z1), z0)) [1] minus(z0, 0) -> z0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] p(s(z0)) -> z0 [0] f(s(z0), z1) -> f(p(minus(s(z0), z1)), p(minus(z1, s(z0)))) [0] f(z0, s(z1)) -> f(p(minus(z0, s(z1))), p(minus(s(z1), z0))) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (7) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (8) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: -'(z0, 0) -> c [1] -'(s(z0), s(z1)) -> c1(-'(z0, z1)) [1] P(s(z0)) -> c2 [1] F(s(z0), z1) -> c3(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), P(minus(s(z0), z1)), -'(s(z0), z1)) [1] F(s(z0), z1) -> c4(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), P(minus(z1, s(z0))), -'(z1, s(z0))) [1] F(z0, s(z1)) -> c5(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), P(minus(z0, s(z1))), -'(z0, s(z1))) [1] F(z0, s(z1)) -> c6(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), P(minus(s(z1), z0)), -'(s(z1), z0)) [1] minus(z0, 0) -> z0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] p(s(z0)) -> z0 [0] f(s(z0), z1) -> f(p(minus(s(z0), z1)), p(minus(z1, s(z0)))) [0] f(z0, s(z1)) -> f(p(minus(z0, s(z1))), p(minus(s(z1), z0))) [0] The TRS has the following type information: -' :: 0:s -> 0:s -> c:c1 0 :: 0:s c :: c:c1 s :: 0:s -> 0:s c1 :: c:c1 -> c:c1 P :: 0:s -> c2 c2 :: c2 F :: 0:s -> 0:s -> c3:c4:c5:c6 c3 :: c3:c4:c5:c6 -> c2 -> c:c1 -> c3:c4:c5:c6 p :: 0:s -> 0:s minus :: 0:s -> 0:s -> 0:s c4 :: c3:c4:c5:c6 -> c2 -> c:c1 -> c3:c4:c5:c6 c5 :: c3:c4:c5:c6 -> c2 -> c:c1 -> c3:c4:c5:c6 c6 :: c3:c4:c5:c6 -> c2 -> c:c1 -> c3:c4:c5:c6 f :: 0:s -> 0:s -> f Rewrite Strategy: INNERMOST ---------------------------------------- (9) CompletionProof (UPPER BOUND(ID)) The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: minus(v0, v1) -> null_minus [0] p(v0) -> null_p [0] f(v0, v1) -> null_f [0] -'(v0, v1) -> null_-' [0] P(v0) -> null_P [0] F(v0, v1) -> null_F [0] And the following fresh constants: null_minus, null_p, null_f, null_-', null_P, null_F ---------------------------------------- (10) Obligation: Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: -'(z0, 0) -> c [1] -'(s(z0), s(z1)) -> c1(-'(z0, z1)) [1] P(s(z0)) -> c2 [1] F(s(z0), z1) -> c3(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), P(minus(s(z0), z1)), -'(s(z0), z1)) [1] F(s(z0), z1) -> c4(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), P(minus(z1, s(z0))), -'(z1, s(z0))) [1] F(z0, s(z1)) -> c5(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), P(minus(z0, s(z1))), -'(z0, s(z1))) [1] F(z0, s(z1)) -> c6(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), P(minus(s(z1), z0)), -'(s(z1), z0)) [1] minus(z0, 0) -> z0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] p(s(z0)) -> z0 [0] f(s(z0), z1) -> f(p(minus(s(z0), z1)), p(minus(z1, s(z0)))) [0] f(z0, s(z1)) -> f(p(minus(z0, s(z1))), p(minus(s(z1), z0))) [0] minus(v0, v1) -> null_minus [0] p(v0) -> null_p [0] f(v0, v1) -> null_f [0] -'(v0, v1) -> null_-' [0] P(v0) -> null_P [0] F(v0, v1) -> null_F [0] The TRS has the following type information: -' :: 0:s:null_minus:null_p -> 0:s:null_minus:null_p -> c:c1:null_-' 0 :: 0:s:null_minus:null_p c :: c:c1:null_-' s :: 0:s:null_minus:null_p -> 0:s:null_minus:null_p c1 :: c:c1:null_-' -> c:c1:null_-' P :: 0:s:null_minus:null_p -> c2:null_P c2 :: c2:null_P F :: 0:s:null_minus:null_p -> 0:s:null_minus:null_p -> c3:c4:c5:c6:null_F c3 :: c3:c4:c5:c6:null_F -> c2:null_P -> c:c1:null_-' -> c3:c4:c5:c6:null_F p :: 0:s:null_minus:null_p -> 0:s:null_minus:null_p minus :: 0:s:null_minus:null_p -> 0:s:null_minus:null_p -> 0:s:null_minus:null_p c4 :: c3:c4:c5:c6:null_F -> c2:null_P -> c:c1:null_-' -> c3:c4:c5:c6:null_F c5 :: c3:c4:c5:c6:null_F -> c2:null_P -> c:c1:null_-' -> c3:c4:c5:c6:null_F c6 :: c3:c4:c5:c6:null_F -> c2:null_P -> c:c1:null_-' -> c3:c4:c5:c6:null_F f :: 0:s:null_minus:null_p -> 0:s:null_minus:null_p -> null_f null_minus :: 0:s:null_minus:null_p null_p :: 0:s:null_minus:null_p null_f :: null_f null_-' :: c:c1:null_-' null_P :: c2:null_P null_F :: c3:c4:c5:c6:null_F Rewrite Strategy: INNERMOST ---------------------------------------- (11) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: 0 => 0 c => 0 c2 => 1 null_minus => 0 null_p => 0 null_f => 0 null_-' => 0 null_P => 0 null_F => 0 ---------------------------------------- (12) Obligation: Complexity RNTS consisting of the following rules: -'(z, z') -{ 1 }-> 0 :|: z = z0, z0 >= 0, z' = 0 -'(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 -'(z, z') -{ 1 }-> 1 + -'(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 F(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 F(z, z') -{ 1 }-> 1 + F(p(minus(z0, 1 + z1)), p(minus(1 + z1, z0))) + P(minus(z0, 1 + z1)) + -'(z0, 1 + z1) :|: z = z0, z1 >= 0, z0 >= 0, z' = 1 + z1 F(z, z') -{ 1 }-> 1 + F(p(minus(z0, 1 + z1)), p(minus(1 + z1, z0))) + P(minus(1 + z1, z0)) + -'(1 + z1, z0) :|: z = z0, z1 >= 0, z0 >= 0, z' = 1 + z1 F(z, z') -{ 1 }-> 1 + F(p(minus(1 + z0, z1)), p(minus(z1, 1 + z0))) + P(minus(z1, 1 + z0)) + -'(z1, 1 + z0) :|: z1 >= 0, z = 1 + z0, z' = z1, z0 >= 0 F(z, z') -{ 1 }-> 1 + F(p(minus(1 + z0, z1)), p(minus(z1, 1 + z0))) + P(minus(1 + z0, z1)) + -'(1 + z0, z1) :|: z1 >= 0, z = 1 + z0, z' = z1, z0 >= 0 P(z) -{ 1 }-> 1 :|: z = 1 + z0, z0 >= 0 P(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 f(z, z') -{ 0 }-> f(p(minus(z0, 1 + z1)), p(minus(1 + z1, z0))) :|: z = z0, z1 >= 0, z0 >= 0, z' = 1 + z1 f(z, z') -{ 0 }-> f(p(minus(1 + z0, z1)), p(minus(z1, 1 + z0))) :|: z1 >= 0, z = 1 + z0, z' = z1, z0 >= 0 f(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 minus(z, z') -{ 0 }-> z0 :|: z = z0, z0 >= 0, z' = 0 minus(z, z') -{ 0 }-> minus(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 minus(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 p(z) -{ 0 }-> z0 :|: z = 1 + z0, z0 >= 0 p(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (13) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[fun1(V1, Out)],[V1 >= 0]). eq(start(V1, V),0,[fun2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[minus(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[p(V1, Out)],[V1 >= 0]). eq(start(V1, V),0,[f(V1, V, Out)],[V1 >= 0,V >= 0]). eq(fun(V1, V, Out),1,[],[Out = 0,V1 = V2,V2 >= 0,V = 0]). eq(fun(V1, V, Out),1,[fun(V4, V3, Ret1)],[Out = 1 + Ret1,V3 >= 0,V1 = 1 + V4,V4 >= 0,V = 1 + V3]). eq(fun1(V1, Out),1,[],[Out = 1,V1 = 1 + V5,V5 >= 0]). eq(fun2(V1, V, Out),1,[minus(1 + V6, V7, Ret00100),p(Ret00100, Ret0010),minus(V7, 1 + V6, Ret00110),p(Ret00110, Ret0011),fun2(Ret0010, Ret0011, Ret001),minus(1 + V6, V7, Ret010),fun1(Ret010, Ret01),fun(1 + V6, V7, Ret11)],[Out = 1 + Ret001 + Ret01 + Ret11,V7 >= 0,V1 = 1 + V6,V = V7,V6 >= 0]). eq(fun2(V1, V, Out),1,[minus(1 + V8, V9, Ret001001),p(Ret001001, Ret00101),minus(V9, 1 + V8, Ret001101),p(Ret001101, Ret00111),fun2(Ret00101, Ret00111, Ret0012),minus(V9, 1 + V8, Ret0101),fun1(Ret0101, Ret011),fun(V9, 1 + V8, Ret12)],[Out = 1 + Ret0012 + Ret011 + Ret12,V9 >= 0,V1 = 1 + V8,V = V9,V8 >= 0]). eq(fun2(V1, V, Out),1,[minus(V10, 1 + V11, Ret001002),p(Ret001002, Ret00102),minus(1 + V11, V10, Ret001102),p(Ret001102, Ret00112),fun2(Ret00102, Ret00112, Ret0013),minus(V10, 1 + V11, Ret0102),fun1(Ret0102, Ret012),fun(V10, 1 + V11, Ret13)],[Out = 1 + Ret0013 + Ret012 + Ret13,V1 = V10,V11 >= 0,V10 >= 0,V = 1 + V11]). eq(fun2(V1, V, Out),1,[minus(V13, 1 + V12, Ret001003),p(Ret001003, Ret00103),minus(1 + V12, V13, Ret001103),p(Ret001103, Ret00113),fun2(Ret00103, Ret00113, Ret0014),minus(1 + V12, V13, Ret0103),fun1(Ret0103, Ret013),fun(1 + V12, V13, Ret14)],[Out = 1 + Ret0014 + Ret013 + Ret14,V1 = V13,V12 >= 0,V13 >= 0,V = 1 + V12]). eq(minus(V1, V, Out),0,[],[Out = V14,V1 = V14,V14 >= 0,V = 0]). eq(minus(V1, V, Out),0,[minus(V16, V15, Ret)],[Out = Ret,V15 >= 0,V1 = 1 + V16,V16 >= 0,V = 1 + V15]). eq(p(V1, Out),0,[],[Out = V17,V1 = 1 + V17,V17 >= 0]). eq(f(V1, V, Out),0,[minus(1 + V19, V18, Ret00),p(Ret00, Ret0),minus(V18, 1 + V19, Ret10),p(Ret10, Ret15),f(Ret0, Ret15, Ret2)],[Out = Ret2,V18 >= 0,V1 = 1 + V19,V = V18,V19 >= 0]). eq(f(V1, V, Out),0,[minus(V21, 1 + V20, Ret002),p(Ret002, Ret02),minus(1 + V20, V21, Ret101),p(Ret101, Ret16),f(Ret02, Ret16, Ret3)],[Out = Ret3,V1 = V21,V20 >= 0,V21 >= 0,V = 1 + V20]). eq(minus(V1, V, Out),0,[],[Out = 0,V23 >= 0,V22 >= 0,V1 = V23,V = V22]). eq(p(V1, Out),0,[],[Out = 0,V24 >= 0,V1 = V24]). eq(f(V1, V, Out),0,[],[Out = 0,V26 >= 0,V25 >= 0,V1 = V26,V = V25]). eq(fun(V1, V, Out),0,[],[Out = 0,V27 >= 0,V28 >= 0,V1 = V27,V = V28]). eq(fun1(V1, Out),0,[],[Out = 0,V29 >= 0,V1 = V29]). eq(fun2(V1, V, Out),0,[],[Out = 0,V30 >= 0,V31 >= 0,V1 = V30,V = V31]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,Out),[V1],[Out]). input_output_vars(fun2(V1,V,Out),[V1,V],[Out]). input_output_vars(minus(V1,V,Out),[V1,V],[Out]). input_output_vars(p(V1,Out),[V1],[Out]). input_output_vars(f(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [minus/3] 1. non_recursive : [p/2] 2. recursive : [f/3] 3. recursive : [fun/3] 4. non_recursive : [fun1/2] 5. recursive [non_tail] : [fun2/3] 6. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into minus/3 1. SCC is partially evaluated into p/2 2. SCC is partially evaluated into f/3 3. SCC is partially evaluated into fun/3 4. SCC is partially evaluated into fun1/2 5. SCC is partially evaluated into fun2/3 6. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations minus/3 * CE 19 is refined into CE [25] * CE 17 is refined into CE [26] * CE 18 is refined into CE [27] ### Cost equations --> "Loop" of minus/3 * CEs [27] --> Loop 17 * CEs [25] --> Loop 18 * CEs [26] --> Loop 19 ### Ranking functions of CR minus(V1,V,Out) * RF of phase [17]: [V,V1] #### Partial ranking functions of CR minus(V1,V,Out) * Partial RF of phase [17]: - RF of loop [17:1]: V V1 ### Specialization of cost equations p/2 * CE 20 is refined into CE [28] * CE 21 is refined into CE [29] ### Cost equations --> "Loop" of p/2 * CEs [28] --> Loop 20 * CEs [29] --> Loop 21 ### Ranking functions of CR p(V1,Out) #### Partial ranking functions of CR p(V1,Out) ### Specialization of cost equations f/3 * CE 24 is refined into CE [30] * CE 22 is refined into CE [31,32,33,34,35,36,37,38] * CE 23 is refined into CE [39,40,41,42,43,44,45,46] ### Cost equations --> "Loop" of f/3 * CEs [38,46] --> Loop 22 * CEs [35,43] --> Loop 23 * CEs [37,45] --> Loop 24 * CEs [32] --> Loop 25 * CEs [31,33] --> Loop 26 * CEs [40] --> Loop 27 * CEs [34,36,39,41,42,44] --> Loop 28 * CEs [30] --> Loop 29 ### Ranking functions of CR f(V1,V,Out) * RF of phase [25]: [V1] * RF of phase [27]: [V] #### Partial ranking functions of CR f(V1,V,Out) * Partial RF of phase [25]: - RF of loop [25:1]: V1 * Partial RF of phase [27]: - RF of loop [27:1]: V ### Specialization of cost equations fun/3 * CE 7 is refined into CE [47] * CE 9 is refined into CE [48] * CE 8 is refined into CE [49] ### Cost equations --> "Loop" of fun/3 * CEs [49] --> Loop 30 * CEs [47,48] --> Loop 31 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [30]: [V,V1] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [30]: - RF of loop [30:1]: V V1 ### Specialization of cost equations fun1/2 * CE 10 is refined into CE [50] * CE 11 is refined into CE [51] ### Cost equations --> "Loop" of fun1/2 * CEs [50] --> Loop 32 * CEs [51] --> Loop 33 ### Ranking functions of CR fun1(V1,Out) #### Partial ranking functions of CR fun1(V1,Out) ### Specialization of cost equations fun2/3 * CE 16 is refined into CE [52] * CE 12 is refined into CE [53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88] * CE 13 is refined into CE [89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118] * CE 14 is refined into CE [119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148] * CE 15 is refined into CE [149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184] ### Cost equations --> "Loop" of fun2/3 * CEs [88,148] --> Loop 34 * CEs [84,86,87,118,144,146,147,184] --> Loop 35 * CEs [83,85,117,143,145,183] --> Loop 36 * CEs [108,174] --> Loop 37 * CEs [72,104,106,107,132,170,172,173] --> Loop 38 * CEs [71,103,105,131,169,171] --> Loop 39 * CEs [66,78,126,138] --> Loop 40 * CEs [96,102,162,168] --> Loop 41 * CEs [64,65,74,76,77,110,124,125,134,136,137,176] --> Loop 42 * CEs [95,101,161,167] --> Loop 43 * CEs [62,68,70,80,82,92,94,98,100,112,114,116,122,128,130,140,142,158,160,164,166,178,180,182] --> Loop 44 * CEs [69,79,81,111,113,115,129,139,141,177,179,181] --> Loop 45 * CEs [57] --> Loop 46 * CEs [56,58,90] --> Loop 47 * CEs [54,60] --> Loop 48 * CEs [53,55,59,61,89,91] --> Loop 49 * CEs [153] --> Loop 50 * CEs [120,152,154] --> Loop 51 * CEs [150,156] --> Loop 52 * CEs [63,67,73,75,93,97,99,109,119,121,123,127,133,135,149,151,155,157,159,163,165,175] --> Loop 53 * CEs [52] --> Loop 54 ### Ranking functions of CR fun2(V1,V,Out) * RF of phase [46,47]: [V1] * RF of phase [50,51]: [V] #### Partial ranking functions of CR fun2(V1,V,Out) * Partial RF of phase [46,47]: - RF of loop [46:1,47:1]: V1 * Partial RF of phase [50,51]: - RF of loop [50:1,51:1]: V ### Specialization of cost equations start/2 * CE 1 is refined into CE [185,186] * CE 2 is refined into CE [187,188] * CE 3 is refined into CE [189,190,191,192,193,194,195,196,197,198,199,200,201,202,203] * CE 4 is refined into CE [204,205,206] * CE 5 is refined into CE [207,208] * CE 6 is refined into CE [209,210,211] ### Cost equations --> "Loop" of start/2 * CEs [211] --> Loop 55 * CEs [190,204,210] --> Loop 56 * CEs [185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,205,206,207,208,209] --> Loop 57 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of minus(V1,V,Out): * Chain [[17],19]: 0 with precondition: [V1=Out+V,V>=1,V1>=V] * Chain [[17],18]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [19]: 0 with precondition: [V=0,V1=Out,V1>=0] * Chain [18]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of p(V1,Out): * Chain [21]: 0 with precondition: [Out=0,V1>=0] * Chain [20]: 0 with precondition: [V1=Out+1,V1>=1] #### Cost of chains of f(V1,V,Out): * Chain [[27],29]: 0 with precondition: [V1=0,Out=0,V>=1] * Chain [[27],28,29]: 0 with precondition: [V1=0,Out=0,V>=2] * Chain [[25],29]: 0 with precondition: [V=0,Out=0,V1>=1] * Chain [[25],26,29]: 0 with precondition: [V=0,Out=0,V1>=2] * Chain [29]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [28,29]: 0 with precondition: [Out=0,V1>=0,V>=1] * Chain [26,29]: 0 with precondition: [Out=0,V1>=1,V>=0] * Chain [24,29]: 0 with precondition: [Out=0,V1=V,V1>=1] * Chain [23,[27],29]: 0 with precondition: [Out=0,V1>=1,V>=V1+2] * Chain [23,[27],28,29]: 0 with precondition: [Out=0,V1>=1,V>=V1+3] * Chain [23,29]: 0 with precondition: [Out=0,V1>=1,V>=V1+1] * Chain [23,28,29]: 0 with precondition: [Out=0,V1>=1,V>=V1+2] * Chain [22,[25],29]: 0 with precondition: [Out=0,V>=1,V1>=V+2] * Chain [22,[25],26,29]: 0 with precondition: [Out=0,V>=1,V1>=V+3] * Chain [22,29]: 0 with precondition: [Out=0,V>=1,V1>=V+1] * Chain [22,26,29]: 0 with precondition: [Out=0,V>=1,V1>=V+2] #### Cost of chains of fun(V1,V,Out): * Chain [[30],31]: 1*it(30)+1 Such that:it(30) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [31]: 1 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun1(V1,Out): * Chain [33]: 0 with precondition: [Out=0,V1>=0] * Chain [32]: 1 with precondition: [Out=1,V1>=1] #### Cost of chains of fun2(V1,V,Out): * Chain [[50,51],54]: 5*it(50)+0 Such that:aux(3) =< V it(50) =< aux(3) with precondition: [V1=0,V>=1,Out>=1,2*V>=Out] * Chain [[50,51],53,54]: 5*it(50)+2 Such that:aux(4) =< V it(50) =< aux(4) with precondition: [V1=0,V>=2,Out>=2,2*V>=Out+1] * Chain [[50,51],52,54]: 5*it(50)+3 Such that:aux(5) =< V it(50) =< aux(5) with precondition: [V1=0,V>=2,Out>=3,2*V>=Out] * Chain [[46,47],54]: 5*it(46)+0 Such that:aux(8) =< V1 it(46) =< aux(8) with precondition: [V=0,V1>=1,Out>=1,2*V1>=Out] * Chain [[46,47],49,54]: 5*it(46)+2 Such that:aux(9) =< V1 it(46) =< aux(9) with precondition: [V=0,V1>=2,Out>=2,2*V1>=Out+1] * Chain [[46,47],48,54]: 5*it(46)+3 Such that:aux(10) =< V1 it(46) =< aux(10) with precondition: [V=0,V1>=2,Out>=3,2*V1>=Out] * Chain [54]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [53,54]: 2 with precondition: [Out=1,V1>=0,V>=1] * Chain [52,54]: 3 with precondition: [V1=0,Out=2,V>=1] * Chain [49,54]: 2 with precondition: [Out=1,V1>=1,V>=0] * Chain [48,54]: 3 with precondition: [V=0,Out=2,V1>=1] * Chain [45,54]: 2 with precondition: [Out=1,V1=V,V1>=1] * Chain [44,54]: 4*s(1)+20*s(2)+2 Such that:aux(11) =< V1 aux(12) =< V s(2) =< aux(11) s(1) =< aux(12) with precondition: [Out>=2,V1+1>=Out,V+1>=Out] * Chain [43,54]: 3 with precondition: [Out=2,V1>=1,V>=V1+1] * Chain [42,54]: 8*s(25)+3 Such that:aux(13) =< V s(25) =< aux(13) with precondition: [Out>=2,V1>=V,V+1>=Out] * Chain [41,54]: 4*s(33)+3 Such that:aux(14) =< V1 s(33) =< aux(14) with precondition: [Out>=3,V>=V1+1,V1+2>=Out] * Chain [40,54]: 4*s(37)+3 Such that:aux(15) =< V s(37) =< aux(15) with precondition: [Out>=3,V1>=V+1,V+2>=Out] * Chain [39,[50,51],54]: 5*it(50)+2 Such that:aux(3) =< -V1+V it(50) =< aux(3) with precondition: [V1>=1,Out>=2,V>=V1+2,2*V>=2*V1+Out+1] * Chain [39,[50,51],53,54]: 5*it(50)+4 Such that:aux(4) =< -V1+V it(50) =< aux(4) with precondition: [V1>=1,Out>=3,V>=V1+3,2*V>=2*V1+Out+2] * Chain [39,[50,51],52,54]: 5*it(50)+5 Such that:aux(5) =< -V1+V it(50) =< aux(5) with precondition: [V1>=1,Out>=4,V>=V1+3,2*V>=2*V1+Out+1] * Chain [39,54]: 2 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [39,53,54]: 4 with precondition: [Out=2,V1>=1,V>=V1+2] * Chain [39,52,54]: 5 with precondition: [Out=3,V1>=1,V>=V1+2] * Chain [38,[50,51],54]: 5*it(50)+6*s(41)+3 Such that:aux(3) =< -V1+V aux(16) =< V1 it(50) =< aux(3) s(41) =< aux(16) with precondition: [V1>=1,Out>=3,V>=V1+2,2*V>=Out+V1+1] * Chain [38,[50,51],53,54]: 5*it(50)+6*s(41)+5 Such that:aux(4) =< -V1+V aux(16) =< V1 it(50) =< aux(4) s(41) =< aux(16) with precondition: [V1>=1,Out>=4,V>=V1+3,2*V>=Out+V1+2] * Chain [38,[50,51],52,54]: 5*it(50)+6*s(41)+6 Such that:aux(5) =< -V1+V aux(16) =< V1 it(50) =< aux(5) s(41) =< aux(16) with precondition: [V1>=1,Out>=5,V>=V1+3,2*V>=Out+V1+1] * Chain [38,54]: 6*s(41)+3 Such that:aux(16) =< V1 s(41) =< aux(16) with precondition: [Out>=2,V>=V1+1,V1+1>=Out] * Chain [38,53,54]: 6*s(41)+5 Such that:aux(16) =< V1 s(41) =< aux(16) with precondition: [Out>=3,V>=V1+2,V1+2>=Out] * Chain [38,52,54]: 6*s(41)+6 Such that:aux(16) =< V1 s(41) =< aux(16) with precondition: [Out>=4,V>=V1+2,V1+3>=Out] * Chain [37,[50,51],54]: 5*it(50)+2*s(47)+3 Such that:aux(3) =< -V1+V aux(17) =< V1 it(50) =< aux(3) s(47) =< aux(17) with precondition: [V1>=1,Out>=4,V>=V1+2,2*V>=Out+V1] * Chain [37,[50,51],53,54]: 5*it(50)+2*s(47)+5 Such that:aux(4) =< -V1+V aux(17) =< V1 it(50) =< aux(4) s(47) =< aux(17) with precondition: [V1>=1,Out>=5,V>=V1+3,2*V>=Out+V1+1] * Chain [37,[50,51],52,54]: 5*it(50)+2*s(47)+6 Such that:aux(5) =< -V1+V aux(17) =< V1 it(50) =< aux(5) s(47) =< aux(17) with precondition: [V1>=1,Out>=6,V>=V1+3,2*V>=Out+V1] * Chain [37,54]: 2*s(47)+3 Such that:aux(17) =< V1 s(47) =< aux(17) with precondition: [Out>=3,V>=V1+1,V1+2>=Out] * Chain [37,53,54]: 2*s(47)+5 Such that:aux(17) =< V1 s(47) =< aux(17) with precondition: [Out>=4,V>=V1+2,V1+3>=Out] * Chain [37,52,54]: 2*s(47)+6 Such that:aux(17) =< V1 s(47) =< aux(17) with precondition: [Out>=5,V>=V1+2,V1+4>=Out] * Chain [36,[46,47],54]: 5*it(46)+2 Such that:aux(8) =< V1-V it(46) =< aux(8) with precondition: [V>=1,Out>=2,V1>=V+2,2*V1>=2*V+Out+1] * Chain [36,[46,47],49,54]: 5*it(46)+4 Such that:aux(9) =< V1-V it(46) =< aux(9) with precondition: [V>=1,Out>=3,V1>=V+3,2*V1>=2*V+Out+2] * Chain [36,[46,47],48,54]: 5*it(46)+5 Such that:aux(10) =< V1-V it(46) =< aux(10) with precondition: [V>=1,Out>=4,V1>=V+3,2*V1>=2*V+Out+1] * Chain [36,54]: 2 with precondition: [Out=1,V>=1,V1>=V+1] * Chain [36,49,54]: 4 with precondition: [Out=2,V>=1,V1>=V+2] * Chain [36,48,54]: 5 with precondition: [Out=3,V>=1,V1>=V+2] * Chain [35,[46,47],54]: 5*it(46)+6*s(49)+3 Such that:aux(8) =< V1-V aux(18) =< V+1 it(46) =< aux(8) s(49) =< aux(18) with precondition: [V>=1,Out>=3,V1>=V+2,2*V1>=Out+V+1] * Chain [35,[46,47],49,54]: 5*it(46)+6*s(49)+5 Such that:aux(9) =< V1-V aux(18) =< V+1 it(46) =< aux(9) s(49) =< aux(18) with precondition: [V>=1,Out>=4,V1>=V+3,2*V1>=Out+V+2] * Chain [35,[46,47],48,54]: 5*it(46)+6*s(49)+6 Such that:aux(10) =< V1-V aux(18) =< V+1 it(46) =< aux(10) s(49) =< aux(18) with precondition: [V>=1,Out>=5,V1>=V+3,2*V1>=Out+V+1] * Chain [35,54]: 6*s(49)+3 Such that:aux(18) =< V+1 s(49) =< aux(18) with precondition: [Out>=2,V1>=V+1,V+1>=Out] * Chain [35,49,54]: 6*s(49)+5 Such that:aux(18) =< V+1 s(49) =< aux(18) with precondition: [Out>=3,V1>=V+2,V+2>=Out] * Chain [35,48,54]: 6*s(49)+6 Such that:aux(18) =< V+1 s(49) =< aux(18) with precondition: [Out>=4,V1>=V+2,V+3>=Out] * Chain [34,[46,47],54]: 5*it(46)+2*s(55)+3 Such that:aux(8) =< V1-V aux(19) =< V+1 it(46) =< aux(8) s(55) =< aux(19) with precondition: [V>=1,Out>=4,V1>=V+2,2*V1>=Out+V] * Chain [34,[46,47],49,54]: 5*it(46)+2*s(55)+5 Such that:aux(9) =< V1-V aux(19) =< V+1 it(46) =< aux(9) s(55) =< aux(19) with precondition: [V>=1,Out>=5,V1>=V+3,2*V1>=Out+V+1] * Chain [34,[46,47],48,54]: 5*it(46)+2*s(55)+6 Such that:aux(10) =< V1-V aux(19) =< V+1 it(46) =< aux(10) s(55) =< aux(19) with precondition: [V>=1,Out>=6,V1>=V+3,2*V1>=Out+V] * Chain [34,54]: 2*s(55)+3 Such that:aux(19) =< V+1 s(55) =< aux(19) with precondition: [Out>=3,V1>=V+1,V+2>=Out] * Chain [34,49,54]: 2*s(55)+5 Such that:aux(19) =< V+1 s(55) =< aux(19) with precondition: [Out>=4,V1>=V+2,V+3>=Out] * Chain [34,48,54]: 2*s(55)+6 Such that:aux(19) =< V+1 s(55) =< aux(19) with precondition: [Out>=5,V1>=V+2,V+4>=Out] #### Cost of chains of start(V1,V): * Chain [57]: 32*s(163)+72*s(168)+45*s(171)+45*s(173)+48*s(177)+6 Such that:aux(34) =< -V1+V aux(35) =< V1 aux(36) =< V1-V aux(37) =< V aux(38) =< V+1 s(163) =< aux(37) s(173) =< aux(34) s(168) =< aux(35) s(171) =< aux(36) s(177) =< aux(38) with precondition: [V1>=0] * Chain [56]: 15*s(201)+3 Such that:s(200) =< V1 s(201) =< s(200) with precondition: [V=0,V1>=0] * Chain [55]: 0 with precondition: [V1=V,V1>=1] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [57] with precondition: [V1>=0] - Upper bound: 72*V1+6+nat(V)*32+nat(V+1)*48+nat(-V1+V)*45+nat(V1-V)*45 - Complexity: n * Chain [56] with precondition: [V=0,V1>=0] - Upper bound: 15*V1+3 - Complexity: n * Chain [55] with precondition: [V1=V,V1>=1] - Upper bound: 0 - Complexity: constant ### Maximum cost of start(V1,V): 57*V1+3+nat(V)*32+nat(V+1)*48+nat(-V1+V)*45+nat(V1-V)*45+(15*V1+3) Asymptotic class: n * Total analysis performed in 2304 ms. ---------------------------------------- (14) BOUNDS(1, n^1) ---------------------------------------- (15) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) Transformed a relative TRS into a decreasing-loop problem. ---------------------------------------- (16) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: -'(z0, 0) -> c -'(s(z0), s(z1)) -> c1(-'(z0, z1)) P(s(z0)) -> c2 F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(s(z0), z1)), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(z1, s(z0))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(z0, s(z1))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(s(z1), z0)), -'(s(z1), z0)) The (relative) TRS S consists of the following rules: -(z0, 0) -> z0 -(s(z0), s(z1)) -> -(z0, z1) p(s(z0)) -> z0 f(s(z0), z1) -> f(p(-(s(z0), z1)), p(-(z1, s(z0)))) f(z0, s(z1)) -> f(p(-(z0, s(z1))), p(-(s(z1), z0))) Rewrite Strategy: INNERMOST ---------------------------------------- (17) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence -'(s(z0), s(z1)) ->^+ c1(-'(z0, z1)) gives rise to a decreasing loop by considering the right hand sides subterm at position [0]. The pumping substitution is [z0 / s(z0), z1 / s(z1)]. The result substitution is [ ]. ---------------------------------------- (18) Complex Obligation (BEST) ---------------------------------------- (19) Obligation: Proved the lower bound n^1 for the following obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: -'(z0, 0) -> c -'(s(z0), s(z1)) -> c1(-'(z0, z1)) P(s(z0)) -> c2 F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(s(z0), z1)), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(z1, s(z0))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(z0, s(z1))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(s(z1), z0)), -'(s(z1), z0)) The (relative) TRS S consists of the following rules: -(z0, 0) -> z0 -(s(z0), s(z1)) -> -(z0, z1) p(s(z0)) -> z0 f(s(z0), z1) -> f(p(-(s(z0), z1)), p(-(z1, s(z0)))) f(z0, s(z1)) -> f(p(-(z0, s(z1))), p(-(s(z1), z0))) Rewrite Strategy: INNERMOST ---------------------------------------- (20) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (21) BOUNDS(n^1, INF) ---------------------------------------- (22) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: -'(z0, 0) -> c -'(s(z0), s(z1)) -> c1(-'(z0, z1)) P(s(z0)) -> c2 F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(s(z0), z1)), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(z1, s(z0))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(z0, s(z1))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(s(z1), z0)), -'(s(z1), z0)) The (relative) TRS S consists of the following rules: -(z0, 0) -> z0 -(s(z0), s(z1)) -> -(z0, z1) p(s(z0)) -> z0 f(s(z0), z1) -> f(p(-(s(z0), z1)), p(-(z1, s(z0)))) f(z0, s(z1)) -> f(p(-(z0, s(z1))), p(-(s(z1), z0))) Rewrite Strategy: INNERMOST