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: max/plus interpretations on natural numbers: le#_A(x1,x2) = x2 + 1 s_A(x1) = x1 le_A(x1,x2) = max{8, x1 + 7, x2 + 6} |0|_A = 0 true_A = 5 false_A = 3 pred_A(x1) = x1 minus_A(x1,x2) = max{x1, x2} gcd_A(x1,x2) = max{x1 + 6, x2 + 6} if_gcd_A(x1,x2,x3) = max{x1 - 2, x2 + 6, x3 + 6} rand_A(x1) = x1 + 2 precedence: false > gcd = if_gcd > |0| > le > minus > s > le# = pred > true = rand partial status: pi(le#) = [2] pi(s) = [1] pi(le) = [1, 2] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(pred) = [1] pi(minus) = [1, 2] pi(gcd) = [] pi(if_gcd) = [] pi(rand) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: le#_A(x1,x2) = max{6, x2} s_A(x1) = 0 le_A(x1,x2) = 25 |0|_A = 0 true_A = 1 false_A = 1 pred_A(x1) = max{10, x1} minus_A(x1,x2) = x1 + 10 gcd_A(x1,x2) = 8 if_gcd_A(x1,x2,x3) = 8 rand_A(x1) = 1 precedence: minus > pred = gcd = if_gcd > le# = le = |0| = true = false = rand > s partial status: pi(le#) = [2] pi(s) = [] pi(le) = [] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(pred) = [] pi(minus) = [1] 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: max/plus interpretations on natural numbers: minus#_A(x1,x2) = max{3, x1 + 1, x2 + 1} s_A(x1) = max{2, x1} le_A(x1,x2) = max{x1 + 17, x2 + 5} |0|_A = 10 true_A = 9 false_A = 16 pred_A(x1) = max{1, x1} minus_A(x1,x2) = max{2, x1, x2} gcd_A(x1,x2) = max{x1 + 4, x2 + 4} if_gcd_A(x1,x2,x3) = max{x2 + 4, x3 + 4} rand_A(x1) = max{6, x1 + 3} precedence: true > minus# = le = false = minus = gcd = if_gcd > s = |0| > pred = rand partial status: pi(minus#) = [2] pi(s) = [1] pi(le) = [] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(pred) = [1] pi(minus) = [1, 2] pi(gcd) = [] pi(if_gcd) = [] pi(rand) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: minus#_A(x1,x2) = max{5, x2} s_A(x1) = 3 le_A(x1,x2) = 18 |0|_A = 3 true_A = 4 false_A = 4 pred_A(x1) = max{17, x1} minus_A(x1,x2) = 17 gcd_A(x1,x2) = 17 if_gcd_A(x1,x2,x3) = 17 rand_A(x1) = 1 precedence: gcd = if_gcd > minus# = s = le = |0| = true = false = pred = minus = rand partial status: pi(minus#) = [2] 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.