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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: towerIter#_A(x1,x2,x3) = max{1, x1 - 7, x2 - 1} s_A(x1) = max{3, x1 - 9} p_A(x1) = max{8, x1 - 13} exp_A(x1,x2) = max{x1, x2 - 42} plus_A(x1,x2) = max{x1 - 20, x2 + 2} |0|_A = 3 towerIter#!_A(x1,x2,x3) = max{32, x2 + 31} s!_A(x1) = 30 p!_A(x1) = 32 exp!_A(x1,x2) = max{33, x1 + 29, x2 - 4} plus!_A(x1,x2) = max{0, x1 - 7} |0|!_A = 27 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: towerIter#_A(x1,x2,x3) = max{0, x1 - 11, x2 - 2} s_A(x1) = max{33, x1 + 22} p_A(x1) = max{10, x1 - 12} exp_A(x1,x2) = max{x1 - 21, x2 + 1} plus_A(x1,x2) = max{x1 - 1, x2 + 35} |0|_A = 21 towerIter#!_A(x1,x2,x3) = max{0, x1 - 18} s!_A(x1) = 17 p!_A(x1) = max{16, x1 - 56} exp!_A(x1,x2) = x1 plus!_A(x1,x2) = max{19, x1 - 57} |0|!_A = 15 partial status: pi(towerIter#) = [2] pi(s) = [1] pi(p) = [1] pi(exp) = [1, 2] pi(plus) = [1, 2] 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 (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: exp#_A(x1,x2) = 0 s_A(x1) = max{26, x1 - 38} exp#!_A(x1,x2) = 0 s!_A(x1) = max{1, x1 - 27} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: exp#_A(x1,x2) = x2 s_A(x1) = max{20, x1 + 1} exp#!_A(x1,x2) = x2 + 1 s!_A(x1) = max{3, x1 - 47} partial status: pi(exp#) = [] pi(s) = [] 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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: times#_A(x1,x2) = max{0, x2 - 1} s_A(x1) = max{4, x1 - 4} p_A(x1) = x1 + 9 |0|_A = 3 times#!_A(x1,x2) = x2 + 2 s!_A(x1) = 18 p!_A(x1) = max{19, x1 + 11} |0|!_A = 16 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: times#_A(x1,x2) = max{0, x1 - 16, x2 - 15} s_A(x1) = max{17, x1 + 15} p_A(x1) = max{2, x1 - 15} |0|_A = 4 times#!_A(x1,x2) = max{1, x1 - 11} s!_A(x1) = max{10, x1 - 47} p!_A(x1) = max{7, x1 - 6} |0|!_A = 9 partial status: pi(times#) = [] pi(s) = [] 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 r1, r7, r8 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x2 - 1} s_A(x1) = x1 + 22 p_A(x1) = max{15, x1 - 2} plus_A(x1,x2) = max{40, x1 - 76, x2} |0|_A = 16 plus#!_A(x1,x2) = max{5, x1 - 16} s!_A(x1) = x1 + 18 p!_A(x1) = max{7, x1 - 5} plus!_A(x1,x2) = max{22, x1 - 56, x2 - 40} |0|!_A = 8 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x2 - 1} s_A(x1) = x1 + 51 p_A(x1) = max{14, x1 - 30} plus_A(x1,x2) = max{53, x1 + 4, x2 + 15} |0|_A = 4 plus#!_A(x1,x2) = max{36, x1 + 23, x2} s!_A(x1) = max{84, x1 + 35} p!_A(x1) = max{5, x1 - 17} plus!_A(x1,x2) = max{89, x1 + 10, x2 - 2} |0|!_A = 37 partial status: pi(plus#) = [] pi(s) = [] pi(p) = [] pi(plus) = [2] 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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. 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 - 12, x2 - 14} |0|_A = 8 p#!_A(x1) = max{2, x1 - 65} s!_A(x1) = max{2, x1 - 58} times!_A(x1,x2) = max{4, x1 - 37, x2 - 29} |0|!_A = 0 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{2, x1 - 97} s!_A(x1) = max{2, x1 - 88} times!_A(x1,x2) = max{2, x1 - 9, x2 - 62} |0|!_A = 0 partial status: pi(p#) = [1] pi(s) = [1] pi(times) = [1] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains.