/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^1)) proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxTRS (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxWeightedTrs (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxTypedWeightedTrs (5) CompletionProof [UPPER BOUND(ID), 0 ms] (6) CpxTypedWeightedCompleteTrs (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 7 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 719 ms] (10) BOUNDS(1, n^1) (11) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTRS (13) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (14) typed CpxTrs (15) OrderProof [LOWER BOUND(ID), 0 ms] (16) typed CpxTrs (17) RewriteLemmaProof [LOWER BOUND(ID), 309 ms] (18) BEST (19) proven lower bound (20) LowerBoundPropagationProof [FINISHED, 0 ms] (21) BOUNDS(n^1, INF) (22) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: p(s(x)) -> x p(0) -> 0 le(0, y) -> true le(s(x), 0) -> false le(s(x), s(y)) -> le(x, y) average(x, y) -> if(le(x, 0), le(y, 0), le(y, s(0)), le(y, s(s(0))), x, y) if(true, b1, b2, b3, x, y) -> if2(b1, b2, b3, x, y) if(false, b1, b2, b3, x, y) -> average(p(x), s(y)) if2(true, b2, b3, x, y) -> 0 if2(false, b2, b3, x, y) -> if3(b2, b3, x, y) if3(true, b3, x, y) -> 0 if3(false, b3, x, y) -> if4(b3, x, y) if4(true, x, y) -> s(0) if4(false, x, y) -> average(s(x), p(p(y))) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (2) 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: p(s(x)) -> x [1] p(0) -> 0 [1] le(0, y) -> true [1] le(s(x), 0) -> false [1] le(s(x), s(y)) -> le(x, y) [1] average(x, y) -> if(le(x, 0), le(y, 0), le(y, s(0)), le(y, s(s(0))), x, y) [1] if(true, b1, b2, b3, x, y) -> if2(b1, b2, b3, x, y) [1] if(false, b1, b2, b3, x, y) -> average(p(x), s(y)) [1] if2(true, b2, b3, x, y) -> 0 [1] if2(false, b2, b3, x, y) -> if3(b2, b3, x, y) [1] if3(true, b3, x, y) -> 0 [1] if3(false, b3, x, y) -> if4(b3, x, y) [1] if4(true, x, y) -> s(0) [1] if4(false, x, y) -> average(s(x), p(p(y))) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (4) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: p(s(x)) -> x [1] p(0) -> 0 [1] le(0, y) -> true [1] le(s(x), 0) -> false [1] le(s(x), s(y)) -> le(x, y) [1] average(x, y) -> if(le(x, 0), le(y, 0), le(y, s(0)), le(y, s(s(0))), x, y) [1] if(true, b1, b2, b3, x, y) -> if2(b1, b2, b3, x, y) [1] if(false, b1, b2, b3, x, y) -> average(p(x), s(y)) [1] if2(true, b2, b3, x, y) -> 0 [1] if2(false, b2, b3, x, y) -> if3(b2, b3, x, y) [1] if3(true, b3, x, y) -> 0 [1] if3(false, b3, x, y) -> if4(b3, x, y) [1] if4(true, x, y) -> s(0) [1] if4(false, x, y) -> average(s(x), p(p(y))) [1] The TRS has the following type information: p :: s:0 -> s:0 s :: s:0 -> s:0 0 :: s:0 le :: s:0 -> s:0 -> true:false true :: true:false false :: true:false average :: s:0 -> s:0 -> s:0 if :: true:false -> true:false -> true:false -> true:false -> s:0 -> s:0 -> s:0 if2 :: true:false -> true:false -> true:false -> s:0 -> s:0 -> s:0 if3 :: true:false -> true:false -> s:0 -> s:0 -> s:0 if4 :: true:false -> s:0 -> s:0 -> s:0 Rewrite Strategy: INNERMOST ---------------------------------------- (5) 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: none And the following fresh constants: none ---------------------------------------- (6) 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: p(s(x)) -> x [1] p(0) -> 0 [1] le(0, y) -> true [1] le(s(x), 0) -> false [1] le(s(x), s(y)) -> le(x, y) [1] average(x, y) -> if(le(x, 0), le(y, 0), le(y, s(0)), le(y, s(s(0))), x, y) [1] if(true, b1, b2, b3, x, y) -> if2(b1, b2, b3, x, y) [1] if(false, b1, b2, b3, x, y) -> average(p(x), s(y)) [1] if2(true, b2, b3, x, y) -> 0 [1] if2(false, b2, b3, x, y) -> if3(b2, b3, x, y) [1] if3(true, b3, x, y) -> 0 [1] if3(false, b3, x, y) -> if4(b3, x, y) [1] if4(true, x, y) -> s(0) [1] if4(false, x, y) -> average(s(x), p(p(y))) [1] The TRS has the following type information: p :: s:0 -> s:0 s :: s:0 -> s:0 0 :: s:0 le :: s:0 -> s:0 -> true:false true :: true:false false :: true:false average :: s:0 -> s:0 -> s:0 if :: true:false -> true:false -> true:false -> true:false -> s:0 -> s:0 -> s:0 if2 :: true:false -> true:false -> true:false -> s:0 -> s:0 -> s:0 if3 :: true:false -> true:false -> s:0 -> s:0 -> s:0 if4 :: true:false -> s:0 -> s:0 -> s:0 Rewrite Strategy: INNERMOST ---------------------------------------- (7) 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 true => 1 false => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: average(z, z') -{ 1 }-> if(le(x, 0), le(y, 0), le(y, 1 + 0), le(y, 1 + (1 + 0)), x, y) :|: x >= 0, y >= 0, z = x, z' = y if(z, z', z'', z1, z2, z3) -{ 1 }-> if2(b1, b2, b3, x, y) :|: b2 >= 0, z2 = x, b1 >= 0, z = 1, z1 = b3, z3 = y, x >= 0, y >= 0, z' = b1, z'' = b2, b3 >= 0 if(z, z', z'', z1, z2, z3) -{ 1 }-> average(p(x), 1 + y) :|: b2 >= 0, z2 = x, b1 >= 0, z1 = b3, z3 = y, x >= 0, y >= 0, z' = b1, z = 0, z'' = b2, b3 >= 0 if2(z, z', z'', z1, z2) -{ 1 }-> if3(b2, b3, x, y) :|: b2 >= 0, z2 = y, x >= 0, y >= 0, z' = b2, z = 0, z'' = b3, z1 = x, b3 >= 0 if2(z, z', z'', z1, z2) -{ 1 }-> 0 :|: b2 >= 0, z2 = y, z = 1, x >= 0, y >= 0, z' = b2, z'' = b3, z1 = x, b3 >= 0 if3(z, z', z'', z1) -{ 1 }-> if4(b3, x, y) :|: z1 = y, z' = b3, x >= 0, y >= 0, z'' = x, z = 0, b3 >= 0 if3(z, z', z'', z1) -{ 1 }-> 0 :|: z1 = y, z' = b3, z = 1, x >= 0, y >= 0, z'' = x, b3 >= 0 if4(z, z', z'') -{ 1 }-> average(1 + x, p(p(y))) :|: z' = x, z'' = y, x >= 0, y >= 0, z = 0 if4(z, z', z'') -{ 1 }-> 1 + 0 :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 le(z, z') -{ 1 }-> le(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x le(z, z') -{ 1 }-> 1 :|: y >= 0, z = 0, z' = y le(z, z') -{ 1 }-> 0 :|: x >= 0, z = 1 + x, z' = 0 p(z) -{ 1 }-> x :|: x >= 0, z = 1 + x p(z) -{ 1 }-> 0 :|: z = 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (9) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V, V2, V11, V17, V15, V16),0,[p(V, Out)],[V >= 0]). eq(start(V, V2, V11, V17, V15, V16),0,[le(V, V2, Out)],[V >= 0,V2 >= 0]). eq(start(V, V2, V11, V17, V15, V16),0,[average(V, V2, Out)],[V >= 0,V2 >= 0]). eq(start(V, V2, V11, V17, V15, V16),0,[if(V, V2, V11, V17, V15, V16, Out)],[V >= 0,V2 >= 0,V11 >= 0,V17 >= 0,V15 >= 0,V16 >= 0]). eq(start(V, V2, V11, V17, V15, V16),0,[if2(V, V2, V11, V17, V15, Out)],[V >= 0,V2 >= 0,V11 >= 0,V17 >= 0,V15 >= 0]). eq(start(V, V2, V11, V17, V15, V16),0,[if3(V, V2, V11, V17, Out)],[V >= 0,V2 >= 0,V11 >= 0,V17 >= 0]). eq(start(V, V2, V11, V17, V15, V16),0,[if4(V, V2, V11, Out)],[V >= 0,V2 >= 0,V11 >= 0]). eq(p(V, Out),1,[],[Out = V1,V1 >= 0,V = 1 + V1]). eq(p(V, Out),1,[],[Out = 0,V = 0]). eq(le(V, V2, Out),1,[],[Out = 1,V3 >= 0,V = 0,V2 = V3]). eq(le(V, V2, Out),1,[],[Out = 0,V4 >= 0,V = 1 + V4,V2 = 0]). eq(le(V, V2, Out),1,[le(V5, V6, Ret)],[Out = Ret,V2 = 1 + V6,V5 >= 0,V6 >= 0,V = 1 + V5]). eq(average(V, V2, Out),1,[le(V7, 0, Ret0),le(V8, 0, Ret1),le(V8, 1 + 0, Ret2),le(V8, 1 + (1 + 0), Ret3),if(Ret0, Ret1, Ret2, Ret3, V7, V8, Ret4)],[Out = Ret4,V7 >= 0,V8 >= 0,V = V7,V2 = V8]). eq(if(V, V2, V11, V17, V15, V16, Out),1,[if2(V14, V12, V13, V9, V10, Ret5)],[Out = Ret5,V12 >= 0,V15 = V9,V14 >= 0,V = 1,V17 = V13,V16 = V10,V9 >= 0,V10 >= 0,V2 = V14,V11 = V12,V13 >= 0]). eq(if(V, V2, V11, V17, V15, V16, Out),1,[p(V20, Ret01),average(Ret01, 1 + V18, Ret6)],[Out = Ret6,V22 >= 0,V15 = V20,V21 >= 0,V17 = V19,V16 = V18,V20 >= 0,V18 >= 0,V2 = V21,V = 0,V11 = V22,V19 >= 0]). eq(if2(V, V2, V11, V17, V15, Out),1,[],[Out = 0,V25 >= 0,V15 = V23,V = 1,V24 >= 0,V23 >= 0,V2 = V25,V11 = V26,V17 = V24,V26 >= 0]). eq(if2(V, V2, V11, V17, V15, Out),1,[if3(V29, V30, V27, V28, Ret7)],[Out = Ret7,V29 >= 0,V15 = V28,V27 >= 0,V28 >= 0,V2 = V29,V = 0,V11 = V30,V17 = V27,V30 >= 0]). eq(if3(V, V2, V11, V17, Out),1,[],[Out = 0,V17 = V32,V2 = V33,V = 1,V31 >= 0,V32 >= 0,V11 = V31,V33 >= 0]). eq(if3(V, V2, V11, V17, Out),1,[if4(V35, V36, V34, Ret8)],[Out = Ret8,V17 = V34,V2 = V35,V36 >= 0,V34 >= 0,V11 = V36,V = 0,V35 >= 0]). eq(if4(V, V2, V11, Out),1,[],[Out = 1,V2 = V37,V11 = V38,V = 1,V37 >= 0,V38 >= 0]). eq(if4(V, V2, V11, Out),1,[p(V40, Ret10),p(Ret10, Ret11),average(1 + V39, Ret11, Ret9)],[Out = Ret9,V2 = V39,V11 = V40,V39 >= 0,V40 >= 0,V = 0]). input_output_vars(p(V,Out),[V],[Out]). input_output_vars(le(V,V2,Out),[V,V2],[Out]). input_output_vars(average(V,V2,Out),[V,V2],[Out]). input_output_vars(if(V,V2,V11,V17,V15,V16,Out),[V,V2,V11,V17,V15,V16],[Out]). input_output_vars(if2(V,V2,V11,V17,V15,Out),[V,V2,V11,V17,V15],[Out]). input_output_vars(if3(V,V2,V11,V17,Out),[V,V2,V11,V17],[Out]). input_output_vars(if4(V,V2,V11,Out),[V,V2,V11],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [p/2] 1. recursive : [le/3] 2. recursive : [average/3,if/7,if2/6,if3/5,if4/4] 3. non_recursive : [start/6] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into p/2 1. SCC is partially evaluated into le/3 2. SCC is partially evaluated into average/3 3. SCC is partially evaluated into start/6 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations p/2 * CE 15 is refined into CE [25] * CE 16 is refined into CE [26] ### Cost equations --> "Loop" of p/2 * CEs [25] --> Loop 17 * CEs [26] --> Loop 18 ### Ranking functions of CR p(V,Out) #### Partial ranking functions of CR p(V,Out) ### Specialization of cost equations le/3 * CE 24 is refined into CE [27] * CE 23 is refined into CE [28] * CE 22 is refined into CE [29] ### Cost equations --> "Loop" of le/3 * CEs [28] --> Loop 19 * CEs [29] --> Loop 20 * CEs [27] --> Loop 21 ### Ranking functions of CR le(V,V2,Out) * RF of phase [21]: [V,V2] #### Partial ranking functions of CR le(V,V2,Out) * Partial RF of phase [21]: - RF of loop [21:1]: V V2 ### Specialization of cost equations average/3 * CE 18 is refined into CE [30] * CE 17 is refined into CE [31] * CE 21 is refined into CE [32] * CE 20 is refined into CE [33,34,35,36] * CE 19 is refined into CE [37] ### Cost equations --> "Loop" of average/3 * CEs [34] --> Loop 22 * CEs [35] --> Loop 23 * CEs [36] --> Loop 24 * CEs [33] --> Loop 25 * CEs [37] --> Loop 26 * CEs [30] --> Loop 27 * CEs [31] --> Loop 28 * CEs [32] --> Loop 29 ### Ranking functions of CR average(V,V2,Out) * RF of phase [22,23,24,26]: [3*V+2*V2-4] #### Partial ranking functions of CR average(V,V2,Out) * Partial RF of phase [22,23,24,26]: - RF of loop [22:1,23:1,24:1]: V depends on loops [26:1] - RF of loop [23:1]: -V2+3 depends on loops [26:1] - RF of loop [24:1]: -V2+2 depends on loops [26:1] - RF of loop [26:1]: -V+1 depends on loops [22:1,23:1,24:1] V2/2-1 depends on loops [22:1,23:1,24:1] ### Specialization of cost equations start/6 * CE 10 is refined into CE [38] * CE 1 is refined into CE [39] * CE 4 is refined into CE [40] * CE 3 is refined into CE [41] * CE 6 is refined into CE [42,43,44,45,46,47,48] * CE 2 is refined into CE [49] * CE 5 is refined into CE [50] * CE 7 is refined into CE [51,52,53,54,55,56,57] * CE 8 is refined into CE [58,59,60,61,62,63,64] * CE 9 is refined into CE [65,66,67,68,69,70] * CE 11 is refined into CE [71,72,73,74,75,76,77] * CE 12 is refined into CE [78,79] * CE 13 is refined into CE [80,81,82,83] * CE 14 is refined into CE [84,85,86,87,88,89] ### Cost equations --> "Loop" of start/6 * CEs [89] --> Loop 30 * CEs [38,41] --> Loop 31 * CEs [39,40,42,43,44,45,46,47,48,79,81,82,83,87,88] --> Loop 32 * CEs [49,50,51,52,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,80,84,85,86] --> Loop 33 ### Ranking functions of CR start(V,V2,V11,V17,V15,V16) #### Partial ranking functions of CR start(V,V2,V11,V17,V15,V16) Computing Bounds ===================================== #### Cost of chains of p(V,Out): * Chain [18]: 1 with precondition: [V=0,Out=0] * Chain [17]: 1 with precondition: [V=Out+1,V>=1] #### Cost of chains of le(V,V2,Out): * Chain [[21],20]: 1*it(21)+1 Such that:it(21) =< V with precondition: [Out=1,V>=1,V2>=V] * Chain [[21],19]: 1*it(21)+1 Such that:it(21) =< V2 with precondition: [Out=0,V2>=1,V>=V2+1] * Chain [20]: 1 with precondition: [V=0,Out=1,V2>=0] * Chain [19]: 1 with precondition: [V2=0,Out=0,V>=1] #### Cost of chains of average(V,V2,Out): * Chain [[22,23,24,26],27]: 37*it(22)+1*s(1)+1*s(2)+3*s(20)+9 Such that:s(1) =< 1 s(2) =< 2 aux(28) =< 3*V+2*V2 it(22) =< aux(28) s(20) =< aux(28)*2 with precondition: [Out=1,V>=0,V2>=1,V2+2*V>=3] * Chain [29]: 7 with precondition: [V=0,V2=0,Out=0] * Chain [28]: 2*s(27)+8 Such that:aux(29) =< 1 s(27) =< aux(29) with precondition: [V=0,V2=1,Out=0] * Chain [27]: 1*s(1)+1*s(2)+9 Such that:s(1) =< 1 s(2) =< 2 with precondition: [V=0,V2=2,Out=1] * Chain [25,[22,23,24,26],27]: 37*it(22)+1*s(1)+1*s(2)+3*s(20)+16 Such that:s(1) =< 1 s(2) =< 2 aux(28) =< 3*V it(22) =< aux(28) s(20) =< aux(28)*2 with precondition: [V2=0,Out=1,V>=2] * Chain [25,28]: 2*s(27)+15 Such that:aux(29) =< 1 s(27) =< aux(29) with precondition: [V=1,V2=0,Out=0] #### Cost of chains of start(V,V2,V11,V17,V15,V16): * Chain [33]: 41*s(30)+17*s(32)+111*s(34)+9*s(35)+37*s(53)+3*s(54)+111*s(60)+9*s(61)+37*s(79)+3*s(80)+37*s(88)+3*s(89)+37*s(97)+3*s(98)+111*s(104)+9*s(105)+37*s(123)+3*s(124)+21 Such that:s(122) =< 3*V2+2*V11 s(78) =< 3*V11+2*V17 s(52) =< 3*V17+2*V15 s(96) =< 3*V15+2*V16 s(87) =< 2*V16+2 aux(30) =< 1 aux(31) =< 2 aux(32) =< 3*V2+3 aux(33) =< 3*V11+3 aux(34) =< 3*V17+3 s(30) =< aux(30) s(32) =< aux(31) s(34) =< aux(34) s(35) =< aux(34)*2 s(53) =< s(52) s(54) =< s(52)*2 s(60) =< aux(33) s(61) =< aux(33)*2 s(79) =< s(78) s(80) =< s(78)*2 s(88) =< s(87) s(89) =< s(87)*2 s(97) =< s(96) s(98) =< s(96)*2 s(104) =< aux(32) s(105) =< aux(32)*2 s(123) =< s(122) s(124) =< s(122)*2 with precondition: [V=0] * Chain [32]: 13*s(130)+5*s(132)+111*s(134)+9*s(135)+37*s(153)+3*s(154)+1*s(155)+1*s(156)+37*s(162)+3*s(163)+22 Such that:s(156) =< V s(161) =< 3*V s(155) =< V2 s(152) =< 3*V15+2*V16 aux(35) =< 1 aux(36) =< 2 aux(37) =< 3*V15+3 s(130) =< aux(35) s(132) =< aux(36) s(134) =< aux(37) s(135) =< aux(37)*2 s(153) =< s(152) s(154) =< s(152)*2 s(162) =< s(161) s(163) =< s(161)*2 with precondition: [V>=1] * Chain [31]: 2 with precondition: [V=1,V2>=0,V11>=0] * Chain [30]: 1*s(164)+1*s(165)+37*s(167)+3*s(168)+9 Such that:s(164) =< 1 s(165) =< 2 s(166) =< 3*V+2*V2 s(167) =< s(166) s(168) =< s(166)*2 with precondition: [V>=0,V2>=1,V2+2*V>=3] Closed-form bounds of start(V,V2,V11,V17,V15,V16): ------------------------------------- * Chain [33] with precondition: [V=0] - Upper bound: nat(2*V16+2)*43+96+nat(3*V2+3)*129+nat(3*V2+2*V11)*43+nat(3*V11+3)*129+nat(3*V11+2*V17)*43+nat(3*V17+3)*129+nat(3*V17+2*V15)*43+nat(3*V15+2*V16)*43 - Complexity: n * Chain [32] with precondition: [V>=1] - Upper bound: V+45+nat(V2)+129*V+nat(3*V15+3)*129+nat(3*V15+2*V16)*43 - Complexity: n * Chain [31] with precondition: [V=1,V2>=0,V11>=0] - Upper bound: 2 - Complexity: constant * Chain [30] with precondition: [V>=0,V2>=1,V2+2*V>=3] - Upper bound: 129*V+86*V2+12 - Complexity: n ### Maximum cost of start(V,V2,V11,V17,V15,V16): max([nat(3*V+2*V2)*43+10,nat(3*V15+2*V16)*43+43+max([nat(V2)+V+129*V+nat(3*V15+3)*129,nat(2*V16+2)*43+51+nat(3*V2+3)*129+nat(3*V2+2*V11)*43+nat(3*V11+3)*129+nat(3*V11+2*V17)*43+nat(3*V17+3)*129+nat(3*V17+2*V15)*43])])+2 Asymptotic class: n * Total analysis performed in 597 ms. ---------------------------------------- (10) BOUNDS(1, n^1) ---------------------------------------- (11) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (12) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: p(s(x)) -> x p(0') -> 0' le(0', y) -> true le(s(x), 0') -> false le(s(x), s(y)) -> le(x, y) average(x, y) -> if(le(x, 0'), le(y, 0'), le(y, s(0')), le(y, s(s(0'))), x, y) if(true, b1, b2, b3, x, y) -> if2(b1, b2, b3, x, y) if(false, b1, b2, b3, x, y) -> average(p(x), s(y)) if2(true, b2, b3, x, y) -> 0' if2(false, b2, b3, x, y) -> if3(b2, b3, x, y) if3(true, b3, x, y) -> 0' if3(false, b3, x, y) -> if4(b3, x, y) if4(true, x, y) -> s(0') if4(false, x, y) -> average(s(x), p(p(y))) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (14) Obligation: Innermost TRS: Rules: p(s(x)) -> x p(0') -> 0' le(0', y) -> true le(s(x), 0') -> false le(s(x), s(y)) -> le(x, y) average(x, y) -> if(le(x, 0'), le(y, 0'), le(y, s(0')), le(y, s(s(0'))), x, y) if(true, b1, b2, b3, x, y) -> if2(b1, b2, b3, x, y) if(false, b1, b2, b3, x, y) -> average(p(x), s(y)) if2(true, b2, b3, x, y) -> 0' if2(false, b2, b3, x, y) -> if3(b2, b3, x, y) if3(true, b3, x, y) -> 0' if3(false, b3, x, y) -> if4(b3, x, y) if4(true, x, y) -> s(0') if4(false, x, y) -> average(s(x), p(p(y))) Types: p :: s:0' -> s:0' s :: s:0' -> s:0' 0' :: s:0' le :: s:0' -> s:0' -> true:false true :: true:false false :: true:false average :: s:0' -> s:0' -> s:0' if :: true:false -> true:false -> true:false -> true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> true:false -> true:false -> s:0' -> s:0' -> s:0' if3 :: true:false -> true:false -> s:0' -> s:0' -> s:0' if4 :: true:false -> s:0' -> s:0' -> s:0' hole_s:0'1_0 :: s:0' hole_true:false2_0 :: true:false gen_s:0'3_0 :: Nat -> s:0' ---------------------------------------- (15) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: le, average They will be analysed ascendingly in the following order: le < average ---------------------------------------- (16) Obligation: Innermost TRS: Rules: p(s(x)) -> x p(0') -> 0' le(0', y) -> true le(s(x), 0') -> false le(s(x), s(y)) -> le(x, y) average(x, y) -> if(le(x, 0'), le(y, 0'), le(y, s(0')), le(y, s(s(0'))), x, y) if(true, b1, b2, b3, x, y) -> if2(b1, b2, b3, x, y) if(false, b1, b2, b3, x, y) -> average(p(x), s(y)) if2(true, b2, b3, x, y) -> 0' if2(false, b2, b3, x, y) -> if3(b2, b3, x, y) if3(true, b3, x, y) -> 0' if3(false, b3, x, y) -> if4(b3, x, y) if4(true, x, y) -> s(0') if4(false, x, y) -> average(s(x), p(p(y))) Types: p :: s:0' -> s:0' s :: s:0' -> s:0' 0' :: s:0' le :: s:0' -> s:0' -> true:false true :: true:false false :: true:false average :: s:0' -> s:0' -> s:0' if :: true:false -> true:false -> true:false -> true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> true:false -> true:false -> s:0' -> s:0' -> s:0' if3 :: true:false -> true:false -> s:0' -> s:0' -> s:0' if4 :: true:false -> s:0' -> s:0' -> s:0' hole_s:0'1_0 :: s:0' hole_true:false2_0 :: true:false gen_s:0'3_0 :: Nat -> s:0' Generator Equations: gen_s:0'3_0(0) <=> 0' gen_s:0'3_0(+(x, 1)) <=> s(gen_s:0'3_0(x)) The following defined symbols remain to be analysed: le, average They will be analysed ascendingly in the following order: le < average ---------------------------------------- (17) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: le(gen_s:0'3_0(n5_0), gen_s:0'3_0(n5_0)) -> true, rt in Omega(1 + n5_0) Induction Base: le(gen_s:0'3_0(0), gen_s:0'3_0(0)) ->_R^Omega(1) true Induction Step: le(gen_s:0'3_0(+(n5_0, 1)), gen_s:0'3_0(+(n5_0, 1))) ->_R^Omega(1) le(gen_s:0'3_0(n5_0), gen_s:0'3_0(n5_0)) ->_IH true We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (18) Complex Obligation (BEST) ---------------------------------------- (19) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: p(s(x)) -> x p(0') -> 0' le(0', y) -> true le(s(x), 0') -> false le(s(x), s(y)) -> le(x, y) average(x, y) -> if(le(x, 0'), le(y, 0'), le(y, s(0')), le(y, s(s(0'))), x, y) if(true, b1, b2, b3, x, y) -> if2(b1, b2, b3, x, y) if(false, b1, b2, b3, x, y) -> average(p(x), s(y)) if2(true, b2, b3, x, y) -> 0' if2(false, b2, b3, x, y) -> if3(b2, b3, x, y) if3(true, b3, x, y) -> 0' if3(false, b3, x, y) -> if4(b3, x, y) if4(true, x, y) -> s(0') if4(false, x, y) -> average(s(x), p(p(y))) Types: p :: s:0' -> s:0' s :: s:0' -> s:0' 0' :: s:0' le :: s:0' -> s:0' -> true:false true :: true:false false :: true:false average :: s:0' -> s:0' -> s:0' if :: true:false -> true:false -> true:false -> true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> true:false -> true:false -> s:0' -> s:0' -> s:0' if3 :: true:false -> true:false -> s:0' -> s:0' -> s:0' if4 :: true:false -> s:0' -> s:0' -> s:0' hole_s:0'1_0 :: s:0' hole_true:false2_0 :: true:false gen_s:0'3_0 :: Nat -> s:0' Generator Equations: gen_s:0'3_0(0) <=> 0' gen_s:0'3_0(+(x, 1)) <=> s(gen_s:0'3_0(x)) The following defined symbols remain to be analysed: le, average They will be analysed ascendingly in the following order: le < average ---------------------------------------- (20) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (21) BOUNDS(n^1, INF) ---------------------------------------- (22) Obligation: Innermost TRS: Rules: p(s(x)) -> x p(0') -> 0' le(0', y) -> true le(s(x), 0') -> false le(s(x), s(y)) -> le(x, y) average(x, y) -> if(le(x, 0'), le(y, 0'), le(y, s(0')), le(y, s(s(0'))), x, y) if(true, b1, b2, b3, x, y) -> if2(b1, b2, b3, x, y) if(false, b1, b2, b3, x, y) -> average(p(x), s(y)) if2(true, b2, b3, x, y) -> 0' if2(false, b2, b3, x, y) -> if3(b2, b3, x, y) if3(true, b3, x, y) -> 0' if3(false, b3, x, y) -> if4(b3, x, y) if4(true, x, y) -> s(0') if4(false, x, y) -> average(s(x), p(p(y))) Types: p :: s:0' -> s:0' s :: s:0' -> s:0' 0' :: s:0' le :: s:0' -> s:0' -> true:false true :: true:false false :: true:false average :: s:0' -> s:0' -> s:0' if :: true:false -> true:false -> true:false -> true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> true:false -> true:false -> s:0' -> s:0' -> s:0' if3 :: true:false -> true:false -> s:0' -> s:0' -> s:0' if4 :: true:false -> s:0' -> s:0' -> s:0' hole_s:0'1_0 :: s:0' hole_true:false2_0 :: true:false gen_s:0'3_0 :: Nat -> s:0' Lemmas: le(gen_s:0'3_0(n5_0), gen_s:0'3_0(n5_0)) -> true, rt in Omega(1 + n5_0) Generator Equations: gen_s:0'3_0(0) <=> 0' gen_s:0'3_0(+(x, 1)) <=> s(gen_s:0'3_0(x)) The following defined symbols remain to be analysed: average