WORST_CASE(Omega(n^1),O(n^2)) proof of input_2IGvvllHW8.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, 356 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), 13 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 292 ms] (30) typed CpxTrs (31) RewriteLemmaProof [LOWER BOUND(ID), 120 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: minus(x, y) -> cond(gt(x, y), x, y) cond(false, x, y) -> 0 cond(true, x, y) -> s(minus(x, 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: minus(z0, z1) -> cond(gt(z0, z1), z0, z1) cond(false, z0, z1) -> 0 cond(true, z0, z1) -> s(minus(z0, s(z1))) gt(0, z0) -> false gt(s(z0), 0) -> true gt(s(z0), s(z1)) -> gt(z0, z1) Tuples: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(0, z0) -> c3 GT(s(z0), 0) -> c4 GT(s(z0), s(z1)) -> c5(GT(z0, z1)) S tuples: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(0, z0) -> c3 GT(s(z0), 0) -> c4 GT(s(z0), s(z1)) -> c5(GT(z0, z1)) K tuples:none Defined Rule Symbols: minus_2, cond_3, gt_2 Defined Pair Symbols: MINUS_2, COND_3, GT_2 Compound Symbols: c_2, c1, c2_1, c3, c4, c5_1 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 3 trailing nodes: COND(false, z0, z1) -> c1 GT(s(z0), 0) -> c4 GT(0, z0) -> c3 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: minus(z0, z1) -> cond(gt(z0, z1), z0, z1) cond(false, z0, z1) -> 0 cond(true, z0, z1) -> s(minus(z0, s(z1))) gt(0, z0) -> false gt(s(z0), 0) -> true gt(s(z0), s(z1)) -> gt(z0, z1) Tuples: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(s(z0), s(z1)) -> c5(GT(z0, z1)) S tuples: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(s(z0), s(z1)) -> c5(GT(z0, z1)) K tuples:none Defined Rule Symbols: minus_2, cond_3, gt_2 Defined Pair Symbols: MINUS_2, COND_3, GT_2 Compound Symbols: c_2, c2_1, c5_1 ---------------------------------------- (5) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: minus(z0, z1) -> cond(gt(z0, z1), z0, z1) cond(false, z0, z1) -> 0 cond(true, z0, z1) -> s(minus(z0, 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: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(s(z0), s(z1)) -> c5(GT(z0, z1)) S tuples: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(s(z0), s(z1)) -> c5(GT(z0, z1)) K tuples:none Defined Rule Symbols: gt_2 Defined Pair Symbols: MINUS_2, COND_3, GT_2 Compound Symbols: c_2, c2_1, c5_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: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(s(z0), s(z1)) -> c5(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: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) [1] COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) [1] GT(s(z0), s(z1)) -> c5(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: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) [1] COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) [1] GT(s(z0), s(z1)) -> c5(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: MINUS :: s:0 -> s:0 -> c c :: c2 -> c5 -> c COND :: true:false -> s:0 -> s:0 -> c2 gt :: s:0 -> s:0 -> true:false GT :: s:0 -> s:0 -> c5 true :: true:false c2 :: c -> c2 s :: s:0 -> s:0 c5 :: c5 -> c5 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] COND(v0, v1, v2) -> null_COND [0] GT(v0, v1) -> null_GT [0] And the following fresh constants: null_gt, null_COND, null_GT, const ---------------------------------------- (14) Obligation: Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) [1] COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) [1] GT(s(z0), s(z1)) -> c5(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] COND(v0, v1, v2) -> null_COND [0] GT(v0, v1) -> null_GT [0] The TRS has the following type information: MINUS :: s:0 -> s:0 -> c c :: c2:null_COND -> c5:null_GT -> c COND :: true:false:null_gt -> s:0 -> s:0 -> c2:null_COND gt :: s:0 -> s:0 -> true:false:null_gt GT :: s:0 -> s:0 -> c5:null_GT true :: true:false:null_gt c2 :: c -> c2:null_COND s :: s:0 -> s:0 c5 :: c5:null_GT -> c5:null_GT 0 :: s:0 false :: true:false:null_gt null_gt :: true:false:null_gt null_COND :: c2:null_COND null_GT :: c5:null_GT const :: c 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_COND => 0 null_GT => 0 const => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: COND(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 COND(z, z', z'') -{ 1 }-> 1 + MINUS(z0, 1 + 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 MINUS(z, z') -{ 1 }-> 1 + COND(gt(z0, z1), z0, z1) + GT(z0, z1) :|: z = z0, z1 >= 0, z' = z1, z0 >= 0 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, V4),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[fun1(V1, V, V4, Out)],[V1 >= 0,V >= 0,V4 >= 0]). eq(start(V1, V, V4),0,[fun2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[gt(V1, V, Out)],[V1 >= 0,V >= 0]). eq(fun(V1, V, Out),1,[gt(V3, V2, Ret010),fun1(Ret010, V3, V2, Ret01),fun2(V3, V2, Ret1)],[Out = 1 + Ret01 + Ret1,V1 = V3,V2 >= 0,V = V2,V3 >= 0]). eq(fun1(V1, V, V4, Out),1,[fun(V6, 1 + V5, Ret11)],[Out = 1 + Ret11,V1 = 2,V5 >= 0,V6 >= 0,V = V6,V4 = V5]). eq(fun2(V1, V, Out),1,[fun2(V8, V7, Ret12)],[Out = 1 + Ret12,V7 >= 0,V1 = 1 + V8,V8 >= 0,V = 1 + V7]). eq(gt(V1, V, Out),0,[],[Out = 1,V9 >= 0,V1 = 0,V = V9]). eq(gt(V1, V, Out),0,[],[Out = 2,V1 = 1 + V10,V10 >= 0,V = 0]). eq(gt(V1, V, Out),0,[gt(V11, V12, Ret)],[Out = Ret,V12 >= 0,V1 = 1 + V11,V11 >= 0,V = 1 + V12]). eq(gt(V1, V, Out),0,[],[Out = 0,V14 >= 0,V13 >= 0,V1 = V14,V = V13]). eq(fun1(V1, V, V4, Out),0,[],[Out = 0,V16 >= 0,V4 = V17,V15 >= 0,V1 = V16,V = V15,V17 >= 0]). eq(fun2(V1, V, Out),0,[],[Out = 0,V19 >= 0,V18 >= 0,V1 = V19,V = V18]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,V,V4,Out),[V1,V,V4],[Out]). input_output_vars(fun2(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 : [fun2/3] 1. recursive : [gt/3] 2. recursive [non_tail] : [fun/3,fun1/4] 3. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun2/3 1. SCC is partially evaluated into gt/3 2. SCC is partially evaluated into fun/3 3. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun2/3 * CE 9 is refined into CE [14] * CE 8 is refined into CE [15] ### Cost equations --> "Loop" of fun2/3 * CEs [15] --> Loop 10 * CEs [14] --> Loop 11 ### Ranking functions of CR fun2(V1,V,Out) * RF of phase [10]: [V,V1] #### Partial ranking functions of CR fun2(V1,V,Out) * Partial RF of phase [10]: - RF of loop [10:1]: V V1 ### Specialization of cost equations gt/3 * CE 13 is refined into CE [16] * CE 11 is refined into CE [17] * CE 10 is refined into CE [18] * CE 12 is refined into CE [19] ### Cost equations --> "Loop" of gt/3 * CEs [19] --> Loop 12 * CEs [16] --> Loop 13 * CEs [17] --> Loop 14 * CEs [18] --> 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/3 * CE 7 is refined into CE [20,21,22] * CE 6 is refined into CE [23,24,25,26,27,28,29,30] ### Cost equations --> "Loop" of fun/3 * CEs [30] --> Loop 16 * CEs [26,28] --> Loop 17 * CEs [24] --> Loop 18 * CEs [23,25,27,29] --> Loop 19 * CEs [21] --> Loop 20 * CEs [22] --> Loop 21 * CEs [20] --> Loop 22 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [20,21]: [V1-V] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [20,21]: - RF of loop [20:1,21:1]: V1-V ### Specialization of cost equations start/3 * CE 1 is refined into CE [31] * CE 2 is refined into CE [32,33,34] * CE 3 is refined into CE [35,36,37,38,39,40] * CE 4 is refined into CE [41,42] * CE 5 is refined into CE [43,44,45,46,47] ### Cost equations --> "Loop" of start/3 * CEs [36,37,38,44] --> Loop 23 * CEs [32,33,34] --> Loop 24 * CEs [31,35,39,40,41,42,43,45,46,47] --> Loop 25 ### Ranking functions of CR start(V1,V,V4) #### Partial ranking functions of CR start(V1,V,V4) Computing Bounds ===================================== #### Cost of chains of fun2(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,Out): * Chain [[20,21],19]: 4*it(20)+1*s(3)+1 Such that:aux(1) =< V1 aux(4) =< V1-V it(20) =< aux(4) s(3) =< it(20)*aux(1) with precondition: [V>=1,Out>=3,V1>=V+1] * Chain [[20,21],17]: 4*it(20)+1*s(3)+2*s(4)+1 Such that:aux(5) =< V1 aux(6) =< V1-V s(4) =< aux(5) it(20) =< aux(6) s(3) =< it(20)*aux(5) with precondition: [V>=1,Out>=4,V1>=V+1] * Chain [[20,21],16]: 4*it(20)+1*s(3)+1*s(6)+1 Such that:aux(7) =< V1 aux(8) =< V1-V s(6) =< aux(7) it(20) =< aux(8) s(3) =< it(20)*aux(7) with precondition: [V>=1,Out>=4,V1>=V+2] * Chain [22,[20,21],19]: 4*it(20)+1*s(3)+3 Such that:aux(9) =< V1 it(20) =< aux(9) s(3) =< it(20)*aux(9) with precondition: [V=0,V1>=2,Out>=5] * Chain [22,[20,21],17]: 6*it(20)+1*s(3)+3 Such that:aux(10) =< V1 it(20) =< aux(10) s(3) =< it(20)*aux(10) with precondition: [V=0,V1>=2,Out>=6] * Chain [22,[20,21],16]: 5*it(20)+1*s(3)+3 Such that:aux(11) =< V1 it(20) =< aux(11) s(3) =< it(20)*aux(11) with precondition: [V=0,V1>=3,Out>=6] * Chain [22,19]: 3 with precondition: [V=0,Out=3,V1>=1] * Chain [22,17]: 1*s(4)+1*s(5)+3 Such that:s(4) =< 1 s(5) =< V1 with precondition: [V=0,Out=4,V1>=1] * Chain [22,16]: 1*s(6)+3 Such that:s(6) =< 1 with precondition: [V=0,Out=4,V1>=2] * Chain [19]: 1 with precondition: [Out=1,V1>=0,V>=0] * Chain [18]: 1 with precondition: [V=0,Out=1,V1>=1] * Chain [17]: 1*s(4)+1*s(5)+1 Such that:s(5) =< V1 s(4) =< V with precondition: [Out>=2,V1+1>=Out,V+1>=Out] * Chain [16]: 1*s(6)+1 Such that:s(6) =< V with precondition: [Out>=2,V1>=V+1,V+1>=Out] #### Cost of chains of start(V1,V,V4): * Chain [25]: 4*s(38)+12*s(39)+3*s(40)+3*s(43)+1 Such that:s(37) =< V1-V aux(17) =< V1 aux(18) =< V s(38) =< aux(17) s(43) =< aux(18) s(39) =< s(37) s(40) =< s(39)*aux(17) with precondition: [V1>=0,V>=0] * Chain [24]: 4*s(47)+12*s(48)+3*s(49)+2*s(52)+2 Such that:s(46) =< V-V4 s(51) =< V4+1 aux(19) =< V s(47) =< aux(19) s(48) =< s(46) s(49) =< s(48)*aux(19) s(52) =< s(51) with precondition: [V1=2,V>=0,V4>=0] * Chain [23]: 16*s(53)+2*s(55)+3*s(58)+3 Such that:s(54) =< 1 aux(20) =< V1 s(53) =< aux(20) s(55) =< s(54) s(58) =< s(53)*aux(20) with precondition: [V=0,V1>=1] Closed-form bounds of start(V1,V,V4): ------------------------------------- * Chain [25] with precondition: [V1>=0,V>=0] - Upper bound: 4*V1+1+3*V1*nat(V1-V)+3*V+nat(V1-V)*12 - Complexity: n^2 * Chain [24] with precondition: [V1=2,V>=0,V4>=0] - Upper bound: 4*V+2+3*V*nat(V-V4)+(2*V4+2)+nat(V-V4)*12 - Complexity: n^2 * Chain [23] with precondition: [V=0,V1>=1] - Upper bound: 16*V1+5+3*V1*V1 - Complexity: n^2 ### Maximum cost of start(V1,V,V4): max([4*V1+max([12*V1+4+3*V1*V1,3*V1*nat(V1-V)+3*V+nat(V1-V)*12]),4*V+1+3*V*nat(V-V4)+nat(V4+1)*2+nat(V-V4)*12])+1 Asymptotic class: n^2 * Total analysis performed in 310 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: minus(z0, z1) -> cond(gt(z0, z1), z0, z1) cond(false, z0, z1) -> 0 cond(true, z0, z1) -> s(minus(z0, s(z1))) gt(0, z0) -> false gt(s(z0), 0) -> true gt(s(z0), s(z1)) -> gt(z0, z1) Tuples: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(0, z0) -> c3 GT(s(z0), 0) -> c4 GT(s(z0), s(z1)) -> c5(GT(z0, z1)) S tuples: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(0, z0) -> c3 GT(s(z0), 0) -> c4 GT(s(z0), s(z1)) -> c5(GT(z0, z1)) K tuples:none Defined Rule Symbols: minus_2, cond_3, gt_2 Defined Pair Symbols: MINUS_2, COND_3, GT_2 Compound Symbols: c_2, c1, c2_1, c3, c4, c5_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: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(0, z0) -> c3 GT(s(z0), 0) -> c4 GT(s(z0), s(z1)) -> c5(GT(z0, z1)) The (relative) TRS S consists of the following rules: minus(z0, z1) -> cond(gt(z0, z1), z0, z1) cond(false, z0, z1) -> 0 cond(true, z0, z1) -> s(minus(z0, 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: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(0', z0) -> c3 GT(s(z0), 0') -> c4 GT(s(z0), s(z1)) -> c5(GT(z0, z1)) The (relative) TRS S consists of the following rules: minus(z0, z1) -> cond(gt(z0, z1), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, 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: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(0', z0) -> c3 GT(s(z0), 0') -> c4 GT(s(z0), s(z1)) -> c5(GT(z0, z1)) minus(z0, z1) -> cond(gt(z0, z1), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, s(z1))) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) Types: MINUS :: s:0' -> s:0' -> c c :: c1:c2 -> c3:c4:c5 -> c COND :: false:true -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> false:true GT :: s:0' -> s:0' -> c3:c4:c5 false :: false:true c1 :: c1:c2 true :: false:true c2 :: c -> c1:c2 s :: s:0' -> s:0' 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 minus :: s:0' -> s:0' -> s:0' cond :: false:true -> s:0' -> s:0' -> s:0' hole_c1_6 :: c hole_s:0'2_6 :: s:0' hole_c1:c23_6 :: c1:c2 hole_c3:c4:c54_6 :: c3:c4:c5 hole_false:true5_6 :: false:true gen_s:0'6_6 :: Nat -> s:0' gen_c3:c4:c57_6 :: Nat -> c3:c4:c5 ---------------------------------------- (27) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: MINUS, gt, GT, minus They will be analysed ascendingly in the following order: gt < MINUS GT < MINUS gt < minus ---------------------------------------- (28) Obligation: Innermost TRS: Rules: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(0', z0) -> c3 GT(s(z0), 0') -> c4 GT(s(z0), s(z1)) -> c5(GT(z0, z1)) minus(z0, z1) -> cond(gt(z0, z1), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, s(z1))) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) Types: MINUS :: s:0' -> s:0' -> c c :: c1:c2 -> c3:c4:c5 -> c COND :: false:true -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> false:true GT :: s:0' -> s:0' -> c3:c4:c5 false :: false:true c1 :: c1:c2 true :: false:true c2 :: c -> c1:c2 s :: s:0' -> s:0' 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 minus :: s:0' -> s:0' -> s:0' cond :: false:true -> s:0' -> s:0' -> s:0' hole_c1_6 :: c hole_s:0'2_6 :: s:0' hole_c1:c23_6 :: c1:c2 hole_c3:c4:c54_6 :: c3:c4:c5 hole_false:true5_6 :: false:true gen_s:0'6_6 :: Nat -> s:0' gen_c3:c4:c57_6 :: Nat -> c3:c4:c5 Generator Equations: gen_s:0'6_6(0) <=> 0' gen_s:0'6_6(+(x, 1)) <=> s(gen_s:0'6_6(x)) gen_c3:c4:c57_6(0) <=> c3 gen_c3:c4:c57_6(+(x, 1)) <=> c5(gen_c3:c4:c57_6(x)) The following defined symbols remain to be analysed: gt, MINUS, GT, minus They will be analysed ascendingly in the following order: gt < MINUS GT < MINUS gt < minus ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: gt(gen_s:0'6_6(n9_6), gen_s:0'6_6(n9_6)) -> false, rt in Omega(0) Induction Base: gt(gen_s:0'6_6(0), gen_s:0'6_6(0)) ->_R^Omega(0) false Induction Step: gt(gen_s:0'6_6(+(n9_6, 1)), gen_s:0'6_6(+(n9_6, 1))) ->_R^Omega(0) gt(gen_s:0'6_6(n9_6), gen_s:0'6_6(n9_6)) ->_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: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(0', z0) -> c3 GT(s(z0), 0') -> c4 GT(s(z0), s(z1)) -> c5(GT(z0, z1)) minus(z0, z1) -> cond(gt(z0, z1), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, s(z1))) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) Types: MINUS :: s:0' -> s:0' -> c c :: c1:c2 -> c3:c4:c5 -> c COND :: false:true -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> false:true GT :: s:0' -> s:0' -> c3:c4:c5 false :: false:true c1 :: c1:c2 true :: false:true c2 :: c -> c1:c2 s :: s:0' -> s:0' 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 minus :: s:0' -> s:0' -> s:0' cond :: false:true -> s:0' -> s:0' -> s:0' hole_c1_6 :: c hole_s:0'2_6 :: s:0' hole_c1:c23_6 :: c1:c2 hole_c3:c4:c54_6 :: c3:c4:c5 hole_false:true5_6 :: false:true gen_s:0'6_6 :: Nat -> s:0' gen_c3:c4:c57_6 :: Nat -> c3:c4:c5 Lemmas: gt(gen_s:0'6_6(n9_6), gen_s:0'6_6(n9_6)) -> false, rt in Omega(0) Generator Equations: gen_s:0'6_6(0) <=> 0' gen_s:0'6_6(+(x, 1)) <=> s(gen_s:0'6_6(x)) gen_c3:c4:c57_6(0) <=> c3 gen_c3:c4:c57_6(+(x, 1)) <=> c5(gen_c3:c4:c57_6(x)) The following defined symbols remain to be analysed: GT, MINUS, minus They will be analysed ascendingly in the following order: GT < MINUS ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: GT(gen_s:0'6_6(n290_6), gen_s:0'6_6(n290_6)) -> gen_c3:c4:c57_6(n290_6), rt in Omega(1 + n290_6) Induction Base: GT(gen_s:0'6_6(0), gen_s:0'6_6(0)) ->_R^Omega(1) c3 Induction Step: GT(gen_s:0'6_6(+(n290_6, 1)), gen_s:0'6_6(+(n290_6, 1))) ->_R^Omega(1) c5(GT(gen_s:0'6_6(n290_6), gen_s:0'6_6(n290_6))) ->_IH c5(gen_c3:c4:c57_6(c291_6)) 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: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(0', z0) -> c3 GT(s(z0), 0') -> c4 GT(s(z0), s(z1)) -> c5(GT(z0, z1)) minus(z0, z1) -> cond(gt(z0, z1), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, s(z1))) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) Types: MINUS :: s:0' -> s:0' -> c c :: c1:c2 -> c3:c4:c5 -> c COND :: false:true -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> false:true GT :: s:0' -> s:0' -> c3:c4:c5 false :: false:true c1 :: c1:c2 true :: false:true c2 :: c -> c1:c2 s :: s:0' -> s:0' 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 minus :: s:0' -> s:0' -> s:0' cond :: false:true -> s:0' -> s:0' -> s:0' hole_c1_6 :: c hole_s:0'2_6 :: s:0' hole_c1:c23_6 :: c1:c2 hole_c3:c4:c54_6 :: c3:c4:c5 hole_false:true5_6 :: false:true gen_s:0'6_6 :: Nat -> s:0' gen_c3:c4:c57_6 :: Nat -> c3:c4:c5 Lemmas: gt(gen_s:0'6_6(n9_6), gen_s:0'6_6(n9_6)) -> false, rt in Omega(0) Generator Equations: gen_s:0'6_6(0) <=> 0' gen_s:0'6_6(+(x, 1)) <=> s(gen_s:0'6_6(x)) gen_c3:c4:c57_6(0) <=> c3 gen_c3:c4:c57_6(+(x, 1)) <=> c5(gen_c3:c4:c57_6(x)) The following defined symbols remain to be analysed: GT, MINUS, minus They will be analysed ascendingly in the following order: GT < MINUS ---------------------------------------- (34) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (35) BOUNDS(n^1, INF) ---------------------------------------- (36) Obligation: Innermost TRS: Rules: MINUS(z0, z1) -> c(COND(gt(z0, z1), z0, z1), GT(z0, z1)) COND(false, z0, z1) -> c1 COND(true, z0, z1) -> c2(MINUS(z0, s(z1))) GT(0', z0) -> c3 GT(s(z0), 0') -> c4 GT(s(z0), s(z1)) -> c5(GT(z0, z1)) minus(z0, z1) -> cond(gt(z0, z1), z0, z1) cond(false, z0, z1) -> 0' cond(true, z0, z1) -> s(minus(z0, s(z1))) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) Types: MINUS :: s:0' -> s:0' -> c c :: c1:c2 -> c3:c4:c5 -> c COND :: false:true -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> false:true GT :: s:0' -> s:0' -> c3:c4:c5 false :: false:true c1 :: c1:c2 true :: false:true c2 :: c -> c1:c2 s :: s:0' -> s:0' 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 minus :: s:0' -> s:0' -> s:0' cond :: false:true -> s:0' -> s:0' -> s:0' hole_c1_6 :: c hole_s:0'2_6 :: s:0' hole_c1:c23_6 :: c1:c2 hole_c3:c4:c54_6 :: c3:c4:c5 hole_false:true5_6 :: false:true gen_s:0'6_6 :: Nat -> s:0' gen_c3:c4:c57_6 :: Nat -> c3:c4:c5 Lemmas: gt(gen_s:0'6_6(n9_6), gen_s:0'6_6(n9_6)) -> false, rt in Omega(0) GT(gen_s:0'6_6(n290_6), gen_s:0'6_6(n290_6)) -> gen_c3:c4:c57_6(n290_6), rt in Omega(1 + n290_6) Generator Equations: gen_s:0'6_6(0) <=> 0' gen_s:0'6_6(+(x, 1)) <=> s(gen_s:0'6_6(x)) gen_c3:c4:c57_6(0) <=> c3 gen_c3:c4:c57_6(+(x, 1)) <=> c5(gen_c3:c4:c57_6(x)) The following defined symbols remain to be analysed: MINUS, minus