WORST_CASE(Omega(1),?) ### Pre-processing the ITS problem ### Initial linear ITS problem Start location: l9 0: l0 -> l1 : a4^0'=a4^post_1, a^0'=a^post_1, answer^0'=answer^post_1, b5^0'=b5^post_1, b^0'=b^post_1, ret_complex6^0'=ret_complex6^post_1, [ 30<=a4^0 && ret_complex6^post_1==1 && answer^post_1==ret_complex6^post_1 && a^0==a^post_1 && a4^0==a4^post_1 && b^0==b^post_1 && b5^0==b5^post_1 ], cost: 1 1: l0 -> l2 : a4^0'=a4^post_2, a^0'=a^post_2, answer^0'=answer^post_2, b5^0'=b5^post_2, b^0'=b^post_2, ret_complex6^0'=ret_complex6^post_2, [ 1+a4^0<=30 && a^0==a^post_2 && a4^0==a4^post_2 && answer^0==answer^post_2 && b^0==b^post_2 && b5^0==b5^post_2 && ret_complex6^0==ret_complex6^post_2 ], cost: 1 3: l2 -> l4 : a4^0'=a4^post_4, a^0'=a^post_4, answer^0'=answer^post_4, b5^0'=b5^post_4, b^0'=b^post_4, ret_complex6^0'=ret_complex6^post_4, [ a^0==a^post_4 && a4^0==a4^post_4 && answer^0==answer^post_4 && b^0==b^post_4 && b5^0==b5^post_4 && ret_complex6^0==ret_complex6^post_4 ], cost: 1 2: l3 -> l0 : a4^0'=a4^post_3, a^0'=a^post_3, answer^0'=answer^post_3, b5^0'=b5^post_3, b^0'=b^post_3, ret_complex6^0'=ret_complex6^post_3, [ a^0==a^post_3 && a4^0==a4^post_3 && answer^0==answer^post_3 && b^0==b^post_3 && b5^0==b5^post_3 && ret_complex6^0==ret_complex6^post_3 ], cost: 1 10: l4 -> l3 : a4^0'=a4^post_11, a^0'=a^post_11, answer^0'=answer^post_11, b5^0'=b5^post_11, b^0'=b^post_11, ret_complex6^0'=ret_complex6^post_11, [ a4^0<=b5^0 && a4^post_11==2+a4^0 && b5^post_11==-10+b5^0 && a^0==a^post_11 && answer^0==answer^post_11 && b^0==b^post_11 && ret_complex6^0==ret_complex6^post_11 ], cost: 1 11: l4 -> l7 : a4^0'=a4^post_12, a^0'=a^post_12, answer^0'=answer^post_12, b5^0'=b5^post_12, b^0'=b^post_12, ret_complex6^0'=ret_complex6^post_12, [ 1+b5^0<=a4^0 && a^0==a^post_12 && a4^0==a4^post_12 && answer^0==answer^post_12 && b^0==b^post_12 && b5^0==b5^post_12 && ret_complex6^0==ret_complex6^post_12 ], cost: 1 4: l5 -> l2 : a4^0'=a4^post_5, a^0'=a^post_5, answer^0'=answer^post_5, b5^0'=b5^post_5, b^0'=b^post_5, ret_complex6^0'=ret_complex6^post_5, [ 13<=b5^0 && a4^post_5==1+a4^0 && a^0==a^post_5 && answer^0==answer^post_5 && b^0==b^post_5 && b5^0==b5^post_5 && ret_complex6^0==ret_complex6^post_5 ], cost: 1 5: l5 -> l2 : a4^0'=a4^post_6, a^0'=a^post_6, answer^0'=answer^post_6, b5^0'=b5^post_6, b^0'=b^post_6, ret_complex6^0'=ret_complex6^post_6, [ b5^0<=12 && a4^post_6==10+a4^0 && a^0==a^post_6 && answer^0==answer^post_6 && b^0==b^post_6 && b5^0==b5^post_6 && ret_complex6^0==ret_complex6^post_6 ], cost: 1 6: l6 -> l2 : a4^0'=a4^post_7, a^0'=a^post_7, answer^0'=answer^post_7, b5^0'=b5^post_7, b^0'=b^post_7, ret_complex6^0'=ret_complex6^post_7, [ 1+b5^0<=10 && a4^post_7==1+a4^0 && a^0==a^post_7 && answer^0==answer^post_7 && b^0==b^post_7 && b5^0==b5^post_7 && ret_complex6^0==ret_complex6^post_7 ], cost: 1 7: l6 -> l5 : a4^0'=a4^post_8, a^0'=a^post_8, answer^0'=answer^post_8, b5^0'=b5^post_8, b^0'=b^post_8, ret_complex6^0'=ret_complex6^post_8, [ 10<=b5^0 && a^0==a^post_8 && a4^0==a4^post_8 && answer^0==answer^post_8 && b^0==b^post_8 && b5^0==b5^post_8 && ret_complex6^0==ret_complex6^post_8 ], cost: 1 8: l7 -> l6 : a4^0'=a4^post_9, a^0'=a^post_9, answer^0'=answer^post_9, b5^0'=b5^post_9, b^0'=b^post_9, ret_complex6^0'=ret_complex6^post_9, [ b5^0<=5 && b5^post_9==2+b5^0 && a^0==a^post_9 && a4^0==a4^post_9 && answer^0==answer^post_9 && b^0==b^post_9 && ret_complex6^0==ret_complex6^post_9 ], cost: 1 9: l7 -> l6 : a4^0'=a4^post_10, a^0'=a^post_10, answer^0'=answer^post_10, b5^0'=b5^post_10, b^0'=b^post_10, ret_complex6^0'=ret_complex6^post_10, [ 6<=b5^0 && b5^post_10==b5^post_10 && a^0==a^post_10 && a4^0==a4^post_10 && answer^0==answer^post_10 && b^0==b^post_10 && ret_complex6^0==ret_complex6^post_10 ], cost: 1 12: l8 -> l3 : a4^0'=a4^post_13, a^0'=a^post_13, answer^0'=answer^post_13, b5^0'=b5^post_13, b^0'=b^post_13, ret_complex6^0'=ret_complex6^post_13, [ a^post_13==1 && b^post_13==1 && answer^post_13==0 && a4^post_13==a^post_13 && b5^post_13==b^post_13 && ret_complex6^0==ret_complex6^post_13 ], cost: 1 13: l9 -> l8 : a4^0'=a4^post_14, a^0'=a^post_14, answer^0'=answer^post_14, b5^0'=b5^post_14, b^0'=b^post_14, ret_complex6^0'=ret_complex6^post_14, [ a^0==a^post_14 && a4^0==a4^post_14 && answer^0==answer^post_14 && b^0==b^post_14 && b5^0==b5^post_14 && ret_complex6^0==ret_complex6^post_14 ], cost: 1 Checking for constant complexity: The following rule is satisfiable with cost >= 1, yielding constant complexity: 13: l9 -> l8 : a4^0'=a4^post_14, a^0'=a^post_14, answer^0'=answer^post_14, b5^0'=b5^post_14, b^0'=b^post_14, ret_complex6^0'=ret_complex6^post_14, [ a^0==a^post_14 && a4^0==a4^post_14 && answer^0==answer^post_14 && b^0==b^post_14 && b5^0==b5^post_14 && ret_complex6^0==ret_complex6^post_14 ], cost: 1 Removed unreachable and leaf rules: Start location: l9 1: l0 -> l2 : a4^0'=a4^post_2, a^0'=a^post_2, answer^0'=answer^post_2, b5^0'=b5^post_2, b^0'=b^post_2, ret_complex6^0'=ret_complex6^post_2, [ 1+a4^0<=30 && a^0==a^post_2 && a4^0==a4^post_2 && answer^0==answer^post_2 && b^0==b^post_2 && b5^0==b5^post_2 && ret_complex6^0==ret_complex6^post_2 ], cost: 1 3: l2 -> l4 : a4^0'=a4^post_4, a^0'=a^post_4, answer^0'=answer^post_4, b5^0'=b5^post_4, b^0'=b^post_4, ret_complex6^0'=ret_complex6^post_4, [ a^0==a^post_4 && a4^0==a4^post_4 && answer^0==answer^post_4 && b^0==b^post_4 && b5^0==b5^post_4 && ret_complex6^0==ret_complex6^post_4 ], cost: 1 2: l3 -> l0 : a4^0'=a4^post_3, a^0'=a^post_3, answer^0'=answer^post_3, b5^0'=b5^post_3, b^0'=b^post_3, ret_complex6^0'=ret_complex6^post_3, [ a^0==a^post_3 && a4^0==a4^post_3 && answer^0==answer^post_3 && b^0==b^post_3 && b5^0==b5^post_3 && ret_complex6^0==ret_complex6^post_3 ], cost: 1 10: l4 -> l3 : a4^0'=a4^post_11, a^0'=a^post_11, answer^0'=answer^post_11, b5^0'=b5^post_11, b^0'=b^post_11, ret_complex6^0'=ret_complex6^post_11, [ a4^0<=b5^0 && a4^post_11==2+a4^0 && b5^post_11==-10+b5^0 && a^0==a^post_11 && answer^0==answer^post_11 && b^0==b^post_11 && ret_complex6^0==ret_complex6^post_11 ], cost: 1 11: l4 -> l7 : a4^0'=a4^post_12, a^0'=a^post_12, answer^0'=answer^post_12, b5^0'=b5^post_12, b^0'=b^post_12, ret_complex6^0'=ret_complex6^post_12, [ 1+b5^0<=a4^0 && a^0==a^post_12 && a4^0==a4^post_12 && answer^0==answer^post_12 && b^0==b^post_12 && b5^0==b5^post_12 && ret_complex6^0==ret_complex6^post_12 ], cost: 1 4: l5 -> l2 : a4^0'=a4^post_5, a^0'=a^post_5, answer^0'=answer^post_5, b5^0'=b5^post_5, b^0'=b^post_5, ret_complex6^0'=ret_complex6^post_5, [ 13<=b5^0 && a4^post_5==1+a4^0 && a^0==a^post_5 && answer^0==answer^post_5 && b^0==b^post_5 && b5^0==b5^post_5 && ret_complex6^0==ret_complex6^post_5 ], cost: 1 5: l5 -> l2 : a4^0'=a4^post_6, a^0'=a^post_6, answer^0'=answer^post_6, b5^0'=b5^post_6, b^0'=b^post_6, ret_complex6^0'=ret_complex6^post_6, [ b5^0<=12 && a4^post_6==10+a4^0 && a^0==a^post_6 && answer^0==answer^post_6 && b^0==b^post_6 && b5^0==b5^post_6 && ret_complex6^0==ret_complex6^post_6 ], cost: 1 6: l6 -> l2 : a4^0'=a4^post_7, a^0'=a^post_7, answer^0'=answer^post_7, b5^0'=b5^post_7, b^0'=b^post_7, ret_complex6^0'=ret_complex6^post_7, [ 1+b5^0<=10 && a4^post_7==1+a4^0 && a^0==a^post_7 && answer^0==answer^post_7 && b^0==b^post_7 && b5^0==b5^post_7 && ret_complex6^0==ret_complex6^post_7 ], cost: 1 7: l6 -> l5 : a4^0'=a4^post_8, a^0'=a^post_8, answer^0'=answer^post_8, b5^0'=b5^post_8, b^0'=b^post_8, ret_complex6^0'=ret_complex6^post_8, [ 10<=b5^0 && a^0==a^post_8 && a4^0==a4^post_8 && answer^0==answer^post_8 && b^0==b^post_8 && b5^0==b5^post_8 && ret_complex6^0==ret_complex6^post_8 ], cost: 1 8: l7 -> l6 : a4^0'=a4^post_9, a^0'=a^post_9, answer^0'=answer^post_9, b5^0'=b5^post_9, b^0'=b^post_9, ret_complex6^0'=ret_complex6^post_9, [ b5^0<=5 && b5^post_9==2+b5^0 && a^0==a^post_9 && a4^0==a4^post_9 && answer^0==answer^post_9 && b^0==b^post_9 && ret_complex6^0==ret_complex6^post_9 ], cost: 1 9: l7 -> l6 : a4^0'=a4^post_10, a^0'=a^post_10, answer^0'=answer^post_10, b5^0'=b5^post_10, b^0'=b^post_10, ret_complex6^0'=ret_complex6^post_10, [ 6<=b5^0 && b5^post_10==b5^post_10 && a^0==a^post_10 && a4^0==a4^post_10 && answer^0==answer^post_10 && b^0==b^post_10 && ret_complex6^0==ret_complex6^post_10 ], cost: 1 12: l8 -> l3 : a4^0'=a4^post_13, a^0'=a^post_13, answer^0'=answer^post_13, b5^0'=b5^post_13, b^0'=b^post_13, ret_complex6^0'=ret_complex6^post_13, [ a^post_13==1 && b^post_13==1 && answer^post_13==0 && a4^post_13==a^post_13 && b5^post_13==b^post_13 && ret_complex6^0==ret_complex6^post_13 ], cost: 1 13: l9 -> l8 : a4^0'=a4^post_14, a^0'=a^post_14, answer^0'=answer^post_14, b5^0'=b5^post_14, b^0'=b^post_14, ret_complex6^0'=ret_complex6^post_14, [ a^0==a^post_14 && a4^0==a4^post_14 && answer^0==answer^post_14 && b^0==b^post_14 && b5^0==b5^post_14 && ret_complex6^0==ret_complex6^post_14 ], cost: 1 Simplified all rules, resulting in: Start location: l9 1: l0 -> l2 : [ 1+a4^0<=30 ], cost: 1 3: l2 -> l4 : [], cost: 1 2: l3 -> l0 : [], cost: 1 10: l4 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ a4^0<=b5^0 ], cost: 1 11: l4 -> l7 : [ 1+b5^0<=a4^0 ], cost: 1 4: l5 -> l2 : a4^0'=1+a4^0, [ 13<=b5^0 ], cost: 1 5: l5 -> l2 : a4^0'=10+a4^0, [ b5^0<=12 ], cost: 1 6: l6 -> l2 : a4^0'=1+a4^0, [ 1+b5^0<=10 ], cost: 1 7: l6 -> l5 : [ 10<=b5^0 ], cost: 1 8: l7 -> l6 : b5^0'=2+b5^0, [ b5^0<=5 ], cost: 1 9: l7 -> l6 : b5^0'=b5^post_10, [ 6<=b5^0 ], cost: 1 12: l8 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 1 13: l9 -> l8 : [], cost: 1 ### Simplification by acceleration and chaining ### Eliminated locations (on linear paths): Start location: l9 3: l2 -> l4 : [], cost: 1 15: l3 -> l2 : [ 1+a4^0<=30 ], cost: 2 10: l4 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ a4^0<=b5^0 ], cost: 1 11: l4 -> l7 : [ 1+b5^0<=a4^0 ], cost: 1 4: l5 -> l2 : a4^0'=1+a4^0, [ 13<=b5^0 ], cost: 1 5: l5 -> l2 : a4^0'=10+a4^0, [ b5^0<=12 ], cost: 1 6: l6 -> l2 : a4^0'=1+a4^0, [ 1+b5^0<=10 ], cost: 1 7: l6 -> l5 : [ 10<=b5^0 ], cost: 1 8: l7 -> l6 : b5^0'=2+b5^0, [ b5^0<=5 ], cost: 1 9: l7 -> l6 : b5^0'=b5^post_10, [ 6<=b5^0 ], cost: 1 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 Eliminated locations (on tree-shaped paths): Start location: l9 16: l2 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ a4^0<=b5^0 ], cost: 2 17: l2 -> l7 : [ 1+b5^0<=a4^0 ], cost: 2 15: l3 -> l2 : [ 1+a4^0<=30 ], cost: 2 4: l5 -> l2 : a4^0'=1+a4^0, [ 13<=b5^0 ], cost: 1 5: l5 -> l2 : a4^0'=10+a4^0, [ b5^0<=12 ], cost: 1 18: l7 -> l2 : a4^0'=1+a4^0, b5^0'=2+b5^0, [ b5^0<=5 ], cost: 2 19: l7 -> l2 : a4^0'=1+a4^0, b5^0'=b5^post_10, [ 6<=b5^0 && 1+b5^post_10<=10 ], cost: 2 20: l7 -> l5 : b5^0'=b5^post_10, [ 6<=b5^0 && 10<=b5^post_10 ], cost: 2 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 Eliminated locations (on tree-shaped paths): Start location: l9 16: l2 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ a4^0<=b5^0 ], cost: 2 21: l2 -> l2 : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+b5^0<=a4^0 && b5^0<=5 ], cost: 4 22: l2 -> l2 : a4^0'=1+a4^0, b5^0'=b5^post_10, [ 1+b5^0<=a4^0 && 6<=b5^0 && 1+b5^post_10<=10 ], cost: 4 23: l2 -> l5 : b5^0'=b5^post_10, [ 1+b5^0<=a4^0 && 6<=b5^0 && 10<=b5^post_10 ], cost: 4 15: l3 -> l2 : [ 1+a4^0<=30 ], cost: 2 4: l5 -> l2 : a4^0'=1+a4^0, [ 13<=b5^0 ], cost: 1 5: l5 -> l2 : a4^0'=10+a4^0, [ b5^0<=12 ], cost: 1 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 Accelerating simple loops of location 2. Accelerating the following rules: 21: l2 -> l2 : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+b5^0<=a4^0 && b5^0<=5 ], cost: 4 22: l2 -> l2 : a4^0'=1+a4^0, b5^0'=b5^post_10, [ 1+b5^0<=a4^0 && 6<=b5^0 && 1+b5^post_10<=10 ], cost: 4 Found no metering function for rule 21. During metering: Instantiating temporary variables by {b5^post_10==9} Accelerated rule 22 with metering function meter (where 2*meter==-b5^0+a4^0), yielding the new rule 24. During metering: Instantiating temporary variables by {meter==1} Removing the simple loops: 22. Accelerated all simple loops using metering functions (where possible): Start location: l9 16: l2 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ a4^0<=b5^0 ], cost: 2 21: l2 -> l2 : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+b5^0<=a4^0 && b5^0<=5 ], cost: 4 23: l2 -> l5 : b5^0'=b5^post_10, [ 1+b5^0<=a4^0 && 6<=b5^0 && 10<=b5^post_10 ], cost: 4 24: l2 -> l2 : a4^0'=a4^0+meter, b5^0'=9, [ 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 ], cost: 4*meter 15: l3 -> l2 : [ 1+a4^0<=30 ], cost: 2 4: l5 -> l2 : a4^0'=1+a4^0, [ 13<=b5^0 ], cost: 1 5: l5 -> l2 : a4^0'=10+a4^0, [ b5^0<=12 ], cost: 1 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 Chained accelerated rules (with incoming rules): Start location: l9 16: l2 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ a4^0<=b5^0 ], cost: 2 23: l2 -> l5 : b5^0'=b5^post_10, [ 1+b5^0<=a4^0 && 6<=b5^0 && 10<=b5^post_10 ], cost: 4 15: l3 -> l2 : [ 1+a4^0<=30 ], cost: 2 26: l3 -> l2 : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && b5^0<=5 ], cost: 6 29: l3 -> l2 : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 ], cost: 2+4*meter 4: l5 -> l2 : a4^0'=1+a4^0, [ 13<=b5^0 ], cost: 1 5: l5 -> l2 : a4^0'=10+a4^0, [ b5^0<=12 ], cost: 1 25: l5 -> l2 : a4^0'=11+a4^0, b5^0'=2+b5^0, [ 1+b5^0<=10+a4^0 && b5^0<=5 ], cost: 5 27: l5 -> l2 : a4^0'=1+a4^0+meter, b5^0'=9, [ 13<=b5^0 && 1+b5^0<=1+a4^0 && 2*meter==1-b5^0+a4^0 && meter>=1 ], cost: 1+4*meter 28: l5 -> l2 : a4^0'=10+a4^0+meter, b5^0'=9, [ b5^0<=12 && 1+b5^0<=10+a4^0 && 6<=b5^0 && 2*meter==10-b5^0+a4^0 && meter>=1 ], cost: 1+4*meter 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 Eliminated locations (on tree-shaped paths): Start location: l9 16: l2 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ a4^0<=b5^0 ], cost: 2 30: l2 -> l2 : a4^0'=1+a4^0, b5^0'=b5^post_10, [ 1+b5^0<=a4^0 && 6<=b5^0 && 13<=b5^post_10 ], cost: 5 31: l2 -> l2 : a4^0'=10+a4^0, b5^0'=b5^post_10, [ 1+b5^0<=a4^0 && 6<=b5^0 && 10<=b5^post_10 && b5^post_10<=12 ], cost: 5 32: l2 -> l2 : a4^0'=1+a4^0+meter, b5^0'=9, [ 1+b5^0<=a4^0 && 6<=b5^0 && 13<=b5^post_10 && 1+b5^post_10<=1+a4^0 && 2*meter==1+a4^0-b5^post_10 && meter>=1 ], cost: 5+4*meter 33: l2 -> l2 : a4^0'=10+a4^0+meter, b5^0'=9, [ 1+b5^0<=a4^0 && 6<=b5^0 && 10<=b5^post_10 && b5^post_10<=12 && 1+b5^post_10<=10+a4^0 && 2*meter==10+a4^0-b5^post_10 && meter>=1 ], cost: 5+4*meter 15: l3 -> l2 : [ 1+a4^0<=30 ], cost: 2 26: l3 -> l2 : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && b5^0<=5 ], cost: 6 29: l3 -> l2 : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 ], cost: 2+4*meter 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 Accelerating simple loops of location 2. Simplified some of the simple loops (and removed duplicate rules). Accelerating the following rules: 30: l2 -> l2 : a4^0'=1+a4^0, b5^0'=b5^post_10, [ 1+b5^0<=a4^0 && 6<=b5^0 && 13<=b5^post_10 ], cost: 5 31: l2 -> l2 : a4^0'=10+a4^0, b5^0'=b5^post_10, [ 1+b5^0<=a4^0 && 6<=b5^0 && 10<=b5^post_10 && b5^post_10<=12 ], cost: 5 32: l2 -> l2 : a4^0'=1+a4^0+meter, b5^0'=9, [ 1+b5^0<=a4^0 && 6<=b5^0 && 13<=1+a4^0-2*meter && 2+a4^0-2*meter<=1+a4^0 && meter>=1 ], cost: 5+4*meter 33: l2 -> l2 : a4^0'=10+a4^0+meter, b5^0'=9, [ 1+b5^0<=a4^0 && 6<=b5^0 && 10<=10+a4^0-2*meter && 10+a4^0-2*meter<=12 && 11+a4^0-2*meter<=10+a4^0 && meter>=1 ], cost: 5+4*meter During metering: Instantiating temporary variables by {b5^post_10==13} Accelerated rule 30 with metering function meter_2 (where 6*meter_2==-b5^0+a4^0), yielding the new rule 34. Accelerated rule 31 with NONTERM, yielding the new rule 35. Accelerated rule 32 with NONTERM, yielding the new rule 36. During metering: Instantiating temporary variables by {meter==1} Accelerated rule 33 with NONTERM, yielding the new rule 37. Removing the simple loops: 30 31 32 33. Accelerated all simple loops using metering functions (where possible): Start location: l9 16: l2 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ a4^0<=b5^0 ], cost: 2 34: l2 -> l2 : a4^0'=meter_2+a4^0, b5^0'=13, [ 1+b5^0<=a4^0 && 6<=b5^0 && 6*meter_2==-b5^0+a4^0 && meter_2>=1 ], cost: 5*meter_2 35: l2 -> [11] : [ 1+b5^0<=a4^0 && 6<=b5^0 && 10<=b5^post_10 && b5^post_10<=12 ], cost: NONTERM 36: l2 -> [11] : [ 1+b5^0<=a4^0 && 6<=b5^0 && 13<=1+a4^0-2*meter && 2+a4^0-2*meter<=1+a4^0 && meter>=1 && 5+4*meter>=1 ], cost: NONTERM 37: l2 -> [11] : [ 1+b5^0<=a4^0 && 6<=b5^0 && 10<=8+a4^0 && 8+a4^0<=12 ], cost: NONTERM 15: l3 -> l2 : [ 1+a4^0<=30 ], cost: 2 26: l3 -> l2 : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && b5^0<=5 ], cost: 6 29: l3 -> l2 : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 ], cost: 2+4*meter 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 Chained accelerated rules (with incoming rules): Start location: l9 16: l2 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ a4^0<=b5^0 ], cost: 2 15: l3 -> l2 : [ 1+a4^0<=30 ], cost: 2 26: l3 -> l2 : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && b5^0<=5 ], cost: 6 29: l3 -> l2 : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 ], cost: 2+4*meter 38: l3 -> l2 : a4^0'=meter_2+a4^0, b5^0'=13, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 6*meter_2==-b5^0+a4^0 && meter_2>=1 ], cost: 2+5*meter_2 39: l3 -> l2 : a4^0'=1+meter_2+a4^0, b5^0'=13, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 && 6*meter_2==-1-b5^0+a4^0 && meter_2>=1 ], cost: 6+5*meter_2 40: l3 -> l2 : a4^0'=9+7*meter_2, b5^0'=13, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 18+12*meter_2-2*a4^0==-b5^0+a4^0 && 9+6*meter_2-a4^0>=1 && 10<=9+6*meter_2 && meter_2>=1 ], cost: 38+29*meter_2-4*a4^0 41: l3 -> [11] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 ], cost: NONTERM 42: l3 -> [11] : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 ], cost: NONTERM 43: l3 -> [11] : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && 10<=a4^0+meter ], cost: NONTERM 44: l3 -> [11] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 13<=1+a4^0-2*meter && 2+a4^0-2*meter<=1+a4^0 && meter>=1 && 5+4*meter>=1 ], cost: NONTERM 45: l3 -> [11] : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 && 13<=2+a4^0-2*meter && 3+a4^0-2*meter<=2+a4^0 && meter>=1 && 5+4*meter>=1 ], cost: NONTERM 46: l3 -> [11] : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && 10<=a4^0+meter && 13<=1+a4^0-meter && 2+a4^0-meter<=1+a4^0+meter && 5+4*meter>=1 ], cost: NONTERM 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 Eliminated locations (on tree-shaped paths): Start location: l9 41: l3 -> [11] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 ], cost: NONTERM 42: l3 -> [11] : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 ], cost: NONTERM 43: l3 -> [11] : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && 10<=a4^0+meter ], cost: NONTERM 44: l3 -> [11] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 13<=1+a4^0-2*meter && 2+a4^0-2*meter<=1+a4^0 && meter>=1 && 5+4*meter>=1 ], cost: NONTERM 45: l3 -> [11] : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 && 13<=2+a4^0-2*meter && 3+a4^0-2*meter<=2+a4^0 && meter>=1 && 5+4*meter>=1 ], cost: NONTERM 46: l3 -> [11] : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && 10<=a4^0+meter && 13<=1+a4^0-meter && 2+a4^0-meter<=1+a4^0+meter && 5+4*meter>=1 ], cost: NONTERM 47: l3 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ 1+a4^0<=30 && a4^0<=b5^0 ], cost: 4 48: l3 -> l3 : a4^0'=3+a4^0, b5^0'=-8+b5^0, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && b5^0<=5 && 1+a4^0<=2+b5^0 ], cost: 8 49: l3 -> l3 : a4^0'=2+a4^0+meter, b5^0'=-1, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && a4^0+meter<=9 ], cost: 4+4*meter 50: l3 -> l3 : a4^0'=2+meter_2+a4^0, b5^0'=3, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 6*meter_2==-b5^0+a4^0 && meter_2>=1 && meter_2+a4^0<=13 ], cost: 4+5*meter_2 51: l3 -> l3 : a4^0'=3+meter_2+a4^0, b5^0'=3, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 && 6*meter_2==-1-b5^0+a4^0 && meter_2>=1 && 1+meter_2+a4^0<=13 ], cost: 8+5*meter_2 52: l3 -> [12] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 18+12*meter_2-2*a4^0==-b5^0+a4^0 && 9+6*meter_2-a4^0>=1 && 10<=9+6*meter_2 && meter_2>=1 ], cost: 38+29*meter_2-4*a4^0 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 Applied pruning (of leafs and parallel rules): Start location: l9 41: l3 -> [11] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 ], cost: NONTERM 42: l3 -> [11] : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 ], cost: NONTERM 43: l3 -> [11] : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && 10<=a4^0+meter ], cost: NONTERM 44: l3 -> [11] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 13<=1+a4^0-2*meter && 2+a4^0-2*meter<=1+a4^0 && meter>=1 && 5+4*meter>=1 ], cost: NONTERM 46: l3 -> [11] : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && 10<=a4^0+meter && 13<=1+a4^0-meter && 2+a4^0-meter<=1+a4^0+meter && 5+4*meter>=1 ], cost: NONTERM 47: l3 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ 1+a4^0<=30 && a4^0<=b5^0 ], cost: 4 48: l3 -> l3 : a4^0'=3+a4^0, b5^0'=-8+b5^0, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && b5^0<=5 && 1+a4^0<=2+b5^0 ], cost: 8 49: l3 -> l3 : a4^0'=2+a4^0+meter, b5^0'=-1, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && a4^0+meter<=9 ], cost: 4+4*meter 50: l3 -> l3 : a4^0'=2+meter_2+a4^0, b5^0'=3, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 6*meter_2==-b5^0+a4^0 && meter_2>=1 && meter_2+a4^0<=13 ], cost: 4+5*meter_2 51: l3 -> l3 : a4^0'=3+meter_2+a4^0, b5^0'=3, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 && 6*meter_2==-1-b5^0+a4^0 && meter_2>=1 && 1+meter_2+a4^0<=13 ], cost: 8+5*meter_2 52: l3 -> [12] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 18+12*meter_2-2*a4^0==-b5^0+a4^0 && 9+6*meter_2-a4^0>=1 && 10<=9+6*meter_2 && meter_2>=1 ], cost: 38+29*meter_2-4*a4^0 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 Accelerating simple loops of location 3. Simplified some of the simple loops (and removed duplicate rules). Accelerating the following rules: 47: l3 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ 1+a4^0<=30 && a4^0<=b5^0 ], cost: 4 48: l3 -> l3 : a4^0'=3+a4^0, b5^0'=-8+b5^0, [ 1+a4^0<=30 && 1+b5^0-a4^0==0 && b5^0<=5 ], cost: 8 49: l3 -> l3 : a4^0'=2+a4^0+meter, b5^0'=-1, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && a4^0+meter<=9 ], cost: 4+4*meter 50: l3 -> l3 : a4^0'=2+meter_2+a4^0, b5^0'=3, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 6*meter_2==-b5^0+a4^0 && meter_2>=1 && meter_2+a4^0<=13 ], cost: 4+5*meter_2 51: l3 -> l3 : a4^0'=3+meter_2+a4^0, b5^0'=3, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 && 6*meter_2==-1-b5^0+a4^0 && meter_2>=1 && 1+meter_2+a4^0<=13 ], cost: 8+5*meter_2 Accelerated rule 47 with metering function meter_3 (where 12*meter_3==b5^0-a4^0) (after adding a4^0>=b5^0), yielding the new rule 53. Accelerated rule 48 with metering function meter_4 (where 11*meter_4==2+b5^0-a4^0), yielding the new rule 54. Accelerated rule 49 with metering function meter_5 (where 31*meter_5==3+b5^0-a4^0-meter), yielding the new rule 55. Accelerated rule 50 with metering function meter_6 (where 163*meter_6==42-6*meter_2+6*b5^0-6*a4^0), yielding the new rule 56. Accelerated rule 51 with metering function meter_7 (where 53*meter_7==48-6*meter_2+6*b5^0-6*a4^0), yielding the new rule 57. Removing the simple loops: 48 49 50 51. Accelerated all simple loops using metering functions (where possible): Start location: l9 41: l3 -> [11] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 ], cost: NONTERM 42: l3 -> [11] : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 ], cost: NONTERM 43: l3 -> [11] : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && 10<=a4^0+meter ], cost: NONTERM 44: l3 -> [11] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 13<=1+a4^0-2*meter && 2+a4^0-2*meter<=1+a4^0 && meter>=1 && 5+4*meter>=1 ], cost: NONTERM 46: l3 -> [11] : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && 10<=a4^0+meter && 13<=1+a4^0-meter && 2+a4^0-meter<=1+a4^0+meter && 5+4*meter>=1 ], cost: NONTERM 47: l3 -> l3 : a4^0'=2+a4^0, b5^0'=-10+b5^0, [ 1+a4^0<=30 && a4^0<=b5^0 ], cost: 4 52: l3 -> [12] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 18+12*meter_2-2*a4^0==-b5^0+a4^0 && 9+6*meter_2-a4^0>=1 && 10<=9+6*meter_2 && meter_2>=1 ], cost: 38+29*meter_2-4*a4^0 53: l3 -> l3 : a4^0'=a4^0+2*meter_3, b5^0'=b5^0-10*meter_3, [ 1+a4^0<=30 && a4^0<=b5^0 && a4^0>=b5^0 && 12*meter_3==b5^0-a4^0 && meter_3>=1 ], cost: 4*meter_3 54: l3 -> l3 : a4^0'=a4^0+3*meter_4, b5^0'=b5^0-8*meter_4, [ 1+a4^0<=30 && 1+b5^0-a4^0==0 && b5^0<=5 && 11*meter_4==2+b5^0-a4^0 && meter_4>=1 ], cost: 8*meter_4 55: l3 -> l3 : a4^0'=2*meter_5+meter_5*meter+a4^0, b5^0'=-1, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && a4^0+meter<=9 && 31*meter_5==3+b5^0-a4^0-meter && meter_5>=1 ], cost: 4*meter_5+4*meter_5*meter 56: l3 -> l3 : a4^0'=a4^0+2*meter_6+meter_2*meter_6, b5^0'=3, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 6*meter_2==-b5^0+a4^0 && meter_2>=1 && meter_2+a4^0<=13 && 163*meter_6==42-6*meter_2+6*b5^0-6*a4^0 && meter_6>=1 ], cost: 4*meter_6+5*meter_2*meter_6 57: l3 -> l3 : a4^0'=meter_7*meter_2+3*meter_7+a4^0, b5^0'=3, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 && 6*meter_2==-1-b5^0+a4^0 && meter_2>=1 && 1+meter_2+a4^0<=13 && 53*meter_7==48-6*meter_2+6*b5^0-6*a4^0 && meter_7>=1 ], cost: 5*meter_7*meter_2+8*meter_7 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 Chained accelerated rules (with incoming rules): Start location: l9 41: l3 -> [11] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 ], cost: NONTERM 42: l3 -> [11] : a4^0'=1+a4^0, b5^0'=2+b5^0, [ 1+a4^0<=30 && b5^0<=5 && 3+b5^0<=1+a4^0 && 6<=2+b5^0 ], cost: NONTERM 43: l3 -> [11] : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && 10<=a4^0+meter ], cost: NONTERM 44: l3 -> [11] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 13<=1+a4^0-2*meter && 2+a4^0-2*meter<=1+a4^0 && meter>=1 && 5+4*meter>=1 ], cost: NONTERM 46: l3 -> [11] : a4^0'=a4^0+meter, b5^0'=9, [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 2*meter==-b5^0+a4^0 && meter>=1 && 10<=a4^0+meter && 13<=1+a4^0-meter && 2+a4^0-meter<=1+a4^0+meter && 5+4*meter>=1 ], cost: NONTERM 52: l3 -> [12] : [ 1+a4^0<=30 && 1+b5^0<=a4^0 && 6<=b5^0 && 18+12*meter_2-2*a4^0==-b5^0+a4^0 && 9+6*meter_2-a4^0>=1 && 10<=9+6*meter_2 && meter_2>=1 ], cost: 38+29*meter_2-4*a4^0 14: l9 -> l3 : a4^0'=1, a^0'=1, answer^0'=0, b5^0'=1, b^0'=1, [], cost: 2 58: l9 -> l3 : a4^0'=3, a^0'=1, answer^0'=0, b5^0'=-9, b^0'=1, [], cost: 6 Eliminated locations (on tree-shaped paths): Start location: l9 Applied pruning (of leafs and parallel rules): Start location: l9 ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: l9 Obtained the following overall complexity (w.r.t. the length of the input n): Complexity: Constant Cpx degree: 0 Solved cost: 1 Rule cost: 1 Rule guard: [ a^0==a^post_14 && a4^0==a4^post_14 && answer^0==answer^post_14 && b^0==b^post_14 && b5^0==b5^post_14 && ret_complex6^0==ret_complex6^post_14 ] WORST_CASE(Omega(1),?)