YES We show the termination of the TRS R: plus(|0|(),x) -> x plus(s(x),y) -> s(plus(p(s(x)),y)) times(|0|(),y) -> |0|() times(s(x),y) -> plus(y,times(p(s(x)),y)) exp(x,|0|()) -> s(|0|()) exp(x,s(y)) -> times(x,exp(x,y)) p(s(|0|())) -> |0|() p(s(s(x))) -> s(p(s(x))) tower(x,y) -> towerIter(x,y,s(|0|())) towerIter(|0|(),y,z) -> z towerIter(s(x),y,z) -> towerIter(p(s(x)),y,exp(y,z)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: plus#(s(x),y) -> plus#(p(s(x)),y) p2: plus#(s(x),y) -> p#(s(x)) p3: times#(s(x),y) -> plus#(y,times(p(s(x)),y)) p4: times#(s(x),y) -> times#(p(s(x)),y) p5: times#(s(x),y) -> p#(s(x)) p6: exp#(x,s(y)) -> times#(x,exp(x,y)) p7: exp#(x,s(y)) -> exp#(x,y) p8: p#(s(s(x))) -> p#(s(x)) p9: tower#(x,y) -> towerIter#(x,y,s(|0|())) p10: towerIter#(s(x),y,z) -> towerIter#(p(s(x)),y,exp(y,z)) p11: towerIter#(s(x),y,z) -> p#(s(x)) p12: towerIter#(s(x),y,z) -> exp#(y,z) and R consists of: r1: plus(|0|(),x) -> x r2: plus(s(x),y) -> s(plus(p(s(x)),y)) r3: times(|0|(),y) -> |0|() r4: times(s(x),y) -> plus(y,times(p(s(x)),y)) r5: exp(x,|0|()) -> s(|0|()) r6: exp(x,s(y)) -> times(x,exp(x,y)) r7: p(s(|0|())) -> |0|() r8: p(s(s(x))) -> s(p(s(x))) r9: tower(x,y) -> towerIter(x,y,s(|0|())) r10: towerIter(|0|(),y,z) -> z r11: towerIter(s(x),y,z) -> towerIter(p(s(x)),y,exp(y,z)) The estimated dependency graph contains the following SCCs: {p10} {p7} {p4} {p1} {p8} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: towerIter#(s(x),y,z) -> towerIter#(p(s(x)),y,exp(y,z)) and R consists of: r1: plus(|0|(),x) -> x r2: plus(s(x),y) -> s(plus(p(s(x)),y)) r3: times(|0|(),y) -> |0|() r4: times(s(x),y) -> plus(y,times(p(s(x)),y)) r5: exp(x,|0|()) -> s(|0|()) r6: exp(x,s(y)) -> times(x,exp(x,y)) r7: p(s(|0|())) -> |0|() r8: p(s(s(x))) -> s(p(s(x))) r9: tower(x,y) -> towerIter(x,y,s(|0|())) r10: towerIter(|0|(),y,z) -> z r11: towerIter(s(x),y,z) -> towerIter(p(s(x)),y,exp(y,z)) The set of usable rules consists of r1, r7, r8 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: towerIter#_A(x1,x2,x3) = 1 s_A(x1) = 4 p_A(x1) = 6 exp_A(x1,x2) = x2 + 3 plus_A(x1,x2) = x1 + x2 |0|_A() = 5 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: towerIter#_A(x1,x2,x3) = max{0, x2 - 1} s_A(x1) = x1 + 6 p_A(x1) = max{3, x1 - 3} exp_A(x1,x2) = x1 + 10 plus_A(x1,x2) = max{13, x2} |0|_A = 13 towerIter#!_A(x1,x2,x3) = max{4, x1} s!_A(x1) = 5 p!_A(x1) = 5 exp!_A(x1,x2) = max{x1 + 23, x2 - 14} plus!_A(x1,x2) = max{23, x1 - 15, x2 - 13} |0|!_A = 22 partial status: pi(towerIter#) = [] pi(s) = [] pi(p) = [] pi(exp) = [] pi(plus) = [] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: exp#(x,s(y)) -> exp#(x,y) and R consists of: r1: plus(|0|(),x) -> x r2: plus(s(x),y) -> s(plus(p(s(x)),y)) r3: times(|0|(),y) -> |0|() r4: times(s(x),y) -> plus(y,times(p(s(x)),y)) r5: exp(x,|0|()) -> s(|0|()) r6: exp(x,s(y)) -> times(x,exp(x,y)) r7: p(s(|0|())) -> |0|() r8: p(s(s(x))) -> s(p(s(x))) r9: tower(x,y) -> towerIter(x,y,s(|0|())) r10: towerIter(|0|(),y,z) -> z r11: towerIter(s(x),y,z) -> towerIter(p(s(x)),y,exp(y,z)) The set of usable rules consists of r3 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: exp#_A(x1,x2) = 1 s_A(x1) = 4 times_A(x1,x2) = 3 |0|_A() = 2 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: exp#_A(x1,x2) = x2 s_A(x1) = x1 + 17 times_A(x1,x2) = max{45, x1 - 27, x2 - 92} |0|_A = 26 exp#!_A(x1,x2) = max{6, x2 - 8} s!_A(x1) = max{19, x1 + 5} times!_A(x1,x2) = max{32, x1 - 176, x2 - 150} |0|!_A = 18 partial status: pi(exp#) = [] pi(s) = [] pi(times) = [] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: times#(s(x),y) -> times#(p(s(x)),y) and R consists of: r1: plus(|0|(),x) -> x r2: plus(s(x),y) -> s(plus(p(s(x)),y)) r3: times(|0|(),y) -> |0|() r4: times(s(x),y) -> plus(y,times(p(s(x)),y)) r5: exp(x,|0|()) -> s(|0|()) r6: exp(x,s(y)) -> times(x,exp(x,y)) r7: p(s(|0|())) -> |0|() r8: p(s(s(x))) -> s(p(s(x))) r9: tower(x,y) -> towerIter(x,y,s(|0|())) r10: towerIter(|0|(),y,z) -> z r11: towerIter(s(x),y,z) -> towerIter(p(s(x)),y,exp(y,z)) The set of usable rules consists of r7, r8 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: times#_A(x1,x2) = 2 s_A(x1) = x1 + 3 p_A(x1) = x1 |0|_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: times#_A(x1,x2) = max{0, x1 - 32, x2 - 2} s_A(x1) = max{40, x1 + 22} p_A(x1) = max{31, x1 - 7} |0|_A = 20 times#!_A(x1,x2) = max{13, x1 - 21} s!_A(x1) = x1 + 16 p!_A(x1) = max{15, x1 - 23} |0|!_A = 11 partial status: pi(times#) = [] pi(s) = [1] pi(p) = [1] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: plus#(s(x),y) -> plus#(p(s(x)),y) and R consists of: r1: plus(|0|(),x) -> x r2: plus(s(x),y) -> s(plus(p(s(x)),y)) r3: times(|0|(),y) -> |0|() r4: times(s(x),y) -> plus(y,times(p(s(x)),y)) r5: exp(x,|0|()) -> s(|0|()) r6: exp(x,s(y)) -> times(x,exp(x,y)) r7: p(s(|0|())) -> |0|() r8: p(s(s(x))) -> s(p(s(x))) r9: tower(x,y) -> towerIter(x,y,s(|0|())) r10: towerIter(|0|(),y,z) -> z r11: towerIter(s(x),y,z) -> towerIter(p(s(x)),y,exp(y,z)) The set of usable rules consists of r7, r8 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: plus#_A(x1,x2) = x1 + x2 + 1 s_A(x1) = x1 p_A(x1) = 0 |0|_A() = 0 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 22, x2 - 5} s_A(x1) = max{50, x1 + 21} p_A(x1) = max{18, x1 - 12} |0|_A = 27 plus#!_A(x1,x2) = max{1, x1 - 19} s!_A(x1) = max{57, x1 + 7} p!_A(x1) = max{105, x1 - 23} |0|!_A = 105 partial status: pi(plus#) = [2] pi(s) = [] pi(p) = [] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: p#(s(s(x))) -> p#(s(x)) and R consists of: r1: plus(|0|(),x) -> x r2: plus(s(x),y) -> s(plus(p(s(x)),y)) r3: times(|0|(),y) -> |0|() r4: times(s(x),y) -> plus(y,times(p(s(x)),y)) r5: exp(x,|0|()) -> s(|0|()) r6: exp(x,s(y)) -> times(x,exp(x,y)) r7: p(s(|0|())) -> |0|() r8: p(s(s(x))) -> s(p(s(x))) r9: tower(x,y) -> towerIter(x,y,s(|0|())) r10: towerIter(|0|(),y,z) -> z r11: towerIter(s(x),y,z) -> towerIter(p(s(x)),y,exp(y,z)) The set of usable rules consists of r3 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: p#_A(x1) = x1 s_A(x1) = x1 + 3 times_A(x1,x2) = x2 + 2 |0|_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: p#_A(x1) = 0 s_A(x1) = max{8, x1 - 9} times_A(x1,x2) = max{14, x1 - 10, x2 - 29} |0|_A = 8 p#!_A(x1) = max{0, x1 - 88} s!_A(x1) = max{0, x1 - 70} times!_A(x1,x2) = max{1, x1 - 78, x2 - 44} |0|!_A = 0 partial status: pi(p#) = [] pi(s) = [1] pi(times) = [] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains.