/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^2)) proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). (0) CpxTRS (1) RcToIrcProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxTRS (3) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxWeightedTrs (5) TypeInferenceProof [BOTH BOUNDS(ID, ID), 2 ms] (6) CpxTypedWeightedTrs (7) CompletionProof [UPPER BOUND(ID), 0 ms] (8) CpxTypedWeightedCompleteTrs (9) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (10) CpxRNTS (11) CompleteCoflocoProof [FINISHED, 1207 ms] (12) BOUNDS(1, n^2) (13) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] (14) TRS for Loop Detection (15) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] (16) BEST (17) proven lower bound (18) LowerBoundPropagationProof [FINISHED, 0 ms] (19) BOUNDS(n^1, INF) (20) TRS for Loop Detection ---------------------------------------- (0) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: le(0, y) -> true le(s(x), 0) -> false le(s(x), s(y)) -> le(x, y) mod(x, 0) -> modZeroErro mod(x, s(y)) -> modIter(x, s(y), 0, 0) modIter(x, s(y), z, u) -> if(le(x, z), x, s(y), z, u) if(true, x, y, z, u) -> u if(false, x, y, z, u) -> if2(le(y, s(u)), x, y, s(z), s(u)) if2(false, x, y, z, u) -> modIter(x, y, z, u) if2(true, x, y, z, u) -> modIter(x, y, z, 0) S is empty. Rewrite Strategy: FULL ---------------------------------------- (1) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. The duplicating contexts are: modIter([], s(y), z, u) modIter(x, s(y), [], u) if(false, x, [], z, u) if(false, x, y, z, []) The defined contexts are: if2([], x1, x2, s(x3), s(x4)) if([], x1, s(x2), x3, x4) [] just represents basic- or constructor-terms in the following defined contexts: if2([], x1, x2, s(x3), s(x4)) if([], x1, s(x2), x3, x4) As the TRS is an overlay system and the defined contexts and the duplicating contexts don't overlap, we have rc = irc. ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: le(0, y) -> true le(s(x), 0) -> false le(s(x), s(y)) -> le(x, y) mod(x, 0) -> modZeroErro mod(x, s(y)) -> modIter(x, s(y), 0, 0) modIter(x, s(y), z, u) -> if(le(x, z), x, s(y), z, u) if(true, x, y, z, u) -> u if(false, x, y, z, u) -> if2(le(y, s(u)), x, y, s(z), s(u)) if2(false, x, y, z, u) -> modIter(x, y, z, u) if2(true, x, y, z, u) -> modIter(x, y, z, 0) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (3) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (4) 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: le(0, y) -> true [1] le(s(x), 0) -> false [1] le(s(x), s(y)) -> le(x, y) [1] mod(x, 0) -> modZeroErro [1] mod(x, s(y)) -> modIter(x, s(y), 0, 0) [1] modIter(x, s(y), z, u) -> if(le(x, z), x, s(y), z, u) [1] if(true, x, y, z, u) -> u [1] if(false, x, y, z, u) -> if2(le(y, s(u)), x, y, s(z), s(u)) [1] if2(false, x, y, z, u) -> modIter(x, y, z, u) [1] if2(true, x, y, z, u) -> modIter(x, y, z, 0) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (5) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (6) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: le(0, y) -> true [1] le(s(x), 0) -> false [1] le(s(x), s(y)) -> le(x, y) [1] mod(x, 0) -> modZeroErro [1] mod(x, s(y)) -> modIter(x, s(y), 0, 0) [1] modIter(x, s(y), z, u) -> if(le(x, z), x, s(y), z, u) [1] if(true, x, y, z, u) -> u [1] if(false, x, y, z, u) -> if2(le(y, s(u)), x, y, s(z), s(u)) [1] if2(false, x, y, z, u) -> modIter(x, y, z, u) [1] if2(true, x, y, z, u) -> modIter(x, y, z, 0) [1] The TRS has the following type information: le :: 0:s:modZeroErro -> 0:s:modZeroErro -> true:false 0 :: 0:s:modZeroErro true :: true:false s :: 0:s:modZeroErro -> 0:s:modZeroErro false :: true:false mod :: 0:s:modZeroErro -> 0:s:modZeroErro -> 0:s:modZeroErro modZeroErro :: 0:s:modZeroErro modIter :: 0:s:modZeroErro -> 0:s:modZeroErro -> 0:s:modZeroErro -> 0:s:modZeroErro -> 0:s:modZeroErro if :: true:false -> 0:s:modZeroErro -> 0:s:modZeroErro -> 0:s:modZeroErro -> 0:s:modZeroErro -> 0:s:modZeroErro if2 :: true:false -> 0:s:modZeroErro -> 0:s:modZeroErro -> 0:s:modZeroErro -> 0:s:modZeroErro -> 0:s:modZeroErro Rewrite Strategy: INNERMOST ---------------------------------------- (7) 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: le(v0, v1) -> null_le [0] mod(v0, v1) -> null_mod [0] modIter(v0, v1, v2, v3) -> null_modIter [0] if(v0, v1, v2, v3, v4) -> null_if [0] if2(v0, v1, v2, v3, v4) -> null_if2 [0] And the following fresh constants: null_le, null_mod, null_modIter, null_if, null_if2 ---------------------------------------- (8) 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: le(0, y) -> true [1] le(s(x), 0) -> false [1] le(s(x), s(y)) -> le(x, y) [1] mod(x, 0) -> modZeroErro [1] mod(x, s(y)) -> modIter(x, s(y), 0, 0) [1] modIter(x, s(y), z, u) -> if(le(x, z), x, s(y), z, u) [1] if(true, x, y, z, u) -> u [1] if(false, x, y, z, u) -> if2(le(y, s(u)), x, y, s(z), s(u)) [1] if2(false, x, y, z, u) -> modIter(x, y, z, u) [1] if2(true, x, y, z, u) -> modIter(x, y, z, 0) [1] le(v0, v1) -> null_le [0] mod(v0, v1) -> null_mod [0] modIter(v0, v1, v2, v3) -> null_modIter [0] if(v0, v1, v2, v3, v4) -> null_if [0] if2(v0, v1, v2, v3, v4) -> null_if2 [0] The TRS has the following type information: le :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> true:false:null_le 0 :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 true :: true:false:null_le s :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 false :: true:false:null_le mod :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 modZeroErro :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 modIter :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 if :: true:false:null_le -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 if2 :: true:false:null_le -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 -> 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 null_le :: true:false:null_le null_mod :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 null_modIter :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 null_if :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 null_if2 :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 Rewrite Strategy: INNERMOST ---------------------------------------- (9) 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 modZeroErro => 1 null_le => 0 null_mod => 0 null_modIter => 0 null_if => 0 null_if2 => 0 ---------------------------------------- (10) Obligation: Complexity RNTS consisting of the following rules: if(z', z'', z1, z2, z3) -{ 1 }-> u :|: z1 = y, z >= 0, z' = 2, z2 = z, x >= 0, y >= 0, z'' = x, z3 = u, u >= 0 if(z', z'', z1, z2, z3) -{ 1 }-> if2(le(y, 1 + u), x, y, 1 + z, 1 + u) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 1, z3 = u, u >= 0 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 if2(z', z'', z1, z2, z3) -{ 1 }-> modIter(x, y, z, u) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 1, z3 = u, u >= 0 if2(z', z'', z1, z2, z3) -{ 1 }-> modIter(x, y, z, 0) :|: z1 = y, z >= 0, z' = 2, z2 = z, x >= 0, y >= 0, z'' = x, z3 = u, u >= 0 if2(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 le(z', z'') -{ 1 }-> le(x, y) :|: z' = 1 + x, x >= 0, y >= 0, z'' = 1 + y le(z', z'') -{ 1 }-> 2 :|: z'' = y, y >= 0, z' = 0 le(z', z'') -{ 1 }-> 1 :|: z'' = 0, z' = 1 + x, x >= 0 le(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 mod(z', z'') -{ 1 }-> modIter(x, 1 + y, 0, 0) :|: z' = x, x >= 0, y >= 0, z'' = 1 + y mod(z', z'') -{ 1 }-> 1 :|: z'' = 0, z' = x, x >= 0 mod(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 modIter(z', z'', z1, z2) -{ 1 }-> if(le(x, z), x, 1 + y, z, u) :|: z1 = z, z2 = u, z >= 0, z' = x, x >= 0, y >= 0, z'' = 1 + y, u >= 0 modIter(z', z'', z1, z2) -{ 0 }-> 0 :|: z2 = v3, v0 >= 0, z1 = v2, v1 >= 0, z'' = v1, v2 >= 0, v3 >= 0, z' = v0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (11) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V, V1, V14, V13, V19),0,[le(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1, V14, V13, V19),0,[mod(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1, V14, V13, V19),0,[modIter(V, V1, V14, V13, Out)],[V >= 0,V1 >= 0,V14 >= 0,V13 >= 0]). eq(start(V, V1, V14, V13, V19),0,[if(V, V1, V14, V13, V19, Out)],[V >= 0,V1 >= 0,V14 >= 0,V13 >= 0,V19 >= 0]). eq(start(V, V1, V14, V13, V19),0,[if2(V, V1, V14, V13, V19, Out)],[V >= 0,V1 >= 0,V14 >= 0,V13 >= 0,V19 >= 0]). eq(le(V, V1, Out),1,[],[Out = 2,V1 = V2,V2 >= 0,V = 0]). eq(le(V, V1, Out),1,[],[Out = 1,V1 = 0,V = 1 + V3,V3 >= 0]). eq(le(V, V1, Out),1,[le(V4, V5, Ret)],[Out = Ret,V = 1 + V4,V4 >= 0,V5 >= 0,V1 = 1 + V5]). eq(mod(V, V1, Out),1,[],[Out = 1,V1 = 0,V = V6,V6 >= 0]). eq(mod(V, V1, Out),1,[modIter(V7, 1 + V8, 0, 0, Ret1)],[Out = Ret1,V = V7,V7 >= 0,V8 >= 0,V1 = 1 + V8]). eq(modIter(V, V1, V14, V13, Out),1,[le(V10, V11, Ret0),if(Ret0, V10, 1 + V12, V11, V9, Ret2)],[Out = Ret2,V14 = V11,V13 = V9,V11 >= 0,V = V10,V10 >= 0,V12 >= 0,V1 = 1 + V12,V9 >= 0]). eq(if(V, V1, V14, V13, V19, Out),1,[],[Out = V16,V14 = V15,V17 >= 0,V = 2,V13 = V17,V18 >= 0,V15 >= 0,V1 = V18,V19 = V16,V16 >= 0]). eq(if(V, V1, V14, V13, V19, Out),1,[le(V21, 1 + V22, Ret01),if2(Ret01, V23, V21, 1 + V20, 1 + V22, Ret3)],[Out = Ret3,V14 = V21,V20 >= 0,V13 = V20,V23 >= 0,V21 >= 0,V1 = V23,V = 1,V19 = V22,V22 >= 0]). eq(if2(V, V1, V14, V13, V19, Out),1,[modIter(V25, V26, V24, V27, Ret4)],[Out = Ret4,V14 = V26,V24 >= 0,V13 = V24,V25 >= 0,V26 >= 0,V1 = V25,V = 1,V19 = V27,V27 >= 0]). eq(if2(V, V1, V14, V13, V19, Out),1,[modIter(V29, V31, V30, 0, Ret5)],[Out = Ret5,V14 = V31,V30 >= 0,V = 2,V13 = V30,V29 >= 0,V31 >= 0,V1 = V29,V19 = V28,V28 >= 0]). eq(le(V, V1, Out),0,[],[Out = 0,V33 >= 0,V32 >= 0,V1 = V32,V = V33]). eq(mod(V, V1, Out),0,[],[Out = 0,V35 >= 0,V34 >= 0,V1 = V34,V = V35]). eq(modIter(V, V1, V14, V13, Out),0,[],[Out = 0,V13 = V38,V37 >= 0,V14 = V39,V36 >= 0,V1 = V36,V39 >= 0,V38 >= 0,V = V37]). eq(if(V, V1, V14, V13, V19, Out),0,[],[Out = 0,V13 = V44,V40 >= 0,V43 >= 0,V14 = V41,V42 >= 0,V1 = V42,V19 = V43,V41 >= 0,V44 >= 0,V = V40]). eq(if2(V, V1, V14, V13, V19, Out),0,[],[Out = 0,V13 = V47,V46 >= 0,V49 >= 0,V14 = V48,V45 >= 0,V1 = V45,V19 = V49,V48 >= 0,V47 >= 0,V = V46]). input_output_vars(le(V,V1,Out),[V,V1],[Out]). input_output_vars(mod(V,V1,Out),[V,V1],[Out]). input_output_vars(modIter(V,V1,V14,V13,Out),[V,V1,V14,V13],[Out]). input_output_vars(if(V,V1,V14,V13,V19,Out),[V,V1,V14,V13,V19],[Out]). input_output_vars(if2(V,V1,V14,V13,V19,Out),[V,V1,V14,V13,V19],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [le/3] 1. recursive : [if/6,if2/6,modIter/5] 2. non_recursive : [(mod)/3] 3. non_recursive : [start/5] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into le/3 1. SCC is partially evaluated into modIter/5 2. SCC is partially evaluated into (mod)/3 3. SCC is partially evaluated into start/5 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations le/3 * CE 14 is refined into CE [24] * CE 12 is refined into CE [25] * CE 11 is refined into CE [26] * CE 13 is refined into CE [27] ### Cost equations --> "Loop" of le/3 * CEs [27] --> Loop 14 * CEs [24] --> Loop 15 * CEs [25] --> Loop 16 * CEs [26] --> Loop 17 ### Ranking functions of CR le(V,V1,Out) * RF of phase [14]: [V,V1] #### Partial ranking functions of CR le(V,V1,Out) * Partial RF of phase [14]: - RF of loop [14:1]: V V1 ### Specialization of cost equations modIter/5 * CE 19 is refined into CE [28,29] * CE 15 is refined into CE [30,31,32,33,34,35] * CE 18 is refined into CE [36,37,38,39,40] * CE 20 is refined into CE [41] * CE 17 is refined into CE [42,43] * CE 16 is refined into CE [44,45] ### Cost equations --> "Loop" of modIter/5 * CEs [43] --> Loop 18 * CEs [45] --> Loop 19 * CEs [42] --> Loop 20 * CEs [44] --> Loop 21 * CEs [29] --> Loop 22 * CEs [30,31,32,37] --> Loop 23 * CEs [28] --> Loop 24 * CEs [33,34,35,36,38,39,40,41] --> Loop 25 ### Ranking functions of CR modIter(V,V1,V14,V13,Out) * RF of phase [18,19]: [V-V14] #### Partial ranking functions of CR modIter(V,V1,V14,V13,Out) * Partial RF of phase [18,19]: - RF of loop [18:1]: V1-V13-1 depends on loops [19:1] - RF of loop [18:1,19:1]: V-V14 ### Specialization of cost equations (mod)/3 * CE 22 is refined into CE [46,47,48,49,50] * CE 23 is refined into CE [51] * CE 21 is refined into CE [52] ### Cost equations --> "Loop" of (mod)/3 * CEs [49] --> Loop 26 * CEs [50] --> Loop 27 * CEs [52] --> Loop 28 * CEs [48] --> Loop 29 * CEs [46,47,51] --> Loop 30 ### Ranking functions of CR mod(V,V1,Out) #### Partial ranking functions of CR mod(V,V1,Out) ### Specialization of cost equations start/5 * CE 4 is refined into CE [53,54,55,56,57,58,59] * CE 7 is refined into CE [60] * CE 1 is refined into CE [61,62,63,64] * CE 2 is refined into CE [65] * CE 3 is refined into CE [66,67,68,69,70] * CE 5 is refined into CE [71,72,73,74] * CE 6 is refined into CE [75,76,77,78,79,80,81] * CE 8 is refined into CE [82,83,84,85,86] * CE 9 is refined into CE [87,88,89,90] * CE 10 is refined into CE [91,92,93,94,95,96,97] ### Cost equations --> "Loop" of start/5 * CEs [94] --> Loop 31 * CEs [95] --> Loop 32 * CEs [83,88] --> Loop 33 * CEs [56] --> Loop 34 * CEs [57] --> Loop 35 * CEs [55] --> Loop 36 * CEs [53,54,58,59,60] --> Loop 37 * CEs [78] --> Loop 38 * CEs [79] --> Loop 39 * CEs [87,93] --> Loop 40 * CEs [61,66] --> Loop 41 * CEs [77] --> Loop 42 * CEs [62,63,64,67,68,69,70,71,72,73,74,75,76,80,81] --> Loop 43 * CEs [65,82,84,85,86,89,90,91,92,96,97] --> Loop 44 ### Ranking functions of CR start(V,V1,V14,V13,V19) #### Partial ranking functions of CR start(V,V1,V14,V13,V19) Computing Bounds ===================================== #### Cost of chains of le(V,V1,Out): * Chain [[14],17]: 1*it(14)+1 Such that:it(14) =< V with precondition: [Out=2,V>=1,V1>=V] * Chain [[14],16]: 1*it(14)+1 Such that:it(14) =< V1 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [[14],15]: 1*it(14)+0 Such that:it(14) =< V1 with precondition: [Out=0,V>=1,V1>=1] * Chain [17]: 1 with precondition: [V=0,Out=2,V1>=0] * Chain [16]: 1 with precondition: [V1=0,Out=1,V>=1] * Chain [15]: 0 with precondition: [Out=0,V>=0,V1>=0] #### Cost of chains of modIter(V,V1,V14,V13,Out): * Chain [[18,19],25]: 10*it(18)+6*s(2)+3*s(3)+1*s(7)+1*s(19)+1*s(20)+1*s(21)+4 Such that:s(7) =< V1 aux(13) =< V1+V13 aux(14) =< V aux(15) =< V-V14 aux(16) =< V-V14+V13+1 s(2) =< aux(14) s(3) =< aux(16) it(18) =< aux(15) aux(7) =< aux(14) s(21) =< it(18)*aux(7) s(20) =< it(18)*aux(13) s(19) =< it(18)*aux(14) with precondition: [Out=0,V1>=1,V14>=1,V13>=0,V>=V14+1] * Chain [[18,19],22]: 10*it(18)+1*s(19)+1*s(20)+1*s(21)+1*s(22)+1*s(23)+3 Such that:s(22) =< V-V14+V13-Out aux(13) =< V1+V13 aux(17) =< V aux(18) =< V-V14 s(23) =< aux(17) it(18) =< aux(18) aux(7) =< aux(17) s(21) =< it(18)*aux(7) s(20) =< it(18)*aux(13) s(19) =< it(18)*aux(17) with precondition: [V14>=1,V13>=0,Out>=0,V>=V14+1,V1>=Out+1,V+V13>=Out+V14] * Chain [25]: 5*s(2)+2*s(3)+1*s(7)+1*s(10)+4 Such that:s(10) =< V s(7) =< V1 aux(1) =< V14 aux(2) =< V13+1 s(2) =< aux(1) s(3) =< aux(2) with precondition: [Out=0,V>=0,V1>=0,V14>=0,V13>=0] * Chain [24]: 3 with precondition: [V=0,V13=Out,V1>=1,V14>=0,V13>=0] * Chain [23]: 2*s(24)+1*s(26)+4 Such that:s(26) =< V1 aux(19) =< V13+1 s(24) =< aux(19) with precondition: [V14=0,Out=0,V>=1,V1>=1,V13>=0] * Chain [22]: 1*s(23)+3 Such that:s(23) =< V with precondition: [V13=Out,V>=1,V1>=1,V13>=0,V14>=V] * Chain [21,[18,19],25]: 19*it(18)+2*s(7)+1*s(19)+1*s(20)+1*s(21)+9 Such that:aux(20) =< V aux(21) =< V1 s(7) =< aux(21) it(18) =< aux(20) aux(7) =< aux(20) s(21) =< it(18)*aux(7) s(20) =< it(18)*aux(21) s(19) =< it(18)*aux(20) with precondition: [V14=0,Out=0,V>=2,V1>=1,V13+1>=V1] * Chain [21,[18,19],22]: 11*it(18)+1*s(19)+1*s(20)+1*s(21)+1*s(22)+1*s(27)+8 Such that:s(22) =< V-Out aux(22) =< V aux(23) =< V1 s(27) =< aux(23) it(18) =< aux(22) aux(7) =< aux(22) s(21) =< it(18)*aux(7) s(20) =< it(18)*aux(23) s(19) =< it(18)*aux(22) with precondition: [V14=0,V>=2,Out>=0,V13+1>=V1,V>=Out+1,V1>=Out+1] * Chain [21,25]: 7*s(2)+2*s(7)+1*s(10)+9 Such that:s(10) =< V aux(24) =< 1 aux(25) =< V1 s(7) =< aux(25) s(2) =< aux(24) with precondition: [V14=0,Out=0,V>=1,V1>=1,V13+1>=V1] * Chain [21,22]: 1*s(23)+1*s(27)+8 Such that:s(23) =< 1 s(27) =< V1 with precondition: [V=1,V14=0,Out=0,V1>=1,V13+1>=V1] * Chain [20,[18,19],25]: 16*it(18)+3*s(3)+1*s(7)+1*s(19)+1*s(20)+1*s(21)+1*s(28)+9 Such that:aux(16) =< V+V13+1 s(7) =< V1 aux(13) =< V1+V13+1 s(28) =< V13+1 aux(26) =< V it(18) =< aux(26) s(3) =< aux(16) aux(7) =< aux(26) s(21) =< it(18)*aux(7) s(20) =< it(18)*aux(13) s(19) =< it(18)*aux(26) with precondition: [V14=0,Out=0,V>=2,V13>=0,V1>=V13+2] * Chain [20,[18,19],22]: 11*it(18)+1*s(19)+1*s(20)+1*s(21)+1*s(22)+1*s(28)+8 Such that:s(22) =< V+V13-Out aux(13) =< V1+V13+1 s(28) =< V13+1 aux(27) =< V it(18) =< aux(27) aux(7) =< aux(27) s(21) =< it(18)*aux(7) s(20) =< it(18)*aux(13) s(19) =< it(18)*aux(27) with precondition: [V14=0,V>=2,V13>=0,Out>=0,V1>=V13+2,V1>=Out+1,V+V13>=Out] * Chain [20,25]: 5*s(2)+2*s(3)+1*s(7)+1*s(10)+1*s(28)+9 Such that:aux(1) =< 1 s(10) =< V s(7) =< V1 s(28) =< V13+1 aux(2) =< V13+2 s(2) =< aux(1) s(3) =< aux(2) with precondition: [V14=0,Out=0,V>=1,V13>=0,V1>=V13+2] * Chain [20,22]: 1*s(23)+1*s(28)+8 Such that:s(23) =< 1 s(28) =< Out with precondition: [V=1,V14=0,V13+1=Out,V13>=0,V1>=V13+2] #### Cost of chains of mod(V,V1,Out): * Chain [30]: 19*s(94)+54*s(95)+10*s(96)+2*s(98)+3*s(100)+2*s(101)+3*s(102)+6*s(104)+1*s(105)+10 Such that:aux(32) =< 1 s(89) =< 2 aux(33) =< V aux(34) =< V+1 aux(35) =< V1 s(87) =< V1+1 s(94) =< aux(32) s(95) =< aux(33) s(96) =< aux(35) s(98) =< s(89) s(99) =< aux(33) s(100) =< s(95)*s(99) s(101) =< s(95)*aux(35) s(102) =< s(95)*aux(33) s(104) =< aux(34) s(105) =< s(95)*s(87) with precondition: [Out=0,V>=0,V1>=0] * Chain [29]: 2*s(111)+9 Such that:aux(36) =< 1 s(111) =< aux(36) with precondition: [V=1,Out=1,V1>=2] * Chain [28]: 1 with precondition: [V1=0,Out=1,V>=0] * Chain [27]: 12*s(113)+1*s(116)+1*s(119)+1*s(120)+1*s(121)+9 Such that:s(115) =< 1 aux(37) =< V s(113) =< aux(37) s(116) =< s(115) s(118) =< aux(37) s(119) =< s(113)*s(118) s(120) =< s(113)*s(115) s(121) =< s(113)*aux(37) with precondition: [V1=1,Out=0,V>=2] * Chain [26]: 12*s(122)+1*s(124)+1*s(128)+1*s(129)+1*s(130)+9 Such that:s(124) =< 1 s(123) =< V1+1 aux(38) =< V s(122) =< aux(38) s(127) =< aux(38) s(128) =< s(122)*s(127) s(129) =< s(122)*s(123) s(130) =< s(122)*aux(38) with precondition: [V>=2,V1>=2,Out>=0,V>=Out,V1>=Out+1] #### Cost of chains of start(V,V1,V14,V13,V19): * Chain [44]: 22*s(155)+125*s(157)+34*s(165)+7*s(167)+1*s(168)+7*s(169)+2*s(171)+3*s(172)+6*s(173)+2*s(174)+6*s(197)+2*s(198)+5*s(203)+3*s(204)+1*s(205)+3*s(206)+20*s(207)+2*s(208)+2*s(209)+2*s(210)+1*s(212)+10 Such that:s(158) =< 2 s(159) =< V+1 s(212) =< V-V14+V13 s(184) =< V-V14+V13+1 s(185) =< V+V13+1 s(187) =< V1+V13+1 s(188) =< V14 s(193) =< V13+1 s(189) =< V13+2 aux(41) =< 1 aux(42) =< V aux(43) =< V-V14 aux(44) =< V1 aux(45) =< V1+1 aux(46) =< V1+V13 s(165) =< aux(41) s(157) =< aux(42) s(155) =< aux(44) s(166) =< aux(42) s(167) =< s(157)*s(166) s(168) =< s(157)*aux(41) s(169) =< s(157)*aux(42) s(171) =< s(158) s(172) =< s(157)*aux(44) s(173) =< s(159) s(174) =< s(157)*aux(45) s(197) =< s(193) s(198) =< s(189) s(203) =< s(188) s(204) =< s(185) s(205) =< s(157)*s(187) s(206) =< s(184) s(207) =< aux(43) s(208) =< s(207)*s(166) s(209) =< s(207)*aux(46) s(210) =< s(207)*aux(42) with precondition: [V>=0,V1>=0] * Chain [43]: 12*s(222)+35*s(224)+45*s(238)+138*s(239)+2*s(242)+6*s(244)+3*s(245)+6*s(246)+10*s(247)+3*s(248)+1*s(249)+64*s(250)+6*s(252)+2*s(253)+6*s(254)+8*s(284)+2*s(285)+3*s(291)+1*s(292)+6*s(293)+2*s(296)+2*s(301)+5*s(331)+3*s(332)+1*s(333)+2*s(337)+12 Such that:s(233) =< 2 s(229) =< V1+1 s(313) =< V1+V19+1 s(272) =< V1+V19+2 s(231) =< V14+1 s(274) =< V14+V19+2 s(316) =< V13 s(276) =< V19+3 aux(52) =< 1 aux(53) =< V1 aux(54) =< V1-V13 aux(55) =< V1-V13+V19 aux(56) =< V1-V13+V19+1 aux(57) =< V14 aux(58) =< V14+V19 aux(59) =< V14+V19+1 aux(60) =< V13+1 aux(61) =< V19+1 aux(62) =< V19+2 s(239) =< aux(53) s(301) =< aux(55) s(224) =< aux(57) s(222) =< aux(61) s(238) =< aux(52) s(284) =< aux(62) s(285) =< s(276) s(243) =< aux(53) s(244) =< s(239)*s(243) s(245) =< s(239)*aux(57) s(246) =< s(239)*aux(53) s(247) =< aux(60) s(291) =< s(272) s(292) =< s(239)*s(274) s(293) =< aux(56) s(250) =< aux(54) s(252) =< s(250)*s(243) s(296) =< s(250)*aux(59) s(254) =< s(250)*aux(53) s(331) =< s(316) s(332) =< s(313) s(333) =< s(239)*aux(59) s(337) =< s(250)*aux(58) s(242) =< s(233) s(248) =< s(229) s(249) =< s(239)*s(231) s(253) =< s(250)*aux(57) with precondition: [V=1,V1>=0,V14>=0,V13>=0,V19>=0] * Chain [42]: 1*s(350)+1*s(351)+9 Such that:s(350) =< 1 s(351) =< V19+1 with precondition: [V=1,V1=1,V13=0,V19>=0,V14>=V19+2] * Chain [41]: 19*s(363)+44*s(364)+2*s(367)+2*s(369)+2*s(371)+5*s(372)+3*s(373)+1*s(374)+13*s(375)+1*s(377)+1*s(379)+12 Such that:aux(64) =< 1 s(358) =< 2 s(360) =< V1 s(354) =< V1+1 aux(65) =< V1-V13 s(357) =< V13+1 s(363) =< aux(64) s(364) =< s(360) s(367) =< s(358) s(368) =< s(360) s(369) =< s(364)*s(368) s(371) =< s(364)*s(360) s(372) =< s(357) s(373) =< s(354) s(374) =< s(364)*aux(64) s(375) =< aux(65) s(377) =< s(375)*s(368) s(379) =< s(375)*s(360) with precondition: [V=1,V14=0,V1>=0,V13>=0,V19>=0] * Chain [40]: 3*s(381)+1*s(383)+9 Such that:s(383) =< V13+1 aux(66) =< 1 s(381) =< aux(66) with precondition: [V=1,V1>=2] * Chain [39]: 12*s(384)+1*s(387)+1*s(390)+1*s(391)+1*s(392)+9 Such that:s(386) =< V14 aux(67) =< V1 s(384) =< aux(67) s(387) =< s(386) s(389) =< aux(67) s(390) =< s(384)*s(389) s(391) =< s(384)*s(386) s(392) =< s(384)*aux(67) with precondition: [V=1,V13=0,V1>=2,V14>=1,V19+1>=V14] * Chain [38]: 1*s(393)+1*s(395)+11*s(397)+1*s(399)+1*s(400)+1*s(401)+9 Such that:s(396) =< V1 s(393) =< V1+V19 s(394) =< V14+V19+1 s(395) =< V19+1 s(397) =< s(396) s(398) =< s(396) s(399) =< s(397)*s(398) s(400) =< s(397)*s(394) s(401) =< s(397)*s(396) with precondition: [V=1,V13=0,V1>=2,V19>=0,V14>=V19+2] * Chain [37]: 19*s(413)+46*s(414)+10*s(415)+2*s(417)+2*s(419)+1*s(420)+2*s(421)+5*s(422)+3*s(423)+1*s(424)+3*s(425)+21*s(426)+2*s(427)+2*s(428)+2*s(429)+10 Such that:aux(68) =< 1 s(408) =< 2 s(404) =< V1+1 s(403) =< V1-V13+1 s(406) =< V14+1 s(407) =< V13 aux(71) =< V1 aux(72) =< V1-V13 aux(73) =< V14 s(414) =< aux(71) s(413) =< aux(68) s(415) =< aux(73) s(417) =< s(408) s(418) =< aux(71) s(419) =< s(414)*s(418) s(420) =< s(414)*aux(73) s(421) =< s(414)*aux(71) s(422) =< s(407) s(423) =< s(404) s(424) =< s(414)*s(406) s(425) =< s(403) s(426) =< aux(72) s(427) =< s(426)*s(418) s(428) =< s(426)*aux(73) s(429) =< s(426)*aux(71) with precondition: [V=2,V1>=0,V14>=0,V13>=0,V19>=0] * Chain [36]: 2*s(441)+9 Such that:aux(74) =< 1 s(441) =< aux(74) with precondition: [V=2,V1=1,V13=0,V14>=2,V19>=0] * Chain [35]: 12*s(443)+1*s(446)+1*s(449)+1*s(450)+1*s(451)+9 Such that:s(445) =< 1 aux(75) =< V1 s(443) =< aux(75) s(446) =< s(445) s(448) =< aux(75) s(449) =< s(443)*s(448) s(450) =< s(443)*s(445) s(451) =< s(443)*aux(75) with precondition: [V=2,V14=1,V13=0,V1>=2,V19>=0] * Chain [34]: 12*s(452)+1*s(454)+1*s(458)+1*s(459)+1*s(460)+9 Such that:s(454) =< 1 s(453) =< V14+1 aux(76) =< V1 s(452) =< aux(76) s(457) =< aux(76) s(458) =< s(452)*s(457) s(459) =< s(452)*s(453) s(460) =< s(452)*aux(76) with precondition: [V=2,V13=0,V1>=2,V14>=2,V19>=0] * Chain [33]: 1 with precondition: [V1=0,V>=0] * Chain [32]: 12*s(461)+1*s(464)+1*s(467)+1*s(468)+1*s(469)+8 Such that:s(463) =< V1 aux(77) =< V s(461) =< aux(77) s(464) =< s(463) s(466) =< aux(77) s(467) =< s(461)*s(466) s(468) =< s(461)*s(463) s(469) =< s(461)*aux(77) with precondition: [V14=0,V>=2,V1>=1,V13+1>=V1] * Chain [31]: 1*s(470)+1*s(472)+11*s(474)+1*s(476)+1*s(477)+1*s(478)+8 Such that:s(473) =< V s(470) =< V+V13 s(471) =< V1+V13+1 s(472) =< V13+1 s(474) =< s(473) s(475) =< s(473) s(476) =< s(474)*s(475) s(477) =< s(474)*s(471) s(478) =< s(474)*s(473) with precondition: [V14=0,V>=2,V13>=0,V1>=V13+2] Closed-form bounds of start(V,V1,V14,V13,V19): ------------------------------------- * Chain [44] with precondition: [V>=0,V1>=0] - Upper bound: 126*V+48+14*V*V+3*V*V1+(V1+1)*(2*V)+nat(V1+V13+1)*V+4*V*nat(V-V14)+22*V1+nat(V14)*5+(6*V+6)+nat(V1+V13)*2*nat(V-V14)+nat(V13+1)*6+nat(V13+2)*2+nat(V+V13+1)*3+nat(V-V14+V13+1)*3+nat(V-V14+V13)+nat(V-V14)*20 - Complexity: n^2 * Chain [43] with precondition: [V=1,V1>=0,V14>=0,V13>=0,V19>=0] - Upper bound: 138*V1+61+12*V1*V1+3*V1*V14+(V14+1)*V1+(V14+V19+1)*V1+(V14+V19+2)*V1+12*V1*nat(V1-V13)+35*V14+2*V14*nat(V1-V13)+5*V13+(3*V1+3)+(2*V14+2*V19)*nat(V1-V13)+(10*V13+10)+(12*V19+12)+(8*V19+16)+(2*V19+6)+(3*V1+3*V19+3)+(3*V1+3*V19+6)+(2*V14+2*V19+2)*nat(V1-V13)+nat(V1-V13+V19+1)*6+nat(V1-V13+V19)*2+nat(V1-V13)*64 - Complexity: n^2 * Chain [42] with precondition: [V=1,V1=1,V13=0,V19>=0,V14>=V19+2] - Upper bound: V19+11 - Complexity: n * Chain [41] with precondition: [V=1,V14=0,V1>=0,V13>=0,V19>=0] - Upper bound: 45*V1+35+4*V1*V1+2*V1*nat(V1-V13)+(3*V1+3)+(5*V13+5)+nat(V1-V13)*13 - Complexity: n^2 * Chain [40] with precondition: [V=1,V1>=2] - Upper bound: nat(V13+1)+12 - Complexity: n * Chain [39] with precondition: [V=1,V13=0,V1>=2,V14>=1,V19+1>=V14] - Upper bound: 12*V1+9+2*V1*V1+V14*V1+V14 - Complexity: n^2 * Chain [38] with precondition: [V=1,V13=0,V1>=2,V19>=0,V14>=V19+2] - Upper bound: 11*V1+9+2*V1*V1+(V14+V19+1)*V1+(V1+V19)+(V19+1) - Complexity: n^2 * Chain [37] with precondition: [V=2,V1>=0,V14>=0,V13>=0,V19>=0] - Upper bound: 46*V1+33+4*V1*V1+V14*V1+(V14+1)*V1+4*V1*nat(V1-V13)+10*V14+2*V14*nat(V1-V13)+5*V13+(3*V1+3)+nat(V1-V13+1)*3+nat(V1-V13)*21 - Complexity: n^2 * Chain [36] with precondition: [V=2,V1=1,V13=0,V14>=2,V19>=0] - Upper bound: 11 - Complexity: constant * Chain [35] with precondition: [V=2,V14=1,V13=0,V1>=2,V19>=0] - Upper bound: 13*V1+10+2*V1*V1 - Complexity: n^2 * Chain [34] with precondition: [V=2,V13=0,V1>=2,V14>=2,V19>=0] - Upper bound: 12*V1+10+2*V1*V1+(V14+1)*V1 - Complexity: n^2 * Chain [33] with precondition: [V1=0,V>=0] - Upper bound: 1 - Complexity: constant * Chain [32] with precondition: [V14=0,V>=2,V1>=1,V13+1>=V1] - Upper bound: 12*V+8+2*V*V+V1*V+V1 - Complexity: n^2 * Chain [31] with precondition: [V14=0,V>=2,V13>=0,V1>=V13+2] - Upper bound: 11*V+8+2*V*V+(V1+V13+1)*V+(V+V13)+(V13+1) - Complexity: n^2 ### Maximum cost of start(V,V1,V14,V13,V19): max([max([max([10,nat(V19+1)+9]),nat(V13+1)+7+max([4,2*V*V+11*V+nat(V1+V13+1)*V+nat(V+V13)])]),V1+7+max([10*V1+1+max([max([2*V1*V1+max([max([nat(V14)*V1+nat(V14),nat(V14+1)*V1+1]),32*V1+23+2*V1*V1+2*V1*nat(V1-V13)+(3*V1+3)+nat(V1-V13)*13+max([nat(V13+1)*5+2,nat(V14)*V1+V1+nat(V14+1)*V1+2*V1*nat(V1-V13)+nat(V14)*10+nat(V14)*2*nat(V1-V13)+nat(V13)*5+nat(V1-V13)*8+max([nat(V1-V13+1)*3,92*V1+28+8*V1*V1+2*V1*nat(V14)+nat(V14+V19+1)*V1+nat(V14+V19+2)*V1+8*V1*nat(V1-V13)+nat(V14)*25+nat(V14+V19)*2*nat(V1-V13)+nat(V13+1)*10+nat(V19+1)*12+nat(V19+2)*8+nat(V19+3)*2+nat(V1+V19+1)*3+nat(V1+V19+2)*3+nat(V14+V19+1)*2*nat(V1-V13)+nat(V1-V13+V19+1)*6+nat(V1-V13+V19)*2+nat(V1-V13)*43])])+(V1+1)]),126*V+39+14*V*V+3*V*V1+(V1+1)*(2*V)+nat(V1+V13+1)*V+4*V*nat(V-V14)+10*V1+nat(V14)*5+(6*V+6)+nat(V1+V13)*2*nat(V-V14)+nat(V13+1)*6+nat(V13+2)*2+nat(V+V13+1)*3+nat(V-V14+V13+1)*3+nat(V-V14+V13)+nat(V-V14)*20])+V1,2*V1*V1+nat(V14+V19+1)*V1+nat(V1+V19)+nat(V19+1)]),2*V*V+12*V+V1*V])])+1 Asymptotic class: n^2 * Total analysis performed in 1048 ms. ---------------------------------------- (12) BOUNDS(1, n^2) ---------------------------------------- (13) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) Transformed a relative TRS into a decreasing-loop problem. ---------------------------------------- (14) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: le(0, y) -> true le(s(x), 0) -> false le(s(x), s(y)) -> le(x, y) mod(x, 0) -> modZeroErro mod(x, s(y)) -> modIter(x, s(y), 0, 0) modIter(x, s(y), z, u) -> if(le(x, z), x, s(y), z, u) if(true, x, y, z, u) -> u if(false, x, y, z, u) -> if2(le(y, s(u)), x, y, s(z), s(u)) if2(false, x, y, z, u) -> modIter(x, y, z, u) if2(true, x, y, z, u) -> modIter(x, y, z, 0) S is empty. Rewrite Strategy: FULL ---------------------------------------- (15) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence le(s(x), s(y)) ->^+ le(x, y) gives rise to a decreasing loop by considering the right hand sides subterm at position []. The pumping substitution is [x / s(x), y / s(y)]. The result substitution is [ ]. ---------------------------------------- (16) Complex Obligation (BEST) ---------------------------------------- (17) Obligation: Proved the lower bound n^1 for the following obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: le(0, y) -> true le(s(x), 0) -> false le(s(x), s(y)) -> le(x, y) mod(x, 0) -> modZeroErro mod(x, s(y)) -> modIter(x, s(y), 0, 0) modIter(x, s(y), z, u) -> if(le(x, z), x, s(y), z, u) if(true, x, y, z, u) -> u if(false, x, y, z, u) -> if2(le(y, s(u)), x, y, s(z), s(u)) if2(false, x, y, z, u) -> modIter(x, y, z, u) if2(true, x, y, z, u) -> modIter(x, y, z, 0) S is empty. Rewrite Strategy: FULL ---------------------------------------- (18) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (19) BOUNDS(n^1, INF) ---------------------------------------- (20) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: le(0, y) -> true le(s(x), 0) -> false le(s(x), s(y)) -> le(x, y) mod(x, 0) -> modZeroErro mod(x, s(y)) -> modIter(x, s(y), 0, 0) modIter(x, s(y), z, u) -> if(le(x, z), x, s(y), z, u) if(true, x, y, z, u) -> u if(false, x, y, z, u) -> if2(le(y, s(u)), x, y, s(z), s(u)) if2(false, x, y, z, u) -> modIter(x, y, z, u) if2(true, x, y, z, u) -> modIter(x, y, z, 0) S is empty. Rewrite Strategy: FULL