WORST_CASE(Omega(n^1),O(n^2)) proof of input_EYLyKM8P1u.trs # AProVE Commit ID: aff8ecad908e01718a4c36e68d2e55d5e0f16e15 fuhs 20220216 unpublished The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). (0) CpxTRS (1) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (2) CdtProblem (3) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CdtProblem (5) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CdtProblem (7) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxRelTRS (9) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxWeightedTrs (11) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTypedWeightedTrs (13) CompletionProof [UPPER BOUND(ID), 0 ms] (14) CpxTypedWeightedCompleteTrs (15) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (16) CpxRNTS (17) CompleteCoflocoProof [FINISHED, 305 ms] (18) BOUNDS(1, n^2) (19) CpxTrsToCdtProof [BOTH BOUNDS(ID, ID), 0 ms] (20) CdtProblem (21) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (22) CpxRelTRS (23) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (24) CpxRelTRS (25) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (26) typed CpxTrs (27) OrderProof [LOWER BOUND(ID), 9 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 315 ms] (30) typed CpxTrs (31) RewriteLemmaProof [LOWER BOUND(ID), 83 ms] (32) BEST (33) proven lower bound (34) LowerBoundPropagationProof [FINISHED, 0 ms] (35) BOUNDS(n^1, INF) (36) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: minus(x, y) -> cond(ge(x, s(y)), x, y) cond(false, x, y) -> 0 cond(true, x, y) -> s(minus(x, s(y))) ge(u, 0) -> true ge(0, s(v)) -> false ge(s(u), s(v)) -> ge(u, v) S is empty. Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (1) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (2) Obligation: Complexity Dependency Tuples Problem Rules: minus(z0, z1) -> cond(ge(z0, s(z1)), z0, z1) cond(false, z0, z1) -> 0 cond(true, z0, z1) -> s(minus(z0, s(z1))) ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Tuples: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(z0, 0) -> c3 GE(0, s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) S tuples: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(z0, 0) -> c3 GE(0, s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) K tuples:none Defined Rule Symbols: minus_2, cond_3, ge_2 Defined Pair Symbols: MINUS_2, COND_3, GE_2 Compound Symbols: c_2, c1, c2_1, c3, c4, c5_1 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 3 trailing nodes: GE(0, s(z0)) -> c4 COND(false, z0, z1) -> c1 GE(z0, 0) -> c3 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: minus(z0, z1) -> cond(ge(z0, s(z1)), z0, z1) cond(false, z0, z1) -> 0 cond(true, z0, z1) -> s(minus(z0, s(z1))) ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Tuples: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(s(z0), s(z1)) -> c5(GE(z0, z1)) S tuples: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(s(z0), s(z1)) -> c5(GE(z0, z1)) K tuples:none Defined Rule Symbols: minus_2, cond_3, ge_2 Defined Pair Symbols: MINUS_2, COND_3, GE_2 Compound Symbols: c_2, c2_1, c5_1 ---------------------------------------- (5) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: minus(z0, z1) -> cond(ge(z0, s(z1)), z0, z1) cond(false, z0, z1) -> 0 cond(true, z0, z1) -> s(minus(z0, s(z1))) ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) ge(z0, 0) -> true Tuples: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(s(z0), s(z1)) -> c5(GE(z0, z1)) S tuples: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(s(z0), s(z1)) -> c5(GE(z0, z1)) K tuples:none Defined Rule Symbols: ge_2 Defined Pair Symbols: MINUS_2, COND_3, GE_2 Compound Symbols: c_2, c2_1, c5_1 ---------------------------------------- (7) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (8) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(s(z0), s(z1)) -> c5(GE(z0, z1)) The (relative) TRS S consists of the following rules: ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) ge(z0, 0) -> true Rewrite Strategy: INNERMOST ---------------------------------------- (9) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (10) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) [1] COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) [1] GE(s(z0), s(z1)) -> c5(GE(z0, z1)) [1] ge(0, s(z0)) -> false [0] ge(s(z0), s(z1)) -> ge(z0, z1) [0] ge(z0, 0) -> true [0] Rewrite Strategy: INNERMOST ---------------------------------------- (11) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (12) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) [1] COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) [1] GE(s(z0), s(z1)) -> c5(GE(z0, z1)) [1] ge(0, s(z0)) -> false [0] ge(s(z0), s(z1)) -> ge(z0, z1) [0] ge(z0, 0) -> true [0] The TRS has the following type information: MINUS :: s:0 -> s:0 -> c c :: c2 -> c5 -> c COND :: true:false -> s:0 -> s:0 -> c2 ge :: s:0 -> s:0 -> true:false s :: s:0 -> s:0 GE :: s:0 -> s:0 -> c5 true :: true:false c2 :: c -> c2 c5 :: c5 -> c5 0 :: s:0 false :: true:false Rewrite Strategy: INNERMOST ---------------------------------------- (13) 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: ge(v0, v1) -> null_ge [0] COND(v0, v1, v2) -> null_COND [0] GE(v0, v1) -> null_GE [0] And the following fresh constants: null_ge, null_COND, null_GE, const ---------------------------------------- (14) 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: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) [1] COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) [1] GE(s(z0), s(z1)) -> c5(GE(z0, z1)) [1] ge(0, s(z0)) -> false [0] ge(s(z0), s(z1)) -> ge(z0, z1) [0] ge(z0, 0) -> true [0] ge(v0, v1) -> null_ge [0] COND(v0, v1, v2) -> null_COND [0] GE(v0, v1) -> null_GE [0] The TRS has the following type information: MINUS :: s:0 -> s:0 -> c c :: c2:null_COND -> c5:null_GE -> c COND :: true:false:null_ge -> s:0 -> s:0 -> c2:null_COND ge :: s:0 -> s:0 -> true:false:null_ge s :: s:0 -> s:0 GE :: s:0 -> s:0 -> c5:null_GE true :: true:false:null_ge c2 :: c -> c2:null_COND c5 :: c5:null_GE -> c5:null_GE 0 :: s:0 false :: true:false:null_ge null_ge :: true:false:null_ge null_COND :: c2:null_COND null_GE :: c5:null_GE const :: c Rewrite Strategy: INNERMOST ---------------------------------------- (15) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: true => 2 0 => 0 false => 1 null_ge => 0 null_COND => 0 null_GE => 0 const => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: COND(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 COND(z, z', z'') -{ 1 }-> 1 + MINUS(z0, 1 + z1) :|: z = 2, z1 >= 0, z0 >= 0, z' = z0, z'' = z1 GE(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 GE(z, z') -{ 1 }-> 1 + GE(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 MINUS(z, z') -{ 1 }-> 1 + COND(ge(z0, 1 + z1), z0, z1) + GE(z0, 1 + z1) :|: z = z0, z1 >= 0, z' = z1, z0 >= 0 ge(z, z') -{ 0 }-> ge(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 ge(z, z') -{ 0 }-> 2 :|: z = z0, z0 >= 0, z' = 0 ge(z, z') -{ 0 }-> 1 :|: z0 >= 0, z' = 1 + z0, z = 0 ge(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (17) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V, V4),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[fun1(V1, V, V4, Out)],[V1 >= 0,V >= 0,V4 >= 0]). eq(start(V1, V, V4),0,[fun2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[ge(V1, V, Out)],[V1 >= 0,V >= 0]). eq(fun(V1, V, Out),1,[ge(V3, 1 + V2, Ret010),fun1(Ret010, V3, V2, Ret01),fun2(V3, 1 + V2, Ret1)],[Out = 1 + Ret01 + Ret1,V1 = V3,V2 >= 0,V = V2,V3 >= 0]). eq(fun1(V1, V, V4, Out),1,[fun(V6, 1 + V5, Ret11)],[Out = 1 + Ret11,V1 = 2,V5 >= 0,V6 >= 0,V = V6,V4 = V5]). eq(fun2(V1, V, Out),1,[fun2(V8, V7, Ret12)],[Out = 1 + Ret12,V7 >= 0,V1 = 1 + V8,V8 >= 0,V = 1 + V7]). eq(ge(V1, V, Out),0,[],[Out = 1,V9 >= 0,V = 1 + V9,V1 = 0]). eq(ge(V1, V, Out),0,[ge(V10, V11, Ret)],[Out = Ret,V11 >= 0,V1 = 1 + V10,V10 >= 0,V = 1 + V11]). eq(ge(V1, V, Out),0,[],[Out = 2,V1 = V12,V12 >= 0,V = 0]). eq(ge(V1, V, Out),0,[],[Out = 0,V14 >= 0,V13 >= 0,V1 = V14,V = V13]). eq(fun1(V1, V, V4, Out),0,[],[Out = 0,V16 >= 0,V4 = V17,V15 >= 0,V1 = V16,V = V15,V17 >= 0]). eq(fun2(V1, V, Out),0,[],[Out = 0,V19 >= 0,V18 >= 0,V1 = V19,V = V18]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,V,V4,Out),[V1,V,V4],[Out]). input_output_vars(fun2(V1,V,Out),[V1,V],[Out]). input_output_vars(ge(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun2/3] 1. recursive : [ge/3] 2. recursive [non_tail] : [fun/3,fun1/4] 3. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun2/3 1. SCC is partially evaluated into ge/3 2. SCC is partially evaluated into fun/3 3. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun2/3 * CE 9 is refined into CE [14] * CE 8 is refined into CE [15] ### Cost equations --> "Loop" of fun2/3 * CEs [15] --> Loop 10 * CEs [14] --> Loop 11 ### Ranking functions of CR fun2(V1,V,Out) * RF of phase [10]: [V,V1] #### Partial ranking functions of CR fun2(V1,V,Out) * Partial RF of phase [10]: - RF of loop [10:1]: V V1 ### Specialization of cost equations ge/3 * CE 13 is refined into CE [16] * CE 12 is refined into CE [17] * CE 10 is refined into CE [18] * CE 11 is refined into CE [19] ### Cost equations --> "Loop" of ge/3 * CEs [19] --> Loop 12 * CEs [16] --> Loop 13 * CEs [17] --> Loop 14 * CEs [18] --> Loop 15 ### Ranking functions of CR ge(V1,V,Out) * RF of phase [12]: [V,V1] #### Partial ranking functions of CR ge(V1,V,Out) * Partial RF of phase [12]: - RF of loop [12:1]: V V1 ### Specialization of cost equations fun/3 * CE 7 is refined into CE [20,21] * CE 6 is refined into CE [22,23,24,25,26,27,28] ### Cost equations --> "Loop" of fun/3 * CEs [28] --> Loop 16 * CEs [24,26] --> Loop 17 * CEs [22,23,25,27] --> Loop 18 * CEs [21] --> Loop 19 * CEs [20] --> Loop 20 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [19,20]: [V1-V] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [19,20]: - RF of loop [19:1,20:1]: V1-V ### Specialization of cost equations start/3 * CE 1 is refined into CE [29] * CE 2 is refined into CE [30,31,32] * CE 3 is refined into CE [33,34,35] * CE 4 is refined into CE [36,37] * CE 5 is refined into CE [38,39,40,41,42] ### Cost equations --> "Loop" of start/3 * CEs [39] --> Loop 21 * CEs [30,31,32] --> Loop 22 * CEs [29,33,34,35,36,37,38,40,41,42] --> Loop 23 ### Ranking functions of CR start(V1,V,V4) #### Partial ranking functions of CR start(V1,V,V4) Computing Bounds ===================================== #### Cost of chains of fun2(V1,V,Out): * Chain [[10],11]: 1*it(10)+0 Such that:it(10) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [11]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of ge(V1,V,Out): * Chain [[12],15]: 0 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [[12],14]: 0 with precondition: [Out=2,V>=1,V1>=V] * Chain [[12],13]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [15]: 0 with precondition: [V1=0,Out=1,V>=1] * Chain [14]: 0 with precondition: [V=0,Out=2,V1>=0] * Chain [13]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun(V1,V,Out): * Chain [[19,20],18]: 4*it(19)+1*s(3)+1 Such that:aux(1) =< V1 aux(4) =< V1-V it(19) =< aux(4) s(3) =< it(19)*aux(1) with precondition: [V>=0,Out>=3,V1>=V+1] * Chain [[19,20],17]: 4*it(19)+1*s(3)+1*s(4)+1*s(5)+1 Such that:s(4) =< V1+1 aux(5) =< V1 aux(6) =< V1-V s(5) =< aux(5) it(19) =< aux(6) s(3) =< it(19)*aux(5) with precondition: [V>=0,Out>=4,V1>=V+1] * Chain [[19,20],16]: 4*it(19)+1*s(3)+1*s(6)+1 Such that:aux(7) =< V1 aux(8) =< V1-V s(6) =< aux(7) it(19) =< aux(8) s(3) =< it(19)*aux(7) with precondition: [V>=0,Out>=4,V1>=V+2] * Chain [18]: 1 with precondition: [Out=1,V1>=0,V>=0] * Chain [17]: 1*s(4)+1*s(5)+1 Such that:s(5) =< V1 s(4) =< V+1 with precondition: [Out>=2,V1+1>=Out,V+2>=Out] * Chain [16]: 1*s(6)+1 Such that:s(6) =< V+1 with precondition: [Out>=2,V1>=V+1,V+2>=Out] #### Cost of chains of start(V1,V,V4): * Chain [23]: 1*s(25)+3*s(28)+12*s(29)+3*s(30)+2*s(33)+1*s(34)+1 Such that:s(25) =< V1+1 s(27) =< V1-V s(34) =< V s(32) =< V+1 aux(12) =< V1 s(28) =< aux(12) s(29) =< s(27) s(30) =< s(29)*aux(12) s(33) =< s(32) with precondition: [V1>=0,V>=0] * Chain [22]: 1*s(35)+3*s(38)+12*s(39)+3*s(40)+2*s(43)+2 Such that:s(35) =< V+1 s(37) =< V-V4 s(42) =< V4+2 aux(13) =< V s(38) =< aux(13) s(39) =< s(37) s(40) =< s(39)*aux(13) s(43) =< s(42) with precondition: [V1=2,V>=0,V4>=0] * Chain [21]: 0 with precondition: [V=0,V1>=0] Closed-form bounds of start(V1,V,V4): ------------------------------------- * Chain [23] with precondition: [V1>=0,V>=0] - Upper bound: 3*V1+1+3*V1*nat(V1-V)+V+(V1+1)+(2*V+2)+nat(V1-V)*12 - Complexity: n^2 * Chain [22] with precondition: [V1=2,V>=0,V4>=0] - Upper bound: 3*V+2+3*V*nat(V-V4)+(V+1)+(2*V4+4)+nat(V-V4)*12 - Complexity: n^2 * Chain [21] with precondition: [V=0,V1>=0] - Upper bound: 0 - Complexity: constant ### Maximum cost of start(V1,V,V4): 2*V+2+max([2*V+1+3*V*nat(V-V4)+nat(V4+2)*2+nat(V-V4)*12,3*V1*nat(V1-V)+3*V1+(V1+1)+(V+1)+nat(V1-V)*12]) Asymptotic class: n^2 * Total analysis performed in 254 ms. ---------------------------------------- (18) BOUNDS(1, n^2) ---------------------------------------- (19) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (20) Obligation: Complexity Dependency Tuples Problem Rules: minus(z0, z1) -> cond(ge(z0, s(z1)), z0, z1) cond(false, z0, z1) -> 0 cond(true, z0, z1) -> s(minus(z0, s(z1))) ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Tuples: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(z0, 0) -> c3 GE(0, s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) S tuples: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(z0, 0) -> c3 GE(0, s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) K tuples:none Defined Rule Symbols: minus_2, cond_3, ge_2 Defined Pair Symbols: MINUS_2, COND_3, GE_2 Compound Symbols: c_2, c1, c2_1, c3, c4, c5_1 ---------------------------------------- (21) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (22) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(z0, 0) -> c3 GE(0, s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) The (relative) TRS S consists of the following rules: minus(z0, z1) -> cond(ge(z0, s(z1)), z0, z1) cond(false, z0, z1) -> 0 cond(true, z0, z1) -> s(minus(z0, s(z1))) ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Rewrite Strategy: INNERMOST ---------------------------------------- (23) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (24) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) The (relative) TRS S consists of the following rules: minus(z0, z1) -> cond(ge(z0, s(z1)), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, s(z1))) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Rewrite Strategy: INNERMOST ---------------------------------------- (25) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (26) Obligation: Innermost TRS: Rules: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) minus(z0, z1) -> cond(ge(z0, s(z1)), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, s(z1))) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: MINUS :: s:0' -> s:0' -> c c :: c1:c2 -> c3:c4:c5 -> c COND :: false:true -> s:0' -> s:0' -> c1:c2 ge :: s:0' -> s:0' -> false:true s :: s:0' -> s:0' GE :: s:0' -> s:0' -> c3:c4:c5 false :: false:true c1 :: c1:c2 true :: false:true c2 :: c -> c1:c2 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 minus :: s:0' -> s:0' -> s:0' cond :: false:true -> s:0' -> s:0' -> s:0' hole_c1_6 :: c hole_s:0'2_6 :: s:0' hole_c1:c23_6 :: c1:c2 hole_c3:c4:c54_6 :: c3:c4:c5 hole_false:true5_6 :: false:true gen_s:0'6_6 :: Nat -> s:0' gen_c3:c4:c57_6 :: Nat -> c3:c4:c5 ---------------------------------------- (27) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: MINUS, ge, GE, minus They will be analysed ascendingly in the following order: ge < MINUS GE < MINUS ge < minus ---------------------------------------- (28) Obligation: Innermost TRS: Rules: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) minus(z0, z1) -> cond(ge(z0, s(z1)), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, s(z1))) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: MINUS :: s:0' -> s:0' -> c c :: c1:c2 -> c3:c4:c5 -> c COND :: false:true -> s:0' -> s:0' -> c1:c2 ge :: s:0' -> s:0' -> false:true s :: s:0' -> s:0' GE :: s:0' -> s:0' -> c3:c4:c5 false :: false:true c1 :: c1:c2 true :: false:true c2 :: c -> c1:c2 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 minus :: s:0' -> s:0' -> s:0' cond :: false:true -> s:0' -> s:0' -> s:0' hole_c1_6 :: c hole_s:0'2_6 :: s:0' hole_c1:c23_6 :: c1:c2 hole_c3:c4:c54_6 :: c3:c4:c5 hole_false:true5_6 :: false:true gen_s:0'6_6 :: Nat -> s:0' gen_c3:c4:c57_6 :: Nat -> c3:c4:c5 Generator Equations: gen_s:0'6_6(0) <=> 0' gen_s:0'6_6(+(x, 1)) <=> s(gen_s:0'6_6(x)) gen_c3:c4:c57_6(0) <=> c3 gen_c3:c4:c57_6(+(x, 1)) <=> c5(gen_c3:c4:c57_6(x)) The following defined symbols remain to be analysed: ge, MINUS, GE, minus They will be analysed ascendingly in the following order: ge < MINUS GE < MINUS ge < minus ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: ge(gen_s:0'6_6(n9_6), gen_s:0'6_6(n9_6)) -> true, rt in Omega(0) Induction Base: ge(gen_s:0'6_6(0), gen_s:0'6_6(0)) ->_R^Omega(0) true Induction Step: ge(gen_s:0'6_6(+(n9_6, 1)), gen_s:0'6_6(+(n9_6, 1))) ->_R^Omega(0) ge(gen_s:0'6_6(n9_6), gen_s:0'6_6(n9_6)) ->_IH true We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (30) Obligation: Innermost TRS: Rules: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) minus(z0, z1) -> cond(ge(z0, s(z1)), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, s(z1))) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: MINUS :: s:0' -> s:0' -> c c :: c1:c2 -> c3:c4:c5 -> c COND :: false:true -> s:0' -> s:0' -> c1:c2 ge :: s:0' -> s:0' -> false:true s :: s:0' -> s:0' GE :: s:0' -> s:0' -> c3:c4:c5 false :: false:true c1 :: c1:c2 true :: false:true c2 :: c -> c1:c2 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 minus :: s:0' -> s:0' -> s:0' cond :: false:true -> s:0' -> s:0' -> s:0' hole_c1_6 :: c hole_s:0'2_6 :: s:0' hole_c1:c23_6 :: c1:c2 hole_c3:c4:c54_6 :: c3:c4:c5 hole_false:true5_6 :: false:true gen_s:0'6_6 :: Nat -> s:0' gen_c3:c4:c57_6 :: Nat -> c3:c4:c5 Lemmas: ge(gen_s:0'6_6(n9_6), gen_s:0'6_6(n9_6)) -> true, rt in Omega(0) Generator Equations: gen_s:0'6_6(0) <=> 0' gen_s:0'6_6(+(x, 1)) <=> s(gen_s:0'6_6(x)) gen_c3:c4:c57_6(0) <=> c3 gen_c3:c4:c57_6(+(x, 1)) <=> c5(gen_c3:c4:c57_6(x)) The following defined symbols remain to be analysed: GE, MINUS, minus They will be analysed ascendingly in the following order: GE < MINUS ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: GE(gen_s:0'6_6(n289_6), gen_s:0'6_6(n289_6)) -> gen_c3:c4:c57_6(n289_6), rt in Omega(1 + n289_6) Induction Base: GE(gen_s:0'6_6(0), gen_s:0'6_6(0)) ->_R^Omega(1) c3 Induction Step: GE(gen_s:0'6_6(+(n289_6, 1)), gen_s:0'6_6(+(n289_6, 1))) ->_R^Omega(1) c5(GE(gen_s:0'6_6(n289_6), gen_s:0'6_6(n289_6))) ->_IH c5(gen_c3:c4:c57_6(c290_6)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (32) Complex Obligation (BEST) ---------------------------------------- (33) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) minus(z0, z1) -> cond(ge(z0, s(z1)), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, s(z1))) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: MINUS :: s:0' -> s:0' -> c c :: c1:c2 -> c3:c4:c5 -> c COND :: false:true -> s:0' -> s:0' -> c1:c2 ge :: s:0' -> s:0' -> false:true s :: s:0' -> s:0' GE :: s:0' -> s:0' -> c3:c4:c5 false :: false:true c1 :: c1:c2 true :: false:true c2 :: c -> c1:c2 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 minus :: s:0' -> s:0' -> s:0' cond :: false:true -> s:0' -> s:0' -> s:0' hole_c1_6 :: c hole_s:0'2_6 :: s:0' hole_c1:c23_6 :: c1:c2 hole_c3:c4:c54_6 :: c3:c4:c5 hole_false:true5_6 :: false:true gen_s:0'6_6 :: Nat -> s:0' gen_c3:c4:c57_6 :: Nat -> c3:c4:c5 Lemmas: ge(gen_s:0'6_6(n9_6), gen_s:0'6_6(n9_6)) -> true, rt in Omega(0) Generator Equations: gen_s:0'6_6(0) <=> 0' gen_s:0'6_6(+(x, 1)) <=> s(gen_s:0'6_6(x)) gen_c3:c4:c57_6(0) <=> c3 gen_c3:c4:c57_6(+(x, 1)) <=> c5(gen_c3:c4:c57_6(x)) The following defined symbols remain to be analysed: GE, MINUS, minus They will be analysed ascendingly in the following order: GE < MINUS ---------------------------------------- (34) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (35) BOUNDS(n^1, INF) ---------------------------------------- (36) Obligation: Innermost TRS: Rules: MINUS(z0, z1) -> c(COND(ge(z0, s(z1)), z0, z1), GE(z0, s(z1))) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) minus(z0, z1) -> cond(ge(z0, s(z1)), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, s(z1))) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: MINUS :: s:0' -> s:0' -> c c :: c1:c2 -> c3:c4:c5 -> c COND :: false:true -> s:0' -> s:0' -> c1:c2 ge :: s:0' -> s:0' -> false:true s :: s:0' -> s:0' GE :: s:0' -> s:0' -> c3:c4:c5 false :: false:true c1 :: c1:c2 true :: false:true c2 :: c -> c1:c2 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 minus :: s:0' -> s:0' -> s:0' cond :: false:true -> s:0' -> s:0' -> s:0' hole_c1_6 :: c hole_s:0'2_6 :: s:0' hole_c1:c23_6 :: c1:c2 hole_c3:c4:c54_6 :: c3:c4:c5 hole_false:true5_6 :: false:true gen_s:0'6_6 :: Nat -> s:0' gen_c3:c4:c57_6 :: Nat -> c3:c4:c5 Lemmas: ge(gen_s:0'6_6(n9_6), gen_s:0'6_6(n9_6)) -> true, rt in Omega(0) GE(gen_s:0'6_6(n289_6), gen_s:0'6_6(n289_6)) -> gen_c3:c4:c57_6(n289_6), rt in Omega(1 + n289_6) Generator Equations: gen_s:0'6_6(0) <=> 0' gen_s:0'6_6(+(x, 1)) <=> s(gen_s:0'6_6(x)) gen_c3:c4:c57_6(0) <=> c3 gen_c3:c4:c57_6(+(x, 1)) <=> c5(gen_c3:c4:c57_6(x)) The following defined symbols remain to be analysed: MINUS, minus