WORST_CASE(Omega(n^1),O(n^2)) proof of input_E4id1KpZjK.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, 426 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), 17 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 260 ms] (30) typed CpxTrs (31) RewriteLemmaProof [LOWER BOUND(ID), 113 ms] (32) BEST (33) proven lower bound (34) LowerBoundPropagationProof [FINISHED, 0 ms] (35) BOUNDS(n^1, INF) (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: f(true, x, y) -> f(gt(x, y), s(x), s(s(y))) gt(0, v) -> false gt(s(u), 0) -> true gt(s(u), s(v)) -> gt(u, v) 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: f(true, z0, z1) -> f(gt(z0, z1), s(z0), s(s(z1))) gt(0, z0) -> false gt(s(z0), 0) -> true gt(s(z0), s(z1)) -> gt(z0, z1) Tuples: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(0, z0) -> c1 GT(s(z0), 0) -> c2 GT(s(z0), s(z1)) -> c3(GT(z0, z1)) S tuples: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(0, z0) -> c1 GT(s(z0), 0) -> c2 GT(s(z0), s(z1)) -> c3(GT(z0, z1)) K tuples:none Defined Rule Symbols: f_3, gt_2 Defined Pair Symbols: F_3, GT_2 Compound Symbols: c_2, c1, c2, c3_1 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing nodes: GT(0, z0) -> c1 GT(s(z0), 0) -> c2 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: f(true, z0, z1) -> f(gt(z0, z1), s(z0), s(s(z1))) gt(0, z0) -> false gt(s(z0), 0) -> true gt(s(z0), s(z1)) -> gt(z0, z1) Tuples: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(s(z0), s(z1)) -> c3(GT(z0, z1)) S tuples: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(s(z0), s(z1)) -> c3(GT(z0, z1)) K tuples:none Defined Rule Symbols: f_3, gt_2 Defined Pair Symbols: F_3, GT_2 Compound Symbols: c_2, c3_1 ---------------------------------------- (5) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: f(true, z0, z1) -> f(gt(z0, z1), s(z0), s(s(z1))) ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: gt(0, z0) -> false gt(s(z0), 0) -> true gt(s(z0), s(z1)) -> gt(z0, z1) Tuples: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(s(z0), s(z1)) -> c3(GT(z0, z1)) S tuples: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(s(z0), s(z1)) -> c3(GT(z0, z1)) K tuples:none Defined Rule Symbols: gt_2 Defined Pair Symbols: F_3, GT_2 Compound Symbols: c_2, c3_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: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(s(z0), s(z1)) -> c3(GT(z0, z1)) The (relative) TRS S consists of the following rules: gt(0, z0) -> false gt(s(z0), 0) -> true gt(s(z0), s(z1)) -> gt(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: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) [1] GT(s(z0), s(z1)) -> c3(GT(z0, z1)) [1] gt(0, z0) -> false [0] gt(s(z0), 0) -> true [0] gt(s(z0), s(z1)) -> gt(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: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) [1] GT(s(z0), s(z1)) -> c3(GT(z0, z1)) [1] gt(0, z0) -> false [0] gt(s(z0), 0) -> true [0] gt(s(z0), s(z1)) -> gt(z0, z1) [0] The TRS has the following type information: F :: true:false -> s:0 -> s:0 -> c true :: true:false c :: c -> c3 -> c gt :: s:0 -> s:0 -> true:false s :: s:0 -> s:0 GT :: s:0 -> s:0 -> c3 c3 :: c3 -> c3 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: gt(v0, v1) -> null_gt [0] F(v0, v1, v2) -> null_F [0] GT(v0, v1) -> null_GT [0] And the following fresh constants: null_gt, null_F, null_GT ---------------------------------------- (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: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) [1] GT(s(z0), s(z1)) -> c3(GT(z0, z1)) [1] gt(0, z0) -> false [0] gt(s(z0), 0) -> true [0] gt(s(z0), s(z1)) -> gt(z0, z1) [0] gt(v0, v1) -> null_gt [0] F(v0, v1, v2) -> null_F [0] GT(v0, v1) -> null_GT [0] The TRS has the following type information: F :: true:false:null_gt -> s:0 -> s:0 -> c:null_F true :: true:false:null_gt c :: c:null_F -> c3:null_GT -> c:null_F gt :: s:0 -> s:0 -> true:false:null_gt s :: s:0 -> s:0 GT :: s:0 -> s:0 -> c3:null_GT c3 :: c3:null_GT -> c3:null_GT 0 :: s:0 false :: true:false:null_gt null_gt :: true:false:null_gt null_F :: c:null_F null_GT :: c3:null_GT 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_gt => 0 null_F => 0 null_GT => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 F(z, z', z'') -{ 1 }-> 1 + F(gt(z0, z1), 1 + z0, 1 + (1 + z1)) + GT(z0, z1) :|: z = 2, z1 >= 0, z0 >= 0, z' = z0, z'' = z1 GT(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 GT(z, z') -{ 1 }-> 1 + GT(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 gt(z, z') -{ 0 }-> gt(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 gt(z, z') -{ 0 }-> 2 :|: z = 1 + z0, z0 >= 0, z' = 0 gt(z, z') -{ 0 }-> 1 :|: z0 >= 0, z = 0, z' = z0 gt(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, V2),0,[fun(V1, V, V2, Out)],[V1 >= 0,V >= 0,V2 >= 0]). eq(start(V1, V, V2),0,[fun1(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V2),0,[gt(V1, V, Out)],[V1 >= 0,V >= 0]). eq(fun(V1, V, V2, Out),1,[gt(V4, V3, Ret010),fun(Ret010, 1 + V4, 1 + (1 + V3), Ret01),fun1(V4, V3, Ret1)],[Out = 1 + Ret01 + Ret1,V1 = 2,V3 >= 0,V4 >= 0,V = V4,V2 = V3]). eq(fun1(V1, V, Out),1,[fun1(V6, V5, Ret11)],[Out = 1 + Ret11,V5 >= 0,V1 = 1 + V6,V6 >= 0,V = 1 + V5]). eq(gt(V1, V, Out),0,[],[Out = 1,V7 >= 0,V1 = 0,V = V7]). eq(gt(V1, V, Out),0,[],[Out = 2,V1 = 1 + V8,V8 >= 0,V = 0]). eq(gt(V1, V, Out),0,[gt(V9, V10, Ret)],[Out = Ret,V10 >= 0,V1 = 1 + V9,V9 >= 0,V = 1 + V10]). eq(gt(V1, V, Out),0,[],[Out = 0,V12 >= 0,V11 >= 0,V1 = V12,V = V11]). eq(fun(V1, V, V2, Out),0,[],[Out = 0,V14 >= 0,V2 = V15,V13 >= 0,V1 = V14,V = V13,V15 >= 0]). eq(fun1(V1, V, Out),0,[],[Out = 0,V17 >= 0,V16 >= 0,V1 = V17,V = V16]). input_output_vars(fun(V1,V,V2,Out),[V1,V,V2],[Out]). input_output_vars(fun1(V1,V,Out),[V1,V],[Out]). input_output_vars(gt(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun1/3] 1. recursive : [gt/3] 2. recursive [non_tail] : [fun/4] 3. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun1/3 1. SCC is partially evaluated into gt/3 2. SCC is partially evaluated into fun/4 3. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun1/3 * CE 7 is refined into CE [12] * CE 6 is refined into CE [13] ### Cost equations --> "Loop" of fun1/3 * CEs [13] --> Loop 10 * CEs [12] --> Loop 11 ### Ranking functions of CR fun1(V1,V,Out) * RF of phase [10]: [V,V1] #### Partial ranking functions of CR fun1(V1,V,Out) * Partial RF of phase [10]: - RF of loop [10:1]: V V1 ### Specialization of cost equations gt/3 * CE 11 is refined into CE [14] * CE 9 is refined into CE [15] * CE 8 is refined into CE [16] * CE 10 is refined into CE [17] ### Cost equations --> "Loop" of gt/3 * CEs [17] --> Loop 12 * CEs [14] --> Loop 13 * CEs [15] --> Loop 14 * CEs [16] --> Loop 15 ### Ranking functions of CR gt(V1,V,Out) * RF of phase [12]: [V,V1] #### Partial ranking functions of CR gt(V1,V,Out) * Partial RF of phase [12]: - RF of loop [12:1]: V V1 ### Specialization of cost equations fun/4 * CE 5 is refined into CE [18] * CE 4 is refined into CE [19,20,21,22,23,24,25,26] ### Cost equations --> "Loop" of fun/4 * CEs [25] --> Loop 16 * CEs [26] --> Loop 17 * CEs [24] --> Loop 18 * CEs [23] --> Loop 19 * CEs [22] --> Loop 20 * CEs [21] --> Loop 21 * CEs [20] --> Loop 22 * CEs [19] --> Loop 23 * CEs [18] --> Loop 24 ### Ranking functions of CR fun(V1,V,V2,Out) * RF of phase [16,17]: [V-V2] #### Partial ranking functions of CR fun(V1,V,V2,Out) * Partial RF of phase [16,17]: - RF of loop [16:1,17:1]: V-V2 ### Specialization of cost equations start/3 * CE 1 is refined into CE [27,28,29,30,31,32,33,34] * CE 2 is refined into CE [35,36] * CE 3 is refined into CE [37,38,39,40,41] ### Cost equations --> "Loop" of start/3 * CEs [38] --> Loop 25 * CEs [27,28,29,30,31,32,33] --> Loop 26 * CEs [34,35,36,37,39,40,41] --> Loop 27 ### Ranking functions of CR start(V1,V,V2) #### Partial ranking functions of CR start(V1,V,V2) Computing Bounds ===================================== #### Cost of chains of fun1(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 gt(V1,V,Out): * Chain [[12],15]: 0 with precondition: [Out=1,V1>=1,V>=V1] * Chain [[12],14]: 0 with precondition: [Out=2,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=1,V>=0] * Chain [14]: 0 with precondition: [V=0,Out=2,V1>=1] * Chain [13]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun(V1,V,V2,Out): * Chain [[16,17],24]: 2*it(16)+1*s(3)+0 Such that:aux(1) =< 2*V-V2 aux(4) =< V-V2 it(16) =< aux(4) s(3) =< it(16)*aux(1) with precondition: [V1=2,V2>=1,Out>=1,V>=V2+1] * Chain [[16,17],21,24]: 2*it(16)+1*s(3)+1 Such that:aux(1) =< 2*V-V2 aux(5) =< V-V2 it(16) =< aux(5) s(3) =< it(16)*aux(1) with precondition: [V1=2,V2>=1,Out>=2,V>=V2+1] * Chain [[16,17],20,24]: 2*it(16)+1*s(3)+1*s(4)+1 Such that:aux(1) =< 2*V-V2 s(4) =< 2*V-V2+2 aux(6) =< V-V2 it(16) =< aux(6) s(3) =< it(16)*aux(1) with precondition: [V1=2,V2>=1,Out>=3,V>=V2+1] * Chain [[16,17],19,24]: 2*it(16)+1*s(3)+1 Such that:aux(1) =< 2*V-V2 aux(7) =< V-V2 it(16) =< aux(7) s(3) =< it(16)*aux(1) with precondition: [V1=2,V2>=1,V>=V2+1,Out+V2>=V+1] * Chain [[16,17],18,24]: 2*it(16)+1*s(3)+1*s(5)+1 Such that:aux(1) =< 2*V-V2 s(5) =< 2*V-V2+1 aux(8) =< V-V2 it(16) =< aux(8) s(3) =< it(16)*aux(1) with precondition: [V1=2,V2>=1,V>=V2+1,Out+V2>=V+2] * Chain [24]: 0 with precondition: [Out=0,V1>=0,V>=0,V2>=0] * Chain [23,24]: 1 with precondition: [V1=2,V=0,Out=1,V2>=0] * Chain [22,[16,17],24]: 2*it(16)+1*s(3)+1 Such that:aux(4) =< V aux(1) =< 2*V it(16) =< aux(4) s(3) =< it(16)*aux(1) with precondition: [V1=2,V2=0,V>=2,Out>=2] * Chain [22,[16,17],21,24]: 2*it(16)+1*s(3)+2 Such that:aux(5) =< V aux(1) =< 2*V it(16) =< aux(5) s(3) =< it(16)*aux(1) with precondition: [V1=2,V2=0,V>=2,Out>=3] * Chain [22,[16,17],20,24]: 2*it(16)+1*s(3)+1*s(4)+2 Such that:aux(6) =< V aux(1) =< 2*V s(4) =< 2*V+2 it(16) =< aux(6) s(3) =< it(16)*aux(1) with precondition: [V1=2,V2=0,V>=2,Out>=4] * Chain [22,[16,17],19,24]: 2*it(16)+1*s(3)+2 Such that:aux(7) =< V aux(1) =< 2*V it(16) =< aux(7) s(3) =< it(16)*aux(1) with precondition: [V1=2,V2=0,V>=2,Out>=V+1] * Chain [22,[16,17],18,24]: 2*it(16)+1*s(3)+1*s(5)+2 Such that:aux(8) =< V aux(1) =< 2*V s(5) =< 2*V+1 it(16) =< aux(8) s(3) =< it(16)*aux(1) with precondition: [V1=2,V2=0,V>=2,Out>=V+2] * Chain [22,24]: 1 with precondition: [V1=2,V2=0,Out=1,V>=1] * Chain [22,21,24]: 2 with precondition: [V1=2,V2=0,Out=2,V>=1] * Chain [22,20,24]: 1*s(4)+2 Such that:s(4) =< 4 with precondition: [V1=2,V2=0,4>=Out,V>=1,Out>=3] * Chain [22,19,24]: 2 with precondition: [V1=2,V=1,V2=0,Out=2] * Chain [22,18,24]: 1*s(5)+2 Such that:s(5) =< 3 with precondition: [V1=2,V=1,V2=0,4>=Out,Out>=3] * Chain [21,24]: 1 with precondition: [V1=2,Out=1,V>=0,V2>=0] * Chain [20,24]: 1*s(4)+1 Such that:s(4) =< V2+2 with precondition: [V1=2,Out>=2,V+1>=Out,V2+1>=Out] * Chain [19,24]: 1 with precondition: [V1=2,Out=1,V>=1,V2>=V] * Chain [18,24]: 1*s(5)+1 Such that:s(5) =< V+1 with precondition: [V1=2,Out>=2,V2>=V,V+1>=Out] #### Cost of chains of start(V1,V,V2): * Chain [27]: 1*s(54)+0 Such that:s(54) =< V with precondition: [V1>=0,V>=0] * Chain [26]: 1*s(55)+1*s(56)+10*s(59)+5*s(60)+1*s(61)+1*s(62)+10*s(65)+5*s(66)+1*s(67)+1*s(68)+9 Such that:s(57) =< V s(67) =< V+1 s(63) =< V-V2 s(58) =< 2*V s(55) =< 2*V+1 s(56) =< 2*V+2 s(64) =< 2*V-V2 s(61) =< 2*V-V2+1 s(62) =< 2*V-V2+2 s(68) =< V2+2 s(59) =< s(57) s(60) =< s(59)*s(58) s(65) =< s(63) s(66) =< s(65)*s(64) with precondition: [V1=2,V>=0,V2>=0] * Chain [25]: 0 with precondition: [V=0,V1>=1] Closed-form bounds of start(V1,V,V2): ------------------------------------- * Chain [27] with precondition: [V1>=0,V>=0] - Upper bound: V - Complexity: n * Chain [26] with precondition: [V1=2,V>=0,V2>=0] - Upper bound: 10*V+9+5*V*(2*V)+(V+1)+(V2+2)+(2*V+1)+(2*V+2)+nat(2*V-V2+1)+nat(2*V-V2+2)+nat(V-V2)*10+nat(V-V2)*5*nat(2*V-V2) - Complexity: n^2 * Chain [25] with precondition: [V=0,V1>=1] - Upper bound: 0 - Complexity: constant ### Maximum cost of start(V1,V,V2): 9*V+9+5*V*(2*V)+(V+1)+nat(V2+2)+(2*V+1)+(2*V+2)+nat(2*V-V2+1)+nat(2*V-V2+2)+nat(V-V2)*10+nat(V-V2)*5*nat(2*V-V2)+V Asymptotic class: n^2 * Total analysis performed in 442 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: f(true, z0, z1) -> f(gt(z0, z1), s(z0), s(s(z1))) gt(0, z0) -> false gt(s(z0), 0) -> true gt(s(z0), s(z1)) -> gt(z0, z1) Tuples: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(0, z0) -> c1 GT(s(z0), 0) -> c2 GT(s(z0), s(z1)) -> c3(GT(z0, z1)) S tuples: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(0, z0) -> c1 GT(s(z0), 0) -> c2 GT(s(z0), s(z1)) -> c3(GT(z0, z1)) K tuples:none Defined Rule Symbols: f_3, gt_2 Defined Pair Symbols: F_3, GT_2 Compound Symbols: c_2, c1, c2, c3_1 ---------------------------------------- (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: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(0, z0) -> c1 GT(s(z0), 0) -> c2 GT(s(z0), s(z1)) -> c3(GT(z0, z1)) The (relative) TRS S consists of the following rules: f(true, z0, z1) -> f(gt(z0, z1), s(z0), s(s(z1))) gt(0, z0) -> false gt(s(z0), 0) -> true gt(s(z0), s(z1)) -> gt(z0, z1) 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: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(0', z0) -> c1 GT(s(z0), 0') -> c2 GT(s(z0), s(z1)) -> c3(GT(z0, z1)) The (relative) TRS S consists of the following rules: f(true, z0, z1) -> f(gt(z0, z1), s(z0), s(s(z1))) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) Rewrite Strategy: INNERMOST ---------------------------------------- (25) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (26) Obligation: Innermost TRS: Rules: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(0', z0) -> c1 GT(s(z0), 0') -> c2 GT(s(z0), s(z1)) -> c3(GT(z0, z1)) f(true, z0, z1) -> f(gt(z0, z1), s(z0), s(s(z1))) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) Types: F :: true:false -> s:0' -> s:0' -> c true :: true:false c :: c -> c1:c2:c3 -> c gt :: s:0' -> s:0' -> true:false s :: s:0' -> s:0' GT :: s:0' -> s:0' -> c1:c2:c3 0' :: s:0' c1 :: c1:c2:c3 c2 :: c1:c2:c3 c3 :: c1:c2:c3 -> c1:c2:c3 f :: true:false -> s:0' -> s:0' -> f false :: true:false hole_c1_4 :: c hole_true:false2_4 :: true:false hole_s:0'3_4 :: s:0' hole_c1:c2:c34_4 :: c1:c2:c3 hole_f5_4 :: f gen_c6_4 :: Nat -> c gen_s:0'7_4 :: Nat -> s:0' gen_c1:c2:c38_4 :: Nat -> c1:c2:c3 ---------------------------------------- (27) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: F, gt, GT, f They will be analysed ascendingly in the following order: gt < F GT < F gt < f ---------------------------------------- (28) Obligation: Innermost TRS: Rules: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(0', z0) -> c1 GT(s(z0), 0') -> c2 GT(s(z0), s(z1)) -> c3(GT(z0, z1)) f(true, z0, z1) -> f(gt(z0, z1), s(z0), s(s(z1))) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) Types: F :: true:false -> s:0' -> s:0' -> c true :: true:false c :: c -> c1:c2:c3 -> c gt :: s:0' -> s:0' -> true:false s :: s:0' -> s:0' GT :: s:0' -> s:0' -> c1:c2:c3 0' :: s:0' c1 :: c1:c2:c3 c2 :: c1:c2:c3 c3 :: c1:c2:c3 -> c1:c2:c3 f :: true:false -> s:0' -> s:0' -> f false :: true:false hole_c1_4 :: c hole_true:false2_4 :: true:false hole_s:0'3_4 :: s:0' hole_c1:c2:c34_4 :: c1:c2:c3 hole_f5_4 :: f gen_c6_4 :: Nat -> c gen_s:0'7_4 :: Nat -> s:0' gen_c1:c2:c38_4 :: Nat -> c1:c2:c3 Generator Equations: gen_c6_4(0) <=> hole_c1_4 gen_c6_4(+(x, 1)) <=> c(gen_c6_4(x), c1) gen_s:0'7_4(0) <=> 0' gen_s:0'7_4(+(x, 1)) <=> s(gen_s:0'7_4(x)) gen_c1:c2:c38_4(0) <=> c1 gen_c1:c2:c38_4(+(x, 1)) <=> c3(gen_c1:c2:c38_4(x)) The following defined symbols remain to be analysed: gt, F, GT, f They will be analysed ascendingly in the following order: gt < F GT < F gt < f ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: gt(gen_s:0'7_4(n10_4), gen_s:0'7_4(n10_4)) -> false, rt in Omega(0) Induction Base: gt(gen_s:0'7_4(0), gen_s:0'7_4(0)) ->_R^Omega(0) false Induction Step: gt(gen_s:0'7_4(+(n10_4, 1)), gen_s:0'7_4(+(n10_4, 1))) ->_R^Omega(0) gt(gen_s:0'7_4(n10_4), gen_s:0'7_4(n10_4)) ->_IH false 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: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(0', z0) -> c1 GT(s(z0), 0') -> c2 GT(s(z0), s(z1)) -> c3(GT(z0, z1)) f(true, z0, z1) -> f(gt(z0, z1), s(z0), s(s(z1))) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) Types: F :: true:false -> s:0' -> s:0' -> c true :: true:false c :: c -> c1:c2:c3 -> c gt :: s:0' -> s:0' -> true:false s :: s:0' -> s:0' GT :: s:0' -> s:0' -> c1:c2:c3 0' :: s:0' c1 :: c1:c2:c3 c2 :: c1:c2:c3 c3 :: c1:c2:c3 -> c1:c2:c3 f :: true:false -> s:0' -> s:0' -> f false :: true:false hole_c1_4 :: c hole_true:false2_4 :: true:false hole_s:0'3_4 :: s:0' hole_c1:c2:c34_4 :: c1:c2:c3 hole_f5_4 :: f gen_c6_4 :: Nat -> c gen_s:0'7_4 :: Nat -> s:0' gen_c1:c2:c38_4 :: Nat -> c1:c2:c3 Lemmas: gt(gen_s:0'7_4(n10_4), gen_s:0'7_4(n10_4)) -> false, rt in Omega(0) Generator Equations: gen_c6_4(0) <=> hole_c1_4 gen_c6_4(+(x, 1)) <=> c(gen_c6_4(x), c1) gen_s:0'7_4(0) <=> 0' gen_s:0'7_4(+(x, 1)) <=> s(gen_s:0'7_4(x)) gen_c1:c2:c38_4(0) <=> c1 gen_c1:c2:c38_4(+(x, 1)) <=> c3(gen_c1:c2:c38_4(x)) The following defined symbols remain to be analysed: GT, F, f They will be analysed ascendingly in the following order: GT < F ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: GT(gen_s:0'7_4(n253_4), gen_s:0'7_4(n253_4)) -> gen_c1:c2:c38_4(n253_4), rt in Omega(1 + n253_4) Induction Base: GT(gen_s:0'7_4(0), gen_s:0'7_4(0)) ->_R^Omega(1) c1 Induction Step: GT(gen_s:0'7_4(+(n253_4, 1)), gen_s:0'7_4(+(n253_4, 1))) ->_R^Omega(1) c3(GT(gen_s:0'7_4(n253_4), gen_s:0'7_4(n253_4))) ->_IH c3(gen_c1:c2:c38_4(c254_4)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (32) Complex Obligation (BEST) ---------------------------------------- (33) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(0', z0) -> c1 GT(s(z0), 0') -> c2 GT(s(z0), s(z1)) -> c3(GT(z0, z1)) f(true, z0, z1) -> f(gt(z0, z1), s(z0), s(s(z1))) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) Types: F :: true:false -> s:0' -> s:0' -> c true :: true:false c :: c -> c1:c2:c3 -> c gt :: s:0' -> s:0' -> true:false s :: s:0' -> s:0' GT :: s:0' -> s:0' -> c1:c2:c3 0' :: s:0' c1 :: c1:c2:c3 c2 :: c1:c2:c3 c3 :: c1:c2:c3 -> c1:c2:c3 f :: true:false -> s:0' -> s:0' -> f false :: true:false hole_c1_4 :: c hole_true:false2_4 :: true:false hole_s:0'3_4 :: s:0' hole_c1:c2:c34_4 :: c1:c2:c3 hole_f5_4 :: f gen_c6_4 :: Nat -> c gen_s:0'7_4 :: Nat -> s:0' gen_c1:c2:c38_4 :: Nat -> c1:c2:c3 Lemmas: gt(gen_s:0'7_4(n10_4), gen_s:0'7_4(n10_4)) -> false, rt in Omega(0) Generator Equations: gen_c6_4(0) <=> hole_c1_4 gen_c6_4(+(x, 1)) <=> c(gen_c6_4(x), c1) gen_s:0'7_4(0) <=> 0' gen_s:0'7_4(+(x, 1)) <=> s(gen_s:0'7_4(x)) gen_c1:c2:c38_4(0) <=> c1 gen_c1:c2:c38_4(+(x, 1)) <=> c3(gen_c1:c2:c38_4(x)) The following defined symbols remain to be analysed: GT, F, f They will be analysed ascendingly in the following order: GT < F ---------------------------------------- (34) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (35) BOUNDS(n^1, INF) ---------------------------------------- (36) Obligation: Innermost TRS: Rules: F(true, z0, z1) -> c(F(gt(z0, z1), s(z0), s(s(z1))), GT(z0, z1)) GT(0', z0) -> c1 GT(s(z0), 0') -> c2 GT(s(z0), s(z1)) -> c3(GT(z0, z1)) f(true, z0, z1) -> f(gt(z0, z1), s(z0), s(s(z1))) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) Types: F :: true:false -> s:0' -> s:0' -> c true :: true:false c :: c -> c1:c2:c3 -> c gt :: s:0' -> s:0' -> true:false s :: s:0' -> s:0' GT :: s:0' -> s:0' -> c1:c2:c3 0' :: s:0' c1 :: c1:c2:c3 c2 :: c1:c2:c3 c3 :: c1:c2:c3 -> c1:c2:c3 f :: true:false -> s:0' -> s:0' -> f false :: true:false hole_c1_4 :: c hole_true:false2_4 :: true:false hole_s:0'3_4 :: s:0' hole_c1:c2:c34_4 :: c1:c2:c3 hole_f5_4 :: f gen_c6_4 :: Nat -> c gen_s:0'7_4 :: Nat -> s:0' gen_c1:c2:c38_4 :: Nat -> c1:c2:c3 Lemmas: gt(gen_s:0'7_4(n10_4), gen_s:0'7_4(n10_4)) -> false, rt in Omega(0) GT(gen_s:0'7_4(n253_4), gen_s:0'7_4(n253_4)) -> gen_c1:c2:c38_4(n253_4), rt in Omega(1 + n253_4) Generator Equations: gen_c6_4(0) <=> hole_c1_4 gen_c6_4(+(x, 1)) <=> c(gen_c6_4(x), c1) gen_s:0'7_4(0) <=> 0' gen_s:0'7_4(+(x, 1)) <=> s(gen_s:0'7_4(x)) gen_c1:c2:c38_4(0) <=> c1 gen_c1:c2:c38_4(+(x, 1)) <=> c3(gen_c1:c2:c38_4(x)) The following defined symbols remain to be analysed: F, f