YES We show the termination of the relative TRS R/S: R: times(x,|0|()) -> |0|() times(x,s(y)) -> plus(times(x,y),x) plus(x,|0|()) -> x plus(|0|(),x) -> x plus(x,s(y)) -> s(plus(x,y)) plus(s(x),y) -> s(plus(x,y)) S: rand(x) -> x rand(x) -> rand(s(x)) -- SCC decomposition. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: times#(x,s(y)) -> plus#(times(x,y),x) p2: times#(x,s(y)) -> times#(x,y) p3: plus#(x,s(y)) -> plus#(x,y) p4: plus#(s(x),y) -> plus#(x,y) and R consists of: r1: times(x,|0|()) -> |0|() r2: times(x,s(y)) -> plus(times(x,y),x) r3: plus(x,|0|()) -> x r4: plus(|0|(),x) -> x r5: plus(x,s(y)) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(x,y)) r7: rand(x) -> x r8: rand(x) -> rand(s(x)) The estimated dependency graph contains the following SCCs: {p2} {p3, p4} -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: times#(x,s(y)) -> times#(x,y) and R consists of: r1: times(x,|0|()) -> |0|() r2: times(x,s(y)) -> plus(times(x,y),x) r3: plus(x,|0|()) -> x r4: plus(|0|(),x) -> x r5: plus(x,s(y)) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(x,y)) r7: rand(x) -> x r8: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: times#_A(x1,x2) = max{4, x2 + 1} s_A(x1) = max{3, x1} times_A(x1,x2) = max{x1 + 2, x2 + 4} |0|_A = 1 plus_A(x1,x2) = max{x1, x2 + 2} rand_A(x1) = max{8, x1 + 4} precedence: times# = times > |0| = plus > s = rand partial status: pi(times#) = [2] pi(s) = [1] pi(times) = [1, 2] pi(|0|) = [] pi(plus) = [1, 2] pi(rand) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: times#_A(x1,x2) = max{5, x2 + 1} s_A(x1) = max{4, x1 + 3} times_A(x1,x2) = max{x1 + 2, x2 + 1} |0|_A = 1 plus_A(x1,x2) = x2 + 3 rand_A(x1) = 1 precedence: plus > times# = s = times = |0| = rand partial status: pi(times#) = [2] pi(s) = [1] pi(times) = [2] pi(|0|) = [] pi(plus) = [] pi(rand) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: plus#(x,s(y)) -> plus#(x,y) p2: plus#(s(x),y) -> plus#(x,y) and R consists of: r1: times(x,|0|()) -> |0|() r2: times(x,s(y)) -> plus(times(x,y),x) r3: plus(x,|0|()) -> x r4: plus(|0|(),x) -> x r5: plus(x,s(y)) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(x,y)) r7: rand(x) -> x r8: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: plus#_A(x1,x2) = max{x1 + 4, x2 + 1} s_A(x1) = max{2, x1} times_A(x1,x2) = max{x1 + 4, x2 + 2} |0|_A = 5 plus_A(x1,x2) = max{x1, x2 + 2} rand_A(x1) = max{6, x1 + 3} precedence: times > |0| = plus > s > plus# > rand partial status: pi(plus#) = [1, 2] pi(s) = [1] pi(times) = [1, 2] pi(|0|) = [] pi(plus) = [1, 2] pi(rand) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: plus#_A(x1,x2) = max{5, x1, x2} s_A(x1) = x1 + 5 times_A(x1,x2) = max{x1 + 8, x2 + 3} |0|_A = 7 plus_A(x1,x2) = max{8, x1, x2 + 3} rand_A(x1) = 0 precedence: plus# = s = |0| > times > plus = rand partial status: pi(plus#) = [1, 2] pi(s) = [1] pi(times) = [2] pi(|0|) = [] pi(plus) = [1, 2] pi(rand) = [] The next rules are strictly ordered: p1, p2 We remove them from the problem. Then no dependency pair remains.