/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^2), O(n^2)) proof of /export/starexec/sandbox/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^2, n^2). (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), 1 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 390 ms] (10) BOUNDS(1, n^2) (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), 267 ms] (18) BEST (19) proven lower bound (20) LowerBoundPropagationProof [FINISHED, 0 ms] (21) BOUNDS(n^1, INF) (22) typed CpxTrs (23) RewriteLemmaProof [LOWER BOUND(ID), 19 ms] (24) proven lower bound (25) LowerBoundPropagationProof [FINISHED, 0 ms] (26) BOUNDS(n^2, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^2, n^2). The TRS R consists of the following rules: nonZero(0) -> false nonZero(s(x)) -> true p(s(0)) -> 0 p(s(s(x))) -> s(p(s(x))) id_inc(x) -> x id_inc(x) -> s(x) random(x) -> rand(x, 0) rand(x, y) -> if(nonZero(x), x, y) if(false, x, y) -> y if(true, x, y) -> rand(p(x), id_inc(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^2). The TRS R consists of the following rules: nonZero(0) -> false [1] nonZero(s(x)) -> true [1] p(s(0)) -> 0 [1] p(s(s(x))) -> s(p(s(x))) [1] id_inc(x) -> x [1] id_inc(x) -> s(x) [1] random(x) -> rand(x, 0) [1] rand(x, y) -> if(nonZero(x), x, y) [1] if(false, x, y) -> y [1] if(true, x, y) -> rand(p(x), id_inc(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: nonZero(0) -> false [1] nonZero(s(x)) -> true [1] p(s(0)) -> 0 [1] p(s(s(x))) -> s(p(s(x))) [1] id_inc(x) -> x [1] id_inc(x) -> s(x) [1] random(x) -> rand(x, 0) [1] rand(x, y) -> if(nonZero(x), x, y) [1] if(false, x, y) -> y [1] if(true, x, y) -> rand(p(x), id_inc(y)) [1] The TRS has the following type information: nonZero :: 0:s -> false:true 0 :: 0:s false :: false:true s :: 0:s -> 0:s true :: false:true p :: 0:s -> 0:s id_inc :: 0:s -> 0:s random :: 0:s -> 0:s rand :: 0:s -> 0:s -> 0:s if :: false:true -> 0:s -> 0:s -> 0:s 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: p(v0) -> null_p [0] nonZero(v0) -> null_nonZero [0] if(v0, v1, v2) -> null_if [0] And the following fresh constants: null_p, null_nonZero, null_if ---------------------------------------- (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: nonZero(0) -> false [1] nonZero(s(x)) -> true [1] p(s(0)) -> 0 [1] p(s(s(x))) -> s(p(s(x))) [1] id_inc(x) -> x [1] id_inc(x) -> s(x) [1] random(x) -> rand(x, 0) [1] rand(x, y) -> if(nonZero(x), x, y) [1] if(false, x, y) -> y [1] if(true, x, y) -> rand(p(x), id_inc(y)) [1] p(v0) -> null_p [0] nonZero(v0) -> null_nonZero [0] if(v0, v1, v2) -> null_if [0] The TRS has the following type information: nonZero :: 0:s:null_p:null_if -> false:true:null_nonZero 0 :: 0:s:null_p:null_if false :: false:true:null_nonZero s :: 0:s:null_p:null_if -> 0:s:null_p:null_if true :: false:true:null_nonZero p :: 0:s:null_p:null_if -> 0:s:null_p:null_if id_inc :: 0:s:null_p:null_if -> 0:s:null_p:null_if random :: 0:s:null_p:null_if -> 0:s:null_p:null_if rand :: 0:s:null_p:null_if -> 0:s:null_p:null_if -> 0:s:null_p:null_if if :: false:true:null_nonZero -> 0:s:null_p:null_if -> 0:s:null_p:null_if -> 0:s:null_p:null_if null_p :: 0:s:null_p:null_if null_nonZero :: false:true:null_nonZero null_if :: 0:s:null_p:null_if 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 false => 1 true => 2 null_p => 0 null_nonZero => 0 null_if => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> x :|: x >= 0, z = x id_inc(z) -{ 1 }-> 1 + x :|: x >= 0, z = x if(z, z', z'') -{ 1 }-> y :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 if(z, z', z'') -{ 1 }-> rand(p(x), id_inc(y)) :|: z = 2, z' = x, z'' = y, x >= 0, y >= 0 if(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 nonZero(z) -{ 1 }-> 2 :|: x >= 0, z = 1 + x nonZero(z) -{ 1 }-> 1 :|: z = 0 nonZero(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 p(z) -{ 1 }-> 0 :|: z = 1 + 0 p(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 p(z) -{ 1 }-> 1 + p(1 + x) :|: x >= 0, z = 1 + (1 + x) rand(z, z') -{ 1 }-> if(nonZero(x), x, y) :|: x >= 0, y >= 0, z = x, z' = y random(z) -{ 1 }-> rand(x, 0) :|: x >= 0, z = x 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, V6, V9),0,[nonZero(V, Out)],[V >= 0]). eq(start(V, V6, V9),0,[p(V, Out)],[V >= 0]). eq(start(V, V6, V9),0,[fun(V, Out)],[V >= 0]). eq(start(V, V6, V9),0,[random(V, Out)],[V >= 0]). eq(start(V, V6, V9),0,[rand(V, V6, Out)],[V >= 0,V6 >= 0]). eq(start(V, V6, V9),0,[if(V, V6, V9, Out)],[V >= 0,V6 >= 0,V9 >= 0]). eq(nonZero(V, Out),1,[],[Out = 1,V = 0]). eq(nonZero(V, Out),1,[],[Out = 2,V1 >= 0,V = 1 + V1]). eq(p(V, Out),1,[],[Out = 0,V = 1]). eq(p(V, Out),1,[p(1 + V2, Ret1)],[Out = 1 + Ret1,V2 >= 0,V = 2 + V2]). eq(fun(V, Out),1,[],[Out = V3,V3 >= 0,V = V3]). eq(fun(V, Out),1,[],[Out = 1 + V4,V4 >= 0,V = V4]). eq(random(V, Out),1,[rand(V5, 0, Ret)],[Out = Ret,V5 >= 0,V = V5]). eq(rand(V, V6, Out),1,[nonZero(V7, Ret0),if(Ret0, V7, V8, Ret2)],[Out = Ret2,V7 >= 0,V8 >= 0,V = V7,V6 = V8]). eq(if(V, V6, V9, Out),1,[],[Out = V11,V6 = V10,V9 = V11,V = 1,V10 >= 0,V11 >= 0]). eq(if(V, V6, V9, Out),1,[p(V13, Ret01),fun(V12, Ret11),rand(Ret01, Ret11, Ret3)],[Out = Ret3,V = 2,V6 = V13,V9 = V12,V13 >= 0,V12 >= 0]). eq(p(V, Out),0,[],[Out = 0,V14 >= 0,V = V14]). eq(nonZero(V, Out),0,[],[Out = 0,V15 >= 0,V = V15]). eq(if(V, V6, V9, Out),0,[],[Out = 0,V17 >= 0,V9 = V18,V16 >= 0,V = V17,V6 = V16,V18 >= 0]). input_output_vars(nonZero(V,Out),[V],[Out]). input_output_vars(p(V,Out),[V],[Out]). input_output_vars(fun(V,Out),[V],[Out]). input_output_vars(random(V,Out),[V],[Out]). input_output_vars(rand(V,V6,Out),[V,V6],[Out]). input_output_vars(if(V,V6,V9,Out),[V,V6,V9],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [fun/2] 1. recursive : [p/2] 2. non_recursive : [nonZero/2] 3. recursive : [if/4,rand/3] 4. non_recursive : [random/2] 5. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/2 1. SCC is partially evaluated into p/2 2. SCC is partially evaluated into nonZero/2 3. SCC is partially evaluated into rand/3 4. SCC is completely evaluated into other SCCs 5. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/2 * CE 12 is refined into CE [20] * CE 13 is refined into CE [21] ### Cost equations --> "Loop" of fun/2 * CEs [20] --> Loop 13 * CEs [21] --> Loop 14 ### Ranking functions of CR fun(V,Out) #### Partial ranking functions of CR fun(V,Out) ### Specialization of cost equations p/2 * CE 9 is refined into CE [22] * CE 11 is refined into CE [23] * CE 10 is refined into CE [24] ### Cost equations --> "Loop" of p/2 * CEs [24] --> Loop 15 * CEs [22,23] --> Loop 16 ### Ranking functions of CR p(V,Out) * RF of phase [15]: [V-1] #### Partial ranking functions of CR p(V,Out) * Partial RF of phase [15]: - RF of loop [15:1]: V-1 ### Specialization of cost equations nonZero/2 * CE 18 is refined into CE [25] * CE 19 is refined into CE [26] * CE 17 is refined into CE [27] ### Cost equations --> "Loop" of nonZero/2 * CEs [25] --> Loop 17 * CEs [26] --> Loop 18 * CEs [27] --> Loop 19 ### Ranking functions of CR nonZero(V,Out) #### Partial ranking functions of CR nonZero(V,Out) ### Specialization of cost equations rand/3 * CE 16 is refined into CE [28] * CE 14 is refined into CE [29,30,31] * CE 15 is refined into CE [32,33,34,35] ### Cost equations --> "Loop" of rand/3 * CEs [35] --> Loop 20 * CEs [34] --> Loop 21 * CEs [33] --> Loop 22 * CEs [32] --> Loop 23 * CEs [28] --> Loop 24 * CEs [29,30,31] --> Loop 25 ### Ranking functions of CR rand(V,V6,Out) * RF of phase [20,21]: [V-1] #### Partial ranking functions of CR rand(V,V6,Out) * Partial RF of phase [20,21]: - RF of loop [20:1,21:1]: V-1 ### Specialization of cost equations start/3 * CE 2 is refined into CE [36,37,38,39,40,41,42,43,44,45,46,47,48,49] * CE 1 is refined into CE [50] * CE 3 is refined into CE [51] * CE 4 is refined into CE [52,53,54] * CE 5 is refined into CE [55,56] * CE 6 is refined into CE [57,58] * CE 7 is refined into CE [59,60,61,62,63,64] * CE 8 is refined into CE [65,66,67,68,69,70] ### Cost equations --> "Loop" of start/3 * CEs [36,37,38,39,40,41,42,43,44,45,46,47,48,49] --> Loop 26 * CEs [51] --> Loop 27 * CEs [50,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70] --> Loop 28 ### Ranking functions of CR start(V,V6,V9) #### Partial ranking functions of CR start(V,V6,V9) Computing Bounds ===================================== #### Cost of chains of fun(V,Out): * Chain [14]: 1 with precondition: [V+1=Out,V>=0] * Chain [13]: 1 with precondition: [V=Out,V>=0] #### Cost of chains of p(V,Out): * Chain [[15],16]: 1*it(15)+1 Such that:it(15) =< Out with precondition: [Out>=1,V>=Out+1] * Chain [16]: 1 with precondition: [Out=0,V>=0] #### Cost of chains of nonZero(V,Out): * Chain [19]: 1 with precondition: [V=0,Out=1] * Chain [18]: 0 with precondition: [Out=0,V>=0] * Chain [17]: 1 with precondition: [Out=2,V>=1] #### Cost of chains of rand(V,V6,Out): * Chain [[20,21],25]: 10*it(20)+1*s(5)+1*s(6)+2 Such that:aux(5) =< V it(20) =< aux(5) aux(2) =< aux(5) s(5) =< it(20)*aux(5) s(6) =< it(20)*aux(2) with precondition: [Out=0,V>=2,V6>=0] * Chain [[20,21],23,25]: 10*it(20)+1*s(5)+1*s(6)+7 Such that:aux(6) =< V it(20) =< aux(6) aux(2) =< aux(6) s(5) =< it(20)*aux(6) s(6) =< it(20)*aux(2) with precondition: [Out=0,V>=2,V6>=0] * Chain [[20,21],23,24]: 10*it(20)+1*s(5)+1*s(6)+8 Such that:aux(7) =< V it(20) =< aux(7) aux(2) =< aux(7) s(5) =< it(20)*aux(7) s(6) =< it(20)*aux(2) with precondition: [V>=2,V6>=0,Out>=V6+1,V+V6>=Out] * Chain [[20,21],22,25]: 10*it(20)+1*s(5)+1*s(6)+7 Such that:aux(8) =< V it(20) =< aux(8) aux(2) =< aux(8) s(5) =< it(20)*aux(8) s(6) =< it(20)*aux(2) with precondition: [Out=0,V>=2,V6>=0] * Chain [[20,21],22,24]: 10*it(20)+1*s(5)+1*s(6)+8 Such that:aux(9) =< V it(20) =< aux(9) aux(2) =< aux(9) s(5) =< it(20)*aux(9) s(6) =< it(20)*aux(2) with precondition: [V>=2,V6>=0,Out>=V6,V+V6>=Out+1] * Chain [25]: 2 with precondition: [Out=0,V>=0,V6>=0] * Chain [24]: 3 with precondition: [V=0,V6=Out,V6>=0] * Chain [23,25]: 7 with precondition: [Out=0,V>=1,V6>=0] * Chain [23,24]: 8 with precondition: [Out=V6+1,V>=1,Out>=1] * Chain [22,25]: 7 with precondition: [Out=0,V>=1,V6>=0] * Chain [22,24]: 8 with precondition: [V6=Out,V>=1,V6>=0] #### Cost of chains of start(V,V6,V9): * Chain [28]: 101*s(22)+10*s(26)+10*s(27)+9 Such that:aux(11) =< V s(22) =< aux(11) s(25) =< aux(11) s(26) =< s(22)*aux(11) s(27) =< s(22)*s(25) with precondition: [V>=0] * Chain [27]: 1 with precondition: [V=1,V6>=0,V9>=0] * Chain [26]: 110*s(63)+10*s(67)+10*s(68)+11 Such that:aux(18) =< V6 s(63) =< aux(18) s(66) =< aux(18) s(67) =< s(63)*aux(18) s(68) =< s(63)*s(66) with precondition: [V=2,V6>=0,V9>=0] Closed-form bounds of start(V,V6,V9): ------------------------------------- * Chain [28] with precondition: [V>=0] - Upper bound: 101*V+9+20*V*V - Complexity: n^2 * Chain [27] with precondition: [V=1,V6>=0,V9>=0] - Upper bound: 1 - Complexity: constant * Chain [26] with precondition: [V=2,V6>=0,V9>=0] - Upper bound: 110*V6+11+20*V6*V6 - Complexity: n^2 ### Maximum cost of start(V,V6,V9): max([101*V+8+20*V*V,nat(V6)*110+10+nat(V6)*20*nat(V6)])+1 Asymptotic class: n^2 * Total analysis performed in 306 ms. ---------------------------------------- (10) BOUNDS(1, n^2) ---------------------------------------- (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^2, INF). The TRS R consists of the following rules: nonZero(0') -> false nonZero(s(x)) -> true p(s(0')) -> 0' p(s(s(x))) -> s(p(s(x))) id_inc(x) -> x id_inc(x) -> s(x) random(x) -> rand(x, 0') rand(x, y) -> if(nonZero(x), x, y) if(false, x, y) -> y if(true, x, y) -> rand(p(x), id_inc(y)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (14) Obligation: Innermost TRS: Rules: nonZero(0') -> false nonZero(s(x)) -> true p(s(0')) -> 0' p(s(s(x))) -> s(p(s(x))) id_inc(x) -> x id_inc(x) -> s(x) random(x) -> rand(x, 0') rand(x, y) -> if(nonZero(x), x, y) if(false, x, y) -> y if(true, x, y) -> rand(p(x), id_inc(y)) Types: nonZero :: 0':s -> false:true 0' :: 0':s false :: false:true s :: 0':s -> 0':s true :: false:true p :: 0':s -> 0':s id_inc :: 0':s -> 0':s random :: 0':s -> 0':s rand :: 0':s -> 0':s -> 0':s if :: false:true -> 0':s -> 0':s -> 0':s hole_false:true1_0 :: false:true hole_0':s2_0 :: 0':s gen_0':s3_0 :: Nat -> 0':s ---------------------------------------- (15) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: p, rand They will be analysed ascendingly in the following order: p < rand ---------------------------------------- (16) Obligation: Innermost TRS: Rules: nonZero(0') -> false nonZero(s(x)) -> true p(s(0')) -> 0' p(s(s(x))) -> s(p(s(x))) id_inc(x) -> x id_inc(x) -> s(x) random(x) -> rand(x, 0') rand(x, y) -> if(nonZero(x), x, y) if(false, x, y) -> y if(true, x, y) -> rand(p(x), id_inc(y)) Types: nonZero :: 0':s -> false:true 0' :: 0':s false :: false:true s :: 0':s -> 0':s true :: false:true p :: 0':s -> 0':s id_inc :: 0':s -> 0':s random :: 0':s -> 0':s rand :: 0':s -> 0':s -> 0':s if :: false:true -> 0':s -> 0':s -> 0':s hole_false:true1_0 :: false:true hole_0':s2_0 :: 0':s gen_0':s3_0 :: Nat -> 0':s Generator Equations: gen_0':s3_0(0) <=> 0' gen_0':s3_0(+(x, 1)) <=> s(gen_0':s3_0(x)) The following defined symbols remain to be analysed: p, rand They will be analysed ascendingly in the following order: p < rand ---------------------------------------- (17) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: p(gen_0':s3_0(+(1, n5_0))) -> gen_0':s3_0(n5_0), rt in Omega(1 + n5_0) Induction Base: p(gen_0':s3_0(+(1, 0))) ->_R^Omega(1) 0' Induction Step: p(gen_0':s3_0(+(1, +(n5_0, 1)))) ->_R^Omega(1) s(p(s(gen_0':s3_0(n5_0)))) ->_IH s(gen_0':s3_0(c6_0)) 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: nonZero(0') -> false nonZero(s(x)) -> true p(s(0')) -> 0' p(s(s(x))) -> s(p(s(x))) id_inc(x) -> x id_inc(x) -> s(x) random(x) -> rand(x, 0') rand(x, y) -> if(nonZero(x), x, y) if(false, x, y) -> y if(true, x, y) -> rand(p(x), id_inc(y)) Types: nonZero :: 0':s -> false:true 0' :: 0':s false :: false:true s :: 0':s -> 0':s true :: false:true p :: 0':s -> 0':s id_inc :: 0':s -> 0':s random :: 0':s -> 0':s rand :: 0':s -> 0':s -> 0':s if :: false:true -> 0':s -> 0':s -> 0':s hole_false:true1_0 :: false:true hole_0':s2_0 :: 0':s gen_0':s3_0 :: Nat -> 0':s Generator Equations: gen_0':s3_0(0) <=> 0' gen_0':s3_0(+(x, 1)) <=> s(gen_0':s3_0(x)) The following defined symbols remain to be analysed: p, rand They will be analysed ascendingly in the following order: p < rand ---------------------------------------- (20) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (21) BOUNDS(n^1, INF) ---------------------------------------- (22) Obligation: Innermost TRS: Rules: nonZero(0') -> false nonZero(s(x)) -> true p(s(0')) -> 0' p(s(s(x))) -> s(p(s(x))) id_inc(x) -> x id_inc(x) -> s(x) random(x) -> rand(x, 0') rand(x, y) -> if(nonZero(x), x, y) if(false, x, y) -> y if(true, x, y) -> rand(p(x), id_inc(y)) Types: nonZero :: 0':s -> false:true 0' :: 0':s false :: false:true s :: 0':s -> 0':s true :: false:true p :: 0':s -> 0':s id_inc :: 0':s -> 0':s random :: 0':s -> 0':s rand :: 0':s -> 0':s -> 0':s if :: false:true -> 0':s -> 0':s -> 0':s hole_false:true1_0 :: false:true hole_0':s2_0 :: 0':s gen_0':s3_0 :: Nat -> 0':s Lemmas: p(gen_0':s3_0(+(1, n5_0))) -> gen_0':s3_0(n5_0), rt in Omega(1 + n5_0) Generator Equations: gen_0':s3_0(0) <=> 0' gen_0':s3_0(+(x, 1)) <=> s(gen_0':s3_0(x)) The following defined symbols remain to be analysed: rand ---------------------------------------- (23) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: rand(gen_0':s3_0(n230_0), gen_0':s3_0(b)) -> gen_0':s3_0(b), rt in Omega(1 + n230_0 + n230_0^2) Induction Base: rand(gen_0':s3_0(0), gen_0':s3_0(b)) ->_R^Omega(1) if(nonZero(gen_0':s3_0(0)), gen_0':s3_0(0), gen_0':s3_0(b)) ->_R^Omega(1) if(false, gen_0':s3_0(0), gen_0':s3_0(b)) ->_R^Omega(1) gen_0':s3_0(b) Induction Step: rand(gen_0':s3_0(+(n230_0, 1)), gen_0':s3_0(b)) ->_R^Omega(1) if(nonZero(gen_0':s3_0(+(n230_0, 1))), gen_0':s3_0(+(n230_0, 1)), gen_0':s3_0(b)) ->_R^Omega(1) if(true, gen_0':s3_0(+(1, n230_0)), gen_0':s3_0(b)) ->_R^Omega(1) rand(p(gen_0':s3_0(+(1, n230_0))), id_inc(gen_0':s3_0(b))) ->_L^Omega(1 + n230_0) rand(gen_0':s3_0(n230_0), id_inc(gen_0':s3_0(b))) ->_R^Omega(1) rand(gen_0':s3_0(n230_0), gen_0':s3_0(b)) ->_IH gen_0':s3_0(b) We have rt in Omega(n^2) and sz in O(n). Thus, we have irc_R in Omega(n^2). ---------------------------------------- (24) Obligation: Proved the lower bound n^2 for the following obligation: Innermost TRS: Rules: nonZero(0') -> false nonZero(s(x)) -> true p(s(0')) -> 0' p(s(s(x))) -> s(p(s(x))) id_inc(x) -> x id_inc(x) -> s(x) random(x) -> rand(x, 0') rand(x, y) -> if(nonZero(x), x, y) if(false, x, y) -> y if(true, x, y) -> rand(p(x), id_inc(y)) Types: nonZero :: 0':s -> false:true 0' :: 0':s false :: false:true s :: 0':s -> 0':s true :: false:true p :: 0':s -> 0':s id_inc :: 0':s -> 0':s random :: 0':s -> 0':s rand :: 0':s -> 0':s -> 0':s if :: false:true -> 0':s -> 0':s -> 0':s hole_false:true1_0 :: false:true hole_0':s2_0 :: 0':s gen_0':s3_0 :: Nat -> 0':s Lemmas: p(gen_0':s3_0(+(1, n5_0))) -> gen_0':s3_0(n5_0), rt in Omega(1 + n5_0) Generator Equations: gen_0':s3_0(0) <=> 0' gen_0':s3_0(+(x, 1)) <=> s(gen_0':s3_0(x)) The following defined symbols remain to be analysed: rand ---------------------------------------- (25) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (26) BOUNDS(n^2, INF)