YES We show the termination of the relative TRS R/S: R: le(|0|(),y) -> true() le(s(x),|0|()) -> false() le(s(x),s(y)) -> le(x,y) pred(s(x)) -> x minus(x,|0|()) -> x minus(x,s(y)) -> pred(minus(x,y)) gcd(|0|(),y) -> y gcd(s(x),|0|()) -> s(x) gcd(s(x),s(y)) -> if_gcd(le(y,x),s(x),s(y)) if_gcd(true(),s(x),s(y)) -> gcd(minus(x,y),s(y)) if_gcd(false(),s(x),s(y)) -> gcd(minus(y,x),s(x)) 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: le#(s(x),s(y)) -> le#(x,y) p2: minus#(x,s(y)) -> pred#(minus(x,y)) p3: minus#(x,s(y)) -> minus#(x,y) p4: gcd#(s(x),s(y)) -> if_gcd#(le(y,x),s(x),s(y)) p5: gcd#(s(x),s(y)) -> le#(y,x) p6: if_gcd#(true(),s(x),s(y)) -> gcd#(minus(x,y),s(y)) p7: if_gcd#(true(),s(x),s(y)) -> minus#(x,y) p8: if_gcd#(false(),s(x),s(y)) -> gcd#(minus(y,x),s(x)) p9: if_gcd#(false(),s(x),s(y)) -> minus#(y,x) and R consists of: r1: le(|0|(),y) -> true() r2: le(s(x),|0|()) -> false() r3: le(s(x),s(y)) -> le(x,y) r4: pred(s(x)) -> x r5: minus(x,|0|()) -> x r6: minus(x,s(y)) -> pred(minus(x,y)) r7: gcd(|0|(),y) -> y r8: gcd(s(x),|0|()) -> s(x) r9: gcd(s(x),s(y)) -> if_gcd(le(y,x),s(x),s(y)) r10: if_gcd(true(),s(x),s(y)) -> gcd(minus(x,y),s(y)) r11: if_gcd(false(),s(x),s(y)) -> gcd(minus(y,x),s(x)) r12: rand(x) -> x r13: rand(x) -> rand(s(x)) The estimated dependency graph contains the following SCCs: {p4, p6, p8} {p1} {p3} -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: if_gcd#(false(),s(x),s(y)) -> gcd#(minus(y,x),s(x)) p2: gcd#(s(x),s(y)) -> if_gcd#(le(y,x),s(x),s(y)) p3: if_gcd#(true(),s(x),s(y)) -> gcd#(minus(x,y),s(y)) and R consists of: r1: le(|0|(),y) -> true() r2: le(s(x),|0|()) -> false() r3: le(s(x),s(y)) -> le(x,y) r4: pred(s(x)) -> x r5: minus(x,|0|()) -> x r6: minus(x,s(y)) -> pred(minus(x,y)) r7: gcd(|0|(),y) -> y r8: gcd(s(x),|0|()) -> s(x) r9: gcd(s(x),s(y)) -> if_gcd(le(y,x),s(x),s(y)) r10: if_gcd(true(),s(x),s(y)) -> gcd(minus(x,y),s(y)) r11: if_gcd(false(),s(x),s(y)) -> gcd(minus(y,x),s(x)) r12: rand(x) -> x r13: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: if_gcd#_A(x1,x2,x3) = x2 + x3 + (2,3) false_A() = (1,7) s_A(x1) = x1 + (0,3) gcd#_A(x1,x2) = x1 + x2 + (2,4) minus_A(x1,x2) = x1 + (0,1) le_A(x1,x2) = ((1,0),(1,1)) x1 + ((0,0),(1,0)) x2 + (3,2) true_A() = (5,5) |0|_A() = (3,4) pred_A(x1) = x1 gcd_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (4,2) if_gcd_A(x1,x2,x3) = ((1,0),(1,1)) x2 + ((1,0),(1,1)) x3 + (4,1) rand_A(x1) = ((1,0),(0,0)) x1 + (1,4) precedence: minus = pred = if_gcd > false = gcd# = le > if_gcd# > true = |0| = gcd > s = rand partial status: pi(if_gcd#) = [2, 3] pi(false) = [] pi(s) = [1] pi(gcd#) = [] pi(minus) = [] pi(le) = [1] pi(true) = [] pi(|0|) = [] pi(pred) = [] pi(gcd) = [] pi(if_gcd) = [] pi(rand) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: if_gcd#_A(x1,x2,x3) = x2 false_A() = (1,1) s_A(x1) = x1 + (2,0) gcd#_A(x1,x2) = (0,0) minus_A(x1,x2) = (0,0) le_A(x1,x2) = x1 + (3,0) true_A() = (1,1) |0|_A() = (0,0) pred_A(x1) = (0,0) gcd_A(x1,x2) = (4,2) if_gcd_A(x1,x2,x3) = (4,2) rand_A(x1) = (1,1) precedence: gcd = if_gcd > true > |0| > false > rand > le > if_gcd# = s = gcd# = minus = pred partial status: pi(if_gcd#) = [2] pi(false) = [] pi(s) = [1] pi(gcd#) = [] pi(minus) = [] pi(le) = [1] pi(true) = [] pi(|0|) = [] pi(pred) = [] pi(gcd) = [] pi(if_gcd) = [] pi(rand) = [] The next rules are strictly ordered: p2, p3 We remove them from the problem. -- SCC decomposition. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: if_gcd#(false(),s(x),s(y)) -> gcd#(minus(y,x),s(x)) and R consists of: r1: le(|0|(),y) -> true() r2: le(s(x),|0|()) -> false() r3: le(s(x),s(y)) -> le(x,y) r4: pred(s(x)) -> x r5: minus(x,|0|()) -> x r6: minus(x,s(y)) -> pred(minus(x,y)) r7: gcd(|0|(),y) -> y r8: gcd(s(x),|0|()) -> s(x) r9: gcd(s(x),s(y)) -> if_gcd(le(y,x),s(x),s(y)) r10: if_gcd(true(),s(x),s(y)) -> gcd(minus(x,y),s(y)) r11: if_gcd(false(),s(x),s(y)) -> gcd(minus(y,x),s(x)) r12: rand(x) -> x r13: rand(x) -> rand(s(x)) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: le#(s(x),s(y)) -> le#(x,y) and R consists of: r1: le(|0|(),y) -> true() r2: le(s(x),|0|()) -> false() r3: le(s(x),s(y)) -> le(x,y) r4: pred(s(x)) -> x r5: minus(x,|0|()) -> x r6: minus(x,s(y)) -> pred(minus(x,y)) r7: gcd(|0|(),y) -> y r8: gcd(s(x),|0|()) -> s(x) r9: gcd(s(x),s(y)) -> if_gcd(le(y,x),s(x),s(y)) r10: if_gcd(true(),s(x),s(y)) -> gcd(minus(x,y),s(y)) r11: if_gcd(false(),s(x),s(y)) -> gcd(minus(y,x),s(x)) r12: rand(x) -> x r13: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: le#_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (1,1) s_A(x1) = x1 + (0,2) le_A(x1,x2) = (2,6) |0|_A() = (2,4) true_A() = (1,3) false_A() = (1,5) pred_A(x1) = x1 minus_A(x1,x2) = x1 + (0,1) gcd_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + (3,7) if_gcd_A(x1,x2,x3) = ((1,0),(0,0)) x2 + ((1,0),(0,0)) x3 + (3,7) rand_A(x1) = ((1,0),(0,0)) x1 + (1,3) precedence: |0| = gcd = if_gcd > le# = pred = minus > le = false > true > s = rand partial status: pi(le#) = [1, 2] pi(s) = [] pi(le) = [] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(pred) = [] pi(minus) = [1] pi(gcd) = [] pi(if_gcd) = [] pi(rand) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: le#_A(x1,x2) = ((0,0),(1,0)) x1 + ((1,0),(1,1)) x2 + (5,6) s_A(x1) = (4,5) le_A(x1,x2) = (3,4) |0|_A() = (2,0) true_A() = (1,3) false_A() = (3,3) pred_A(x1) = (0,1) minus_A(x1,x2) = (0,2) gcd_A(x1,x2) = (5,6) if_gcd_A(x1,x2,x3) = (5,6) rand_A(x1) = (1,1) precedence: le# = rand > gcd = if_gcd > pred = minus > s = le > false > |0| = true partial status: pi(le#) = [] pi(s) = [] pi(le) = [] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(pred) = [] pi(minus) = [] pi(gcd) = [] pi(if_gcd) = [] 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: minus#(x,s(y)) -> minus#(x,y) and R consists of: r1: le(|0|(),y) -> true() r2: le(s(x),|0|()) -> false() r3: le(s(x),s(y)) -> le(x,y) r4: pred(s(x)) -> x r5: minus(x,|0|()) -> x r6: minus(x,s(y)) -> pred(minus(x,y)) r7: gcd(|0|(),y) -> y r8: gcd(s(x),|0|()) -> s(x) r9: gcd(s(x),s(y)) -> if_gcd(le(y,x),s(x),s(y)) r10: if_gcd(true(),s(x),s(y)) -> gcd(minus(x,y),s(y)) r11: if_gcd(false(),s(x),s(y)) -> gcd(minus(y,x),s(x)) r12: rand(x) -> x r13: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: minus#_A(x1,x2) = x2 + (0,3) s_A(x1) = x1 + (0,4) le_A(x1,x2) = x2 + (2,9) |0|_A() = (2,9) true_A() = (1,8) false_A() = (1,10) pred_A(x1) = x1 minus_A(x1,x2) = x1 + (0,1) gcd_A(x1,x2) = x1 + x2 + (3,2) if_gcd_A(x1,x2,x3) = x2 + x3 + (3,1) rand_A(x1) = ((1,0),(0,0)) x1 + (1,1) precedence: pred = minus = rand > if_gcd > gcd > s = le = |0| = false > minus# = true partial status: pi(minus#) = [2] pi(s) = [1] pi(le) = [] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(pred) = [] pi(minus) = [] pi(gcd) = [] pi(if_gcd) = [3] pi(rand) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: minus#_A(x1,x2) = ((0,0),(1,0)) x2 + (1,3) s_A(x1) = x1 + (4,2) le_A(x1,x2) = (0,0) |0|_A() = (3,0) true_A() = (0,0) false_A() = (2,3) pred_A(x1) = (0,0) minus_A(x1,x2) = (0,0) gcd_A(x1,x2) = (1,1) if_gcd_A(x1,x2,x3) = (2,2) rand_A(x1) = (1,3) precedence: minus > rand > minus# > s = le = |0| = false = pred = if_gcd > true = gcd partial status: pi(minus#) = [] pi(s) = [1] pi(le) = [] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(pred) = [] pi(minus) = [] pi(gcd) = [] pi(if_gcd) = [] pi(rand) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.