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)) -(x,|0|()) -> x -(s(x),s(y)) -> -(x,y) gcd(s(x),|0|()) -> s(x) gcd(|0|(),s(x)) -> s(x) gcd(s(x),s(y)) -> gcd(-(max(x,y),min(x,y)),s(min(x,y))) -- 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: -#(s(x),s(y)) -> -#(x,y) p4: gcd#(s(x),s(y)) -> gcd#(-(max(x,y),min(x,y)),s(min(x,y))) p5: gcd#(s(x),s(y)) -> -#(max(x,y),min(x,y)) p6: gcd#(s(x),s(y)) -> max#(x,y) p7: gcd#(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: -(x,|0|()) -> x r8: -(s(x),s(y)) -> -(x,y) r9: gcd(s(x),|0|()) -> s(x) r10: gcd(|0|(),s(x)) -> s(x) r11: gcd(s(x),s(y)) -> gcd(-(max(x,y),min(x,y)),s(min(x,y))) The estimated dependency graph contains the following SCCs: {p4} {p1} {p2} {p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: gcd#(s(x),s(y)) -> gcd#(-(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: -(x,|0|()) -> x r8: -(s(x),s(y)) -> -(x,y) r9: gcd(s(x),|0|()) -> s(x) r10: gcd(|0|(),s(x)) -> s(x) r11: gcd(s(x),s(y)) -> gcd(-(max(x,y),min(x,y)),s(min(x,y))) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: gcd#_A(x1,x2) = max{0, x1 - 13, x2 - 19} s_A(x1) = max{21, x1 + 17} -_A(x1,x2) = max{14, x1 + 1, x2} max_A(x1,x2) = max{x1 + 10, x2} min_A(x1,x2) = max{9, x1 + 5} |0|_A = 4 precedence: max = min > gcd# = s = - = |0| partial status: pi(gcd#) = [] pi(s) = [1] pi(-) = [1, 2] pi(max) = [1, 2] pi(min) = [1] pi(|0|) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: gcd#_A(x1,x2) = 0 s_A(x1) = max{11, x1 + 7} -_A(x1,x2) = max{x1 - 8, x2 + 24} max_A(x1,x2) = max{10, x1 - 8, x2 + 5} min_A(x1,x2) = max{10, x1 + 5} |0|_A = 4 precedence: gcd# > s = - > max = min = |0| partial status: pi(gcd#) = [] pi(s) = [] pi(-) = [2] pi(max) = [2] pi(min) = [1] pi(|0|) = [] The next rules are strictly ordered: p1 We remove them from the problem. 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: -(x,|0|()) -> x r8: -(s(x),s(y)) -> -(x,y) r9: gcd(s(x),|0|()) -> s(x) r10: gcd(|0|(),s(x)) -> s(x) r11: gcd(s(x),s(y)) -> gcd(-(max(x,y),min(x,y)),s(min(x,y))) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: min#_A(x1,x2) = max{2, x1 - 1, x2 + 1} s_A(x1) = max{1, x1} precedence: min# = s partial status: pi(min#) = [2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: min#_A(x1,x2) = 0 s_A(x1) = max{2, x1} precedence: min# = s partial status: pi(min#) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. 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: -(x,|0|()) -> x r8: -(s(x),s(y)) -> -(x,y) r9: gcd(s(x),|0|()) -> s(x) r10: gcd(|0|(),s(x)) -> s(x) r11: gcd(s(x),s(y)) -> gcd(-(max(x,y),min(x,y)),s(min(x,y))) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: max#_A(x1,x2) = max{2, x1 - 1, x2 + 1} s_A(x1) = max{1, x1} precedence: max# = s partial status: pi(max#) = [2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: max#_A(x1,x2) = 0 s_A(x1) = max{2, x1} precedence: max# = s partial status: pi(max#) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: -#(s(x),s(y)) -> -#(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: -(x,|0|()) -> x r8: -(s(x),s(y)) -> -(x,y) r9: gcd(s(x),|0|()) -> s(x) r10: gcd(|0|(),s(x)) -> s(x) r11: gcd(s(x),s(y)) -> gcd(-(max(x,y),min(x,y)),s(min(x,y))) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: -#_A(x1,x2) = max{2, x1 - 1, x2 + 1} s_A(x1) = max{1, x1} precedence: -# = s partial status: pi(-#) = [2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: -#_A(x1,x2) = 0 s_A(x1) = max{2, x1} precedence: -# = s partial status: pi(-#) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.