/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^1)) proof of /export/starexec/sandbox/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxTRS (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxWeightedTrs (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxTypedWeightedTrs (5) CompletionProof [UPPER BOUND(ID), 0 ms] (6) CpxTypedWeightedCompleteTrs (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 7 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 1114 ms] (10) BOUNDS(1, n^1) (11) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTRS (13) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (14) typed CpxTrs (15) OrderProof [LOWER BOUND(ID), 0 ms] (16) typed CpxTrs (17) RewriteLemmaProof [LOWER BOUND(ID), 260 ms] (18) BEST (19) proven lower bound (20) LowerBoundPropagationProof [FINISHED, 0 ms] (21) BOUNDS(n^1, INF) (22) typed CpxTrs (23) RewriteLemmaProof [LOWER BOUND(ID), 55 ms] (24) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: ge(x, 0) -> true ge(0, s(y)) -> false ge(s(x), s(y)) -> ge(x, y) minus(x, 0) -> x minus(0, y) -> 0 minus(s(x), s(y)) -> minus(x, y) id_inc(x) -> x id_inc(x) -> s(x) quot(x, y) -> div(x, y, 0) div(x, y, z) -> if(ge(y, s(0)), ge(x, y), x, y, z) if(false, b, x, y, z) -> div_by_zero if(true, false, x, y, z) -> z if(true, true, x, y, z) -> div(minus(x, y), y, id_inc(z)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: ge(x, 0) -> true [1] ge(0, s(y)) -> false [1] ge(s(x), s(y)) -> ge(x, y) [1] minus(x, 0) -> x [1] minus(0, y) -> 0 [1] minus(s(x), s(y)) -> minus(x, y) [1] id_inc(x) -> x [1] id_inc(x) -> s(x) [1] quot(x, y) -> div(x, y, 0) [1] div(x, y, z) -> if(ge(y, s(0)), ge(x, y), x, y, z) [1] if(false, b, x, y, z) -> div_by_zero [1] if(true, false, x, y, z) -> z [1] if(true, true, x, y, z) -> div(minus(x, y), y, id_inc(z)) [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: ge(x, 0) -> true [1] ge(0, s(y)) -> false [1] ge(s(x), s(y)) -> ge(x, y) [1] minus(x, 0) -> x [1] minus(0, y) -> 0 [1] minus(s(x), s(y)) -> minus(x, y) [1] id_inc(x) -> x [1] id_inc(x) -> s(x) [1] quot(x, y) -> div(x, y, 0) [1] div(x, y, z) -> if(ge(y, s(0)), ge(x, y), x, y, z) [1] if(false, b, x, y, z) -> div_by_zero [1] if(true, false, x, y, z) -> z [1] if(true, true, x, y, z) -> div(minus(x, y), y, id_inc(z)) [1] The TRS has the following type information: ge :: 0:s:div_by_zero -> 0:s:div_by_zero -> true:false 0 :: 0:s:div_by_zero true :: true:false s :: 0:s:div_by_zero -> 0:s:div_by_zero false :: true:false minus :: 0:s:div_by_zero -> 0:s:div_by_zero -> 0:s:div_by_zero id_inc :: 0:s:div_by_zero -> 0:s:div_by_zero quot :: 0:s:div_by_zero -> 0:s:div_by_zero -> 0:s:div_by_zero div :: 0:s:div_by_zero -> 0:s:div_by_zero -> 0:s:div_by_zero -> 0:s:div_by_zero if :: true:false -> true:false -> 0:s:div_by_zero -> 0:s:div_by_zero -> 0:s:div_by_zero -> 0:s:div_by_zero div_by_zero :: 0:s:div_by_zero 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: ge(v0, v1) -> null_ge [0] minus(v0, v1) -> null_minus [0] if(v0, v1, v2, v3, v4) -> null_if [0] And the following fresh constants: null_ge, null_minus, null_if ---------------------------------------- (6) Obligation: Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: ge(x, 0) -> true [1] ge(0, s(y)) -> false [1] ge(s(x), s(y)) -> ge(x, y) [1] minus(x, 0) -> x [1] minus(0, y) -> 0 [1] minus(s(x), s(y)) -> minus(x, y) [1] id_inc(x) -> x [1] id_inc(x) -> s(x) [1] quot(x, y) -> div(x, y, 0) [1] div(x, y, z) -> if(ge(y, s(0)), ge(x, y), x, y, z) [1] if(false, b, x, y, z) -> div_by_zero [1] if(true, false, x, y, z) -> z [1] if(true, true, x, y, z) -> div(minus(x, y), y, id_inc(z)) [1] ge(v0, v1) -> null_ge [0] minus(v0, v1) -> null_minus [0] if(v0, v1, v2, v3, v4) -> null_if [0] The TRS has the following type information: ge :: 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if -> true:false:null_ge 0 :: 0:s:div_by_zero:null_minus:null_if true :: true:false:null_ge s :: 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if false :: true:false:null_ge minus :: 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if id_inc :: 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if quot :: 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if div :: 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if if :: true:false:null_ge -> true:false:null_ge -> 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if -> 0:s:div_by_zero:null_minus:null_if div_by_zero :: 0:s:div_by_zero:null_minus:null_if null_ge :: true:false:null_ge null_minus :: 0:s:div_by_zero:null_minus:null_if null_if :: 0:s:div_by_zero:null_minus:null_if Rewrite Strategy: INNERMOST ---------------------------------------- (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: 0 => 0 true => 2 false => 1 div_by_zero => 1 null_ge => 0 null_minus => 0 null_if => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: div(z', z'', z1) -{ 1 }-> if(ge(y, 1 + 0), ge(x, y), x, y, z) :|: z1 = z, z >= 0, z' = x, z'' = y, x >= 0, y >= 0 ge(z', z'') -{ 1 }-> ge(x, y) :|: z' = 1 + x, x >= 0, y >= 0, z'' = 1 + y ge(z', z'') -{ 1 }-> 2 :|: z'' = 0, z' = x, x >= 0 ge(z', z'') -{ 1 }-> 1 :|: y >= 0, z'' = 1 + y, z' = 0 ge(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 id_inc(z') -{ 1 }-> x :|: z' = x, x >= 0 id_inc(z') -{ 1 }-> 1 + x :|: z' = x, x >= 0 if(z', z'', z1, z2, z3) -{ 1 }-> z :|: z2 = y, z >= 0, z' = 2, z3 = z, x >= 0, y >= 0, z'' = 1, z1 = x if(z', z'', z1, z2, z3) -{ 1 }-> div(minus(x, y), y, id_inc(z)) :|: z2 = y, z >= 0, z' = 2, z3 = z, x >= 0, y >= 0, z'' = 2, z1 = x if(z', z'', z1, z2, z3) -{ 1 }-> 1 :|: b >= 0, z2 = y, z >= 0, z'' = b, z3 = z, x >= 0, y >= 0, z' = 1, z1 = x if(z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z2 = v3, v0 >= 0, v4 >= 0, z1 = v2, v1 >= 0, z'' = v1, z3 = v4, v2 >= 0, v3 >= 0, z' = v0 minus(z', z'') -{ 1 }-> x :|: z'' = 0, z' = x, x >= 0 minus(z', z'') -{ 1 }-> minus(x, y) :|: z' = 1 + x, x >= 0, y >= 0, z'' = 1 + y minus(z', z'') -{ 1 }-> 0 :|: z'' = y, y >= 0, z' = 0 minus(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 quot(z', z'') -{ 1 }-> div(x, y, 0) :|: z' = x, z'' = y, x >= 0, y >= 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (9) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V, V1, V17, V22, V23),0,[ge(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1, V17, V22, V23),0,[minus(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1, V17, V22, V23),0,[fun(V, Out)],[V >= 0]). eq(start(V, V1, V17, V22, V23),0,[quot(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1, V17, V22, V23),0,[div(V, V1, V17, Out)],[V >= 0,V1 >= 0,V17 >= 0]). eq(start(V, V1, V17, V22, V23),0,[if(V, V1, V17, V22, V23, Out)],[V >= 0,V1 >= 0,V17 >= 0,V22 >= 0,V23 >= 0]). eq(ge(V, V1, Out),1,[],[Out = 2,V1 = 0,V = V2,V2 >= 0]). eq(ge(V, V1, Out),1,[],[Out = 1,V3 >= 0,V1 = 1 + V3,V = 0]). eq(ge(V, V1, Out),1,[ge(V4, V5, Ret)],[Out = Ret,V = 1 + V4,V4 >= 0,V5 >= 0,V1 = 1 + V5]). eq(minus(V, V1, Out),1,[],[Out = V6,V1 = 0,V = V6,V6 >= 0]). eq(minus(V, V1, Out),1,[],[Out = 0,V1 = V7,V7 >= 0,V = 0]). eq(minus(V, V1, Out),1,[minus(V8, V9, Ret1)],[Out = Ret1,V = 1 + V8,V8 >= 0,V9 >= 0,V1 = 1 + V9]). eq(fun(V, Out),1,[],[Out = V10,V = V10,V10 >= 0]). eq(fun(V, Out),1,[],[Out = 1 + V11,V = V11,V11 >= 0]). eq(quot(V, V1, Out),1,[div(V13, V12, 0, Ret2)],[Out = Ret2,V = V13,V1 = V12,V13 >= 0,V12 >= 0]). eq(div(V, V1, V17, Out),1,[ge(V14, 1 + 0, Ret0),ge(V16, V14, Ret11),if(Ret0, Ret11, V16, V14, V15, Ret3)],[Out = Ret3,V17 = V15,V15 >= 0,V = V16,V1 = V14,V16 >= 0,V14 >= 0]). eq(if(V, V1, V17, V22, V23, Out),1,[],[Out = 1,V21 >= 0,V22 = V20,V18 >= 0,V1 = V21,V23 = V18,V19 >= 0,V20 >= 0,V = 1,V17 = V19]). eq(if(V, V1, V17, V22, V23, Out),1,[],[Out = V24,V22 = V25,V24 >= 0,V = 2,V23 = V24,V26 >= 0,V25 >= 0,V1 = 1,V17 = V26]). eq(if(V, V1, V17, V22, V23, Out),1,[minus(V29, V28, Ret01),fun(V27, Ret21),div(Ret01, V28, Ret21, Ret4)],[Out = Ret4,V22 = V28,V27 >= 0,V = 2,V23 = V27,V29 >= 0,V28 >= 0,V1 = 2,V17 = V29]). eq(ge(V, V1, Out),0,[],[Out = 0,V31 >= 0,V30 >= 0,V1 = V30,V = V31]). eq(minus(V, V1, Out),0,[],[Out = 0,V33 >= 0,V32 >= 0,V1 = V32,V = V33]). eq(if(V, V1, V17, V22, V23, Out),0,[],[Out = 0,V22 = V37,V35 >= 0,V36 >= 0,V17 = V38,V34 >= 0,V1 = V34,V23 = V36,V38 >= 0,V37 >= 0,V = V35]). input_output_vars(ge(V,V1,Out),[V,V1],[Out]). input_output_vars(minus(V,V1,Out),[V,V1],[Out]). input_output_vars(fun(V,Out),[V],[Out]). input_output_vars(quot(V,V1,Out),[V,V1],[Out]). input_output_vars(div(V,V1,V17,Out),[V,V1,V17],[Out]). input_output_vars(if(V,V1,V17,V22,V23,Out),[V,V1,V17,V22,V23],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [ge/3] 1. non_recursive : [fun/2] 2. recursive : [minus/3] 3. recursive : [(div)/4,if/6] 4. non_recursive : [quot/3] 5. non_recursive : [start/5] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into ge/3 1. SCC is partially evaluated into fun/2 2. SCC is partially evaluated into minus/3 3. SCC is partially evaluated into (div)/4 4. SCC is completely evaluated into other SCCs 5. SCC is partially evaluated into start/5 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations ge/3 * CE 23 is refined into CE [24] * CE 20 is refined into CE [25] * CE 21 is refined into CE [26] * CE 22 is refined into CE [27] ### Cost equations --> "Loop" of ge/3 * CEs [27] --> Loop 17 * CEs [24] --> Loop 18 * CEs [25] --> Loop 19 * CEs [26] --> Loop 20 ### Ranking functions of CR ge(V,V1,Out) * RF of phase [17]: [V,V1] #### Partial ranking functions of CR ge(V,V1,Out) * Partial RF of phase [17]: - RF of loop [17:1]: V V1 ### Specialization of cost equations fun/2 * CE 14 is refined into CE [28] * CE 15 is refined into CE [29] ### Cost equations --> "Loop" of fun/2 * CEs [28] --> Loop 21 * CEs [29] --> Loop 22 ### Ranking functions of CR fun(V,Out) #### Partial ranking functions of CR fun(V,Out) ### Specialization of cost equations minus/3 * CE 10 is refined into CE [30] * CE 11 is refined into CE [31] * CE 13 is refined into CE [32] * CE 12 is refined into CE [33] ### Cost equations --> "Loop" of minus/3 * CEs [33] --> Loop 23 * CEs [30] --> Loop 24 * CEs [31,32] --> Loop 25 ### Ranking functions of CR minus(V,V1,Out) * RF of phase [23]: [V,V1] #### Partial ranking functions of CR minus(V,V1,Out) * Partial RF of phase [23]: - RF of loop [23:1]: V V1 ### Specialization of cost equations (div)/4 * CE 18 is refined into CE [34,35] * CE 19 is refined into CE [36,37] * CE 16 is refined into CE [38,39,40,41,42,43,44,45,46,47,48] * CE 17 is refined into CE [49,50,51,52] ### Cost equations --> "Loop" of (div)/4 * CEs [52] --> Loop 26 * CEs [51] --> Loop 27 * CEs [50] --> Loop 28 * CEs [49] --> Loop 29 * CEs [35] --> Loop 30 * CEs [36,37] --> Loop 31 * CEs [38,39,41] --> Loop 32 * CEs [34] --> Loop 33 * CEs [40,42,43,44,45,46,47,48] --> Loop 34 ### Ranking functions of CR div(V,V1,V17,Out) * RF of phase [26,27]: [V,V-V1+1] #### Partial ranking functions of CR div(V,V1,V17,Out) * Partial RF of phase [26,27]: - RF of loop [26:1,27:1]: V V-V1+1 ### Specialization of cost equations start/5 * CE 2 is refined into CE [53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76] * CE 3 is refined into CE [77] * CE 1 is refined into CE [78] * CE 4 is refined into CE [79] * CE 5 is refined into CE [80,81,82,83,84] * CE 6 is refined into CE [85,86,87] * CE 7 is refined into CE [88,89] * CE 8 is refined into CE [90,91,92,93,94,95,96,97] * CE 9 is refined into CE [98,99,100,101,102,103,104,105] ### Cost equations --> "Loop" of start/5 * CEs [81,85,92,100] --> Loop 35 * CEs [63,70] --> Loop 36 * CEs [53,54,55,56,57,58,59,60,61,62,64,65,66,67,68,69,71,72,73,74,75,76] --> Loop 37 * CEs [77] --> Loop 38 * CEs [79] --> Loop 39 * CEs [78,80,82,83,84,86,87,88,89,90,91,93,94,95,96,97,98,99,101,102,103,104,105] --> Loop 40 ### Ranking functions of CR start(V,V1,V17,V22,V23) #### Partial ranking functions of CR start(V,V1,V17,V22,V23) Computing Bounds ===================================== #### Cost of chains of ge(V,V1,Out): * Chain [[17],20]: 1*it(17)+1 Such that:it(17) =< V with precondition: [Out=1,V>=1,V1>=V+1] * Chain [[17],19]: 1*it(17)+1 Such that:it(17) =< V1 with precondition: [Out=2,V1>=1,V>=V1] * Chain [[17],18]: 1*it(17)+0 Such that:it(17) =< V1 with precondition: [Out=0,V>=1,V1>=1] * Chain [20]: 1 with precondition: [V=0,Out=1,V1>=1] * Chain [19]: 1 with precondition: [V1=0,Out=2,V>=0] * Chain [18]: 0 with precondition: [Out=0,V>=0,V1>=0] #### Cost of chains of fun(V,Out): * Chain [22]: 1 with precondition: [V+1=Out,V>=0] * Chain [21]: 1 with precondition: [V=Out,V>=0] #### Cost of chains of minus(V,V1,Out): * Chain [[23],25]: 1*it(23)+1 Such that:it(23) =< V1 with precondition: [Out=0,V>=1,V1>=1] * Chain [[23],24]: 1*it(23)+1 Such that:it(23) =< V1 with precondition: [V=Out+V1,V1>=1,V>=V1] * Chain [25]: 1 with precondition: [Out=0,V>=0,V1>=0] * Chain [24]: 1 with precondition: [V1=0,V=Out,V>=0] #### Cost of chains of div(V,V1,V17,Out): * Chain [[26,27],34]: 12*it(26)+8*s(3)+4*s(5)+6*s(7)+2*s(29)+3 Such that:aux(1) =< 1 aux(9) =< V-V1+1 aux(3) =< V1 aux(12) =< V s(3) =< aux(1) s(7) =< aux(12) s(5) =< aux(3) aux(6) =< aux(12) it(26) =< aux(12) aux(6) =< aux(9) it(26) =< aux(9) s(29) =< aux(6) with precondition: [Out=0,V1>=1,V17>=0,V>=V1] * Chain [[26,27],33]: 12*it(26)+2*s(29)+2*s(30)+2*s(33)+1*s(35)+4 Such that:s(35) =< 1 aux(9) =< V-V1+1 s(31) =< V+V17-Out aux(13) =< V aux(6) =< aux(13) it(26) =< aux(13) aux(6) =< aux(9) it(26) =< aux(9) s(29) =< aux(6) s(33) =< aux(13) s(30) =< s(31) with precondition: [V1>=1,V17>=0,V>=V1,Out>=V17,V+V17+1>=Out+V1] * Chain [[26,27],30]: 12*it(26)+2*s(29)+2*s(30)+3*s(33)+1*s(36)+4 Such that:s(36) =< 1 aux(9) =< V-V1+1 s(31) =< V+V17-Out aux(14) =< V s(33) =< aux(14) aux(6) =< aux(14) it(26) =< aux(14) aux(6) =< aux(9) it(26) =< aux(9) s(29) =< aux(6) s(30) =< s(31) with precondition: [V1>=2,V17>=0,V>=V1+1,Out>=V17,V+2*V17+1>=2*Out+V1] * Chain [[26,27],29,34]: 12*it(26)+9*s(3)+6*s(5)+2*s(29)+2*s(30)+2*s(33)+9 Such that:aux(16) =< 1 aux(8) =< V aux(9) =< V-V1+1 aux(17) =< V1 aux(18) =< V-V1 s(3) =< aux(16) s(5) =< aux(17) aux(6) =< aux(8) it(26) =< aux(8) s(34) =< aux(8) aux(6) =< aux(9) it(26) =< aux(9) aux(6) =< aux(18) it(26) =< aux(18) s(34) =< aux(18) s(29) =< aux(6) s(33) =< s(34) s(30) =< aux(18) with precondition: [Out=0,V1>=1,V17>=0,V>=2*V1] * Chain [[26,27],29,33]: 12*it(26)+2*s(29)+2*s(30)+2*s(33)+2*s(35)+2*s(39)+10 Such that:aux(19) =< 1 aux(8) =< V aux(9) =< V-V1+1 s(31) =< V-V1+V17-Out+1 aux(15) =< V1 aux(20) =< V-V1 s(35) =< aux(19) s(39) =< aux(15) aux(6) =< aux(8) it(26) =< aux(8) s(34) =< aux(8) aux(6) =< aux(9) it(26) =< aux(9) aux(6) =< aux(20) it(26) =< aux(20) s(34) =< aux(20) s(29) =< aux(6) s(33) =< s(34) s(30) =< s(31) with precondition: [V1>=1,V17>=0,V>=2*V1,Out>=V17+1,V+V17+2>=2*V1+Out] * Chain [[26,27],28,34]: 12*it(26)+9*s(3)+6*s(5)+2*s(29)+2*s(30)+2*s(33)+9 Such that:aux(22) =< 1 aux(8) =< V aux(9) =< V-V1+1 aux(23) =< V1 aux(24) =< V-V1 s(3) =< aux(22) s(5) =< aux(23) aux(6) =< aux(8) it(26) =< aux(8) s(34) =< aux(8) aux(6) =< aux(9) it(26) =< aux(9) aux(6) =< aux(24) it(26) =< aux(24) s(34) =< aux(24) s(29) =< aux(6) s(33) =< s(34) s(30) =< aux(24) with precondition: [Out=0,V1>=1,V17>=0,V>=2*V1] * Chain [[26,27],28,33]: 12*it(26)+2*s(29)+2*s(30)+2*s(33)+2*s(35)+2*s(42)+10 Such that:aux(25) =< 1 aux(8) =< V aux(9) =< V-V1+1 s(31) =< V-V1+V17-Out aux(21) =< V1 aux(26) =< V-V1 s(35) =< aux(25) s(42) =< aux(21) aux(6) =< aux(8) it(26) =< aux(8) s(34) =< aux(8) aux(6) =< aux(9) it(26) =< aux(9) aux(6) =< aux(26) it(26) =< aux(26) s(34) =< aux(26) s(29) =< aux(6) s(33) =< s(34) s(30) =< s(31) with precondition: [V1>=1,V17>=0,V>=2*V1,Out>=V17,V+V17+1>=2*V1+Out] * Chain [34]: 8*s(3)+4*s(5)+2*s(7)+3 Such that:aux(1) =< 1 aux(2) =< V aux(3) =< V1 s(3) =< aux(1) s(7) =< aux(2) s(5) =< aux(3) with precondition: [Out=0,V>=0,V1>=0,V17>=0] * Chain [33]: 1*s(35)+4 Such that:s(35) =< 1 with precondition: [V=0,V17=Out,V1>=1,V17>=0] * Chain [32]: 4 with precondition: [V1=0,Out=0,V>=0,V17>=0] * Chain [31]: 4 with precondition: [V1=0,Out=1,V>=0,V17>=0] * Chain [30]: 1*s(36)+1*s(37)+4 Such that:s(36) =< 1 s(37) =< V with precondition: [V17=Out,V>=1,V17>=0,V1>=V+1] * Chain [29,34]: 9*s(3)+6*s(5)+9 Such that:aux(16) =< 1 aux(17) =< V1 s(3) =< aux(16) s(5) =< aux(17) with precondition: [Out=0,V1>=1,V17>=0,V>=V1] * Chain [29,33]: 2*s(35)+2*s(39)+10 Such that:aux(15) =< V1 aux(19) =< 1 s(35) =< aux(19) s(39) =< aux(15) with precondition: [Out=V17+1,V1>=1,Out>=1,V>=V1] * Chain [28,34]: 9*s(3)+6*s(5)+9 Such that:aux(22) =< 1 aux(23) =< V1 s(3) =< aux(22) s(5) =< aux(23) with precondition: [Out=0,V1>=1,V17>=0,V>=V1] * Chain [28,33]: 2*s(35)+2*s(42)+10 Such that:aux(21) =< V1 aux(25) =< 1 s(35) =< aux(25) s(42) =< aux(21) with precondition: [V17=Out,V1>=1,V17>=0,V>=V1] #### Cost of chains of start(V,V1,V17,V22,V23): * Chain [40]: 84*s(119)+37*s(120)+128*s(124)+96*s(134)+16*s(136)+16*s(137)+16*s(138)+72*s(140)+12*s(141)+11 Such that:aux(42) =< 1 aux(43) =< V aux(44) =< V-V1 aux(45) =< V-V1+1 aux(46) =< V1 s(124) =< aux(42) s(120) =< aux(43) s(119) =< aux(46) s(133) =< aux(43) s(134) =< aux(43) s(135) =< aux(43) s(133) =< aux(45) s(134) =< aux(45) s(133) =< aux(44) s(134) =< aux(44) s(135) =< aux(44) s(136) =< s(133) s(137) =< s(135) s(138) =< aux(44) s(139) =< aux(43) s(140) =< aux(43) s(139) =< aux(45) s(140) =< aux(45) s(141) =< s(139) with precondition: [V>=0] * Chain [39]: 1 with precondition: [V=1,V1>=0,V17>=0,V22>=0,V23>=0] * Chain [38]: 1 with precondition: [V=2,V1=1,V17>=0,V22>=0,V23>=0] * Chain [37]: 336*s(257)+32*s(259)+72*s(261)+12*s(263)+160*s(286)+8*s(302)+36*s(336)+96*s(338)+16*s(340)+16*s(341)+16*s(342)+72*s(344)+12*s(345)+13 Such that:aux(67) =< 1 aux(68) =< V17 aux(69) =< V17+1 aux(70) =< V17-2*V22 aux(71) =< V17-2*V22+1 aux(72) =< V17-V22 aux(73) =< -V22 aux(74) =< V22 s(257) =< aux(67) s(336) =< aux(72) s(286) =< aux(74) s(259) =< aux(68) s(260) =< aux(68) s(261) =< aux(68) s(260) =< aux(69) s(261) =< aux(69) s(263) =< s(260) s(302) =< aux(73) s(337) =< aux(72) s(338) =< aux(72) s(339) =< aux(72) s(337) =< aux(71) s(338) =< aux(71) s(337) =< aux(70) s(338) =< aux(70) s(339) =< aux(70) s(340) =< s(337) s(341) =< s(339) s(342) =< aux(70) s(343) =< aux(72) s(344) =< aux(72) s(343) =< aux(71) s(344) =< aux(71) s(345) =< s(343) with precondition: [V=2,V1=2,V17>=0,V22>=0,V23>=0] * Chain [36]: 2*s(466)+2*s(467)+7 Such that:aux(75) =< 1 aux(76) =< V22 s(467) =< aux(75) s(466) =< aux(76) with precondition: [V=2,V1=2,V17=V22,V17>=1,V23>=0] * Chain [35]: 5 with precondition: [V1=0,V>=0] Closed-form bounds of start(V,V1,V17,V22,V23): ------------------------------------- * Chain [40] with precondition: [V>=0] - Upper bound: 249*V+139+nat(V1)*84+nat(V-V1)*16 - Complexity: n * Chain [39] with precondition: [V=1,V1>=0,V17>=0,V22>=0,V23>=0] - Upper bound: 1 - Complexity: constant * Chain [38] with precondition: [V=2,V1=1,V17>=0,V22>=0,V23>=0] - Upper bound: 1 - Complexity: constant * Chain [37] with precondition: [V=2,V1=2,V17>=0,V22>=0,V23>=0] - Upper bound: 116*V17+160*V22+349+nat(V17-V22)*248+nat(V17-2*V22)*16 - Complexity: n * Chain [36] with precondition: [V=2,V1=2,V17=V22,V17>=1,V23>=0] - Upper bound: 2*V22+9 - Complexity: n * Chain [35] with precondition: [V1=0,V>=0] - Upper bound: 5 - Complexity: constant ### Maximum cost of start(V,V1,V17,V22,V23): max([max([4,249*V+138+nat(V1)*84+nat(V-V1)*16]),nat(V17)*116+340+nat(V22)*158+nat(V17-V22)*248+nat(V17-2*V22)*16+(nat(V22)*2+8)])+1 Asymptotic class: n * Total analysis performed in 963 ms. ---------------------------------------- (10) BOUNDS(1, n^1) ---------------------------------------- (11) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (12) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: ge(x, 0') -> true ge(0', s(y)) -> false ge(s(x), s(y)) -> ge(x, y) minus(x, 0') -> x minus(0', y) -> 0' minus(s(x), s(y)) -> minus(x, y) id_inc(x) -> x id_inc(x) -> s(x) quot(x, y) -> div(x, y, 0') div(x, y, z) -> if(ge(y, s(0')), ge(x, y), x, y, z) if(false, b, x, y, z) -> div_by_zero if(true, false, x, y, z) -> z if(true, true, x, y, z) -> div(minus(x, y), y, id_inc(z)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (14) Obligation: Innermost TRS: Rules: ge(x, 0') -> true ge(0', s(y)) -> false ge(s(x), s(y)) -> ge(x, y) minus(x, 0') -> x minus(0', y) -> 0' minus(s(x), s(y)) -> minus(x, y) id_inc(x) -> x id_inc(x) -> s(x) quot(x, y) -> div(x, y, 0') div(x, y, z) -> if(ge(y, s(0')), ge(x, y), x, y, z) if(false, b, x, y, z) -> div_by_zero if(true, false, x, y, z) -> z if(true, true, x, y, z) -> div(minus(x, y), y, id_inc(z)) Types: ge :: 0':s:div_by_zero -> 0':s:div_by_zero -> true:false 0' :: 0':s:div_by_zero true :: true:false s :: 0':s:div_by_zero -> 0':s:div_by_zero false :: true:false minus :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero id_inc :: 0':s:div_by_zero -> 0':s:div_by_zero quot :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero div :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero if :: true:false -> true:false -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero div_by_zero :: 0':s:div_by_zero hole_true:false1_0 :: true:false hole_0':s:div_by_zero2_0 :: 0':s:div_by_zero gen_0':s:div_by_zero3_0 :: Nat -> 0':s:div_by_zero ---------------------------------------- (15) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: ge, minus, div They will be analysed ascendingly in the following order: ge < div minus < div ---------------------------------------- (16) Obligation: Innermost TRS: Rules: ge(x, 0') -> true ge(0', s(y)) -> false ge(s(x), s(y)) -> ge(x, y) minus(x, 0') -> x minus(0', y) -> 0' minus(s(x), s(y)) -> minus(x, y) id_inc(x) -> x id_inc(x) -> s(x) quot(x, y) -> div(x, y, 0') div(x, y, z) -> if(ge(y, s(0')), ge(x, y), x, y, z) if(false, b, x, y, z) -> div_by_zero if(true, false, x, y, z) -> z if(true, true, x, y, z) -> div(minus(x, y), y, id_inc(z)) Types: ge :: 0':s:div_by_zero -> 0':s:div_by_zero -> true:false 0' :: 0':s:div_by_zero true :: true:false s :: 0':s:div_by_zero -> 0':s:div_by_zero false :: true:false minus :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero id_inc :: 0':s:div_by_zero -> 0':s:div_by_zero quot :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero div :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero if :: true:false -> true:false -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero div_by_zero :: 0':s:div_by_zero hole_true:false1_0 :: true:false hole_0':s:div_by_zero2_0 :: 0':s:div_by_zero gen_0':s:div_by_zero3_0 :: Nat -> 0':s:div_by_zero Generator Equations: gen_0':s:div_by_zero3_0(0) <=> 0' gen_0':s:div_by_zero3_0(+(x, 1)) <=> s(gen_0':s:div_by_zero3_0(x)) The following defined symbols remain to be analysed: ge, minus, div They will be analysed ascendingly in the following order: ge < div minus < div ---------------------------------------- (17) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: ge(gen_0':s:div_by_zero3_0(n5_0), gen_0':s:div_by_zero3_0(n5_0)) -> true, rt in Omega(1 + n5_0) Induction Base: ge(gen_0':s:div_by_zero3_0(0), gen_0':s:div_by_zero3_0(0)) ->_R^Omega(1) true Induction Step: ge(gen_0':s:div_by_zero3_0(+(n5_0, 1)), gen_0':s:div_by_zero3_0(+(n5_0, 1))) ->_R^Omega(1) ge(gen_0':s:div_by_zero3_0(n5_0), gen_0':s:div_by_zero3_0(n5_0)) ->_IH true We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (18) Complex Obligation (BEST) ---------------------------------------- (19) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: ge(x, 0') -> true ge(0', s(y)) -> false ge(s(x), s(y)) -> ge(x, y) minus(x, 0') -> x minus(0', y) -> 0' minus(s(x), s(y)) -> minus(x, y) id_inc(x) -> x id_inc(x) -> s(x) quot(x, y) -> div(x, y, 0') div(x, y, z) -> if(ge(y, s(0')), ge(x, y), x, y, z) if(false, b, x, y, z) -> div_by_zero if(true, false, x, y, z) -> z if(true, true, x, y, z) -> div(minus(x, y), y, id_inc(z)) Types: ge :: 0':s:div_by_zero -> 0':s:div_by_zero -> true:false 0' :: 0':s:div_by_zero true :: true:false s :: 0':s:div_by_zero -> 0':s:div_by_zero false :: true:false minus :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero id_inc :: 0':s:div_by_zero -> 0':s:div_by_zero quot :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero div :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero if :: true:false -> true:false -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero div_by_zero :: 0':s:div_by_zero hole_true:false1_0 :: true:false hole_0':s:div_by_zero2_0 :: 0':s:div_by_zero gen_0':s:div_by_zero3_0 :: Nat -> 0':s:div_by_zero Generator Equations: gen_0':s:div_by_zero3_0(0) <=> 0' gen_0':s:div_by_zero3_0(+(x, 1)) <=> s(gen_0':s:div_by_zero3_0(x)) The following defined symbols remain to be analysed: ge, minus, div They will be analysed ascendingly in the following order: ge < div minus < div ---------------------------------------- (20) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (21) BOUNDS(n^1, INF) ---------------------------------------- (22) Obligation: Innermost TRS: Rules: ge(x, 0') -> true ge(0', s(y)) -> false ge(s(x), s(y)) -> ge(x, y) minus(x, 0') -> x minus(0', y) -> 0' minus(s(x), s(y)) -> minus(x, y) id_inc(x) -> x id_inc(x) -> s(x) quot(x, y) -> div(x, y, 0') div(x, y, z) -> if(ge(y, s(0')), ge(x, y), x, y, z) if(false, b, x, y, z) -> div_by_zero if(true, false, x, y, z) -> z if(true, true, x, y, z) -> div(minus(x, y), y, id_inc(z)) Types: ge :: 0':s:div_by_zero -> 0':s:div_by_zero -> true:false 0' :: 0':s:div_by_zero true :: true:false s :: 0':s:div_by_zero -> 0':s:div_by_zero false :: true:false minus :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero id_inc :: 0':s:div_by_zero -> 0':s:div_by_zero quot :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero div :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero if :: true:false -> true:false -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero div_by_zero :: 0':s:div_by_zero hole_true:false1_0 :: true:false hole_0':s:div_by_zero2_0 :: 0':s:div_by_zero gen_0':s:div_by_zero3_0 :: Nat -> 0':s:div_by_zero Lemmas: ge(gen_0':s:div_by_zero3_0(n5_0), gen_0':s:div_by_zero3_0(n5_0)) -> true, rt in Omega(1 + n5_0) Generator Equations: gen_0':s:div_by_zero3_0(0) <=> 0' gen_0':s:div_by_zero3_0(+(x, 1)) <=> s(gen_0':s:div_by_zero3_0(x)) The following defined symbols remain to be analysed: minus, div They will be analysed ascendingly in the following order: minus < div ---------------------------------------- (23) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: minus(gen_0':s:div_by_zero3_0(n329_0), gen_0':s:div_by_zero3_0(n329_0)) -> gen_0':s:div_by_zero3_0(0), rt in Omega(1 + n329_0) Induction Base: minus(gen_0':s:div_by_zero3_0(0), gen_0':s:div_by_zero3_0(0)) ->_R^Omega(1) gen_0':s:div_by_zero3_0(0) Induction Step: minus(gen_0':s:div_by_zero3_0(+(n329_0, 1)), gen_0':s:div_by_zero3_0(+(n329_0, 1))) ->_R^Omega(1) minus(gen_0':s:div_by_zero3_0(n329_0), gen_0':s:div_by_zero3_0(n329_0)) ->_IH gen_0':s:div_by_zero3_0(0) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (24) Obligation: Innermost TRS: Rules: ge(x, 0') -> true ge(0', s(y)) -> false ge(s(x), s(y)) -> ge(x, y) minus(x, 0') -> x minus(0', y) -> 0' minus(s(x), s(y)) -> minus(x, y) id_inc(x) -> x id_inc(x) -> s(x) quot(x, y) -> div(x, y, 0') div(x, y, z) -> if(ge(y, s(0')), ge(x, y), x, y, z) if(false, b, x, y, z) -> div_by_zero if(true, false, x, y, z) -> z if(true, true, x, y, z) -> div(minus(x, y), y, id_inc(z)) Types: ge :: 0':s:div_by_zero -> 0':s:div_by_zero -> true:false 0' :: 0':s:div_by_zero true :: true:false s :: 0':s:div_by_zero -> 0':s:div_by_zero false :: true:false minus :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero id_inc :: 0':s:div_by_zero -> 0':s:div_by_zero quot :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero div :: 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero if :: true:false -> true:false -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero -> 0':s:div_by_zero div_by_zero :: 0':s:div_by_zero hole_true:false1_0 :: true:false hole_0':s:div_by_zero2_0 :: 0':s:div_by_zero gen_0':s:div_by_zero3_0 :: Nat -> 0':s:div_by_zero Lemmas: ge(gen_0':s:div_by_zero3_0(n5_0), gen_0':s:div_by_zero3_0(n5_0)) -> true, rt in Omega(1 + n5_0) minus(gen_0':s:div_by_zero3_0(n329_0), gen_0':s:div_by_zero3_0(n329_0)) -> gen_0':s:div_by_zero3_0(0), rt in Omega(1 + n329_0) Generator Equations: gen_0':s:div_by_zero3_0(0) <=> 0' gen_0':s:div_by_zero3_0(+(x, 1)) <=> s(gen_0':s:div_by_zero3_0(x)) The following defined symbols remain to be analysed: div