WORST_CASE(Omega(n^1),?) ### Pre-processing the ITS problem ### Initial linear ITS problem Start location: l9 0: l0 -> l1 : i1^0'=i1^post_1, i2^0'=i2^post_1, i3^0'=i3^post_1, i4^0'=i4^post_1, n^0'=n^post_1, [ 1<=i4^0 && i4^post_1==-1+i4^0 && i1^0==i1^post_1 && i2^0==i2^post_1 && i3^0==i3^post_1 && n^0==n^post_1 ], cost: 1 1: l1 -> l0 : i1^0'=i1^post_2, i2^0'=i2^post_2, i3^0'=i3^post_2, i4^0'=i4^post_2, n^0'=n^post_2, [ i1^0==i1^post_2 && i2^0==i2^post_2 && i3^0==i3^post_2 && i4^0==i4^post_2 && n^0==n^post_2 ], cost: 1 2: l2 -> l0 : i1^0'=i1^post_3, i2^0'=i2^post_3, i3^0'=i3^post_3, i4^0'=i4^post_3, n^0'=n^post_3, [ n^0<=i3^0 && i4^post_3==i3^0 && i1^0==i1^post_3 && i2^0==i2^post_3 && i3^0==i3^post_3 && n^0==n^post_3 ], cost: 1 3: l2 -> l3 : i1^0'=i1^post_4, i2^0'=i2^post_4, i3^0'=i3^post_4, i4^0'=i4^post_4, n^0'=n^post_4, [ 1+i3^0<=n^0 && i3^post_4==1+i3^0 && i1^0==i1^post_4 && i2^0==i2^post_4 && i4^0==i4^post_4 && n^0==n^post_4 ], cost: 1 4: l3 -> l2 : i1^0'=i1^post_5, i2^0'=i2^post_5, i3^0'=i3^post_5, i4^0'=i4^post_5, n^0'=n^post_5, [ i1^0==i1^post_5 && i2^0==i2^post_5 && i3^0==i3^post_5 && i4^0==i4^post_5 && n^0==n^post_5 ], cost: 1 5: l4 -> l2 : i1^0'=i1^post_6, i2^0'=i2^post_6, i3^0'=i3^post_6, i4^0'=i4^post_6, n^0'=n^post_6, [ i2^0<=0 && i3^post_6==i2^0 && i1^0==i1^post_6 && i2^0==i2^post_6 && i4^0==i4^post_6 && n^0==n^post_6 ], cost: 1 6: l4 -> l5 : i1^0'=i1^post_7, i2^0'=i2^post_7, i3^0'=i3^post_7, i4^0'=i4^post_7, n^0'=n^post_7, [ 1<=i2^0 && i2^post_7==-1+i2^0 && i1^0==i1^post_7 && i3^0==i3^post_7 && i4^0==i4^post_7 && n^0==n^post_7 ], cost: 1 7: l5 -> l4 : i1^0'=i1^post_8, i2^0'=i2^post_8, i3^0'=i3^post_8, i4^0'=i4^post_8, n^0'=n^post_8, [ i1^0==i1^post_8 && i2^0==i2^post_8 && i3^0==i3^post_8 && i4^0==i4^post_8 && n^0==n^post_8 ], cost: 1 8: l6 -> l4 : i1^0'=i1^post_9, i2^0'=i2^post_9, i3^0'=i3^post_9, i4^0'=i4^post_9, n^0'=n^post_9, [ n^0<=i1^0 && i2^post_9==i1^0 && i1^0==i1^post_9 && i3^0==i3^post_9 && i4^0==i4^post_9 && n^0==n^post_9 ], cost: 1 9: l6 -> l7 : i1^0'=i1^post_10, i2^0'=i2^post_10, i3^0'=i3^post_10, i4^0'=i4^post_10, n^0'=n^post_10, [ 1+i1^0<=n^0 && i1^post_10==1+i1^0 && i2^0==i2^post_10 && i3^0==i3^post_10 && i4^0==i4^post_10 && n^0==n^post_10 ], cost: 1 10: l7 -> l6 : i1^0'=i1^post_11, i2^0'=i2^post_11, i3^0'=i3^post_11, i4^0'=i4^post_11, n^0'=n^post_11, [ i1^0==i1^post_11 && i2^0==i2^post_11 && i3^0==i3^post_11 && i4^0==i4^post_11 && n^0==n^post_11 ], cost: 1 11: l8 -> l6 : i1^0'=i1^post_12, i2^0'=i2^post_12, i3^0'=i3^post_12, i4^0'=i4^post_12, n^0'=n^post_12, [ i1^0==i1^post_12 && i2^0==i2^post_12 && i3^0==i3^post_12 && i4^0==i4^post_12 && n^0==n^post_12 ], cost: 1 12: l9 -> l8 : i1^0'=i1^post_13, i2^0'=i2^post_13, i3^0'=i3^post_13, i4^0'=i4^post_13, n^0'=n^post_13, [ i1^0==i1^post_13 && i2^0==i2^post_13 && i3^0==i3^post_13 && i4^0==i4^post_13 && n^0==n^post_13 ], cost: 1 Checking for constant complexity: The following rule is satisfiable with cost >= 1, yielding constant complexity: 12: l9 -> l8 : i1^0'=i1^post_13, i2^0'=i2^post_13, i3^0'=i3^post_13, i4^0'=i4^post_13, n^0'=n^post_13, [ i1^0==i1^post_13 && i2^0==i2^post_13 && i3^0==i3^post_13 && i4^0==i4^post_13 && n^0==n^post_13 ], cost: 1 Simplified all rules, resulting in: Start location: l9 0: l0 -> l1 : i4^0'=-1+i4^0, [ 1<=i4^0 ], cost: 1 1: l1 -> l0 : [], cost: 1 2: l2 -> l0 : i4^0'=i3^0, [ n^0<=i3^0 ], cost: 1 3: l2 -> l3 : i3^0'=1+i3^0, [ 1+i3^0<=n^0 ], cost: 1 4: l3 -> l2 : [], cost: 1 5: l4 -> l2 : i3^0'=i2^0, [ i2^0<=0 ], cost: 1 6: l4 -> l5 : i2^0'=-1+i2^0, [ 1<=i2^0 ], cost: 1 7: l5 -> l4 : [], cost: 1 8: l6 -> l4 : i2^0'=i1^0, [ n^0<=i1^0 ], cost: 1 9: l6 -> l7 : i1^0'=1+i1^0, [ 1+i1^0<=n^0 ], cost: 1 10: l7 -> l6 : [], cost: 1 11: l8 -> l6 : [], cost: 1 12: l9 -> l8 : [], cost: 1 ### Simplification by acceleration and chaining ### Eliminated locations (on linear paths): Start location: l9 17: l0 -> l0 : i4^0'=-1+i4^0, [ 1<=i4^0 ], cost: 2 2: l2 -> l0 : i4^0'=i3^0, [ n^0<=i3^0 ], cost: 1 16: l2 -> l2 : i3^0'=1+i3^0, [ 1+i3^0<=n^0 ], cost: 2 5: l4 -> l2 : i3^0'=i2^0, [ i2^0<=0 ], cost: 1 15: l4 -> l4 : i2^0'=-1+i2^0, [ 1<=i2^0 ], cost: 2 8: l6 -> l4 : i2^0'=i1^0, [ n^0<=i1^0 ], cost: 1 14: l6 -> l6 : i1^0'=1+i1^0, [ 1+i1^0<=n^0 ], cost: 2 13: l9 -> l6 : [], cost: 2 Accelerating simple loops of location 0. Accelerating the following rules: 17: l0 -> l0 : i4^0'=-1+i4^0, [ 1<=i4^0 ], cost: 2 Accelerated rule 17 with metering function i4^0, yielding the new rule 18. Removing the simple loops: 17. Accelerating simple loops of location 2. Accelerating the following rules: 16: l2 -> l2 : i3^0'=1+i3^0, [ 1+i3^0<=n^0 ], cost: 2 Accelerated rule 16 with metering function -i3^0+n^0, yielding the new rule 19. Removing the simple loops: 16. Accelerating simple loops of location 4. Accelerating the following rules: 15: l4 -> l4 : i2^0'=-1+i2^0, [ 1<=i2^0 ], cost: 2 Accelerated rule 15 with metering function i2^0, yielding the new rule 20. Removing the simple loops: 15. Accelerating simple loops of location 6. Accelerating the following rules: 14: l6 -> l6 : i1^0'=1+i1^0, [ 1+i1^0<=n^0 ], cost: 2 Accelerated rule 14 with metering function -i1^0+n^0, yielding the new rule 21. Removing the simple loops: 14. Accelerated all simple loops using metering functions (where possible): Start location: l9 18: l0 -> l0 : i4^0'=0, [ 1<=i4^0 ], cost: 2*i4^0 2: l2 -> l0 : i4^0'=i3^0, [ n^0<=i3^0 ], cost: 1 19: l2 -> l2 : i3^0'=n^0, [ 1+i3^0<=n^0 ], cost: -2*i3^0+2*n^0 5: l4 -> l2 : i3^0'=i2^0, [ i2^0<=0 ], cost: 1 20: l4 -> l4 : i2^0'=0, [ 1<=i2^0 ], cost: 2*i2^0 8: l6 -> l4 : i2^0'=i1^0, [ n^0<=i1^0 ], cost: 1 21: l6 -> l6 : i1^0'=n^0, [ 1+i1^0<=n^0 ], cost: -2*i1^0+2*n^0 13: l9 -> l6 : [], cost: 2 Chained accelerated rules (with incoming rules): Start location: l9 2: l2 -> l0 : i4^0'=i3^0, [ n^0<=i3^0 ], cost: 1 22: l2 -> l0 : i4^0'=0, [ n^0<=i3^0 && 1<=i3^0 ], cost: 1+2*i3^0 5: l4 -> l2 : i3^0'=i2^0, [ i2^0<=0 ], cost: 1 23: l4 -> l2 : i3^0'=n^0, [ i2^0<=0 && 1+i2^0<=n^0 ], cost: 1+2*n^0-2*i2^0 8: l6 -> l4 : i2^0'=i1^0, [ n^0<=i1^0 ], cost: 1 24: l6 -> l4 : i2^0'=0, [ n^0<=i1^0 && 1<=i1^0 ], cost: 1+2*i1^0 13: l9 -> l6 : [], cost: 2 25: l9 -> l6 : i1^0'=n^0, [ 1+i1^0<=n^0 ], cost: 2-2*i1^0+2*n^0 Removed unreachable locations (and leaf rules with constant cost): Start location: l9 22: l2 -> l0 : i4^0'=0, [ n^0<=i3^0 && 1<=i3^0 ], cost: 1+2*i3^0 5: l4 -> l2 : i3^0'=i2^0, [ i2^0<=0 ], cost: 1 23: l4 -> l2 : i3^0'=n^0, [ i2^0<=0 && 1+i2^0<=n^0 ], cost: 1+2*n^0-2*i2^0 8: l6 -> l4 : i2^0'=i1^0, [ n^0<=i1^0 ], cost: 1 24: l6 -> l4 : i2^0'=0, [ n^0<=i1^0 && 1<=i1^0 ], cost: 1+2*i1^0 13: l9 -> l6 : [], cost: 2 25: l9 -> l6 : i1^0'=n^0, [ 1+i1^0<=n^0 ], cost: 2-2*i1^0+2*n^0 Eliminated locations (on tree-shaped paths): Start location: l9 30: l4 -> l0 : i3^0'=n^0, i4^0'=0, [ i2^0<=0 && 1+i2^0<=n^0 && 1<=n^0 ], cost: 2+4*n^0-2*i2^0 26: l9 -> l4 : i2^0'=i1^0, [ n^0<=i1^0 ], cost: 3 27: l9 -> l4 : i2^0'=0, [ n^0<=i1^0 && 1<=i1^0 ], cost: 3+2*i1^0 28: l9 -> l4 : i1^0'=n^0, i2^0'=n^0, [ 1+i1^0<=n^0 ], cost: 3-2*i1^0+2*n^0 29: l9 -> l4 : i1^0'=n^0, i2^0'=0, [ 1+i1^0<=n^0 && 1<=n^0 ], cost: 3-2*i1^0+4*n^0 Eliminated locations (on tree-shaped paths): Start location: l9 31: l9 -> l0 : i2^0'=0, i3^0'=n^0, i4^0'=0, [ n^0<=i1^0 && 1<=i1^0 && 1<=n^0 ], cost: 5+2*i1^0+4*n^0 32: l9 -> l0 : i1^0'=n^0, i2^0'=0, i3^0'=n^0, i4^0'=0, [ 1+i1^0<=n^0 && 1<=n^0 ], cost: 5-2*i1^0+8*n^0 33: l9 -> [14] : [ 1+i1^0<=n^0 ], cost: 3-2*i1^0+2*n^0 ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: l9 31: l9 -> l0 : i2^0'=0, i3^0'=n^0, i4^0'=0, [ n^0<=i1^0 && 1<=i1^0 && 1<=n^0 ], cost: 5+2*i1^0+4*n^0 32: l9 -> l0 : i1^0'=n^0, i2^0'=0, i3^0'=n^0, i4^0'=0, [ 1+i1^0<=n^0 && 1<=n^0 ], cost: 5-2*i1^0+8*n^0 33: l9 -> [14] : [ 1+i1^0<=n^0 ], cost: 3-2*i1^0+2*n^0 Computing asymptotic complexity for rule 31 Solved the limit problem by the following transformations: Created initial limit problem: 1+i1^0-n^0 (+/+!), 5+2*i1^0+4*n^0 (+), i1^0 (+/+!), n^0 (+/+!) [not solved] removing all constraints (solved by SMT) resulting limit problem: [solved] applying transformation rule (C) using substitution {i1^0==n,n^0==1} resulting limit problem: [solved] Solution: i1^0 / n n^0 / 1 Resulting cost 9+2*n has complexity: Poly(n^1) Found new complexity Poly(n^1). Obtained the following overall complexity (w.r.t. the length of the input n): Complexity: Poly(n^1) Cpx degree: 1 Solved cost: 9+2*n Rule cost: 5+2*i1^0+4*n^0 Rule guard: [ n^0<=i1^0 && 1<=i1^0 && 1<=n^0 ] WORST_CASE(Omega(n^1),?)