WORST_CASE(Omega(n^1),O(n^1)) proof of input_JI5CKXi3sr.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^1). (0) CpxTRS (1) RelTrsToWeightedTrsProof [UPPER BOUND(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), 0 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 417 ms] (10) BOUNDS(1, n^1) (11) CpxTrsToCdtProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CdtProblem (13) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxRelTRS (15) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxRelTRS (17) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (18) typed CpxTrs (19) OrderProof [LOWER BOUND(ID), 17 ms] (20) typed CpxTrs (21) RewriteLemmaProof [LOWER BOUND(ID), 1232 ms] (22) typed CpxTrs (23) RewriteLemmaProof [LOWER BOUND(ID), 875 ms] (24) BEST (25) proven lower bound (26) LowerBoundPropagationProof [FINISHED, 0 ms] (27) BOUNDS(n^1, INF) (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 13 ms] (30) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: pred(s(x)) -> x minus(x, 0) -> x minus(x, s(y)) -> pred(minus(x, y)) quot(0, s(y)) -> 0 quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) log(s(0)) -> 0 log(s(s(x))) -> s(log(s(quot(x, s(s(0)))))) S is empty. Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (1) RelTrsToWeightedTrsProof (UPPER BOUND(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: pred(s(x)) -> x [1] minus(x, 0) -> x [1] minus(x, s(y)) -> pred(minus(x, y)) [1] quot(0, s(y)) -> 0 [1] quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) [1] log(s(0)) -> 0 [1] log(s(s(x))) -> s(log(s(quot(x, s(s(0)))))) [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: pred(s(x)) -> x [1] minus(x, 0) -> x [1] minus(x, s(y)) -> pred(minus(x, y)) [1] quot(0, s(y)) -> 0 [1] quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) [1] log(s(0)) -> 0 [1] log(s(s(x))) -> s(log(s(quot(x, s(s(0)))))) [1] The TRS has the following type information: pred :: s:0 -> s:0 s :: s:0 -> s:0 minus :: s:0 -> s:0 -> s:0 0 :: s:0 quot :: s:0 -> s:0 -> s:0 log :: 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: pred(v0) -> null_pred [0] quot(v0, v1) -> null_quot [0] log(v0) -> null_log [0] minus(v0, v1) -> null_minus [0] And the following fresh constants: null_pred, null_quot, null_log, null_minus ---------------------------------------- (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: pred(s(x)) -> x [1] minus(x, 0) -> x [1] minus(x, s(y)) -> pred(minus(x, y)) [1] quot(0, s(y)) -> 0 [1] quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) [1] log(s(0)) -> 0 [1] log(s(s(x))) -> s(log(s(quot(x, s(s(0)))))) [1] pred(v0) -> null_pred [0] quot(v0, v1) -> null_quot [0] log(v0) -> null_log [0] minus(v0, v1) -> null_minus [0] The TRS has the following type information: pred :: s:0:null_pred:null_quot:null_log:null_minus -> s:0:null_pred:null_quot:null_log:null_minus s :: s:0:null_pred:null_quot:null_log:null_minus -> s:0:null_pred:null_quot:null_log:null_minus minus :: s:0:null_pred:null_quot:null_log:null_minus -> s:0:null_pred:null_quot:null_log:null_minus -> s:0:null_pred:null_quot:null_log:null_minus 0 :: s:0:null_pred:null_quot:null_log:null_minus quot :: s:0:null_pred:null_quot:null_log:null_minus -> s:0:null_pred:null_quot:null_log:null_minus -> s:0:null_pred:null_quot:null_log:null_minus log :: s:0:null_pred:null_quot:null_log:null_minus -> s:0:null_pred:null_quot:null_log:null_minus null_pred :: s:0:null_pred:null_quot:null_log:null_minus null_quot :: s:0:null_pred:null_quot:null_log:null_minus null_log :: s:0:null_pred:null_quot:null_log:null_minus null_minus :: s:0:null_pred:null_quot:null_log:null_minus 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 null_pred => 0 null_quot => 0 null_log => 0 null_minus => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: log(z) -{ 1 }-> 0 :|: z = 1 + 0 log(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 log(z) -{ 1 }-> 1 + log(1 + quot(x, 1 + (1 + 0))) :|: x >= 0, z = 1 + (1 + x) minus(z, z') -{ 1 }-> x :|: x >= 0, z = x, z' = 0 minus(z, z') -{ 1 }-> pred(minus(x, y)) :|: z' = 1 + y, x >= 0, y >= 0, z = x minus(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 pred(z) -{ 1 }-> x :|: x >= 0, z = 1 + x pred(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 quot(z, z') -{ 1 }-> 0 :|: z' = 1 + y, y >= 0, z = 0 quot(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 quot(z, z') -{ 1 }-> 1 + quot(minus(x, y), 1 + y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + 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, V2),0,[pred(V, Out)],[V >= 0]). eq(start(V, V2),0,[minus(V, V2, Out)],[V >= 0,V2 >= 0]). eq(start(V, V2),0,[quot(V, V2, Out)],[V >= 0,V2 >= 0]). eq(start(V, V2),0,[log(V, Out)],[V >= 0]). eq(pred(V, Out),1,[],[Out = V1,V1 >= 0,V = 1 + V1]). eq(minus(V, V2, Out),1,[],[Out = V3,V3 >= 0,V = V3,V2 = 0]). eq(minus(V, V2, Out),1,[minus(V4, V5, Ret0),pred(Ret0, Ret)],[Out = Ret,V2 = 1 + V5,V4 >= 0,V5 >= 0,V = V4]). eq(quot(V, V2, Out),1,[],[Out = 0,V2 = 1 + V6,V6 >= 0,V = 0]). eq(quot(V, V2, Out),1,[minus(V7, V8, Ret10),quot(Ret10, 1 + V8, Ret1)],[Out = 1 + Ret1,V2 = 1 + V8,V7 >= 0,V8 >= 0,V = 1 + V7]). eq(log(V, Out),1,[],[Out = 0,V = 1]). eq(log(V, Out),1,[quot(V9, 1 + (1 + 0), Ret101),log(1 + Ret101, Ret11)],[Out = 1 + Ret11,V9 >= 0,V = 2 + V9]). eq(pred(V, Out),0,[],[Out = 0,V10 >= 0,V = V10]). eq(quot(V, V2, Out),0,[],[Out = 0,V12 >= 0,V11 >= 0,V = V12,V2 = V11]). eq(log(V, Out),0,[],[Out = 0,V13 >= 0,V = V13]). eq(minus(V, V2, Out),0,[],[Out = 0,V14 >= 0,V15 >= 0,V = V14,V2 = V15]). input_output_vars(pred(V,Out),[V],[Out]). input_output_vars(minus(V,V2,Out),[V,V2],[Out]). input_output_vars(quot(V,V2,Out),[V,V2],[Out]). input_output_vars(log(V,Out),[V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [pred/2] 1. recursive [non_tail] : [minus/3] 2. recursive : [quot/3] 3. recursive : [log/2] 4. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into pred/2 1. SCC is partially evaluated into minus/3 2. SCC is partially evaluated into quot/3 3. SCC is partially evaluated into log/2 4. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations pred/2 * CE 5 is refined into CE [16] * CE 6 is refined into CE [17] ### Cost equations --> "Loop" of pred/2 * CEs [16] --> Loop 11 * CEs [17] --> Loop 12 ### Ranking functions of CR pred(V,Out) #### Partial ranking functions of CR pred(V,Out) ### Specialization of cost equations minus/3 * CE 9 is refined into CE [18] * CE 7 is refined into CE [19] * CE 8 is refined into CE [20,21] ### Cost equations --> "Loop" of minus/3 * CEs [21] --> Loop 13 * CEs [20] --> Loop 14 * CEs [18] --> Loop 15 * CEs [19] --> Loop 16 ### Ranking functions of CR minus(V,V2,Out) * RF of phase [13]: [V2] * RF of phase [14]: [V2] #### Partial ranking functions of CR minus(V,V2,Out) * Partial RF of phase [13]: - RF of loop [13:1]: V2 * Partial RF of phase [14]: - RF of loop [14:1]: V2 ### Specialization of cost equations quot/3 * CE 10 is refined into CE [22] * CE 12 is refined into CE [23] * CE 11 is refined into CE [24,25,26] ### Cost equations --> "Loop" of quot/3 * CEs [26] --> Loop 17 * CEs [25] --> Loop 18 * CEs [24] --> Loop 19 * CEs [22,23] --> Loop 20 ### Ranking functions of CR quot(V,V2,Out) * RF of phase [17]: [V-1,V-V2+1] * RF of phase [19]: [V] #### Partial ranking functions of CR quot(V,V2,Out) * Partial RF of phase [17]: - RF of loop [17:1]: V-1 V-V2+1 * Partial RF of phase [19]: - RF of loop [19:1]: V ### Specialization of cost equations log/2 * CE 13 is refined into CE [27] * CE 15 is refined into CE [28] * CE 14 is refined into CE [29,30,31,32] ### Cost equations --> "Loop" of log/2 * CEs [32] --> Loop 21 * CEs [31] --> Loop 22 * CEs [30] --> Loop 23 * CEs [29] --> Loop 24 * CEs [27,28] --> Loop 25 ### Ranking functions of CR log(V,Out) * RF of phase [21,22]: [V-3,V/2-3/2] #### Partial ranking functions of CR log(V,Out) * Partial RF of phase [21,22]: - RF of loop [21:1]: V/2-2 - RF of loop [22:1]: V-3 ### Specialization of cost equations start/2 * CE 1 is refined into CE [33,34] * CE 2 is refined into CE [35,36,37] * CE 3 is refined into CE [38,39,40,41,42] * CE 4 is refined into CE [43,44,45,46,47,48] ### Cost equations --> "Loop" of start/2 * CEs [38] --> Loop 26 * CEs [33,34,35,36,37,39,40,41,42,43,44,45,46,47,48] --> Loop 27 ### Ranking functions of CR start(V,V2) #### Partial ranking functions of CR start(V,V2) Computing Bounds ===================================== #### Cost of chains of pred(V,Out): * Chain [12]: 0 with precondition: [Out=0,V>=0] * Chain [11]: 1 with precondition: [V=Out+1,V>=1] #### Cost of chains of minus(V,V2,Out): * Chain [[14],[13],16]: 3*it(13)+1 Such that:aux(1) =< V2 it(13) =< aux(1) with precondition: [Out=0,V>=1,V2>=2] * Chain [[14],16]: 1*it(14)+1 Such that:it(14) =< V2 with precondition: [Out=0,V>=0,V2>=1] * Chain [[14],15]: 1*it(14)+0 Such that:it(14) =< V2 with precondition: [Out=0,V>=0,V2>=1] * Chain [[13],16]: 2*it(13)+1 Such that:it(13) =< V2 with precondition: [V=Out+V2,V2>=1,V>=V2] * Chain [16]: 1 with precondition: [V2=0,V=Out,V>=0] * Chain [15]: 0 with precondition: [Out=0,V>=0,V2>=0] #### Cost of chains of quot(V,V2,Out): * Chain [[19],20]: 2*it(19)+1 Such that:it(19) =< Out with precondition: [V2=1,Out>=1,V>=Out] * Chain [[19],18,20]: 2*it(19)+5*s(6)+3 Such that:s(5) =< 1 it(19) =< Out s(6) =< s(5) with precondition: [V2=1,Out>=2,V>=Out] * Chain [[17],20]: 2*it(17)+2*s(9)+1 Such that:it(17) =< V-V2+1 aux(5) =< V it(17) =< aux(5) s(9) =< aux(5) with precondition: [V2>=2,Out>=1,V+2>=2*Out+V2] * Chain [[17],18,20]: 2*it(17)+5*s(6)+2*s(9)+3 Such that:it(17) =< V-V2+1 s(5) =< V2 aux(6) =< V s(6) =< s(5) it(17) =< aux(6) s(9) =< aux(6) with precondition: [V2>=2,Out>=2,V+3>=2*Out+V2] * Chain [20]: 1 with precondition: [Out=0,V>=0,V2>=0] * Chain [18,20]: 5*s(6)+3 Such that:s(5) =< V2 s(6) =< s(5) with precondition: [Out=1,V>=1,V2>=1] #### Cost of chains of log(V,Out): * Chain [[21,22],25]: 4*it(21)+2*it(22)+4*s(28)+5*s(29)+4*s(32)+1 Such that:s(33) =< 2*V aux(16) =< 5/2*V aux(15) =< 5/2*V+27/2 aux(17) =< V aux(18) =< V/2 aux(10) =< aux(17) it(21) =< aux(17) it(22) =< aux(17) aux(10) =< aux(18) it(21) =< aux(18) it(22) =< aux(18) it(22) =< aux(15) s(31) =< aux(15) it(22) =< aux(16) s(31) =< aux(16) s(30) =< aux(10)*2 s(32) =< s(33) s(28) =< s(31) s(29) =< s(30) with precondition: [Out>=1,V>=3*Out+1] * Chain [[21,22],24,25]: 4*it(21)+2*it(22)+4*s(28)+5*s(29)+4*s(32)+3 Such that:s(33) =< 2*V aux(16) =< 5/2*V aux(15) =< 5/2*V+27/2 aux(19) =< V aux(20) =< V/2 aux(10) =< aux(19) it(21) =< aux(19) it(22) =< aux(19) aux(10) =< aux(20) it(21) =< aux(20) it(22) =< aux(20) it(22) =< aux(15) s(31) =< aux(15) it(22) =< aux(16) s(31) =< aux(16) s(30) =< aux(10)*2 s(32) =< s(33) s(28) =< s(31) s(29) =< s(30) with precondition: [Out>=2,V+2>=3*Out] * Chain [[21,22],23,25]: 4*it(21)+2*it(22)+4*s(28)+5*s(29)+4*s(32)+5*s(35)+5 Such that:s(34) =< 2 s(33) =< 2*V aux(16) =< 5/2*V aux(15) =< 5/2*V+27/2 aux(21) =< V aux(22) =< V/2 s(35) =< s(34) aux(10) =< aux(21) it(21) =< aux(21) it(22) =< aux(21) aux(10) =< aux(22) it(21) =< aux(22) it(22) =< aux(22) it(22) =< aux(15) s(31) =< aux(15) it(22) =< aux(16) s(31) =< aux(16) s(30) =< aux(10)*2 s(32) =< s(33) s(28) =< s(31) s(29) =< s(30) with precondition: [Out>=2,V+3>=4*Out] * Chain [[21,22],23,24,25]: 4*it(21)+2*it(22)+4*s(28)+5*s(29)+4*s(32)+5*s(35)+7 Such that:s(34) =< 2 s(33) =< 2*V aux(16) =< 5/2*V aux(15) =< 5/2*V+27/2 aux(23) =< V aux(24) =< V/2 s(35) =< s(34) aux(10) =< aux(23) it(21) =< aux(23) it(22) =< aux(23) aux(10) =< aux(24) it(21) =< aux(24) it(22) =< aux(24) it(22) =< aux(15) s(31) =< aux(15) it(22) =< aux(16) s(31) =< aux(16) s(30) =< aux(10)*2 s(32) =< s(33) s(28) =< s(31) s(29) =< s(30) with precondition: [Out>=3,V+7>=4*Out] * Chain [25]: 1 with precondition: [Out=0,V>=0] * Chain [24,25]: 3 with precondition: [Out=1,V>=2] * Chain [23,25]: 5*s(35)+5 Such that:s(34) =< 2 s(35) =< s(34) with precondition: [Out=1,V>=3] * Chain [23,24,25]: 5*s(35)+7 Such that:s(34) =< 2 s(35) =< s(34) with precondition: [Out=2,V>=3] #### Cost of chains of start(V,V2): * Chain [27]: 17*s(67)+4*s(71)+4*s(73)+15*s(80)+16*s(87)+8*s(88)+16*s(91)+16*s(92)+20*s(93)+15 Such that:aux(30) =< 2 aux(31) =< V aux(32) =< V-V2+1 aux(33) =< 2*V aux(34) =< V/2 aux(35) =< 5/2*V aux(36) =< 5/2*V+27/2 aux(37) =< V2 s(71) =< aux(32) s(67) =< aux(37) s(80) =< aux(30) s(86) =< aux(31) s(87) =< aux(31) s(88) =< aux(31) s(86) =< aux(34) s(87) =< aux(34) s(88) =< aux(34) s(88) =< aux(36) s(89) =< aux(36) s(88) =< aux(35) s(89) =< aux(35) s(90) =< s(86)*2 s(91) =< aux(33) s(92) =< s(89) s(93) =< s(90) s(71) =< aux(31) s(73) =< aux(31) with precondition: [V>=0] * Chain [26]: 4*s(126)+5*s(127)+3 Such that:s(124) =< 1 s(125) =< V s(126) =< s(125) s(127) =< s(124) with precondition: [V2=1,V>=1] Closed-form bounds of start(V,V2): ------------------------------------- * Chain [27] with precondition: [V>=0] - Upper bound: 68*V+45+nat(V2)*17+32*V+(40*V+216)+nat(V-V2+1)*4 - Complexity: n * Chain [26] with precondition: [V2=1,V>=1] - Upper bound: 4*V+8 - Complexity: n ### Maximum cost of start(V,V2): 64*V+37+nat(V2)*17+32*V+(40*V+216)+nat(V-V2+1)*4+(4*V+8) Asymptotic class: n * Total analysis performed in 375 ms. ---------------------------------------- (10) BOUNDS(1, n^1) ---------------------------------------- (11) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (12) Obligation: Complexity Dependency Tuples Problem Rules: pred(s(z0)) -> z0 minus(z0, 0) -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) quot(0, s(z0)) -> 0 quot(s(z0), s(z1)) -> s(quot(minus(z0, z1), s(z1))) log(s(0)) -> 0 log(s(s(z0))) -> s(log(s(quot(z0, s(s(0)))))) Tuples: PRED(s(z0)) -> c MINUS(z0, 0) -> c1 MINUS(z0, s(z1)) -> c2(PRED(minus(z0, z1)), MINUS(z0, z1)) QUOT(0, s(z0)) -> c3 QUOT(s(z0), s(z1)) -> c4(QUOT(minus(z0, z1), s(z1)), MINUS(z0, z1)) LOG(s(0)) -> c5 LOG(s(s(z0))) -> c6(LOG(s(quot(z0, s(s(0))))), QUOT(z0, s(s(0)))) S tuples: PRED(s(z0)) -> c MINUS(z0, 0) -> c1 MINUS(z0, s(z1)) -> c2(PRED(minus(z0, z1)), MINUS(z0, z1)) QUOT(0, s(z0)) -> c3 QUOT(s(z0), s(z1)) -> c4(QUOT(minus(z0, z1), s(z1)), MINUS(z0, z1)) LOG(s(0)) -> c5 LOG(s(s(z0))) -> c6(LOG(s(quot(z0, s(s(0))))), QUOT(z0, s(s(0)))) K tuples:none Defined Rule Symbols: pred_1, minus_2, quot_2, log_1 Defined Pair Symbols: PRED_1, MINUS_2, QUOT_2, LOG_1 Compound Symbols: c, c1, c2_2, c3, c4_2, c5, c6_2 ---------------------------------------- (13) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (14) 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: PRED(s(z0)) -> c MINUS(z0, 0) -> c1 MINUS(z0, s(z1)) -> c2(PRED(minus(z0, z1)), MINUS(z0, z1)) QUOT(0, s(z0)) -> c3 QUOT(s(z0), s(z1)) -> c4(QUOT(minus(z0, z1), s(z1)), MINUS(z0, z1)) LOG(s(0)) -> c5 LOG(s(s(z0))) -> c6(LOG(s(quot(z0, s(s(0))))), QUOT(z0, s(s(0)))) The (relative) TRS S consists of the following rules: pred(s(z0)) -> z0 minus(z0, 0) -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) quot(0, s(z0)) -> 0 quot(s(z0), s(z1)) -> s(quot(minus(z0, z1), s(z1))) log(s(0)) -> 0 log(s(s(z0))) -> s(log(s(quot(z0, s(s(0)))))) Rewrite Strategy: INNERMOST ---------------------------------------- (15) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (16) 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: PRED(s(z0)) -> c MINUS(z0, 0') -> c1 MINUS(z0, s(z1)) -> c2(PRED(minus(z0, z1)), MINUS(z0, z1)) QUOT(0', s(z0)) -> c3 QUOT(s(z0), s(z1)) -> c4(QUOT(minus(z0, z1), s(z1)), MINUS(z0, z1)) LOG(s(0')) -> c5 LOG(s(s(z0))) -> c6(LOG(s(quot(z0, s(s(0'))))), QUOT(z0, s(s(0')))) The (relative) TRS S consists of the following rules: pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) quot(0', s(z0)) -> 0' quot(s(z0), s(z1)) -> s(quot(minus(z0, z1), s(z1))) log(s(0')) -> 0' log(s(s(z0))) -> s(log(s(quot(z0, s(s(0')))))) Rewrite Strategy: INNERMOST ---------------------------------------- (17) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (18) Obligation: Innermost TRS: Rules: PRED(s(z0)) -> c MINUS(z0, 0') -> c1 MINUS(z0, s(z1)) -> c2(PRED(minus(z0, z1)), MINUS(z0, z1)) QUOT(0', s(z0)) -> c3 QUOT(s(z0), s(z1)) -> c4(QUOT(minus(z0, z1), s(z1)), MINUS(z0, z1)) LOG(s(0')) -> c5 LOG(s(s(z0))) -> c6(LOG(s(quot(z0, s(s(0'))))), QUOT(z0, s(s(0')))) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) quot(0', s(z0)) -> 0' quot(s(z0), s(z1)) -> s(quot(minus(z0, z1), s(z1))) log(s(0')) -> 0' log(s(s(z0))) -> s(log(s(quot(z0, s(s(0')))))) Types: PRED :: s:0' -> c s :: s:0' -> s:0' c :: c MINUS :: s:0' -> s:0' -> c1:c2 0' :: s:0' c1 :: c1:c2 c2 :: c -> c1:c2 -> c1:c2 minus :: s:0' -> s:0' -> s:0' QUOT :: s:0' -> s:0' -> c3:c4 c3 :: c3:c4 c4 :: c3:c4 -> c1:c2 -> c3:c4 LOG :: s:0' -> c5:c6 c5 :: c5:c6 c6 :: c5:c6 -> c3:c4 -> c5:c6 quot :: s:0' -> s:0' -> s:0' pred :: s:0' -> s:0' log :: s:0' -> s:0' hole_c1_7 :: c hole_s:0'2_7 :: s:0' hole_c1:c23_7 :: c1:c2 hole_c3:c44_7 :: c3:c4 hole_c5:c65_7 :: c5:c6 gen_s:0'6_7 :: Nat -> s:0' gen_c1:c27_7 :: Nat -> c1:c2 gen_c3:c48_7 :: Nat -> c3:c4 gen_c5:c69_7 :: Nat -> c5:c6 ---------------------------------------- (19) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: MINUS, minus, QUOT, LOG, quot, log They will be analysed ascendingly in the following order: minus < MINUS MINUS < QUOT minus < QUOT minus < quot QUOT < LOG quot < LOG quot < log ---------------------------------------- (20) Obligation: Innermost TRS: Rules: PRED(s(z0)) -> c MINUS(z0, 0') -> c1 MINUS(z0, s(z1)) -> c2(PRED(minus(z0, z1)), MINUS(z0, z1)) QUOT(0', s(z0)) -> c3 QUOT(s(z0), s(z1)) -> c4(QUOT(minus(z0, z1), s(z1)), MINUS(z0, z1)) LOG(s(0')) -> c5 LOG(s(s(z0))) -> c6(LOG(s(quot(z0, s(s(0'))))), QUOT(z0, s(s(0')))) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) quot(0', s(z0)) -> 0' quot(s(z0), s(z1)) -> s(quot(minus(z0, z1), s(z1))) log(s(0')) -> 0' log(s(s(z0))) -> s(log(s(quot(z0, s(s(0')))))) Types: PRED :: s:0' -> c s :: s:0' -> s:0' c :: c MINUS :: s:0' -> s:0' -> c1:c2 0' :: s:0' c1 :: c1:c2 c2 :: c -> c1:c2 -> c1:c2 minus :: s:0' -> s:0' -> s:0' QUOT :: s:0' -> s:0' -> c3:c4 c3 :: c3:c4 c4 :: c3:c4 -> c1:c2 -> c3:c4 LOG :: s:0' -> c5:c6 c5 :: c5:c6 c6 :: c5:c6 -> c3:c4 -> c5:c6 quot :: s:0' -> s:0' -> s:0' pred :: s:0' -> s:0' log :: s:0' -> s:0' hole_c1_7 :: c hole_s:0'2_7 :: s:0' hole_c1:c23_7 :: c1:c2 hole_c3:c44_7 :: c3:c4 hole_c5:c65_7 :: c5:c6 gen_s:0'6_7 :: Nat -> s:0' gen_c1:c27_7 :: Nat -> c1:c2 gen_c3:c48_7 :: Nat -> c3:c4 gen_c5:c69_7 :: Nat -> c5:c6 Generator Equations: gen_s:0'6_7(0) <=> 0' gen_s:0'6_7(+(x, 1)) <=> s(gen_s:0'6_7(x)) gen_c1:c27_7(0) <=> c1 gen_c1:c27_7(+(x, 1)) <=> c2(c, gen_c1:c27_7(x)) gen_c3:c48_7(0) <=> c3 gen_c3:c48_7(+(x, 1)) <=> c4(gen_c3:c48_7(x), c1) gen_c5:c69_7(0) <=> c5 gen_c5:c69_7(+(x, 1)) <=> c6(gen_c5:c69_7(x), c3) The following defined symbols remain to be analysed: minus, MINUS, QUOT, LOG, quot, log They will be analysed ascendingly in the following order: minus < MINUS MINUS < QUOT minus < QUOT minus < quot QUOT < LOG quot < LOG quot < log ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: minus(gen_s:0'6_7(a), gen_s:0'6_7(+(1, n11_7))) -> *10_7, rt in Omega(0) Induction Base: minus(gen_s:0'6_7(a), gen_s:0'6_7(+(1, 0))) Induction Step: minus(gen_s:0'6_7(a), gen_s:0'6_7(+(1, +(n11_7, 1)))) ->_R^Omega(0) pred(minus(gen_s:0'6_7(a), gen_s:0'6_7(+(1, n11_7)))) ->_IH pred(*10_7) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (22) Obligation: Innermost TRS: Rules: PRED(s(z0)) -> c MINUS(z0, 0') -> c1 MINUS(z0, s(z1)) -> c2(PRED(minus(z0, z1)), MINUS(z0, z1)) QUOT(0', s(z0)) -> c3 QUOT(s(z0), s(z1)) -> c4(QUOT(minus(z0, z1), s(z1)), MINUS(z0, z1)) LOG(s(0')) -> c5 LOG(s(s(z0))) -> c6(LOG(s(quot(z0, s(s(0'))))), QUOT(z0, s(s(0')))) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) quot(0', s(z0)) -> 0' quot(s(z0), s(z1)) -> s(quot(minus(z0, z1), s(z1))) log(s(0')) -> 0' log(s(s(z0))) -> s(log(s(quot(z0, s(s(0')))))) Types: PRED :: s:0' -> c s :: s:0' -> s:0' c :: c MINUS :: s:0' -> s:0' -> c1:c2 0' :: s:0' c1 :: c1:c2 c2 :: c -> c1:c2 -> c1:c2 minus :: s:0' -> s:0' -> s:0' QUOT :: s:0' -> s:0' -> c3:c4 c3 :: c3:c4 c4 :: c3:c4 -> c1:c2 -> c3:c4 LOG :: s:0' -> c5:c6 c5 :: c5:c6 c6 :: c5:c6 -> c3:c4 -> c5:c6 quot :: s:0' -> s:0' -> s:0' pred :: s:0' -> s:0' log :: s:0' -> s:0' hole_c1_7 :: c hole_s:0'2_7 :: s:0' hole_c1:c23_7 :: c1:c2 hole_c3:c44_7 :: c3:c4 hole_c5:c65_7 :: c5:c6 gen_s:0'6_7 :: Nat -> s:0' gen_c1:c27_7 :: Nat -> c1:c2 gen_c3:c48_7 :: Nat -> c3:c4 gen_c5:c69_7 :: Nat -> c5:c6 Lemmas: minus(gen_s:0'6_7(a), gen_s:0'6_7(+(1, n11_7))) -> *10_7, rt in Omega(0) Generator Equations: gen_s:0'6_7(0) <=> 0' gen_s:0'6_7(+(x, 1)) <=> s(gen_s:0'6_7(x)) gen_c1:c27_7(0) <=> c1 gen_c1:c27_7(+(x, 1)) <=> c2(c, gen_c1:c27_7(x)) gen_c3:c48_7(0) <=> c3 gen_c3:c48_7(+(x, 1)) <=> c4(gen_c3:c48_7(x), c1) gen_c5:c69_7(0) <=> c5 gen_c5:c69_7(+(x, 1)) <=> c6(gen_c5:c69_7(x), c3) The following defined symbols remain to be analysed: MINUS, QUOT, LOG, quot, log They will be analysed ascendingly in the following order: MINUS < QUOT QUOT < LOG quot < LOG quot < log ---------------------------------------- (23) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: QUOT(gen_s:0'6_7(n16818_7), gen_s:0'6_7(1)) -> gen_c3:c48_7(n16818_7), rt in Omega(1 + n16818_7) Induction Base: QUOT(gen_s:0'6_7(0), gen_s:0'6_7(1)) ->_R^Omega(1) c3 Induction Step: QUOT(gen_s:0'6_7(+(n16818_7, 1)), gen_s:0'6_7(1)) ->_R^Omega(1) c4(QUOT(minus(gen_s:0'6_7(n16818_7), gen_s:0'6_7(0)), s(gen_s:0'6_7(0))), MINUS(gen_s:0'6_7(n16818_7), gen_s:0'6_7(0))) ->_R^Omega(0) c4(QUOT(gen_s:0'6_7(n16818_7), s(gen_s:0'6_7(0))), MINUS(gen_s:0'6_7(n16818_7), gen_s:0'6_7(0))) ->_IH c4(gen_c3:c48_7(c16819_7), MINUS(gen_s:0'6_7(n16818_7), gen_s:0'6_7(0))) ->_R^Omega(1) c4(gen_c3:c48_7(n16818_7), c1) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (24) Complex Obligation (BEST) ---------------------------------------- (25) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: PRED(s(z0)) -> c MINUS(z0, 0') -> c1 MINUS(z0, s(z1)) -> c2(PRED(minus(z0, z1)), MINUS(z0, z1)) QUOT(0', s(z0)) -> c3 QUOT(s(z0), s(z1)) -> c4(QUOT(minus(z0, z1), s(z1)), MINUS(z0, z1)) LOG(s(0')) -> c5 LOG(s(s(z0))) -> c6(LOG(s(quot(z0, s(s(0'))))), QUOT(z0, s(s(0')))) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) quot(0', s(z0)) -> 0' quot(s(z0), s(z1)) -> s(quot(minus(z0, z1), s(z1))) log(s(0')) -> 0' log(s(s(z0))) -> s(log(s(quot(z0, s(s(0')))))) Types: PRED :: s:0' -> c s :: s:0' -> s:0' c :: c MINUS :: s:0' -> s:0' -> c1:c2 0' :: s:0' c1 :: c1:c2 c2 :: c -> c1:c2 -> c1:c2 minus :: s:0' -> s:0' -> s:0' QUOT :: s:0' -> s:0' -> c3:c4 c3 :: c3:c4 c4 :: c3:c4 -> c1:c2 -> c3:c4 LOG :: s:0' -> c5:c6 c5 :: c5:c6 c6 :: c5:c6 -> c3:c4 -> c5:c6 quot :: s:0' -> s:0' -> s:0' pred :: s:0' -> s:0' log :: s:0' -> s:0' hole_c1_7 :: c hole_s:0'2_7 :: s:0' hole_c1:c23_7 :: c1:c2 hole_c3:c44_7 :: c3:c4 hole_c5:c65_7 :: c5:c6 gen_s:0'6_7 :: Nat -> s:0' gen_c1:c27_7 :: Nat -> c1:c2 gen_c3:c48_7 :: Nat -> c3:c4 gen_c5:c69_7 :: Nat -> c5:c6 Lemmas: minus(gen_s:0'6_7(a), gen_s:0'6_7(+(1, n11_7))) -> *10_7, rt in Omega(0) Generator Equations: gen_s:0'6_7(0) <=> 0' gen_s:0'6_7(+(x, 1)) <=> s(gen_s:0'6_7(x)) gen_c1:c27_7(0) <=> c1 gen_c1:c27_7(+(x, 1)) <=> c2(c, gen_c1:c27_7(x)) gen_c3:c48_7(0) <=> c3 gen_c3:c48_7(+(x, 1)) <=> c4(gen_c3:c48_7(x), c1) gen_c5:c69_7(0) <=> c5 gen_c5:c69_7(+(x, 1)) <=> c6(gen_c5:c69_7(x), c3) The following defined symbols remain to be analysed: QUOT, LOG, quot, log They will be analysed ascendingly in the following order: QUOT < LOG quot < LOG quot < log ---------------------------------------- (26) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (27) BOUNDS(n^1, INF) ---------------------------------------- (28) Obligation: Innermost TRS: Rules: PRED(s(z0)) -> c MINUS(z0, 0') -> c1 MINUS(z0, s(z1)) -> c2(PRED(minus(z0, z1)), MINUS(z0, z1)) QUOT(0', s(z0)) -> c3 QUOT(s(z0), s(z1)) -> c4(QUOT(minus(z0, z1), s(z1)), MINUS(z0, z1)) LOG(s(0')) -> c5 LOG(s(s(z0))) -> c6(LOG(s(quot(z0, s(s(0'))))), QUOT(z0, s(s(0')))) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) quot(0', s(z0)) -> 0' quot(s(z0), s(z1)) -> s(quot(minus(z0, z1), s(z1))) log(s(0')) -> 0' log(s(s(z0))) -> s(log(s(quot(z0, s(s(0')))))) Types: PRED :: s:0' -> c s :: s:0' -> s:0' c :: c MINUS :: s:0' -> s:0' -> c1:c2 0' :: s:0' c1 :: c1:c2 c2 :: c -> c1:c2 -> c1:c2 minus :: s:0' -> s:0' -> s:0' QUOT :: s:0' -> s:0' -> c3:c4 c3 :: c3:c4 c4 :: c3:c4 -> c1:c2 -> c3:c4 LOG :: s:0' -> c5:c6 c5 :: c5:c6 c6 :: c5:c6 -> c3:c4 -> c5:c6 quot :: s:0' -> s:0' -> s:0' pred :: s:0' -> s:0' log :: s:0' -> s:0' hole_c1_7 :: c hole_s:0'2_7 :: s:0' hole_c1:c23_7 :: c1:c2 hole_c3:c44_7 :: c3:c4 hole_c5:c65_7 :: c5:c6 gen_s:0'6_7 :: Nat -> s:0' gen_c1:c27_7 :: Nat -> c1:c2 gen_c3:c48_7 :: Nat -> c3:c4 gen_c5:c69_7 :: Nat -> c5:c6 Lemmas: minus(gen_s:0'6_7(a), gen_s:0'6_7(+(1, n11_7))) -> *10_7, rt in Omega(0) QUOT(gen_s:0'6_7(n16818_7), gen_s:0'6_7(1)) -> gen_c3:c48_7(n16818_7), rt in Omega(1 + n16818_7) Generator Equations: gen_s:0'6_7(0) <=> 0' gen_s:0'6_7(+(x, 1)) <=> s(gen_s:0'6_7(x)) gen_c1:c27_7(0) <=> c1 gen_c1:c27_7(+(x, 1)) <=> c2(c, gen_c1:c27_7(x)) gen_c3:c48_7(0) <=> c3 gen_c3:c48_7(+(x, 1)) <=> c4(gen_c3:c48_7(x), c1) gen_c5:c69_7(0) <=> c5 gen_c5:c69_7(+(x, 1)) <=> c6(gen_c5:c69_7(x), c3) The following defined symbols remain to be analysed: quot, LOG, log They will be analysed ascendingly in the following order: quot < LOG quot < log ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: quot(gen_s:0'6_7(n19069_7), gen_s:0'6_7(1)) -> gen_s:0'6_7(n19069_7), rt in Omega(0) Induction Base: quot(gen_s:0'6_7(0), gen_s:0'6_7(1)) ->_R^Omega(0) 0' Induction Step: quot(gen_s:0'6_7(+(n19069_7, 1)), gen_s:0'6_7(1)) ->_R^Omega(0) s(quot(minus(gen_s:0'6_7(n19069_7), gen_s:0'6_7(0)), s(gen_s:0'6_7(0)))) ->_R^Omega(0) s(quot(gen_s:0'6_7(n19069_7), s(gen_s:0'6_7(0)))) ->_IH s(gen_s:0'6_7(c19070_7)) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (30) Obligation: Innermost TRS: Rules: PRED(s(z0)) -> c MINUS(z0, 0') -> c1 MINUS(z0, s(z1)) -> c2(PRED(minus(z0, z1)), MINUS(z0, z1)) QUOT(0', s(z0)) -> c3 QUOT(s(z0), s(z1)) -> c4(QUOT(minus(z0, z1), s(z1)), MINUS(z0, z1)) LOG(s(0')) -> c5 LOG(s(s(z0))) -> c6(LOG(s(quot(z0, s(s(0'))))), QUOT(z0, s(s(0')))) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) quot(0', s(z0)) -> 0' quot(s(z0), s(z1)) -> s(quot(minus(z0, z1), s(z1))) log(s(0')) -> 0' log(s(s(z0))) -> s(log(s(quot(z0, s(s(0')))))) Types: PRED :: s:0' -> c s :: s:0' -> s:0' c :: c MINUS :: s:0' -> s:0' -> c1:c2 0' :: s:0' c1 :: c1:c2 c2 :: c -> c1:c2 -> c1:c2 minus :: s:0' -> s:0' -> s:0' QUOT :: s:0' -> s:0' -> c3:c4 c3 :: c3:c4 c4 :: c3:c4 -> c1:c2 -> c3:c4 LOG :: s:0' -> c5:c6 c5 :: c5:c6 c6 :: c5:c6 -> c3:c4 -> c5:c6 quot :: s:0' -> s:0' -> s:0' pred :: s:0' -> s:0' log :: s:0' -> s:0' hole_c1_7 :: c hole_s:0'2_7 :: s:0' hole_c1:c23_7 :: c1:c2 hole_c3:c44_7 :: c3:c4 hole_c5:c65_7 :: c5:c6 gen_s:0'6_7 :: Nat -> s:0' gen_c1:c27_7 :: Nat -> c1:c2 gen_c3:c48_7 :: Nat -> c3:c4 gen_c5:c69_7 :: Nat -> c5:c6 Lemmas: minus(gen_s:0'6_7(a), gen_s:0'6_7(+(1, n11_7))) -> *10_7, rt in Omega(0) QUOT(gen_s:0'6_7(n16818_7), gen_s:0'6_7(1)) -> gen_c3:c48_7(n16818_7), rt in Omega(1 + n16818_7) quot(gen_s:0'6_7(n19069_7), gen_s:0'6_7(1)) -> gen_s:0'6_7(n19069_7), rt in Omega(0) Generator Equations: gen_s:0'6_7(0) <=> 0' gen_s:0'6_7(+(x, 1)) <=> s(gen_s:0'6_7(x)) gen_c1:c27_7(0) <=> c1 gen_c1:c27_7(+(x, 1)) <=> c2(c, gen_c1:c27_7(x)) gen_c3:c48_7(0) <=> c3 gen_c3:c48_7(+(x, 1)) <=> c4(gen_c3:c48_7(x), c1) gen_c5:c69_7(0) <=> c5 gen_c5:c69_7(+(x, 1)) <=> c6(gen_c5:c69_7(x), c3) The following defined symbols remain to be analysed: LOG, log