WORST_CASE(Omega(n^1),?) ### Pre-processing the ITS problem ### Initial linear ITS problem Start location: l3 0: l0 -> l1 : id^0'=id^post_1, m^0'=m^post_1, x^0'=x^post_1, [ x^0<=m^0 && x^post_1==1+x^0 && x^post_1<=1+m^0 && 0<=x^post_1 && id^0==id^post_1 && m^0==m^post_1 ], cost: 1 1: l0 -> l1 : id^0'=id^post_2, m^0'=m^post_2, x^0'=x^post_2, [ 1+m^0<=x^0 && 1<=x^0 && x^post_2==0 && x^post_2<=1+m^0 && 0<=x^post_2 && id^0==id^post_2 && m^0==m^post_2 ], cost: 1 2: l1 -> l0 : id^0'=id^post_3, m^0'=m^post_3, x^0'=x^post_3, [ 1+id^0<=x^0 && id^0==id^post_3 && m^0==m^post_3 && x^0==x^post_3 ], cost: 1 3: l1 -> l0 : id^0'=id^post_4, m^0'=m^post_4, x^0'=x^post_4, [ 1+x^0<=id^0 && id^0==id^post_4 && m^0==m^post_4 && x^0==x^post_4 ], cost: 1 4: l2 -> l1 : id^0'=id^post_5, m^0'=m^post_5, x^0'=x^post_5, [ id^0<=m^0 && 1<=id^0 && 1<=m^0 && x^post_5==1+id^0 && x^post_5<=1+m^0 && 0<=x^post_5 && id^0==id^post_5 && m^0==m^post_5 ], cost: 1 5: l3 -> l2 : id^0'=id^post_6, m^0'=m^post_6, x^0'=x^post_6, [ id^0==id^post_6 && m^0==m^post_6 && x^0==x^post_6 ], cost: 1 Checking for constant complexity: The following rule is satisfiable with cost >= 1, yielding constant complexity: 5: l3 -> l2 : id^0'=id^post_6, m^0'=m^post_6, x^0'=x^post_6, [ id^0==id^post_6 && m^0==m^post_6 && x^0==x^post_6 ], cost: 1 Simplified all rules, resulting in: Start location: l3 0: l0 -> l1 : x^0'=1+x^0, [ x^0<=m^0 && 0<=1+x^0 ], cost: 1 1: l0 -> l1 : x^0'=0, [ 1+m^0<=x^0 && 1<=x^0 && 0<=1+m^0 ], cost: 1 2: l1 -> l0 : [ 1+id^0<=x^0 ], cost: 1 3: l1 -> l0 : [ 1+x^0<=id^0 ], cost: 1 4: l2 -> l1 : x^0'=1+id^0, [ id^0<=m^0 && 1<=id^0 ], cost: 1 5: l3 -> l2 : [], cost: 1 ### Simplification by acceleration and chaining ### Eliminated locations (on linear paths): Start location: l3 0: l0 -> l1 : x^0'=1+x^0, [ x^0<=m^0 && 0<=1+x^0 ], cost: 1 1: l0 -> l1 : x^0'=0, [ 1+m^0<=x^0 && 1<=x^0 && 0<=1+m^0 ], cost: 1 2: l1 -> l0 : [ 1+id^0<=x^0 ], cost: 1 3: l1 -> l0 : [ 1+x^0<=id^0 ], cost: 1 6: l3 -> l1 : x^0'=1+id^0, [ id^0<=m^0 && 1<=id^0 ], cost: 2 Eliminated locations (on tree-shaped paths): Start location: l3 7: l1 -> l1 : x^0'=1+x^0, [ 1+id^0<=x^0 && x^0<=m^0 && 0<=1+x^0 ], cost: 2 8: l1 -> l1 : x^0'=0, [ 1+id^0<=x^0 && 1+m^0<=x^0 && 1<=x^0 && 0<=1+m^0 ], cost: 2 9: l1 -> l1 : x^0'=1+x^0, [ 1+x^0<=id^0 && x^0<=m^0 && 0<=1+x^0 ], cost: 2 10: l1 -> l1 : x^0'=0, [ 1+x^0<=id^0 && 1+m^0<=x^0 && 1<=x^0 && 0<=1+m^0 ], cost: 2 6: l3 -> l1 : x^0'=1+id^0, [ id^0<=m^0 && 1<=id^0 ], cost: 2 Accelerating simple loops of location 1. Accelerating the following rules: 7: l1 -> l1 : x^0'=1+x^0, [ 1+id^0<=x^0 && x^0<=m^0 && 0<=1+x^0 ], cost: 2 8: l1 -> l1 : x^0'=0, [ 1+id^0<=x^0 && 1+m^0<=x^0 && 1<=x^0 && 0<=1+m^0 ], cost: 2 9: l1 -> l1 : x^0'=1+x^0, [ 1+x^0<=id^0 && x^0<=m^0 && 0<=1+x^0 ], cost: 2 10: l1 -> l1 : x^0'=0, [ 1+x^0<=id^0 && 1+m^0<=x^0 && 1<=x^0 && 0<=1+m^0 ], cost: 2 Accelerated rule 7 with metering function 1-x^0+m^0, yielding the new rule 11. Found no metering function for rule 8. Found no metering function for rule 9. Found no metering function for rule 10. Nested simple loops 8 (outer loop) and 11 (inner loop) with NONTERM, resulting in the new rules: 12, 13. Removing the simple loops: 7 8. Accelerated all simple loops using metering functions (where possible): Start location: l3 9: l1 -> l1 : x^0'=1+x^0, [ 1+x^0<=id^0 && x^0<=m^0 && 0<=1+x^0 ], cost: 2 10: l1 -> l1 : x^0'=0, [ 1+x^0<=id^0 && 1+m^0<=x^0 && 1<=x^0 && 0<=1+m^0 ], cost: 2 11: l1 -> l1 : x^0'=1+m^0, [ 1+id^0<=x^0 && x^0<=m^0 && 0<=1+x^0 ], cost: 2-2*x^0+2*m^0 12: l1 -> [4] : [ 1+id^0<=x^0 && 1+m^0<=x^0 && 1<=x^0 && 1+id^0<=0 && 0<=m^0 && 4+2*m^0>=1 ], cost: NONTERM 13: l1 -> [4] : x^0'=1+m^0, [ 1+id^0<=x^0 && x^0<=m^0 && 0<=1+x^0 && 1+id^0<=1+m^0 && 1<=1+m^0 && 1+id^0<=0 && 4+2*m^0>=1 ], cost: NONTERM 6: l3 -> l1 : x^0'=1+id^0, [ id^0<=m^0 && 1<=id^0 ], cost: 2 Chained accelerated rules (with incoming rules): Start location: l3 6: l3 -> l1 : x^0'=1+id^0, [ id^0<=m^0 && 1<=id^0 ], cost: 2 14: l3 -> l1 : x^0'=1+m^0, [ 1<=id^0 && 1+id^0<=m^0 ], cost: 2-2*id^0+2*m^0 Removed unreachable locations (and leaf rules with constant cost): Start location: l3 14: l3 -> l1 : x^0'=1+m^0, [ 1<=id^0 && 1+id^0<=m^0 ], cost: 2-2*id^0+2*m^0 ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: l3 14: l3 -> l1 : x^0'=1+m^0, [ 1<=id^0 && 1+id^0<=m^0 ], cost: 2-2*id^0+2*m^0 Computing asymptotic complexity for rule 14 Solved the limit problem by the following transformations: Created initial limit problem: 2-2*id^0+2*m^0 (+), id^0 (+/+!), -id^0+m^0 (+/+!) [not solved] removing all constraints (solved by SMT) resulting limit problem: [solved] applying transformation rule (C) using substitution {id^0==1,m^0==n} resulting limit problem: [solved] Solution: id^0 / 1 m^0 / n Resulting cost 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: 2*n Rule cost: 2-2*id^0+2*m^0 Rule guard: [ 1<=id^0 && 1+id^0<=m^0 ] WORST_CASE(Omega(n^1),?)