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: standard order interpretations: if_gcd#_A(x1,x2,x3) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + x3 + (1,0) false_A() = (1,0) s_A(x1) = ((1,1),(0,0)) x1 gcd#_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + (2,0) minus_A(x1,x2) = ((1,1),(1,1)) x1 + (0,3) le_A(x1,x2) = ((0,0),(1,0)) x2 + (1,4) true_A() = (1,2) |0|_A() = (2,1) pred_A(x1) = ((1,0),(1,0)) x1 + (0,1) gcd_A(x1,x2) = ((1,0),(0,0)) x1 + x2 + (2,3) if_gcd_A(x1,x2,x3) = ((1,0),(0,0)) x2 + ((1,0),(0,0)) x3 + (2,3) rand_A(x1) = ((1,1),(0,1)) x1 + (1,1) precedence: if_gcd# = false = s = gcd# = minus = le = true = |0| = pred = gcd = if_gcd = rand partial status: pi(if_gcd#) = [] pi(false) = [] pi(s) = [] pi(gcd#) = [] pi(minus) = [] pi(le) = [] 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: standard order interpretations: if_gcd#_A(x1,x2,x3) = ((1,1),(0,0)) x1 + x2 + ((0,1),(0,1)) x3 + (5,0) false_A() = (2,3) s_A(x1) = ((1,1),(1,1)) x1 + (9,4) gcd#_A(x1,x2) = ((1,1),(0,1)) x1 + x2 + (1,0) minus_A(x1,x2) = x1 + (7,2) le_A(x1,x2) = (2,3) true_A() = (1,1) |0|_A() = (3,4) pred_A(x1) = x1 gcd_A(x1,x2) = ((0,1),(1,0)) x1 + x2 + (1,5) if_gcd_A(x1,x2,x3) = ((0,1),(1,0)) x2 + ((0,1),(1,0)) x3 + (5,0) rand_A(x1) = (0,0) precedence: if_gcd > minus = |0| = pred > gcd > if_gcd# = false = s = gcd# = le = true = rand partial status: pi(if_gcd#) = [] pi(false) = [] pi(s) = [] pi(gcd#) = [1] pi(minus) = [1] pi(le) = [] pi(true) = [] pi(|0|) = [] pi(pred) = [] pi(gcd) = [] pi(if_gcd) = [] 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: gcd#(s(x),s(y)) -> if_gcd#(le(y,x),s(x),s(y)) p2: 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 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: gcd#(s(x),s(y)) -> if_gcd#(le(y,x),s(x),s(y)) p2: 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: standard order interpretations: gcd#_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + (3,1) s_A(x1) = ((1,1),(0,0)) x1 if_gcd#_A(x1,x2,x3) = ((1,1),(0,1)) x2 + ((1,0),(0,0)) x3 + (3,1) le_A(x1,x2) = ((1,1),(0,0)) x2 + (2,2) true_A() = (1,2) minus_A(x1,x2) = ((1,0),(1,1)) x1 + (0,4) |0|_A() = (2,1) false_A() = (2,2) pred_A(x1) = ((1,0),(1,0)) x1 + (0,1) gcd_A(x1,x2) = ((1,0),(1,0)) x1 + ((1,0),(1,1)) x2 + (3,3) if_gcd_A(x1,x2,x3) = ((0,1),(0,0)) x1 + ((1,0),(1,0)) x2 + ((1,0),(1,0)) x3 + (1,3) rand_A(x1) = ((1,1),(0,1)) x1 + (1,1) precedence: gcd# = s = if_gcd# = le = true = minus = |0| = false = pred = gcd = if_gcd = rand partial status: pi(gcd#) = [] pi(s) = [] pi(if_gcd#) = [] pi(le) = [] pi(true) = [] pi(minus) = [] pi(|0|) = [] pi(false) = [] pi(pred) = [] pi(gcd) = [] pi(if_gcd) = [] pi(rand) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: gcd#_A(x1,x2) = ((0,1),(0,1)) x1 + (8,10) s_A(x1) = ((1,0),(1,1)) x1 + (17,10) if_gcd#_A(x1,x2,x3) = ((0,1),(0,1)) x2 + (0,1) le_A(x1,x2) = (16,0) true_A() = (15,0) minus_A(x1,x2) = x1 + (1,1) |0|_A() = (0,0) false_A() = (1,0) pred_A(x1) = x1 gcd_A(x1,x2) = ((1,1),(0,1)) x1 + ((0,1),(0,1)) x2 + (2,0) if_gcd_A(x1,x2,x3) = ((1,1),(0,1)) x2 + ((0,1),(0,1)) x3 + (1,0) rand_A(x1) = (0,0) precedence: if_gcd > gcd > le > gcd# = s = if_gcd# = true = minus = |0| = false = pred = rand partial status: pi(gcd#) = [] pi(s) = [] pi(if_gcd#) = [] pi(le) = [] pi(true) = [] pi(minus) = [1] pi(|0|) = [] pi(false) = [] pi(pred) = [] pi(gcd) = [] pi(if_gcd) = [2] 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: 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 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.