WORST_CASE(Omega(n^1),O(n^3)) proof of input_u22tRbllXD.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^3). (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, 691 ms] (10) BOUNDS(1, n^3) (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), 10 ms] (20) typed CpxTrs (21) RewriteLemmaProof [LOWER BOUND(ID), 306 ms] (22) typed CpxTrs (23) RewriteLemmaProof [LOWER BOUND(ID), 123 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), 105 ms] (30) typed CpxTrs (31) RewriteLemmaProof [LOWER BOUND(ID), 12 ms] (32) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^3). The TRS R consists of the following rules: minus(s(x), y) -> if(gt(s(x), y), x, y) if(true, x, y) -> s(minus(x, y)) if(false, x, y) -> 0 ge(x, 0) -> true ge(0, s(x)) -> false ge(s(x), s(y)) -> ge(x, y) gt(0, y) -> false gt(s(x), 0) -> true gt(s(x), s(y)) -> gt(x, y) div(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0), x, y) if1(false, x, y) -> 0 if2(true, x, y) -> s(div(minus(x, y), y)) if2(false, x, y) -> 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^3). The TRS R consists of the following rules: minus(s(x), y) -> if(gt(s(x), y), x, y) [1] if(true, x, y) -> s(minus(x, y)) [1] if(false, x, y) -> 0 [1] ge(x, 0) -> true [1] ge(0, s(x)) -> false [1] ge(s(x), s(y)) -> ge(x, y) [1] gt(0, y) -> false [1] gt(s(x), 0) -> true [1] gt(s(x), s(y)) -> gt(x, y) [1] div(x, y) -> if1(ge(x, y), x, y) [1] if1(true, x, y) -> if2(gt(y, 0), x, y) [1] if1(false, x, y) -> 0 [1] if2(true, x, y) -> s(div(minus(x, y), y)) [1] if2(false, x, y) -> 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: minus(s(x), y) -> if(gt(s(x), y), x, y) [1] if(true, x, y) -> s(minus(x, y)) [1] if(false, x, y) -> 0 [1] ge(x, 0) -> true [1] ge(0, s(x)) -> false [1] ge(s(x), s(y)) -> ge(x, y) [1] gt(0, y) -> false [1] gt(s(x), 0) -> true [1] gt(s(x), s(y)) -> gt(x, y) [1] div(x, y) -> if1(ge(x, y), x, y) [1] if1(true, x, y) -> if2(gt(y, 0), x, y) [1] if1(false, x, y) -> 0 [1] if2(true, x, y) -> s(div(minus(x, y), y)) [1] if2(false, x, y) -> 0 [1] The TRS has the following type information: minus :: s:0 -> s:0 -> s:0 s :: s:0 -> s:0 if :: true:false -> s:0 -> s:0 -> s:0 gt :: s:0 -> s:0 -> true:false true :: true:false false :: true:false 0 :: s:0 ge :: s:0 -> s:0 -> true:false div :: s:0 -> s:0 -> s:0 if1 :: true:false -> s:0 -> s:0 -> s:0 if2 :: true:false -> s:0 -> s:0 -> s:0 Rewrite Strategy: INNERMOST ---------------------------------------- (5) CompletionProof (UPPER BOUND(ID)) The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: minus(v0, v1) -> null_minus [0] ge(v0, v1) -> null_ge [0] gt(v0, v1) -> null_gt [0] if(v0, v1, v2) -> null_if [0] if1(v0, v1, v2) -> null_if1 [0] if2(v0, v1, v2) -> null_if2 [0] And the following fresh constants: null_minus, null_ge, null_gt, null_if, null_if1, null_if2 ---------------------------------------- (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: minus(s(x), y) -> if(gt(s(x), y), x, y) [1] if(true, x, y) -> s(minus(x, y)) [1] if(false, x, y) -> 0 [1] ge(x, 0) -> true [1] ge(0, s(x)) -> false [1] ge(s(x), s(y)) -> ge(x, y) [1] gt(0, y) -> false [1] gt(s(x), 0) -> true [1] gt(s(x), s(y)) -> gt(x, y) [1] div(x, y) -> if1(ge(x, y), x, y) [1] if1(true, x, y) -> if2(gt(y, 0), x, y) [1] if1(false, x, y) -> 0 [1] if2(true, x, y) -> s(div(minus(x, y), y)) [1] if2(false, x, y) -> 0 [1] minus(v0, v1) -> null_minus [0] ge(v0, v1) -> null_ge [0] gt(v0, v1) -> null_gt [0] if(v0, v1, v2) -> null_if [0] if1(v0, v1, v2) -> null_if1 [0] if2(v0, v1, v2) -> null_if2 [0] The TRS has the following type information: minus :: s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 s :: s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 if :: true:false:null_ge:null_gt -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 gt :: s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> true:false:null_ge:null_gt true :: true:false:null_ge:null_gt false :: true:false:null_ge:null_gt 0 :: s:0:null_minus:null_if:null_if1:null_if2 ge :: s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> true:false:null_ge:null_gt div :: s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 if1 :: true:false:null_ge:null_gt -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 if2 :: true:false:null_ge:null_gt -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 null_minus :: s:0:null_minus:null_if:null_if1:null_if2 null_ge :: true:false:null_ge:null_gt null_gt :: true:false:null_ge:null_gt null_if :: s:0:null_minus:null_if:null_if1:null_if2 null_if1 :: s:0:null_minus:null_if:null_if1:null_if2 null_if2 :: s:0:null_minus:null_if:null_if1:null_if2 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: true => 2 false => 1 0 => 0 null_minus => 0 null_ge => 0 null_gt => 0 null_if => 0 null_if1 => 0 null_if2 => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: div(z, z') -{ 1 }-> if1(ge(x, y), x, y) :|: x >= 0, y >= 0, z = x, z' = y ge(z, z') -{ 1 }-> ge(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x ge(z, z') -{ 1 }-> 2 :|: x >= 0, z = x, z' = 0 ge(z, z') -{ 1 }-> 1 :|: z' = 1 + x, x >= 0, z = 0 ge(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 gt(z, z') -{ 1 }-> gt(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x gt(z, z') -{ 1 }-> 2 :|: x >= 0, z = 1 + x, z' = 0 gt(z, z') -{ 1 }-> 1 :|: y >= 0, z = 0, z' = y gt(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 if(z, z', z'') -{ 1 }-> 0 :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 if(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 if(z, z', z'') -{ 1 }-> 1 + minus(x, y) :|: z = 2, z' = x, z'' = y, x >= 0, y >= 0 if1(z, z', z'') -{ 1 }-> if2(gt(y, 0), x, y) :|: z = 2, z' = x, z'' = y, x >= 0, y >= 0 if1(z, z', z'') -{ 1 }-> 0 :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 if1(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 if2(z, z', z'') -{ 1 }-> 0 :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 if2(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 if2(z, z', z'') -{ 1 }-> 1 + div(minus(x, y), y) :|: z = 2, z' = x, z'' = y, x >= 0, y >= 0 minus(z, z') -{ 1 }-> if(gt(1 + x, y), x, y) :|: x >= 0, y >= 0, z = 1 + x, z' = y minus(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 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(V1, V, V5),0,[minus(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V5),0,[if(V1, V, V5, Out)],[V1 >= 0,V >= 0,V5 >= 0]). eq(start(V1, V, V5),0,[ge(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V5),0,[gt(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V5),0,[div(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V5),0,[if1(V1, V, V5, Out)],[V1 >= 0,V >= 0,V5 >= 0]). eq(start(V1, V, V5),0,[if2(V1, V, V5, Out)],[V1 >= 0,V >= 0,V5 >= 0]). eq(minus(V1, V, Out),1,[gt(1 + V3, V2, Ret0),if(Ret0, V3, V2, Ret)],[Out = Ret,V3 >= 0,V2 >= 0,V1 = 1 + V3,V = V2]). eq(if(V1, V, V5, Out),1,[minus(V4, V6, Ret1)],[Out = 1 + Ret1,V1 = 2,V = V4,V5 = V6,V4 >= 0,V6 >= 0]). eq(if(V1, V, V5, Out),1,[],[Out = 0,V = V8,V5 = V7,V1 = 1,V8 >= 0,V7 >= 0]). eq(ge(V1, V, Out),1,[],[Out = 2,V9 >= 0,V1 = V9,V = 0]). eq(ge(V1, V, Out),1,[],[Out = 1,V = 1 + V10,V10 >= 0,V1 = 0]). eq(ge(V1, V, Out),1,[ge(V12, V11, Ret2)],[Out = Ret2,V = 1 + V11,V12 >= 0,V11 >= 0,V1 = 1 + V12]). eq(gt(V1, V, Out),1,[],[Out = 1,V13 >= 0,V1 = 0,V = V13]). eq(gt(V1, V, Out),1,[],[Out = 2,V14 >= 0,V1 = 1 + V14,V = 0]). eq(gt(V1, V, Out),1,[gt(V16, V15, Ret3)],[Out = Ret3,V = 1 + V15,V16 >= 0,V15 >= 0,V1 = 1 + V16]). eq(div(V1, V, Out),1,[ge(V17, V18, Ret01),if1(Ret01, V17, V18, Ret4)],[Out = Ret4,V17 >= 0,V18 >= 0,V1 = V17,V = V18]). eq(if1(V1, V, V5, Out),1,[gt(V19, 0, Ret02),if2(Ret02, V20, V19, Ret5)],[Out = Ret5,V1 = 2,V = V20,V5 = V19,V20 >= 0,V19 >= 0]). eq(if1(V1, V, V5, Out),1,[],[Out = 0,V = V22,V5 = V21,V1 = 1,V22 >= 0,V21 >= 0]). eq(if2(V1, V, V5, Out),1,[minus(V24, V23, Ret10),div(Ret10, V23, Ret11)],[Out = 1 + Ret11,V1 = 2,V = V24,V5 = V23,V24 >= 0,V23 >= 0]). eq(if2(V1, V, V5, Out),1,[],[Out = 0,V = V25,V5 = V26,V1 = 1,V25 >= 0,V26 >= 0]). eq(minus(V1, V, Out),0,[],[Out = 0,V28 >= 0,V27 >= 0,V1 = V28,V = V27]). eq(ge(V1, V, Out),0,[],[Out = 0,V30 >= 0,V29 >= 0,V1 = V30,V = V29]). eq(gt(V1, V, Out),0,[],[Out = 0,V32 >= 0,V31 >= 0,V1 = V32,V = V31]). eq(if(V1, V, V5, Out),0,[],[Out = 0,V33 >= 0,V5 = V35,V34 >= 0,V1 = V33,V = V34,V35 >= 0]). eq(if1(V1, V, V5, Out),0,[],[Out = 0,V37 >= 0,V5 = V38,V36 >= 0,V1 = V37,V = V36,V38 >= 0]). eq(if2(V1, V, V5, Out),0,[],[Out = 0,V40 >= 0,V5 = V41,V39 >= 0,V1 = V40,V = V39,V41 >= 0]). input_output_vars(minus(V1,V,Out),[V1,V],[Out]). input_output_vars(if(V1,V,V5,Out),[V1,V,V5],[Out]). input_output_vars(ge(V1,V,Out),[V1,V],[Out]). input_output_vars(gt(V1,V,Out),[V1,V],[Out]). input_output_vars(div(V1,V,Out),[V1,V],[Out]). input_output_vars(if1(V1,V,V5,Out),[V1,V,V5],[Out]). input_output_vars(if2(V1,V,V5,Out),[V1,V,V5],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [ge/3] 1. recursive : [gt/3] 2. recursive : [if/4,minus/3] 3. recursive : [(div)/3,if1/4,if2/4] 4. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into ge/3 1. SCC is partially evaluated into gt/3 2. SCC is partially evaluated into minus/3 3. SCC is partially evaluated into (div)/3 4. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations ge/3 * CE 28 is refined into CE [29] * CE 25 is refined into CE [30] * CE 26 is refined into CE [31] * CE 27 is refined into CE [32] ### Cost equations --> "Loop" of ge/3 * CEs [32] --> Loop 15 * CEs [29] --> Loop 16 * CEs [30] --> Loop 17 * CEs [31] --> Loop 18 ### Ranking functions of CR ge(V1,V,Out) * RF of phase [15]: [V,V1] #### Partial ranking functions of CR ge(V1,V,Out) * Partial RF of phase [15]: - RF of loop [15:1]: V V1 ### Specialization of cost equations gt/3 * CE 15 is refined into CE [33] * CE 13 is refined into CE [34] * CE 12 is refined into CE [35] * CE 14 is refined into CE [36] ### Cost equations --> "Loop" of gt/3 * CEs [36] --> Loop 19 * CEs [33] --> Loop 20 * CEs [34] --> Loop 21 * CEs [35] --> Loop 22 ### Ranking functions of CR gt(V1,V,Out) * RF of phase [19]: [V,V1] #### Partial ranking functions of CR gt(V1,V,Out) * Partial RF of phase [19]: - RF of loop [19:1]: V V1 ### Specialization of cost equations minus/3 * CE 16 is refined into CE [37,38,39,40] * CE 17 is refined into CE [41] * CE 19 is refined into CE [42] * CE 18 is refined into CE [43,44] ### Cost equations --> "Loop" of minus/3 * CEs [44] --> Loop 23 * CEs [43] --> Loop 24 * CEs [37,38,39,40,41,42] --> Loop 25 ### Ranking functions of CR minus(V1,V,Out) * RF of phase [23]: [V1-1,V1-V] * RF of phase [24]: [V1] #### Partial ranking functions of CR minus(V1,V,Out) * Partial RF of phase [23]: - RF of loop [23:1]: V1-1 V1-V * Partial RF of phase [24]: - RF of loop [24:1]: V1 ### Specialization of cost equations (div)/3 * CE 20 is refined into CE [45,46,47,48] * CE 21 is refined into CE [49] * CE 23 is refined into CE [50,51,52,53,54] * CE 24 is refined into CE [55,56] * CE 22 is refined into CE [57,58] ### Cost equations --> "Loop" of (div)/3 * CEs [58] --> Loop 26 * CEs [57] --> Loop 27 * CEs [45,46,49,51] --> Loop 28 * CEs [47,48,50,52,53,54,55,56] --> Loop 29 ### Ranking functions of CR div(V1,V,Out) * RF of phase [26]: [V1-1,V1-V] #### Partial ranking functions of CR div(V1,V,Out) * Partial RF of phase [26]: - RF of loop [26:1]: V1-1 V1-V ### Specialization of cost equations start/3 * CE 1 is refined into CE [59,60,61] * CE 3 is refined into CE [62] * CE 5 is refined into CE [63,64,65,66,67] * CE 6 is refined into CE [68,69,70,71,72,73] * CE 7 is refined into CE [74,75,76] * CE 2 is refined into CE [77] * CE 4 is refined into CE [78] * CE 8 is refined into CE [79,80,81] * CE 9 is refined into CE [82,83,84,85,86] * CE 10 is refined into CE [87,88,89,90,91] * CE 11 is refined into CE [92,93,94,95] ### Cost equations --> "Loop" of start/3 * CEs [79,83,88] --> Loop 30 * CEs [59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76] --> Loop 31 * CEs [78] --> Loop 32 * CEs [77,80,81,82,84,85,86,87,89,90,91,92,93,94,95] --> Loop 33 ### Ranking functions of CR start(V1,V,V5) #### Partial ranking functions of CR start(V1,V,V5) Computing Bounds ===================================== #### Cost of chains of ge(V1,V,Out): * Chain [[15],18]: 1*it(15)+1 Such that:it(15) =< V1 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [[15],17]: 1*it(15)+1 Such that:it(15) =< V with precondition: [Out=2,V>=1,V1>=V] * Chain [[15],16]: 1*it(15)+0 Such that:it(15) =< V with precondition: [Out=0,V1>=1,V>=1] * Chain [18]: 1 with precondition: [V1=0,Out=1,V>=1] * Chain [17]: 1 with precondition: [V=0,Out=2,V1>=0] * Chain [16]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of gt(V1,V,Out): * Chain [[19],22]: 1*it(19)+1 Such that:it(19) =< V1 with precondition: [Out=1,V1>=1,V>=V1] * Chain [[19],21]: 1*it(19)+1 Such that:it(19) =< V with precondition: [Out=2,V>=1,V1>=V+1] * Chain [[19],20]: 1*it(19)+0 Such that:it(19) =< V with precondition: [Out=0,V1>=1,V>=1] * Chain [22]: 1 with precondition: [V1=0,Out=1,V>=0] * Chain [21]: 1 with precondition: [V=0,Out=2,V1>=1] * Chain [20]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of minus(V1,V,Out): * Chain [[24],25]: 3*it(24)+2*s(4)+3 Such that:aux(1) =< V1-Out it(24) =< Out s(4) =< aux(1) with precondition: [V=0,Out>=1,V1>=Out] * Chain [[23],25]: 3*it(23)+2*s(3)+2*s(4)+1*s(9)+3 Such that:aux(1) =< V1-Out it(23) =< Out aux(4) =< V s(4) =< aux(1) s(3) =< aux(4) s(9) =< it(23)*aux(4) with precondition: [V>=1,Out>=1,V1>=Out+V] * Chain [25]: 2*s(3)+2*s(4)+3 Such that:aux(1) =< V1 aux(2) =< V s(4) =< aux(1) s(3) =< aux(2) with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of div(V1,V,Out): * Chain [[26],29]: 8*it(26)+4*s(10)+7*s(14)+3*s(31)+1*s(33)+4 Such that:aux(10) =< V1-V aux(12) =< V1 aux(13) =< V it(26) =< aux(12) s(14) =< aux(12) s(10) =< aux(13) it(26) =< aux(10) s(31) =< it(26)*aux(10) s(33) =< s(31)*aux(13) with precondition: [V>=1,Out>=1,V1>=Out+V] * Chain [[26],27,29]: 8*it(26)+7*s(10)+7*s(30)+3*s(31)+1*s(33)+12 Such that:aux(10) =< V1-V aux(16) =< V1 aux(17) =< V it(26) =< aux(16) s(10) =< aux(17) s(30) =< aux(16) it(26) =< aux(10) s(31) =< it(26)*aux(10) s(33) =< s(31)*aux(17) with precondition: [V>=1,Out>=2,V1+2>=2*V+Out] * Chain [29]: 4*s(10)+2*s(14)+4 Such that:aux(5) =< V1 aux(6) =< V s(14) =< aux(5) s(10) =< aux(6) with precondition: [Out=0,V1>=0,V>=0] * Chain [28]: 5 with precondition: [V=0,Out=0,V1>=0] * Chain [27,29]: 7*s(10)+2*s(39)+12 Such that:s(37) =< V1 aux(15) =< V s(10) =< aux(15) s(39) =< s(37) with precondition: [Out=1,V>=1,V1>=V] #### Cost of chains of start(V1,V,V5): * Chain [33]: 27*s(48)+30*s(49)+1*s(55)+16*s(73)+6*s(76)+2*s(77)+12 Such that:aux(19) =< V1 aux(20) =< V1-V aux(21) =< V s(48) =< aux(19) s(49) =< aux(21) s(73) =< aux(19) s(73) =< aux(20) s(76) =< s(73)*aux(20) s(77) =< s(76)*aux(21) s(55) =< s(48)*aux(21) with precondition: [V1>=0,V>=0] * Chain [32]: 1 with precondition: [V1=1,V>=0,V5>=0] * Chain [31]: 99*s(89)+76*s(90)+9*s(100)+32*s(124)+12*s(127)+4*s(128)+18 Such that:aux(43) =< V aux(44) =< V-V5 aux(45) =< V5 s(89) =< aux(43) s(90) =< aux(45) s(100) =< s(89)*aux(45) s(124) =< aux(43) s(124) =< aux(44) s(127) =< s(124)*aux(44) s(128) =< s(127)*aux(45) with precondition: [V1=2,V>=0,V5>=0] * Chain [30]: 5*s(220)+3 Such that:aux(46) =< V1 s(220) =< aux(46) with precondition: [V=0,V1>=0] Closed-form bounds of start(V1,V,V5): ------------------------------------- * Chain [33] with precondition: [V1>=0,V>=0] - Upper bound: 43*V1+12+V*V1+2*V1*V*nat(V1-V)+6*V1*nat(V1-V)+30*V - Complexity: n^3 * Chain [32] with precondition: [V1=1,V>=0,V5>=0] - Upper bound: 1 - Complexity: constant * Chain [31] with precondition: [V1=2,V>=0,V5>=0] - Upper bound: 131*V+18+9*V*V5+4*V*V5*nat(V-V5)+12*V*nat(V-V5)+76*V5 - Complexity: n^3 * Chain [30] with precondition: [V=0,V1>=0] - Upper bound: 5*V1+3 - Complexity: n ### Maximum cost of start(V1,V,V5): max([131*V+17+9*V*nat(V5)+4*V*nat(V5)*nat(V-V5)+12*V*nat(V-V5)+nat(V5)*76,38*V1+9+V*V1+2*V1*V*nat(V1-V)+6*V1*nat(V1-V)+30*V+(5*V1+2)])+1 Asymptotic class: n^3 * Total analysis performed in 583 ms. ---------------------------------------- (10) BOUNDS(1, n^3) ---------------------------------------- (11) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (12) Obligation: Complexity Dependency Tuples Problem Rules: minus(s(z0), z1) -> if(gt(s(z0), z1), z0, z1) if(true, z0, z1) -> s(minus(z0, z1)) if(false, z0, z1) -> 0 ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) gt(0, z0) -> false gt(s(z0), 0) -> true gt(s(z0), s(z1)) -> gt(z0, z1) div(z0, z1) -> if1(ge(z0, z1), z0, z1) if1(true, z0, z1) -> if2(gt(z1, 0), z0, z1) if1(false, z0, z1) -> 0 if2(true, z0, z1) -> s(div(minus(z0, z1), z1)) if2(false, z0, z1) -> 0 Tuples: MINUS(s(z0), z1) -> c(IF(gt(s(z0), z1), z0, z1), GT(s(z0), z1)) IF(true, z0, z1) -> c1(MINUS(z0, z1)) IF(false, z0, z1) -> c2 GE(z0, 0) -> c3 GE(0, s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) GT(0, z0) -> c6 GT(s(z0), 0) -> c7 GT(s(z0), s(z1)) -> c8(GT(z0, z1)) DIV(z0, z1) -> c9(IF1(ge(z0, z1), z0, z1), GE(z0, z1)) IF1(true, z0, z1) -> c10(IF2(gt(z1, 0), z0, z1), GT(z1, 0)) IF1(false, z0, z1) -> c11 IF2(true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) IF2(false, z0, z1) -> c13 S tuples: MINUS(s(z0), z1) -> c(IF(gt(s(z0), z1), z0, z1), GT(s(z0), z1)) IF(true, z0, z1) -> c1(MINUS(z0, z1)) IF(false, z0, z1) -> c2 GE(z0, 0) -> c3 GE(0, s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) GT(0, z0) -> c6 GT(s(z0), 0) -> c7 GT(s(z0), s(z1)) -> c8(GT(z0, z1)) DIV(z0, z1) -> c9(IF1(ge(z0, z1), z0, z1), GE(z0, z1)) IF1(true, z0, z1) -> c10(IF2(gt(z1, 0), z0, z1), GT(z1, 0)) IF1(false, z0, z1) -> c11 IF2(true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) IF2(false, z0, z1) -> c13 K tuples:none Defined Rule Symbols: minus_2, if_3, ge_2, gt_2, div_2, if1_3, if2_3 Defined Pair Symbols: MINUS_2, IF_3, GE_2, GT_2, DIV_2, IF1_3, IF2_3 Compound Symbols: c_2, c1_1, c2, c3, c4, c5_1, c6, c7, c8_1, c9_2, c10_2, c11, c12_2, c13 ---------------------------------------- (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: MINUS(s(z0), z1) -> c(IF(gt(s(z0), z1), z0, z1), GT(s(z0), z1)) IF(true, z0, z1) -> c1(MINUS(z0, z1)) IF(false, z0, z1) -> c2 GE(z0, 0) -> c3 GE(0, s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) GT(0, z0) -> c6 GT(s(z0), 0) -> c7 GT(s(z0), s(z1)) -> c8(GT(z0, z1)) DIV(z0, z1) -> c9(IF1(ge(z0, z1), z0, z1), GE(z0, z1)) IF1(true, z0, z1) -> c10(IF2(gt(z1, 0), z0, z1), GT(z1, 0)) IF1(false, z0, z1) -> c11 IF2(true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) IF2(false, z0, z1) -> c13 The (relative) TRS S consists of the following rules: minus(s(z0), z1) -> if(gt(s(z0), z1), z0, z1) if(true, z0, z1) -> s(minus(z0, z1)) if(false, z0, z1) -> 0 ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) gt(0, z0) -> false gt(s(z0), 0) -> true gt(s(z0), s(z1)) -> gt(z0, z1) div(z0, z1) -> if1(ge(z0, z1), z0, z1) if1(true, z0, z1) -> if2(gt(z1, 0), z0, z1) if1(false, z0, z1) -> 0 if2(true, z0, z1) -> s(div(minus(z0, z1), z1)) if2(false, z0, z1) -> 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: MINUS(s(z0), z1) -> c(IF(gt(s(z0), z1), z0, z1), GT(s(z0), z1)) IF(true, z0, z1) -> c1(MINUS(z0, z1)) IF(false, z0, z1) -> c2 GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) GT(0', z0) -> c6 GT(s(z0), 0') -> c7 GT(s(z0), s(z1)) -> c8(GT(z0, z1)) DIV(z0, z1) -> c9(IF1(ge(z0, z1), z0, z1), GE(z0, z1)) IF1(true, z0, z1) -> c10(IF2(gt(z1, 0'), z0, z1), GT(z1, 0')) IF1(false, z0, z1) -> c11 IF2(true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) IF2(false, z0, z1) -> c13 The (relative) TRS S consists of the following rules: minus(s(z0), z1) -> if(gt(s(z0), z1), z0, z1) if(true, z0, z1) -> s(minus(z0, z1)) if(false, z0, z1) -> 0' ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) div(z0, z1) -> if1(ge(z0, z1), z0, z1) if1(true, z0, z1) -> if2(gt(z1, 0'), z0, z1) if1(false, z0, z1) -> 0' if2(true, z0, z1) -> s(div(minus(z0, z1), z1)) if2(false, z0, z1) -> 0' Rewrite Strategy: INNERMOST ---------------------------------------- (17) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (18) Obligation: Innermost TRS: Rules: MINUS(s(z0), z1) -> c(IF(gt(s(z0), z1), z0, z1), GT(s(z0), z1)) IF(true, z0, z1) -> c1(MINUS(z0, z1)) IF(false, z0, z1) -> c2 GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) GT(0', z0) -> c6 GT(s(z0), 0') -> c7 GT(s(z0), s(z1)) -> c8(GT(z0, z1)) DIV(z0, z1) -> c9(IF1(ge(z0, z1), z0, z1), GE(z0, z1)) IF1(true, z0, z1) -> c10(IF2(gt(z1, 0'), z0, z1), GT(z1, 0')) IF1(false, z0, z1) -> c11 IF2(true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) IF2(false, z0, z1) -> c13 minus(s(z0), z1) -> if(gt(s(z0), z1), z0, z1) if(true, z0, z1) -> s(minus(z0, z1)) if(false, z0, z1) -> 0' ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) div(z0, z1) -> if1(ge(z0, z1), z0, z1) if1(true, z0, z1) -> if2(gt(z1, 0'), z0, z1) if1(false, z0, z1) -> 0' if2(true, z0, z1) -> s(div(minus(z0, z1), z1)) if2(false, z0, z1) -> 0' Types: MINUS :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c6:c7:c8 -> c IF :: true:false -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> true:false GT :: s:0' -> s:0' -> c6:c7:c8 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c1:c2 GE :: s:0' -> s:0' -> c3:c4:c5 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c6:c7:c8 -> c6:c7:c8 DIV :: s:0' -> s:0' -> c9 c9 :: c10:c11 -> c3:c4:c5 -> c9 IF1 :: true:false -> s:0' -> s:0' -> c10:c11 ge :: s:0' -> s:0' -> true:false c10 :: c12:c13 -> c6:c7:c8 -> c10:c11 IF2 :: true:false -> s:0' -> s:0' -> c12:c13 c11 :: c10:c11 c12 :: c9 -> c -> c12:c13 minus :: s:0' -> s:0' -> s:0' c13 :: c12:c13 if :: true:false -> s:0' -> s:0' -> s:0' div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_c1_14 :: c hole_s:0'2_14 :: s:0' hole_c1:c23_14 :: c1:c2 hole_c6:c7:c84_14 :: c6:c7:c8 hole_true:false5_14 :: true:false hole_c3:c4:c56_14 :: c3:c4:c5 hole_c97_14 :: c9 hole_c10:c118_14 :: c10:c11 hole_c12:c139_14 :: c12:c13 gen_s:0'10_14 :: Nat -> s:0' gen_c6:c7:c811_14 :: Nat -> c6:c7:c8 gen_c3:c4:c512_14 :: Nat -> c3:c4:c5 ---------------------------------------- (19) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: MINUS, gt, GT, GE, DIV, ge, minus, div They will be analysed ascendingly in the following order: gt < MINUS GT < MINUS MINUS < DIV gt < DIV gt < minus gt < div GT < DIV GE < DIV ge < DIV minus < DIV ge < div minus < div ---------------------------------------- (20) Obligation: Innermost TRS: Rules: MINUS(s(z0), z1) -> c(IF(gt(s(z0), z1), z0, z1), GT(s(z0), z1)) IF(true, z0, z1) -> c1(MINUS(z0, z1)) IF(false, z0, z1) -> c2 GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) GT(0', z0) -> c6 GT(s(z0), 0') -> c7 GT(s(z0), s(z1)) -> c8(GT(z0, z1)) DIV(z0, z1) -> c9(IF1(ge(z0, z1), z0, z1), GE(z0, z1)) IF1(true, z0, z1) -> c10(IF2(gt(z1, 0'), z0, z1), GT(z1, 0')) IF1(false, z0, z1) -> c11 IF2(true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) IF2(false, z0, z1) -> c13 minus(s(z0), z1) -> if(gt(s(z0), z1), z0, z1) if(true, z0, z1) -> s(minus(z0, z1)) if(false, z0, z1) -> 0' ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) div(z0, z1) -> if1(ge(z0, z1), z0, z1) if1(true, z0, z1) -> if2(gt(z1, 0'), z0, z1) if1(false, z0, z1) -> 0' if2(true, z0, z1) -> s(div(minus(z0, z1), z1)) if2(false, z0, z1) -> 0' Types: MINUS :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c6:c7:c8 -> c IF :: true:false -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> true:false GT :: s:0' -> s:0' -> c6:c7:c8 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c1:c2 GE :: s:0' -> s:0' -> c3:c4:c5 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c6:c7:c8 -> c6:c7:c8 DIV :: s:0' -> s:0' -> c9 c9 :: c10:c11 -> c3:c4:c5 -> c9 IF1 :: true:false -> s:0' -> s:0' -> c10:c11 ge :: s:0' -> s:0' -> true:false c10 :: c12:c13 -> c6:c7:c8 -> c10:c11 IF2 :: true:false -> s:0' -> s:0' -> c12:c13 c11 :: c10:c11 c12 :: c9 -> c -> c12:c13 minus :: s:0' -> s:0' -> s:0' c13 :: c12:c13 if :: true:false -> s:0' -> s:0' -> s:0' div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_c1_14 :: c hole_s:0'2_14 :: s:0' hole_c1:c23_14 :: c1:c2 hole_c6:c7:c84_14 :: c6:c7:c8 hole_true:false5_14 :: true:false hole_c3:c4:c56_14 :: c3:c4:c5 hole_c97_14 :: c9 hole_c10:c118_14 :: c10:c11 hole_c12:c139_14 :: c12:c13 gen_s:0'10_14 :: Nat -> s:0' gen_c6:c7:c811_14 :: Nat -> c6:c7:c8 gen_c3:c4:c512_14 :: Nat -> c3:c4:c5 Generator Equations: gen_s:0'10_14(0) <=> 0' gen_s:0'10_14(+(x, 1)) <=> s(gen_s:0'10_14(x)) gen_c6:c7:c811_14(0) <=> c6 gen_c6:c7:c811_14(+(x, 1)) <=> c8(gen_c6:c7:c811_14(x)) gen_c3:c4:c512_14(0) <=> c3 gen_c3:c4:c512_14(+(x, 1)) <=> c5(gen_c3:c4:c512_14(x)) The following defined symbols remain to be analysed: gt, MINUS, GT, GE, DIV, ge, minus, div They will be analysed ascendingly in the following order: gt < MINUS GT < MINUS MINUS < DIV gt < DIV gt < minus gt < div GT < DIV GE < DIV ge < DIV minus < DIV ge < div minus < div ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: gt(gen_s:0'10_14(n14_14), gen_s:0'10_14(n14_14)) -> false, rt in Omega(0) Induction Base: gt(gen_s:0'10_14(0), gen_s:0'10_14(0)) ->_R^Omega(0) false Induction Step: gt(gen_s:0'10_14(+(n14_14, 1)), gen_s:0'10_14(+(n14_14, 1))) ->_R^Omega(0) gt(gen_s:0'10_14(n14_14), gen_s:0'10_14(n14_14)) ->_IH false 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: MINUS(s(z0), z1) -> c(IF(gt(s(z0), z1), z0, z1), GT(s(z0), z1)) IF(true, z0, z1) -> c1(MINUS(z0, z1)) IF(false, z0, z1) -> c2 GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) GT(0', z0) -> c6 GT(s(z0), 0') -> c7 GT(s(z0), s(z1)) -> c8(GT(z0, z1)) DIV(z0, z1) -> c9(IF1(ge(z0, z1), z0, z1), GE(z0, z1)) IF1(true, z0, z1) -> c10(IF2(gt(z1, 0'), z0, z1), GT(z1, 0')) IF1(false, z0, z1) -> c11 IF2(true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) IF2(false, z0, z1) -> c13 minus(s(z0), z1) -> if(gt(s(z0), z1), z0, z1) if(true, z0, z1) -> s(minus(z0, z1)) if(false, z0, z1) -> 0' ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) div(z0, z1) -> if1(ge(z0, z1), z0, z1) if1(true, z0, z1) -> if2(gt(z1, 0'), z0, z1) if1(false, z0, z1) -> 0' if2(true, z0, z1) -> s(div(minus(z0, z1), z1)) if2(false, z0, z1) -> 0' Types: MINUS :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c6:c7:c8 -> c IF :: true:false -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> true:false GT :: s:0' -> s:0' -> c6:c7:c8 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c1:c2 GE :: s:0' -> s:0' -> c3:c4:c5 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c6:c7:c8 -> c6:c7:c8 DIV :: s:0' -> s:0' -> c9 c9 :: c10:c11 -> c3:c4:c5 -> c9 IF1 :: true:false -> s:0' -> s:0' -> c10:c11 ge :: s:0' -> s:0' -> true:false c10 :: c12:c13 -> c6:c7:c8 -> c10:c11 IF2 :: true:false -> s:0' -> s:0' -> c12:c13 c11 :: c10:c11 c12 :: c9 -> c -> c12:c13 minus :: s:0' -> s:0' -> s:0' c13 :: c12:c13 if :: true:false -> s:0' -> s:0' -> s:0' div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_c1_14 :: c hole_s:0'2_14 :: s:0' hole_c1:c23_14 :: c1:c2 hole_c6:c7:c84_14 :: c6:c7:c8 hole_true:false5_14 :: true:false hole_c3:c4:c56_14 :: c3:c4:c5 hole_c97_14 :: c9 hole_c10:c118_14 :: c10:c11 hole_c12:c139_14 :: c12:c13 gen_s:0'10_14 :: Nat -> s:0' gen_c6:c7:c811_14 :: Nat -> c6:c7:c8 gen_c3:c4:c512_14 :: Nat -> c3:c4:c5 Lemmas: gt(gen_s:0'10_14(n14_14), gen_s:0'10_14(n14_14)) -> false, rt in Omega(0) Generator Equations: gen_s:0'10_14(0) <=> 0' gen_s:0'10_14(+(x, 1)) <=> s(gen_s:0'10_14(x)) gen_c6:c7:c811_14(0) <=> c6 gen_c6:c7:c811_14(+(x, 1)) <=> c8(gen_c6:c7:c811_14(x)) gen_c3:c4:c512_14(0) <=> c3 gen_c3:c4:c512_14(+(x, 1)) <=> c5(gen_c3:c4:c512_14(x)) The following defined symbols remain to be analysed: GT, MINUS, GE, DIV, ge, minus, div They will be analysed ascendingly in the following order: GT < MINUS MINUS < DIV GT < DIV GE < DIV ge < DIV minus < DIV ge < div minus < div ---------------------------------------- (23) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: GT(gen_s:0'10_14(n425_14), gen_s:0'10_14(n425_14)) -> gen_c6:c7:c811_14(n425_14), rt in Omega(1 + n425_14) Induction Base: GT(gen_s:0'10_14(0), gen_s:0'10_14(0)) ->_R^Omega(1) c6 Induction Step: GT(gen_s:0'10_14(+(n425_14, 1)), gen_s:0'10_14(+(n425_14, 1))) ->_R^Omega(1) c8(GT(gen_s:0'10_14(n425_14), gen_s:0'10_14(n425_14))) ->_IH c8(gen_c6:c7:c811_14(c426_14)) 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: MINUS(s(z0), z1) -> c(IF(gt(s(z0), z1), z0, z1), GT(s(z0), z1)) IF(true, z0, z1) -> c1(MINUS(z0, z1)) IF(false, z0, z1) -> c2 GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) GT(0', z0) -> c6 GT(s(z0), 0') -> c7 GT(s(z0), s(z1)) -> c8(GT(z0, z1)) DIV(z0, z1) -> c9(IF1(ge(z0, z1), z0, z1), GE(z0, z1)) IF1(true, z0, z1) -> c10(IF2(gt(z1, 0'), z0, z1), GT(z1, 0')) IF1(false, z0, z1) -> c11 IF2(true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) IF2(false, z0, z1) -> c13 minus(s(z0), z1) -> if(gt(s(z0), z1), z0, z1) if(true, z0, z1) -> s(minus(z0, z1)) if(false, z0, z1) -> 0' ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) div(z0, z1) -> if1(ge(z0, z1), z0, z1) if1(true, z0, z1) -> if2(gt(z1, 0'), z0, z1) if1(false, z0, z1) -> 0' if2(true, z0, z1) -> s(div(minus(z0, z1), z1)) if2(false, z0, z1) -> 0' Types: MINUS :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c6:c7:c8 -> c IF :: true:false -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> true:false GT :: s:0' -> s:0' -> c6:c7:c8 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c1:c2 GE :: s:0' -> s:0' -> c3:c4:c5 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c6:c7:c8 -> c6:c7:c8 DIV :: s:0' -> s:0' -> c9 c9 :: c10:c11 -> c3:c4:c5 -> c9 IF1 :: true:false -> s:0' -> s:0' -> c10:c11 ge :: s:0' -> s:0' -> true:false c10 :: c12:c13 -> c6:c7:c8 -> c10:c11 IF2 :: true:false -> s:0' -> s:0' -> c12:c13 c11 :: c10:c11 c12 :: c9 -> c -> c12:c13 minus :: s:0' -> s:0' -> s:0' c13 :: c12:c13 if :: true:false -> s:0' -> s:0' -> s:0' div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_c1_14 :: c hole_s:0'2_14 :: s:0' hole_c1:c23_14 :: c1:c2 hole_c6:c7:c84_14 :: c6:c7:c8 hole_true:false5_14 :: true:false hole_c3:c4:c56_14 :: c3:c4:c5 hole_c97_14 :: c9 hole_c10:c118_14 :: c10:c11 hole_c12:c139_14 :: c12:c13 gen_s:0'10_14 :: Nat -> s:0' gen_c6:c7:c811_14 :: Nat -> c6:c7:c8 gen_c3:c4:c512_14 :: Nat -> c3:c4:c5 Lemmas: gt(gen_s:0'10_14(n14_14), gen_s:0'10_14(n14_14)) -> false, rt in Omega(0) Generator Equations: gen_s:0'10_14(0) <=> 0' gen_s:0'10_14(+(x, 1)) <=> s(gen_s:0'10_14(x)) gen_c6:c7:c811_14(0) <=> c6 gen_c6:c7:c811_14(+(x, 1)) <=> c8(gen_c6:c7:c811_14(x)) gen_c3:c4:c512_14(0) <=> c3 gen_c3:c4:c512_14(+(x, 1)) <=> c5(gen_c3:c4:c512_14(x)) The following defined symbols remain to be analysed: GT, MINUS, GE, DIV, ge, minus, div They will be analysed ascendingly in the following order: GT < MINUS MINUS < DIV GT < DIV GE < DIV ge < DIV minus < DIV ge < div minus < div ---------------------------------------- (26) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (27) BOUNDS(n^1, INF) ---------------------------------------- (28) Obligation: Innermost TRS: Rules: MINUS(s(z0), z1) -> c(IF(gt(s(z0), z1), z0, z1), GT(s(z0), z1)) IF(true, z0, z1) -> c1(MINUS(z0, z1)) IF(false, z0, z1) -> c2 GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) GT(0', z0) -> c6 GT(s(z0), 0') -> c7 GT(s(z0), s(z1)) -> c8(GT(z0, z1)) DIV(z0, z1) -> c9(IF1(ge(z0, z1), z0, z1), GE(z0, z1)) IF1(true, z0, z1) -> c10(IF2(gt(z1, 0'), z0, z1), GT(z1, 0')) IF1(false, z0, z1) -> c11 IF2(true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) IF2(false, z0, z1) -> c13 minus(s(z0), z1) -> if(gt(s(z0), z1), z0, z1) if(true, z0, z1) -> s(minus(z0, z1)) if(false, z0, z1) -> 0' ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) div(z0, z1) -> if1(ge(z0, z1), z0, z1) if1(true, z0, z1) -> if2(gt(z1, 0'), z0, z1) if1(false, z0, z1) -> 0' if2(true, z0, z1) -> s(div(minus(z0, z1), z1)) if2(false, z0, z1) -> 0' Types: MINUS :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c6:c7:c8 -> c IF :: true:false -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> true:false GT :: s:0' -> s:0' -> c6:c7:c8 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c1:c2 GE :: s:0' -> s:0' -> c3:c4:c5 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c6:c7:c8 -> c6:c7:c8 DIV :: s:0' -> s:0' -> c9 c9 :: c10:c11 -> c3:c4:c5 -> c9 IF1 :: true:false -> s:0' -> s:0' -> c10:c11 ge :: s:0' -> s:0' -> true:false c10 :: c12:c13 -> c6:c7:c8 -> c10:c11 IF2 :: true:false -> s:0' -> s:0' -> c12:c13 c11 :: c10:c11 c12 :: c9 -> c -> c12:c13 minus :: s:0' -> s:0' -> s:0' c13 :: c12:c13 if :: true:false -> s:0' -> s:0' -> s:0' div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_c1_14 :: c hole_s:0'2_14 :: s:0' hole_c1:c23_14 :: c1:c2 hole_c6:c7:c84_14 :: c6:c7:c8 hole_true:false5_14 :: true:false hole_c3:c4:c56_14 :: c3:c4:c5 hole_c97_14 :: c9 hole_c10:c118_14 :: c10:c11 hole_c12:c139_14 :: c12:c13 gen_s:0'10_14 :: Nat -> s:0' gen_c6:c7:c811_14 :: Nat -> c6:c7:c8 gen_c3:c4:c512_14 :: Nat -> c3:c4:c5 Lemmas: gt(gen_s:0'10_14(n14_14), gen_s:0'10_14(n14_14)) -> false, rt in Omega(0) GT(gen_s:0'10_14(n425_14), gen_s:0'10_14(n425_14)) -> gen_c6:c7:c811_14(n425_14), rt in Omega(1 + n425_14) Generator Equations: gen_s:0'10_14(0) <=> 0' gen_s:0'10_14(+(x, 1)) <=> s(gen_s:0'10_14(x)) gen_c6:c7:c811_14(0) <=> c6 gen_c6:c7:c811_14(+(x, 1)) <=> c8(gen_c6:c7:c811_14(x)) gen_c3:c4:c512_14(0) <=> c3 gen_c3:c4:c512_14(+(x, 1)) <=> c5(gen_c3:c4:c512_14(x)) The following defined symbols remain to be analysed: MINUS, GE, DIV, ge, minus, div They will be analysed ascendingly in the following order: MINUS < DIV GE < DIV ge < DIV minus < DIV ge < div minus < div ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: GE(gen_s:0'10_14(n1507_14), gen_s:0'10_14(n1507_14)) -> gen_c3:c4:c512_14(n1507_14), rt in Omega(1 + n1507_14) Induction Base: GE(gen_s:0'10_14(0), gen_s:0'10_14(0)) ->_R^Omega(1) c3 Induction Step: GE(gen_s:0'10_14(+(n1507_14, 1)), gen_s:0'10_14(+(n1507_14, 1))) ->_R^Omega(1) c5(GE(gen_s:0'10_14(n1507_14), gen_s:0'10_14(n1507_14))) ->_IH c5(gen_c3:c4:c512_14(c1508_14)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (30) Obligation: Innermost TRS: Rules: MINUS(s(z0), z1) -> c(IF(gt(s(z0), z1), z0, z1), GT(s(z0), z1)) IF(true, z0, z1) -> c1(MINUS(z0, z1)) IF(false, z0, z1) -> c2 GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) GT(0', z0) -> c6 GT(s(z0), 0') -> c7 GT(s(z0), s(z1)) -> c8(GT(z0, z1)) DIV(z0, z1) -> c9(IF1(ge(z0, z1), z0, z1), GE(z0, z1)) IF1(true, z0, z1) -> c10(IF2(gt(z1, 0'), z0, z1), GT(z1, 0')) IF1(false, z0, z1) -> c11 IF2(true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) IF2(false, z0, z1) -> c13 minus(s(z0), z1) -> if(gt(s(z0), z1), z0, z1) if(true, z0, z1) -> s(minus(z0, z1)) if(false, z0, z1) -> 0' ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) div(z0, z1) -> if1(ge(z0, z1), z0, z1) if1(true, z0, z1) -> if2(gt(z1, 0'), z0, z1) if1(false, z0, z1) -> 0' if2(true, z0, z1) -> s(div(minus(z0, z1), z1)) if2(false, z0, z1) -> 0' Types: MINUS :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c6:c7:c8 -> c IF :: true:false -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> true:false GT :: s:0' -> s:0' -> c6:c7:c8 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c1:c2 GE :: s:0' -> s:0' -> c3:c4:c5 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c6:c7:c8 -> c6:c7:c8 DIV :: s:0' -> s:0' -> c9 c9 :: c10:c11 -> c3:c4:c5 -> c9 IF1 :: true:false -> s:0' -> s:0' -> c10:c11 ge :: s:0' -> s:0' -> true:false c10 :: c12:c13 -> c6:c7:c8 -> c10:c11 IF2 :: true:false -> s:0' -> s:0' -> c12:c13 c11 :: c10:c11 c12 :: c9 -> c -> c12:c13 minus :: s:0' -> s:0' -> s:0' c13 :: c12:c13 if :: true:false -> s:0' -> s:0' -> s:0' div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_c1_14 :: c hole_s:0'2_14 :: s:0' hole_c1:c23_14 :: c1:c2 hole_c6:c7:c84_14 :: c6:c7:c8 hole_true:false5_14 :: true:false hole_c3:c4:c56_14 :: c3:c4:c5 hole_c97_14 :: c9 hole_c10:c118_14 :: c10:c11 hole_c12:c139_14 :: c12:c13 gen_s:0'10_14 :: Nat -> s:0' gen_c6:c7:c811_14 :: Nat -> c6:c7:c8 gen_c3:c4:c512_14 :: Nat -> c3:c4:c5 Lemmas: gt(gen_s:0'10_14(n14_14), gen_s:0'10_14(n14_14)) -> false, rt in Omega(0) GT(gen_s:0'10_14(n425_14), gen_s:0'10_14(n425_14)) -> gen_c6:c7:c811_14(n425_14), rt in Omega(1 + n425_14) GE(gen_s:0'10_14(n1507_14), gen_s:0'10_14(n1507_14)) -> gen_c3:c4:c512_14(n1507_14), rt in Omega(1 + n1507_14) Generator Equations: gen_s:0'10_14(0) <=> 0' gen_s:0'10_14(+(x, 1)) <=> s(gen_s:0'10_14(x)) gen_c6:c7:c811_14(0) <=> c6 gen_c6:c7:c811_14(+(x, 1)) <=> c8(gen_c6:c7:c811_14(x)) gen_c3:c4:c512_14(0) <=> c3 gen_c3:c4:c512_14(+(x, 1)) <=> c5(gen_c3:c4:c512_14(x)) The following defined symbols remain to be analysed: ge, DIV, minus, div They will be analysed ascendingly in the following order: ge < DIV minus < DIV ge < div minus < div ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: ge(gen_s:0'10_14(n2228_14), gen_s:0'10_14(n2228_14)) -> true, rt in Omega(0) Induction Base: ge(gen_s:0'10_14(0), gen_s:0'10_14(0)) ->_R^Omega(0) true Induction Step: ge(gen_s:0'10_14(+(n2228_14, 1)), gen_s:0'10_14(+(n2228_14, 1))) ->_R^Omega(0) ge(gen_s:0'10_14(n2228_14), gen_s:0'10_14(n2228_14)) ->_IH true We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (32) Obligation: Innermost TRS: Rules: MINUS(s(z0), z1) -> c(IF(gt(s(z0), z1), z0, z1), GT(s(z0), z1)) IF(true, z0, z1) -> c1(MINUS(z0, z1)) IF(false, z0, z1) -> c2 GE(z0, 0') -> c3 GE(0', s(z0)) -> c4 GE(s(z0), s(z1)) -> c5(GE(z0, z1)) GT(0', z0) -> c6 GT(s(z0), 0') -> c7 GT(s(z0), s(z1)) -> c8(GT(z0, z1)) DIV(z0, z1) -> c9(IF1(ge(z0, z1), z0, z1), GE(z0, z1)) IF1(true, z0, z1) -> c10(IF2(gt(z1, 0'), z0, z1), GT(z1, 0')) IF1(false, z0, z1) -> c11 IF2(true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) IF2(false, z0, z1) -> c13 minus(s(z0), z1) -> if(gt(s(z0), z1), z0, z1) if(true, z0, z1) -> s(minus(z0, z1)) if(false, z0, z1) -> 0' ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) gt(0', z0) -> false gt(s(z0), 0') -> true gt(s(z0), s(z1)) -> gt(z0, z1) div(z0, z1) -> if1(ge(z0, z1), z0, z1) if1(true, z0, z1) -> if2(gt(z1, 0'), z0, z1) if1(false, z0, z1) -> 0' if2(true, z0, z1) -> s(div(minus(z0, z1), z1)) if2(false, z0, z1) -> 0' Types: MINUS :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c6:c7:c8 -> c IF :: true:false -> s:0' -> s:0' -> c1:c2 gt :: s:0' -> s:0' -> true:false GT :: s:0' -> s:0' -> c6:c7:c8 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c1:c2 GE :: s:0' -> s:0' -> c3:c4:c5 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c6:c7:c8 -> c6:c7:c8 DIV :: s:0' -> s:0' -> c9 c9 :: c10:c11 -> c3:c4:c5 -> c9 IF1 :: true:false -> s:0' -> s:0' -> c10:c11 ge :: s:0' -> s:0' -> true:false c10 :: c12:c13 -> c6:c7:c8 -> c10:c11 IF2 :: true:false -> s:0' -> s:0' -> c12:c13 c11 :: c10:c11 c12 :: c9 -> c -> c12:c13 minus :: s:0' -> s:0' -> s:0' c13 :: c12:c13 if :: true:false -> s:0' -> s:0' -> s:0' div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_c1_14 :: c hole_s:0'2_14 :: s:0' hole_c1:c23_14 :: c1:c2 hole_c6:c7:c84_14 :: c6:c7:c8 hole_true:false5_14 :: true:false hole_c3:c4:c56_14 :: c3:c4:c5 hole_c97_14 :: c9 hole_c10:c118_14 :: c10:c11 hole_c12:c139_14 :: c12:c13 gen_s:0'10_14 :: Nat -> s:0' gen_c6:c7:c811_14 :: Nat -> c6:c7:c8 gen_c3:c4:c512_14 :: Nat -> c3:c4:c5 Lemmas: gt(gen_s:0'10_14(n14_14), gen_s:0'10_14(n14_14)) -> false, rt in Omega(0) GT(gen_s:0'10_14(n425_14), gen_s:0'10_14(n425_14)) -> gen_c6:c7:c811_14(n425_14), rt in Omega(1 + n425_14) GE(gen_s:0'10_14(n1507_14), gen_s:0'10_14(n1507_14)) -> gen_c3:c4:c512_14(n1507_14), rt in Omega(1 + n1507_14) ge(gen_s:0'10_14(n2228_14), gen_s:0'10_14(n2228_14)) -> true, rt in Omega(0) Generator Equations: gen_s:0'10_14(0) <=> 0' gen_s:0'10_14(+(x, 1)) <=> s(gen_s:0'10_14(x)) gen_c6:c7:c811_14(0) <=> c6 gen_c6:c7:c811_14(+(x, 1)) <=> c8(gen_c6:c7:c811_14(x)) gen_c3:c4:c512_14(0) <=> c3 gen_c3:c4:c512_14(+(x, 1)) <=> c5(gen_c3:c4:c512_14(x)) The following defined symbols remain to be analysed: minus, DIV, div They will be analysed ascendingly in the following order: minus < DIV minus < div