WORST_CASE(Omega(n^1),O(n^2)) proof of input_spvTLqQwvB.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 [ComplexityIfPolyImplication, 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, 286 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), 12 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 433 ms] (30) BEST (31) proven lower bound (32) LowerBoundPropagationProof [FINISHED, 0 ms] (33) BOUNDS(n^1, INF) (34) typed CpxTrs (35) RewriteLemmaProof [LOWER BOUND(ID), 86 ms] (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: lt(0, s(x)) -> true lt(x, 0) -> false lt(s(x), s(y)) -> lt(x, y) fac(x) -> help(x, 0) help(x, c) -> if(lt(c, x), x, c) if(true, x, c) -> times(s(c), help(x, s(c))) if(false, x, c) -> s(0) 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: lt(0, s(z0)) -> true lt(z0, 0) -> false lt(s(z0), s(z1)) -> lt(z0, z1) fac(z0) -> help(z0, 0) help(z0, z1) -> if(lt(z1, z0), z0, z1) if(true, z0, z1) -> times(s(z1), help(z0, s(z1))) if(false, z0, z1) -> s(0) Tuples: LT(0, s(z0)) -> c LT(z0, 0) -> c1 LT(s(z0), s(z1)) -> c2(LT(z0, z1)) FAC(z0) -> c3(HELP(z0, 0)) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) IF(false, z0, z1) -> c6 S tuples: LT(0, s(z0)) -> c LT(z0, 0) -> c1 LT(s(z0), s(z1)) -> c2(LT(z0, z1)) FAC(z0) -> c3(HELP(z0, 0)) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) IF(false, z0, z1) -> c6 K tuples:none Defined Rule Symbols: lt_2, fac_1, help_2, if_3 Defined Pair Symbols: LT_2, FAC_1, HELP_2, IF_3 Compound Symbols: c, c1, c2_1, c3_1, c4_2, c5_1, c6 ---------------------------------------- (3) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: FAC(z0) -> c3(HELP(z0, 0)) Removed 3 trailing nodes: IF(false, z0, z1) -> c6 LT(z0, 0) -> c1 LT(0, s(z0)) -> c ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: lt(0, s(z0)) -> true lt(z0, 0) -> false lt(s(z0), s(z1)) -> lt(z0, z1) fac(z0) -> help(z0, 0) help(z0, z1) -> if(lt(z1, z0), z0, z1) if(true, z0, z1) -> times(s(z1), help(z0, s(z1))) if(false, z0, z1) -> s(0) Tuples: LT(s(z0), s(z1)) -> c2(LT(z0, z1)) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) S tuples: LT(s(z0), s(z1)) -> c2(LT(z0, z1)) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) K tuples:none Defined Rule Symbols: lt_2, fac_1, help_2, if_3 Defined Pair Symbols: LT_2, HELP_2, IF_3 Compound Symbols: c2_1, c4_2, c5_1 ---------------------------------------- (5) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: fac(z0) -> help(z0, 0) help(z0, z1) -> if(lt(z1, z0), z0, z1) if(true, z0, z1) -> times(s(z1), help(z0, s(z1))) if(false, z0, z1) -> s(0) ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: lt(0, s(z0)) -> true lt(z0, 0) -> false lt(s(z0), s(z1)) -> lt(z0, z1) Tuples: LT(s(z0), s(z1)) -> c2(LT(z0, z1)) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) S tuples: LT(s(z0), s(z1)) -> c2(LT(z0, z1)) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) K tuples:none Defined Rule Symbols: lt_2 Defined Pair Symbols: LT_2, HELP_2, IF_3 Compound Symbols: c2_1, c4_2, 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: LT(s(z0), s(z1)) -> c2(LT(z0, z1)) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) The (relative) TRS S consists of the following rules: lt(0, s(z0)) -> true lt(z0, 0) -> false lt(s(z0), s(z1)) -> lt(z0, z1) 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: LT(s(z0), s(z1)) -> c2(LT(z0, z1)) [1] HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) [1] IF(true, z0, z1) -> c5(HELP(z0, s(z1))) [1] lt(0, s(z0)) -> true [0] lt(z0, 0) -> false [0] lt(s(z0), s(z1)) -> lt(z0, z1) [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: LT(s(z0), s(z1)) -> c2(LT(z0, z1)) [1] HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) [1] IF(true, z0, z1) -> c5(HELP(z0, s(z1))) [1] lt(0, s(z0)) -> true [0] lt(z0, 0) -> false [0] lt(s(z0), s(z1)) -> lt(z0, z1) [0] The TRS has the following type information: LT :: s:0 -> s:0 -> c2 s :: s:0 -> s:0 c2 :: c2 -> c2 HELP :: s:0 -> s:0 -> c4 c4 :: c5 -> c2 -> c4 IF :: true:false -> s:0 -> s:0 -> c5 lt :: s:0 -> s:0 -> true:false true :: true:false c5 :: c4 -> 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: lt(v0, v1) -> null_lt [0] LT(v0, v1) -> null_LT [0] IF(v0, v1, v2) -> null_IF [0] And the following fresh constants: null_lt, null_LT, null_IF, 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: LT(s(z0), s(z1)) -> c2(LT(z0, z1)) [1] HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) [1] IF(true, z0, z1) -> c5(HELP(z0, s(z1))) [1] lt(0, s(z0)) -> true [0] lt(z0, 0) -> false [0] lt(s(z0), s(z1)) -> lt(z0, z1) [0] lt(v0, v1) -> null_lt [0] LT(v0, v1) -> null_LT [0] IF(v0, v1, v2) -> null_IF [0] The TRS has the following type information: LT :: s:0 -> s:0 -> c2:null_LT s :: s:0 -> s:0 c2 :: c2:null_LT -> c2:null_LT HELP :: s:0 -> s:0 -> c4 c4 :: c5:null_IF -> c2:null_LT -> c4 IF :: true:false:null_lt -> s:0 -> s:0 -> c5:null_IF lt :: s:0 -> s:0 -> true:false:null_lt true :: true:false:null_lt c5 :: c4 -> c5:null_IF 0 :: s:0 false :: true:false:null_lt null_lt :: true:false:null_lt null_LT :: c2:null_LT null_IF :: c5:null_IF const :: c4 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_lt => 0 null_LT => 0 null_IF => 0 const => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: HELP(z, z') -{ 1 }-> 1 + IF(lt(z1, z0), z0, z1) + LT(z1, z0) :|: z = z0, z1 >= 0, z' = z1, z0 >= 0 IF(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 IF(z, z', z'') -{ 1 }-> 1 + HELP(z0, 1 + z1) :|: z = 2, z1 >= 0, z0 >= 0, z' = z0, z'' = z1 LT(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 LT(z, z') -{ 1 }-> 1 + LT(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 lt(z, z') -{ 0 }-> lt(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 lt(z, z') -{ 0 }-> 2 :|: z0 >= 0, z' = 1 + z0, z = 0 lt(z, z') -{ 0 }-> 1 :|: z = z0, z0 >= 0, z' = 0 lt(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, V6),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V6),0,[fun1(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V6),0,[fun2(V1, V, V6, Out)],[V1 >= 0,V >= 0,V6 >= 0]). eq(start(V1, V, V6),0,[lt(V1, V, Out)],[V1 >= 0,V >= 0]). eq(fun(V1, V, Out),1,[fun(V3, V2, Ret1)],[Out = 1 + Ret1,V2 >= 0,V1 = 1 + V3,V3 >= 0,V = 1 + V2]). eq(fun1(V1, V, Out),1,[lt(V4, V5, Ret010),fun2(Ret010, V5, V4, Ret01),fun(V4, V5, Ret11)],[Out = 1 + Ret01 + Ret11,V1 = V5,V4 >= 0,V = V4,V5 >= 0]). eq(fun2(V1, V, V6, Out),1,[fun1(V8, 1 + V7, Ret12)],[Out = 1 + Ret12,V1 = 2,V7 >= 0,V8 >= 0,V = V8,V6 = V7]). eq(lt(V1, V, Out),0,[],[Out = 2,V9 >= 0,V = 1 + V9,V1 = 0]). eq(lt(V1, V, Out),0,[],[Out = 1,V1 = V10,V10 >= 0,V = 0]). eq(lt(V1, V, Out),0,[lt(V11, V12, Ret)],[Out = Ret,V12 >= 0,V1 = 1 + V11,V11 >= 0,V = 1 + V12]). eq(lt(V1, V, Out),0,[],[Out = 0,V14 >= 0,V13 >= 0,V1 = V14,V = V13]). eq(fun(V1, V, Out),0,[],[Out = 0,V16 >= 0,V15 >= 0,V1 = V16,V = V15]). eq(fun2(V1, V, V6, Out),0,[],[Out = 0,V18 >= 0,V6 = V19,V17 >= 0,V1 = V18,V = V17,V19 >= 0]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,V,Out),[V1,V],[Out]). input_output_vars(fun2(V1,V,V6,Out),[V1,V,V6],[Out]). input_output_vars(lt(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun/3] 1. recursive : [lt/3] 2. recursive [non_tail] : [fun1/3,fun2/4] 3. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/3 1. SCC is partially evaluated into lt/3 2. SCC is partially evaluated into fun1/3 3. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/3 * CE 9 is refined into CE [14] * CE 8 is refined into CE [15] ### Cost equations --> "Loop" of fun/3 * CEs [15] --> Loop 10 * CEs [14] --> Loop 11 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [10]: [V,V1] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [10]: - RF of loop [10:1]: V V1 ### Specialization of cost equations lt/3 * CE 13 is refined into CE [16] * CE 11 is refined into CE [17] * CE 10 is refined into CE [18] * CE 12 is refined into CE [19] ### Cost equations --> "Loop" of lt/3 * CEs [19] --> Loop 12 * CEs [16] --> Loop 13 * CEs [17] --> Loop 14 * CEs [18] --> Loop 15 ### Ranking functions of CR lt(V1,V,Out) * RF of phase [12]: [V,V1] #### Partial ranking functions of CR lt(V1,V,Out) * Partial RF of phase [12]: - RF of loop [12:1]: V V1 ### Specialization of cost equations fun1/3 * CE 7 is refined into CE [20,21,22] * CE 6 is refined into CE [23,24,25,26,27,28,29,30] ### Cost equations --> "Loop" of fun1/3 * CEs [30] --> Loop 16 * CEs [26,28] --> Loop 17 * CEs [23] --> Loop 18 * CEs [24,25,27,29] --> Loop 19 * CEs [21] --> Loop 20 * CEs [22] --> Loop 21 * CEs [20] --> Loop 22 ### Ranking functions of CR fun1(V1,V,Out) * RF of phase [20,21]: [V1-V] #### Partial ranking functions of CR fun1(V1,V,Out) * Partial RF of phase [20,21]: - RF of loop [20:1,21:1]: V1-V ### Specialization of cost equations start/3 * CE 1 is refined into CE [31] * CE 2 is refined into CE [32,33,34] * CE 3 is refined into CE [35,36] * CE 4 is refined into CE [37,38,39,40,41,42] * CE 5 is refined into CE [43,44,45,46,47] ### Cost equations --> "Loop" of start/3 * CEs [38,39,40,44] --> Loop 23 * CEs [32,33,34] --> Loop 24 * CEs [31,35,36,37,41,42,43,45,46,47] --> Loop 25 ### Ranking functions of CR start(V1,V,V6) #### Partial ranking functions of CR start(V1,V,V6) Computing Bounds ===================================== #### Cost of chains of fun(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 lt(V1,V,Out): * Chain [[12],15]: 0 with precondition: [Out=2,V1>=1,V>=V1+1] * Chain [[12],14]: 0 with precondition: [Out=1,V>=1,V1>=V] * Chain [[12],13]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [15]: 0 with precondition: [V1=0,Out=2,V>=1] * Chain [14]: 0 with precondition: [V=0,Out=1,V1>=0] * Chain [13]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun1(V1,V,Out): * Chain [[20,21],19]: 4*it(20)+1*s(3)+1 Such that:aux(1) =< V1 aux(4) =< V1-V it(20) =< aux(4) s(3) =< it(20)*aux(1) with precondition: [V>=1,Out>=3,V1>=V+1] * Chain [[20,21],17]: 4*it(20)+1*s(3)+2*s(4)+1 Such that:aux(5) =< V1 aux(6) =< V1-V s(4) =< aux(5) it(20) =< aux(6) s(3) =< it(20)*aux(5) with precondition: [V>=1,Out>=4,V1>=V+1] * Chain [[20,21],16]: 4*it(20)+1*s(3)+1*s(6)+1 Such that:aux(7) =< V1 aux(8) =< V1-V s(6) =< aux(7) it(20) =< aux(8) s(3) =< it(20)*aux(7) with precondition: [V>=1,Out>=4,V1>=V+2] * Chain [22,[20,21],19]: 4*it(20)+1*s(3)+3 Such that:aux(9) =< V1 it(20) =< aux(9) s(3) =< it(20)*aux(9) with precondition: [V=0,V1>=2,Out>=5] * Chain [22,[20,21],17]: 6*it(20)+1*s(3)+3 Such that:aux(10) =< V1 it(20) =< aux(10) s(3) =< it(20)*aux(10) with precondition: [V=0,V1>=2,Out>=6] * Chain [22,[20,21],16]: 5*it(20)+1*s(3)+3 Such that:aux(11) =< V1 it(20) =< aux(11) s(3) =< it(20)*aux(11) with precondition: [V=0,V1>=3,Out>=6] * Chain [22,19]: 3 with precondition: [V=0,Out=3,V1>=1] * Chain [22,17]: 1*s(4)+1*s(5)+3 Such that:s(4) =< 1 s(5) =< V1 with precondition: [V=0,Out=4,V1>=1] * Chain [22,16]: 1*s(6)+3 Such that:s(6) =< 1 with precondition: [V=0,Out=4,V1>=2] * Chain [19]: 1 with precondition: [Out=1,V1>=0,V>=0] * Chain [18]: 1 with precondition: [V=0,Out=1,V1>=1] * Chain [17]: 1*s(4)+1*s(5)+1 Such that:s(5) =< V1 s(4) =< V with precondition: [Out>=2,V1+1>=Out,V+1>=Out] * Chain [16]: 1*s(6)+1 Such that:s(6) =< V with precondition: [Out>=2,V1>=V+1,V+1>=Out] #### Cost of chains of start(V1,V,V6): * Chain [25]: 3*s(36)+4*s(39)+12*s(40)+3*s(41)+1 Such that:s(38) =< V1-V aux(17) =< V1 aux(18) =< V s(39) =< aux(17) s(36) =< aux(18) s(40) =< s(38) s(41) =< s(40)*aux(17) with precondition: [V1>=0,V>=0] * Chain [24]: 4*s(47)+12*s(48)+3*s(49)+2*s(52)+2 Such that:s(46) =< V-V6 s(51) =< V6+1 aux(19) =< V s(47) =< aux(19) s(48) =< s(46) s(49) =< s(48)*aux(19) s(52) =< s(51) with precondition: [V1=2,V>=0,V6>=0] * Chain [23]: 16*s(53)+2*s(55)+3*s(58)+3 Such that:s(54) =< 1 aux(20) =< V1 s(53) =< aux(20) s(55) =< s(54) s(58) =< s(53)*aux(20) with precondition: [V=0,V1>=0] Closed-form bounds of start(V1,V,V6): ------------------------------------- * Chain [25] with precondition: [V1>=0,V>=0] - Upper bound: 4*V1+1+3*V1*nat(V1-V)+3*V+nat(V1-V)*12 - Complexity: n^2 * Chain [24] with precondition: [V1=2,V>=0,V6>=0] - Upper bound: 4*V+2+3*V*nat(V-V6)+(2*V6+2)+nat(V-V6)*12 - Complexity: n^2 * Chain [23] with precondition: [V=0,V1>=0] - Upper bound: 16*V1+5+3*V1*V1 - Complexity: n^2 ### Maximum cost of start(V1,V,V6): max([4*V1+max([12*V1+4+3*V1*V1,3*V1*nat(V1-V)+3*V+nat(V1-V)*12]),4*V+1+3*V*nat(V-V6)+nat(V6+1)*2+nat(V-V6)*12])+1 Asymptotic class: n^2 * Total analysis performed in 306 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: lt(0, s(z0)) -> true lt(z0, 0) -> false lt(s(z0), s(z1)) -> lt(z0, z1) fac(z0) -> help(z0, 0) help(z0, z1) -> if(lt(z1, z0), z0, z1) if(true, z0, z1) -> times(s(z1), help(z0, s(z1))) if(false, z0, z1) -> s(0) Tuples: LT(0, s(z0)) -> c LT(z0, 0) -> c1 LT(s(z0), s(z1)) -> c2(LT(z0, z1)) FAC(z0) -> c3(HELP(z0, 0)) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) IF(false, z0, z1) -> c6 S tuples: LT(0, s(z0)) -> c LT(z0, 0) -> c1 LT(s(z0), s(z1)) -> c2(LT(z0, z1)) FAC(z0) -> c3(HELP(z0, 0)) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) IF(false, z0, z1) -> c6 K tuples:none Defined Rule Symbols: lt_2, fac_1, help_2, if_3 Defined Pair Symbols: LT_2, FAC_1, HELP_2, IF_3 Compound Symbols: c, c1, c2_1, c3_1, c4_2, c5_1, c6 ---------------------------------------- (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: LT(0, s(z0)) -> c LT(z0, 0) -> c1 LT(s(z0), s(z1)) -> c2(LT(z0, z1)) FAC(z0) -> c3(HELP(z0, 0)) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) IF(false, z0, z1) -> c6 The (relative) TRS S consists of the following rules: lt(0, s(z0)) -> true lt(z0, 0) -> false lt(s(z0), s(z1)) -> lt(z0, z1) fac(z0) -> help(z0, 0) help(z0, z1) -> if(lt(z1, z0), z0, z1) if(true, z0, z1) -> times(s(z1), help(z0, s(z1))) if(false, z0, z1) -> s(0) 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: LT(0', s(z0)) -> c LT(z0, 0') -> c1 LT(s(z0), s(z1)) -> c2(LT(z0, z1)) FAC(z0) -> c3(HELP(z0, 0')) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) IF(false, z0, z1) -> c6 The (relative) TRS S consists of the following rules: lt(0', s(z0)) -> true lt(z0, 0') -> false lt(s(z0), s(z1)) -> lt(z0, z1) fac(z0) -> help(z0, 0') help(z0, z1) -> if(lt(z1, z0), z0, z1) if(true, z0, z1) -> times(s(z1), help(z0, s(z1))) if(false, z0, z1) -> s(0') Rewrite Strategy: INNERMOST ---------------------------------------- (25) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (26) Obligation: Innermost TRS: Rules: LT(0', s(z0)) -> c LT(z0, 0') -> c1 LT(s(z0), s(z1)) -> c2(LT(z0, z1)) FAC(z0) -> c3(HELP(z0, 0')) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) IF(false, z0, z1) -> c6 lt(0', s(z0)) -> true lt(z0, 0') -> false lt(s(z0), s(z1)) -> lt(z0, z1) fac(z0) -> help(z0, 0') help(z0, z1) -> if(lt(z1, z0), z0, z1) if(true, z0, z1) -> times(s(z1), help(z0, s(z1))) if(false, z0, z1) -> s(0') Types: LT :: 0':s:times -> 0':s:times -> c:c1:c2 0' :: 0':s:times s :: 0':s:times -> 0':s:times c :: c:c1:c2 c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 FAC :: 0':s:times -> c3 c3 :: c4 -> c3 HELP :: 0':s:times -> 0':s:times -> c4 c4 :: c5:c6 -> c:c1:c2 -> c4 IF :: true:false -> 0':s:times -> 0':s:times -> c5:c6 lt :: 0':s:times -> 0':s:times -> true:false true :: true:false c5 :: c4 -> c5:c6 false :: true:false c6 :: c5:c6 fac :: 0':s:times -> 0':s:times help :: 0':s:times -> 0':s:times -> 0':s:times if :: true:false -> 0':s:times -> 0':s:times -> 0':s:times times :: 0':s:times -> 0':s:times -> 0':s:times hole_c:c1:c21_7 :: c:c1:c2 hole_0':s:times2_7 :: 0':s:times hole_c33_7 :: c3 hole_c44_7 :: c4 hole_c5:c65_7 :: c5:c6 hole_true:false6_7 :: true:false gen_c:c1:c27_7 :: Nat -> c:c1:c2 gen_0':s:times8_7 :: Nat -> 0':s:times ---------------------------------------- (27) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: LT, HELP, lt, help They will be analysed ascendingly in the following order: LT < HELP lt < HELP lt < help ---------------------------------------- (28) Obligation: Innermost TRS: Rules: LT(0', s(z0)) -> c LT(z0, 0') -> c1 LT(s(z0), s(z1)) -> c2(LT(z0, z1)) FAC(z0) -> c3(HELP(z0, 0')) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) IF(false, z0, z1) -> c6 lt(0', s(z0)) -> true lt(z0, 0') -> false lt(s(z0), s(z1)) -> lt(z0, z1) fac(z0) -> help(z0, 0') help(z0, z1) -> if(lt(z1, z0), z0, z1) if(true, z0, z1) -> times(s(z1), help(z0, s(z1))) if(false, z0, z1) -> s(0') Types: LT :: 0':s:times -> 0':s:times -> c:c1:c2 0' :: 0':s:times s :: 0':s:times -> 0':s:times c :: c:c1:c2 c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 FAC :: 0':s:times -> c3 c3 :: c4 -> c3 HELP :: 0':s:times -> 0':s:times -> c4 c4 :: c5:c6 -> c:c1:c2 -> c4 IF :: true:false -> 0':s:times -> 0':s:times -> c5:c6 lt :: 0':s:times -> 0':s:times -> true:false true :: true:false c5 :: c4 -> c5:c6 false :: true:false c6 :: c5:c6 fac :: 0':s:times -> 0':s:times help :: 0':s:times -> 0':s:times -> 0':s:times if :: true:false -> 0':s:times -> 0':s:times -> 0':s:times times :: 0':s:times -> 0':s:times -> 0':s:times hole_c:c1:c21_7 :: c:c1:c2 hole_0':s:times2_7 :: 0':s:times hole_c33_7 :: c3 hole_c44_7 :: c4 hole_c5:c65_7 :: c5:c6 hole_true:false6_7 :: true:false gen_c:c1:c27_7 :: Nat -> c:c1:c2 gen_0':s:times8_7 :: Nat -> 0':s:times Generator Equations: gen_c:c1:c27_7(0) <=> c gen_c:c1:c27_7(+(x, 1)) <=> c2(gen_c:c1:c27_7(x)) gen_0':s:times8_7(0) <=> 0' gen_0':s:times8_7(+(x, 1)) <=> s(gen_0':s:times8_7(x)) The following defined symbols remain to be analysed: LT, HELP, lt, help They will be analysed ascendingly in the following order: LT < HELP lt < HELP lt < help ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: LT(gen_0':s:times8_7(n10_7), gen_0':s:times8_7(+(1, n10_7))) -> gen_c:c1:c27_7(n10_7), rt in Omega(1 + n10_7) Induction Base: LT(gen_0':s:times8_7(0), gen_0':s:times8_7(+(1, 0))) ->_R^Omega(1) c Induction Step: LT(gen_0':s:times8_7(+(n10_7, 1)), gen_0':s:times8_7(+(1, +(n10_7, 1)))) ->_R^Omega(1) c2(LT(gen_0':s:times8_7(n10_7), gen_0':s:times8_7(+(1, n10_7)))) ->_IH c2(gen_c:c1:c27_7(c11_7)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (30) Complex Obligation (BEST) ---------------------------------------- (31) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: LT(0', s(z0)) -> c LT(z0, 0') -> c1 LT(s(z0), s(z1)) -> c2(LT(z0, z1)) FAC(z0) -> c3(HELP(z0, 0')) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) IF(false, z0, z1) -> c6 lt(0', s(z0)) -> true lt(z0, 0') -> false lt(s(z0), s(z1)) -> lt(z0, z1) fac(z0) -> help(z0, 0') help(z0, z1) -> if(lt(z1, z0), z0, z1) if(true, z0, z1) -> times(s(z1), help(z0, s(z1))) if(false, z0, z1) -> s(0') Types: LT :: 0':s:times -> 0':s:times -> c:c1:c2 0' :: 0':s:times s :: 0':s:times -> 0':s:times c :: c:c1:c2 c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 FAC :: 0':s:times -> c3 c3 :: c4 -> c3 HELP :: 0':s:times -> 0':s:times -> c4 c4 :: c5:c6 -> c:c1:c2 -> c4 IF :: true:false -> 0':s:times -> 0':s:times -> c5:c6 lt :: 0':s:times -> 0':s:times -> true:false true :: true:false c5 :: c4 -> c5:c6 false :: true:false c6 :: c5:c6 fac :: 0':s:times -> 0':s:times help :: 0':s:times -> 0':s:times -> 0':s:times if :: true:false -> 0':s:times -> 0':s:times -> 0':s:times times :: 0':s:times -> 0':s:times -> 0':s:times hole_c:c1:c21_7 :: c:c1:c2 hole_0':s:times2_7 :: 0':s:times hole_c33_7 :: c3 hole_c44_7 :: c4 hole_c5:c65_7 :: c5:c6 hole_true:false6_7 :: true:false gen_c:c1:c27_7 :: Nat -> c:c1:c2 gen_0':s:times8_7 :: Nat -> 0':s:times Generator Equations: gen_c:c1:c27_7(0) <=> c gen_c:c1:c27_7(+(x, 1)) <=> c2(gen_c:c1:c27_7(x)) gen_0':s:times8_7(0) <=> 0' gen_0':s:times8_7(+(x, 1)) <=> s(gen_0':s:times8_7(x)) The following defined symbols remain to be analysed: LT, HELP, lt, help They will be analysed ascendingly in the following order: LT < HELP lt < HELP lt < help ---------------------------------------- (32) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (33) BOUNDS(n^1, INF) ---------------------------------------- (34) Obligation: Innermost TRS: Rules: LT(0', s(z0)) -> c LT(z0, 0') -> c1 LT(s(z0), s(z1)) -> c2(LT(z0, z1)) FAC(z0) -> c3(HELP(z0, 0')) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) IF(false, z0, z1) -> c6 lt(0', s(z0)) -> true lt(z0, 0') -> false lt(s(z0), s(z1)) -> lt(z0, z1) fac(z0) -> help(z0, 0') help(z0, z1) -> if(lt(z1, z0), z0, z1) if(true, z0, z1) -> times(s(z1), help(z0, s(z1))) if(false, z0, z1) -> s(0') Types: LT :: 0':s:times -> 0':s:times -> c:c1:c2 0' :: 0':s:times s :: 0':s:times -> 0':s:times c :: c:c1:c2 c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 FAC :: 0':s:times -> c3 c3 :: c4 -> c3 HELP :: 0':s:times -> 0':s:times -> c4 c4 :: c5:c6 -> c:c1:c2 -> c4 IF :: true:false -> 0':s:times -> 0':s:times -> c5:c6 lt :: 0':s:times -> 0':s:times -> true:false true :: true:false c5 :: c4 -> c5:c6 false :: true:false c6 :: c5:c6 fac :: 0':s:times -> 0':s:times help :: 0':s:times -> 0':s:times -> 0':s:times if :: true:false -> 0':s:times -> 0':s:times -> 0':s:times times :: 0':s:times -> 0':s:times -> 0':s:times hole_c:c1:c21_7 :: c:c1:c2 hole_0':s:times2_7 :: 0':s:times hole_c33_7 :: c3 hole_c44_7 :: c4 hole_c5:c65_7 :: c5:c6 hole_true:false6_7 :: true:false gen_c:c1:c27_7 :: Nat -> c:c1:c2 gen_0':s:times8_7 :: Nat -> 0':s:times Lemmas: LT(gen_0':s:times8_7(n10_7), gen_0':s:times8_7(+(1, n10_7))) -> gen_c:c1:c27_7(n10_7), rt in Omega(1 + n10_7) Generator Equations: gen_c:c1:c27_7(0) <=> c gen_c:c1:c27_7(+(x, 1)) <=> c2(gen_c:c1:c27_7(x)) gen_0':s:times8_7(0) <=> 0' gen_0':s:times8_7(+(x, 1)) <=> s(gen_0':s:times8_7(x)) The following defined symbols remain to be analysed: lt, HELP, help They will be analysed ascendingly in the following order: lt < HELP lt < help ---------------------------------------- (35) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: lt(gen_0':s:times8_7(n517_7), gen_0':s:times8_7(+(1, n517_7))) -> true, rt in Omega(0) Induction Base: lt(gen_0':s:times8_7(0), gen_0':s:times8_7(+(1, 0))) ->_R^Omega(0) true Induction Step: lt(gen_0':s:times8_7(+(n517_7, 1)), gen_0':s:times8_7(+(1, +(n517_7, 1)))) ->_R^Omega(0) lt(gen_0':s:times8_7(n517_7), gen_0':s:times8_7(+(1, n517_7))) ->_IH true We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (36) Obligation: Innermost TRS: Rules: LT(0', s(z0)) -> c LT(z0, 0') -> c1 LT(s(z0), s(z1)) -> c2(LT(z0, z1)) FAC(z0) -> c3(HELP(z0, 0')) HELP(z0, z1) -> c4(IF(lt(z1, z0), z0, z1), LT(z1, z0)) IF(true, z0, z1) -> c5(HELP(z0, s(z1))) IF(false, z0, z1) -> c6 lt(0', s(z0)) -> true lt(z0, 0') -> false lt(s(z0), s(z1)) -> lt(z0, z1) fac(z0) -> help(z0, 0') help(z0, z1) -> if(lt(z1, z0), z0, z1) if(true, z0, z1) -> times(s(z1), help(z0, s(z1))) if(false, z0, z1) -> s(0') Types: LT :: 0':s:times -> 0':s:times -> c:c1:c2 0' :: 0':s:times s :: 0':s:times -> 0':s:times c :: c:c1:c2 c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 FAC :: 0':s:times -> c3 c3 :: c4 -> c3 HELP :: 0':s:times -> 0':s:times -> c4 c4 :: c5:c6 -> c:c1:c2 -> c4 IF :: true:false -> 0':s:times -> 0':s:times -> c5:c6 lt :: 0':s:times -> 0':s:times -> true:false true :: true:false c5 :: c4 -> c5:c6 false :: true:false c6 :: c5:c6 fac :: 0':s:times -> 0':s:times help :: 0':s:times -> 0':s:times -> 0':s:times if :: true:false -> 0':s:times -> 0':s:times -> 0':s:times times :: 0':s:times -> 0':s:times -> 0':s:times hole_c:c1:c21_7 :: c:c1:c2 hole_0':s:times2_7 :: 0':s:times hole_c33_7 :: c3 hole_c44_7 :: c4 hole_c5:c65_7 :: c5:c6 hole_true:false6_7 :: true:false gen_c:c1:c27_7 :: Nat -> c:c1:c2 gen_0':s:times8_7 :: Nat -> 0':s:times Lemmas: LT(gen_0':s:times8_7(n10_7), gen_0':s:times8_7(+(1, n10_7))) -> gen_c:c1:c27_7(n10_7), rt in Omega(1 + n10_7) lt(gen_0':s:times8_7(n517_7), gen_0':s:times8_7(+(1, n517_7))) -> true, rt in Omega(0) Generator Equations: gen_c:c1:c27_7(0) <=> c gen_c:c1:c27_7(+(x, 1)) <=> c2(gen_c:c1:c27_7(x)) gen_0':s:times8_7(0) <=> 0' gen_0':s:times8_7(+(x, 1)) <=> s(gen_0':s:times8_7(x)) The following defined symbols remain to be analysed: HELP, help