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