WORST_CASE(Omega(n^1),O(n^2)) proof of input_dO4Nc3Ny6y.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, 365 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), 21 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 390 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), 83 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: le(0, y) -> true le(s(x), 0) -> false le(s(x), s(y)) -> le(x, y) int(x, y) -> if(le(x, y), x, y) if(true, x, y) -> cons(x, int(s(x), y)) if(false, x, y) -> nil 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: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) int(z0, z1) -> if(le(z0, z1), z0, z1) if(true, z0, z1) -> cons(z0, int(s(z0), z1)) if(false, z0, z1) -> nil Tuples: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) IF(false, z0, z1) -> c5 S tuples: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) IF(false, z0, z1) -> c5 K tuples:none Defined Rule Symbols: le_2, int_2, if_3 Defined Pair Symbols: LE_2, INT_2, IF_3 Compound Symbols: c, c1, c2_1, c3_2, c4_1, c5 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 3 trailing nodes: IF(false, z0, z1) -> c5 LE(0, z0) -> c LE(s(z0), 0) -> c1 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) int(z0, z1) -> if(le(z0, z1), z0, z1) if(true, z0, z1) -> cons(z0, int(s(z0), z1)) if(false, z0, z1) -> nil Tuples: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) S tuples: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) K tuples:none Defined Rule Symbols: le_2, int_2, if_3 Defined Pair Symbols: LE_2, INT_2, IF_3 Compound Symbols: c2_1, c3_2, c4_1 ---------------------------------------- (5) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: int(z0, z1) -> if(le(z0, z1), z0, z1) if(true, z0, z1) -> cons(z0, int(s(z0), z1)) if(false, z0, z1) -> nil ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) Tuples: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) S tuples: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) K tuples:none Defined Rule Symbols: le_2 Defined Pair Symbols: LE_2, INT_2, IF_3 Compound Symbols: c2_1, c3_2, c4_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: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) The (relative) TRS S consists of the following rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(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: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) [1] INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) [1] IF(true, z0, z1) -> c4(INT(s(z0), z1)) [1] le(0, z0) -> true [0] le(s(z0), 0) -> false [0] le(s(z0), s(z1)) -> le(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: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) [1] INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) [1] IF(true, z0, z1) -> c4(INT(s(z0), z1)) [1] le(0, z0) -> true [0] le(s(z0), 0) -> false [0] le(s(z0), s(z1)) -> le(z0, z1) [0] The TRS has the following type information: LE :: s:0 -> s:0 -> c2 s :: s:0 -> s:0 c2 :: c2 -> c2 INT :: s:0 -> s:0 -> c3 c3 :: c4 -> c2 -> c3 IF :: true:false -> s:0 -> s:0 -> c4 le :: s:0 -> s:0 -> true:false true :: true:false c4 :: c3 -> c4 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: le(v0, v1) -> null_le [0] LE(v0, v1) -> null_LE [0] IF(v0, v1, v2) -> null_IF [0] And the following fresh constants: null_le, null_LE, 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: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) [1] INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) [1] IF(true, z0, z1) -> c4(INT(s(z0), z1)) [1] le(0, z0) -> true [0] le(s(z0), 0) -> false [0] le(s(z0), s(z1)) -> le(z0, z1) [0] le(v0, v1) -> null_le [0] LE(v0, v1) -> null_LE [0] IF(v0, v1, v2) -> null_IF [0] The TRS has the following type information: LE :: s:0 -> s:0 -> c2:null_LE s :: s:0 -> s:0 c2 :: c2:null_LE -> c2:null_LE INT :: s:0 -> s:0 -> c3 c3 :: c4:null_IF -> c2:null_LE -> c3 IF :: true:false:null_le -> s:0 -> s:0 -> c4:null_IF le :: s:0 -> s:0 -> true:false:null_le true :: true:false:null_le c4 :: c3 -> c4:null_IF 0 :: s:0 false :: true:false:null_le null_le :: true:false:null_le null_LE :: c2:null_LE null_IF :: c4:null_IF const :: c3 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_le => 0 null_LE => 0 null_IF => 0 const => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: IF(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 IF(z, z', z'') -{ 1 }-> 1 + INT(1 + z0, z1) :|: z = 2, z1 >= 0, z0 >= 0, z' = z0, z'' = z1 INT(z, z') -{ 1 }-> 1 + IF(le(z0, z1), z0, z1) + LE(z0, z1) :|: z = z0, z1 >= 0, z' = z1, z0 >= 0 LE(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 LE(z, z') -{ 1 }-> 1 + LE(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 le(z, z') -{ 0 }-> le(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 le(z, z') -{ 0 }-> 2 :|: z0 >= 0, z = 0, z' = z0 le(z, z') -{ 0 }-> 1 :|: z = 1 + z0, z0 >= 0, z' = 0 le(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,[le(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,[le(V5, V4, Ret010),fun2(Ret010, V5, V4, Ret01),fun(V5, V4, Ret11)],[Out = 1 + Ret01 + Ret11,V1 = V5,V4 >= 0,V = V4,V5 >= 0]). eq(fun2(V1, V, V6, Out),1,[fun1(1 + V8, V7, Ret12)],[Out = 1 + Ret12,V1 = 2,V7 >= 0,V8 >= 0,V = V8,V6 = V7]). eq(le(V1, V, Out),0,[],[Out = 2,V9 >= 0,V1 = 0,V = V9]). eq(le(V1, V, Out),0,[],[Out = 1,V1 = 1 + V10,V10 >= 0,V = 0]). eq(le(V1, V, Out),0,[le(V11, V12, Ret)],[Out = Ret,V12 >= 0,V1 = 1 + V11,V11 >= 0,V = 1 + V12]). eq(le(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(le(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun/3] 1. recursive : [le/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 le/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 le/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 le/3 * CEs [19] --> Loop 12 * CEs [16] --> Loop 13 * CEs [17] --> Loop 14 * CEs [18] --> Loop 15 ### Ranking functions of CR le(V1,V,Out) * RF of phase [12]: [V,V1] #### Partial ranking functions of CR le(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 [28] --> Loop 16 * CEs [26,30] --> Loop 17 * CEs [24] --> Loop 18 * CEs [23,25,27,29] --> Loop 19 * CEs [22] --> Loop 20 * CEs [21] --> Loop 21 * CEs [20] --> Loop 22 ### Ranking functions of CR fun1(V1,V,Out) * RF of phase [20,21]: [-V1+V+1] #### Partial ranking functions of CR fun1(V1,V,Out) * Partial RF of phase [20,21]: - RF of loop [20:1,21:1]: -V1+V+1 ### 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 [44] --> Loop 23 * CEs [32,33,34] --> Loop 24 * CEs [31,35,36,37,38,39,40,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 le(V1,V,Out): * Chain [[12],15]: 0 with precondition: [Out=2,V1>=1,V>=V1] * Chain [[12],14]: 0 with precondition: [Out=1,V>=1,V1>=V+1] * Chain [[12],13]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [15]: 0 with precondition: [V1=0,Out=2,V>=0] * Chain [14]: 0 with precondition: [V=0,Out=1,V1>=1] * 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) =< V+1 aux(4) =< -V1+V+1 it(20) =< aux(4) s(3) =< it(20)*aux(1) with precondition: [V1>=1,Out>=3,V>=V1] * Chain [[20,21],17]: 4*it(20)+1*s(3)+1*s(4)+1*s(5)+1 Such that:s(4) =< V aux(5) =< -V1+V+1 aux(6) =< V+1 s(5) =< aux(6) it(20) =< aux(5) s(3) =< it(20)*aux(6) with precondition: [V1>=1,Out>=4,V>=V1] * Chain [[20,21],16]: 4*it(20)+1*s(3)+1*s(6)+1 Such that:s(6) =< V aux(1) =< V+1 aux(7) =< -V1+V+1 it(20) =< aux(7) s(3) =< it(20)*aux(1) with precondition: [V1>=1,V>=V1,Out+2*V1>=2*V+4] * Chain [22,[20,21],19]: 4*it(20)+1*s(3)+3 Such that:aux(4) =< V aux(1) =< V+1 it(20) =< aux(4) s(3) =< it(20)*aux(1) with precondition: [V1=0,V>=1,Out>=5] * Chain [22,[20,21],17]: 5*it(20)+1*s(3)+1*s(5)+3 Such that:aux(6) =< V+1 aux(8) =< V it(20) =< aux(8) s(5) =< aux(6) s(3) =< it(20)*aux(6) with precondition: [V1=0,V>=1,Out>=6] * Chain [22,[20,21],16]: 5*it(20)+1*s(3)+3 Such that:aux(1) =< V+1 aux(9) =< V it(20) =< aux(9) s(3) =< it(20)*aux(1) with precondition: [V1=0,V>=1,Out>=2*V+4] * Chain [22,19]: 3 with precondition: [V1=0,Out=3,V>=0] * Chain [22,18]: 3 with precondition: [V1=0,V=0,Out=3] * Chain [22,17]: 1*s(4)+1*s(5)+3 Such that:s(5) =< 1 s(4) =< V with precondition: [V1=0,Out=4,V>=1] * 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]: 20*s(38)+1*s(39)+3*s(44)+2*s(45)+12*s(50)+3*s(51)+1*s(53)+3 Such that:s(39) =< 1 s(46) =< -V1+V+1 s(53) =< V1 aux(16) =< V aux(17) =< V+1 s(38) =< aux(16) s(50) =< s(46) s(51) =< s(50)*aux(17) s(45) =< aux(17) s(44) =< s(38)*aux(17) with precondition: [V1>=0,V>=0] * Chain [24]: 4*s(59)+12*s(60)+3*s(61)+1*s(62)+1*s(63)+2 Such that:s(56) =< -V+V6 s(63) =< V+1 s(58) =< V6+1 aux(18) =< V6 s(59) =< aux(18) s(60) =< s(56) s(61) =< s(60)*s(58) s(62) =< s(58) with precondition: [V1=2,V>=0,V6>=0] * Chain [23]: 0 with precondition: [V=0,V1>=1] Closed-form bounds of start(V1,V,V6): ------------------------------------- * Chain [25] with precondition: [V1>=0,V>=0] - Upper bound: V1+20*V+4+(V+1)*(3*V)+(2*V+2)+(3*V+3)*nat(-V1+V+1)+nat(-V1+V+1)*12 - Complexity: n^2 * Chain [24] with precondition: [V1=2,V>=0,V6>=0] - Upper bound: V+5*V6+4+(3*V6+3)*nat(-V+V6)+nat(-V+V6)*12 - Complexity: n^2 * Chain [23] with precondition: [V=0,V1>=1] - Upper bound: 0 - Complexity: constant ### Maximum cost of start(V1,V,V6): V+3+max([nat(V6)*4+nat(V6+1)+nat(V6+1)*3*nat(-V+V6)+nat(-V+V6)*12,V1+20*V+2+(V+1)*(3*V)+(V+1)+(3*V+3)*nat(-V1+V+1)+nat(-V1+V+1)*12]) Asymptotic class: n^2 * Total analysis performed in 315 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: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) int(z0, z1) -> if(le(z0, z1), z0, z1) if(true, z0, z1) -> cons(z0, int(s(z0), z1)) if(false, z0, z1) -> nil Tuples: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) IF(false, z0, z1) -> c5 S tuples: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) IF(false, z0, z1) -> c5 K tuples:none Defined Rule Symbols: le_2, int_2, if_3 Defined Pair Symbols: LE_2, INT_2, IF_3 Compound Symbols: c, c1, c2_1, c3_2, c4_1, c5 ---------------------------------------- (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: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) IF(false, z0, z1) -> c5 The (relative) TRS S consists of the following rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) int(z0, z1) -> if(le(z0, z1), z0, z1) if(true, z0, z1) -> cons(z0, int(s(z0), z1)) if(false, z0, z1) -> nil 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: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) IF(false, z0, z1) -> c5 The (relative) TRS S consists of the following rules: le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) int(z0, z1) -> if(le(z0, z1), z0, z1) if(true, z0, z1) -> cons(z0, int(s(z0), z1)) if(false, z0, z1) -> nil Rewrite Strategy: INNERMOST ---------------------------------------- (25) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (26) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) IF(false, z0, z1) -> c5 le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) int(z0, z1) -> if(le(z0, z1), z0, z1) if(true, z0, z1) -> cons(z0, int(s(z0), z1)) if(false, z0, z1) -> nil Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 INT :: 0':s -> 0':s -> c3 c3 :: c4:c5 -> c:c1:c2 -> c3 IF :: true:false -> 0':s -> 0':s -> c4:c5 le :: 0':s -> 0':s -> true:false true :: true:false c4 :: c3 -> c4:c5 false :: true:false c5 :: c4:c5 int :: 0':s -> 0':s -> cons:nil if :: true:false -> 0':s -> 0':s -> cons:nil cons :: 0':s -> cons:nil -> cons:nil nil :: cons:nil hole_c:c1:c21_6 :: c:c1:c2 hole_0':s2_6 :: 0':s hole_c33_6 :: c3 hole_c4:c54_6 :: c4:c5 hole_true:false5_6 :: true:false hole_cons:nil6_6 :: cons:nil gen_c:c1:c27_6 :: Nat -> c:c1:c2 gen_0':s8_6 :: Nat -> 0':s gen_cons:nil9_6 :: Nat -> cons:nil ---------------------------------------- (27) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: LE, INT, le, int They will be analysed ascendingly in the following order: LE < INT le < INT le < int ---------------------------------------- (28) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) IF(false, z0, z1) -> c5 le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) int(z0, z1) -> if(le(z0, z1), z0, z1) if(true, z0, z1) -> cons(z0, int(s(z0), z1)) if(false, z0, z1) -> nil Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 INT :: 0':s -> 0':s -> c3 c3 :: c4:c5 -> c:c1:c2 -> c3 IF :: true:false -> 0':s -> 0':s -> c4:c5 le :: 0':s -> 0':s -> true:false true :: true:false c4 :: c3 -> c4:c5 false :: true:false c5 :: c4:c5 int :: 0':s -> 0':s -> cons:nil if :: true:false -> 0':s -> 0':s -> cons:nil cons :: 0':s -> cons:nil -> cons:nil nil :: cons:nil hole_c:c1:c21_6 :: c:c1:c2 hole_0':s2_6 :: 0':s hole_c33_6 :: c3 hole_c4:c54_6 :: c4:c5 hole_true:false5_6 :: true:false hole_cons:nil6_6 :: cons:nil gen_c:c1:c27_6 :: Nat -> c:c1:c2 gen_0':s8_6 :: Nat -> 0':s gen_cons:nil9_6 :: Nat -> cons:nil Generator Equations: gen_c:c1:c27_6(0) <=> c gen_c:c1:c27_6(+(x, 1)) <=> c2(gen_c:c1:c27_6(x)) gen_0':s8_6(0) <=> 0' gen_0':s8_6(+(x, 1)) <=> s(gen_0':s8_6(x)) gen_cons:nil9_6(0) <=> nil gen_cons:nil9_6(+(x, 1)) <=> cons(0', gen_cons:nil9_6(x)) The following defined symbols remain to be analysed: LE, INT, le, int They will be analysed ascendingly in the following order: LE < INT le < INT le < int ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: LE(gen_0':s8_6(n11_6), gen_0':s8_6(n11_6)) -> gen_c:c1:c27_6(n11_6), rt in Omega(1 + n11_6) Induction Base: LE(gen_0':s8_6(0), gen_0':s8_6(0)) ->_R^Omega(1) c Induction Step: LE(gen_0':s8_6(+(n11_6, 1)), gen_0':s8_6(+(n11_6, 1))) ->_R^Omega(1) c2(LE(gen_0':s8_6(n11_6), gen_0':s8_6(n11_6))) ->_IH c2(gen_c:c1:c27_6(c12_6)) 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: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) IF(false, z0, z1) -> c5 le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) int(z0, z1) -> if(le(z0, z1), z0, z1) if(true, z0, z1) -> cons(z0, int(s(z0), z1)) if(false, z0, z1) -> nil Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 INT :: 0':s -> 0':s -> c3 c3 :: c4:c5 -> c:c1:c2 -> c3 IF :: true:false -> 0':s -> 0':s -> c4:c5 le :: 0':s -> 0':s -> true:false true :: true:false c4 :: c3 -> c4:c5 false :: true:false c5 :: c4:c5 int :: 0':s -> 0':s -> cons:nil if :: true:false -> 0':s -> 0':s -> cons:nil cons :: 0':s -> cons:nil -> cons:nil nil :: cons:nil hole_c:c1:c21_6 :: c:c1:c2 hole_0':s2_6 :: 0':s hole_c33_6 :: c3 hole_c4:c54_6 :: c4:c5 hole_true:false5_6 :: true:false hole_cons:nil6_6 :: cons:nil gen_c:c1:c27_6 :: Nat -> c:c1:c2 gen_0':s8_6 :: Nat -> 0':s gen_cons:nil9_6 :: Nat -> cons:nil Generator Equations: gen_c:c1:c27_6(0) <=> c gen_c:c1:c27_6(+(x, 1)) <=> c2(gen_c:c1:c27_6(x)) gen_0':s8_6(0) <=> 0' gen_0':s8_6(+(x, 1)) <=> s(gen_0':s8_6(x)) gen_cons:nil9_6(0) <=> nil gen_cons:nil9_6(+(x, 1)) <=> cons(0', gen_cons:nil9_6(x)) The following defined symbols remain to be analysed: LE, INT, le, int They will be analysed ascendingly in the following order: LE < INT le < INT le < int ---------------------------------------- (32) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (33) BOUNDS(n^1, INF) ---------------------------------------- (34) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) IF(false, z0, z1) -> c5 le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) int(z0, z1) -> if(le(z0, z1), z0, z1) if(true, z0, z1) -> cons(z0, int(s(z0), z1)) if(false, z0, z1) -> nil Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 INT :: 0':s -> 0':s -> c3 c3 :: c4:c5 -> c:c1:c2 -> c3 IF :: true:false -> 0':s -> 0':s -> c4:c5 le :: 0':s -> 0':s -> true:false true :: true:false c4 :: c3 -> c4:c5 false :: true:false c5 :: c4:c5 int :: 0':s -> 0':s -> cons:nil if :: true:false -> 0':s -> 0':s -> cons:nil cons :: 0':s -> cons:nil -> cons:nil nil :: cons:nil hole_c:c1:c21_6 :: c:c1:c2 hole_0':s2_6 :: 0':s hole_c33_6 :: c3 hole_c4:c54_6 :: c4:c5 hole_true:false5_6 :: true:false hole_cons:nil6_6 :: cons:nil gen_c:c1:c27_6 :: Nat -> c:c1:c2 gen_0':s8_6 :: Nat -> 0':s gen_cons:nil9_6 :: Nat -> cons:nil Lemmas: LE(gen_0':s8_6(n11_6), gen_0':s8_6(n11_6)) -> gen_c:c1:c27_6(n11_6), rt in Omega(1 + n11_6) Generator Equations: gen_c:c1:c27_6(0) <=> c gen_c:c1:c27_6(+(x, 1)) <=> c2(gen_c:c1:c27_6(x)) gen_0':s8_6(0) <=> 0' gen_0':s8_6(+(x, 1)) <=> s(gen_0':s8_6(x)) gen_cons:nil9_6(0) <=> nil gen_cons:nil9_6(+(x, 1)) <=> cons(0', gen_cons:nil9_6(x)) The following defined symbols remain to be analysed: le, INT, int They will be analysed ascendingly in the following order: le < INT le < int ---------------------------------------- (35) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: le(gen_0':s8_6(n491_6), gen_0':s8_6(n491_6)) -> true, rt in Omega(0) Induction Base: le(gen_0':s8_6(0), gen_0':s8_6(0)) ->_R^Omega(0) true Induction Step: le(gen_0':s8_6(+(n491_6, 1)), gen_0':s8_6(+(n491_6, 1))) ->_R^Omega(0) le(gen_0':s8_6(n491_6), gen_0':s8_6(n491_6)) ->_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: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) INT(z0, z1) -> c3(IF(le(z0, z1), z0, z1), LE(z0, z1)) IF(true, z0, z1) -> c4(INT(s(z0), z1)) IF(false, z0, z1) -> c5 le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) int(z0, z1) -> if(le(z0, z1), z0, z1) if(true, z0, z1) -> cons(z0, int(s(z0), z1)) if(false, z0, z1) -> nil Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 INT :: 0':s -> 0':s -> c3 c3 :: c4:c5 -> c:c1:c2 -> c3 IF :: true:false -> 0':s -> 0':s -> c4:c5 le :: 0':s -> 0':s -> true:false true :: true:false c4 :: c3 -> c4:c5 false :: true:false c5 :: c4:c5 int :: 0':s -> 0':s -> cons:nil if :: true:false -> 0':s -> 0':s -> cons:nil cons :: 0':s -> cons:nil -> cons:nil nil :: cons:nil hole_c:c1:c21_6 :: c:c1:c2 hole_0':s2_6 :: 0':s hole_c33_6 :: c3 hole_c4:c54_6 :: c4:c5 hole_true:false5_6 :: true:false hole_cons:nil6_6 :: cons:nil gen_c:c1:c27_6 :: Nat -> c:c1:c2 gen_0':s8_6 :: Nat -> 0':s gen_cons:nil9_6 :: Nat -> cons:nil Lemmas: LE(gen_0':s8_6(n11_6), gen_0':s8_6(n11_6)) -> gen_c:c1:c27_6(n11_6), rt in Omega(1 + n11_6) le(gen_0':s8_6(n491_6), gen_0':s8_6(n491_6)) -> true, rt in Omega(0) Generator Equations: gen_c:c1:c27_6(0) <=> c gen_c:c1:c27_6(+(x, 1)) <=> c2(gen_c:c1:c27_6(x)) gen_0':s8_6(0) <=> 0' gen_0':s8_6(+(x, 1)) <=> s(gen_0':s8_6(x)) gen_cons:nil9_6(0) <=> nil gen_cons:nil9_6(+(x, 1)) <=> cons(0', gen_cons:nil9_6(x)) The following defined symbols remain to be analysed: INT, int