YES We show the termination of the TRS R: min(x,|0|()) -> |0|() min(|0|(),y) -> |0|() min(s(x),s(y)) -> s(min(x,y)) max(x,|0|()) -> x max(|0|(),y) -> y max(s(x),s(y)) -> s(max(x,y)) minus(x,|0|()) -> x minus(s(x),s(y)) -> s(minus(x,any(y))) gcd(s(x),s(y)) -> gcd(minus(max(x,y),min(x,y)),s(min(x,y))) any(s(x)) -> s(s(any(x))) any(x) -> x -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: min#(s(x),s(y)) -> min#(x,y) p2: max#(s(x),s(y)) -> max#(x,y) p3: minus#(s(x),s(y)) -> minus#(x,any(y)) p4: minus#(s(x),s(y)) -> any#(y) p5: gcd#(s(x),s(y)) -> gcd#(minus(max(x,y),min(x,y)),s(min(x,y))) p6: gcd#(s(x),s(y)) -> minus#(max(x,y),min(x,y)) p7: gcd#(s(x),s(y)) -> max#(x,y) p8: gcd#(s(x),s(y)) -> min#(x,y) p9: any#(s(x)) -> any#(x) and R consists of: r1: min(x,|0|()) -> |0|() r2: min(|0|(),y) -> |0|() r3: min(s(x),s(y)) -> s(min(x,y)) r4: max(x,|0|()) -> x r5: max(|0|(),y) -> y r6: max(s(x),s(y)) -> s(max(x,y)) r7: minus(x,|0|()) -> x r8: minus(s(x),s(y)) -> s(minus(x,any(y))) r9: gcd(s(x),s(y)) -> gcd(minus(max(x,y),min(x,y)),s(min(x,y))) r10: any(s(x)) -> s(s(any(x))) r11: any(x) -> x The estimated dependency graph contains the following SCCs: {p5} {p1} {p2} {p3} {p9} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: gcd#(s(x),s(y)) -> gcd#(minus(max(x,y),min(x,y)),s(min(x,y))) and R consists of: r1: min(x,|0|()) -> |0|() r2: min(|0|(),y) -> |0|() r3: min(s(x),s(y)) -> s(min(x,y)) r4: max(x,|0|()) -> x r5: max(|0|(),y) -> y r6: max(s(x),s(y)) -> s(max(x,y)) r7: minus(x,|0|()) -> x r8: minus(s(x),s(y)) -> s(minus(x,any(y))) r9: gcd(s(x),s(y)) -> gcd(minus(max(x,y),min(x,y)),s(min(x,y))) r10: any(s(x)) -> s(s(any(x))) r11: any(x) -> x The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: gcd#_A(x1,x2) = max{x1 + 9, x2 - 1} s_A(x1) = x1 + 12 minus_A(x1,x2) = x1 max_A(x1,x2) = max{x1 + 7, x2 + 1} min_A(x1,x2) = x1 + 4 |0|_A = 3 any_A(x1) = max{0, x1 - 25} base order 2: precedence: max > min > gcd# = |0| > minus > s > any partial status: pi(gcd#) = [1] pi(s) = [] pi(minus) = [1] pi(max) = [1, 2] pi(min) = [1] pi(|0|) = [] pi(any) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: min#(s(x),s(y)) -> min#(x,y) and R consists of: r1: min(x,|0|()) -> |0|() r2: min(|0|(),y) -> |0|() r3: min(s(x),s(y)) -> s(min(x,y)) r4: max(x,|0|()) -> x r5: max(|0|(),y) -> y r6: max(s(x),s(y)) -> s(max(x,y)) r7: minus(x,|0|()) -> x r8: minus(s(x),s(y)) -> s(minus(x,any(y))) r9: gcd(s(x),s(y)) -> gcd(minus(max(x,y),min(x,y)),s(min(x,y))) r10: any(s(x)) -> s(s(any(x))) r11: any(x) -> x The set of usable rules consists of r1, r2 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: min#_A(x1,x2) = max{x1 - 6, x2 + 14} s_A(x1) = x1 + 13 min_A(x1,x2) = max{x1 - 14, x2 + 30} |0|_A = 13 base order 2: precedence: min > min# > s = |0| partial status: pi(min#) = [2] pi(s) = [1] pi(min) = [] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: max#(s(x),s(y)) -> max#(x,y) and R consists of: r1: min(x,|0|()) -> |0|() r2: min(|0|(),y) -> |0|() r3: min(s(x),s(y)) -> s(min(x,y)) r4: max(x,|0|()) -> x r5: max(|0|(),y) -> y r6: max(s(x),s(y)) -> s(max(x,y)) r7: minus(x,|0|()) -> x r8: minus(s(x),s(y)) -> s(minus(x,any(y))) r9: gcd(s(x),s(y)) -> gcd(minus(max(x,y),min(x,y)),s(min(x,y))) r10: any(s(x)) -> s(s(any(x))) r11: any(x) -> x The set of usable rules consists of r1, r2 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: max#_A(x1,x2) = max{x1 - 1, x2 + 6} s_A(x1) = x1 + 5 min_A(x1,x2) = max{6, x1 - 13, x2 - 13} |0|_A = 0 base order 2: precedence: max# = min > s = |0| partial status: pi(max#) = [2] pi(s) = [1] pi(min) = [] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: minus#(s(x),s(y)) -> minus#(x,any(y)) and R consists of: r1: min(x,|0|()) -> |0|() r2: min(|0|(),y) -> |0|() r3: min(s(x),s(y)) -> s(min(x,y)) r4: max(x,|0|()) -> x r5: max(|0|(),y) -> y r6: max(s(x),s(y)) -> s(max(x,y)) r7: minus(x,|0|()) -> x r8: minus(s(x),s(y)) -> s(minus(x,any(y))) r9: gcd(s(x),s(y)) -> gcd(minus(max(x,y),min(x,y)),s(min(x,y))) r10: any(s(x)) -> s(s(any(x))) r11: any(x) -> x The set of usable rules consists of r1, r2 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{3, x1 - 14} s_A(x1) = max{18, x1 + 12} any_A(x1) = max{5, x1 - 25} min_A(x1,x2) = max{1, x1 - 19, x2 - 34} |0|_A = 0 base order 2: precedence: minus# = min > s = any = |0| partial status: pi(minus#) = [] pi(s) = [1] pi(any) = [] pi(min) = [] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: any#(s(x)) -> any#(x) and R consists of: r1: min(x,|0|()) -> |0|() r2: min(|0|(),y) -> |0|() r3: min(s(x),s(y)) -> s(min(x,y)) r4: max(x,|0|()) -> x r5: max(|0|(),y) -> y r6: max(s(x),s(y)) -> s(max(x,y)) r7: minus(x,|0|()) -> x r8: minus(s(x),s(y)) -> s(minus(x,any(y))) r9: gcd(s(x),s(y)) -> gcd(minus(max(x,y),min(x,y)),s(min(x,y))) r10: any(s(x)) -> s(s(any(x))) r11: any(x) -> x The set of usable rules consists of r1, r2 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: any#_A(x1) = max{3, x1 - 1} s_A(x1) = max{8, x1 + 5} min_A(x1,x2) = max{2, x1 - 17, x2 - 18} |0|_A = 0 base order 2: precedence: min > s = |0| > any# partial status: pi(any#) = [] pi(s) = [1] pi(min) = [] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains.