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, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: gcd#_A(x1,x2) = 0 s_A(x1) = max{37, x1 + 33} minus_A(x1,x2) = max{6, x1 + 3} max_A(x1,x2) = max{13, x1 + 11, x2 + 1} min_A(x1,x2) = max{2, x1 + 1} |0|_A = 2 any_A(x1) = max{25, x1 - 33} gcd#!_A(x1,x2) = max{5, x1 - 5, x2 - 31} s!_A(x1) = x1 + 8 minus!_A(x1,x2) = max{33, x1 - 12} max!_A(x1,x2) = max{31, x1 - 6, x2 - 11} min!_A(x1,x2) = max{62, x1 + 29, x2 + 9} |0|!_A = 32 any!_A(x1) = max{1, x1 - 59} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: gcd#_A(x1,x2) = max{0, x2 - 10} s_A(x1) = 8 minus_A(x1,x2) = max{20, x1} max_A(x1,x2) = max{19, x1, x2 + 5} min_A(x1,x2) = 8 |0|_A = 8 any_A(x1) = x1 + 8 gcd#!_A(x1,x2) = max{2, x1 - 6, x2 - 9} s!_A(x1) = x1 + 12 minus!_A(x1,x2) = max{9, x1 - 21} max!_A(x1,x2) = max{32, x1 - 2, x2 - 2} min!_A(x1,x2) = max{21, x1 - 9, x2 - 9} |0|!_A = 22 any!_A(x1) = max{10, x1 - 9} partial status: pi(gcd#) = [] pi(s) = [] pi(minus) = [1] pi(max) = [1, 2] pi(min) = [] pi(|0|) = [] pi(any) = [1] 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 (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: min#_A(x1,x2) = 0 s_A(x1) = max{5, x1 - 21} min#!_A(x1,x2) = 0 s!_A(x1) = x1 + 29 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: min#_A(x1,x2) = 0 s_A(x1) = max{11, x1 + 7} min#!_A(x1,x2) = max{5, x1 - 1, x2 - 6} s!_A(x1) = 0 partial status: pi(min#) = [] pi(s) = [] 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 (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: max#_A(x1,x2) = 0 s_A(x1) = max{28, x1 + 8} max#!_A(x1,x2) = max{1, x2 - 6} s!_A(x1) = max{27, x1 - 5} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: max#_A(x1,x2) = 0 s_A(x1) = max{5, x1 - 24} max#!_A(x1,x2) = max{49, x2 + 25} s!_A(x1) = max{154, x1 + 48} partial status: pi(max#) = [] pi(s) = [] 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, r10, r11 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{0, x1 - 5, x2 - 5} s_A(x1) = max{3, x1} any_A(x1) = max{4, x1} min_A(x1,x2) = max{7, x1 - 4, x2 - 4} |0|_A = 0 minus#!_A(x1,x2) = 0 s!_A(x1) = 0 any!_A(x1) = 1 min!_A(x1,x2) = 0 |0|!_A = 0 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{0, x1 - 4, x2 - 13} s_A(x1) = max{2, x1} any_A(x1) = max{12, x1} min_A(x1,x2) = max{16, x1 - 14, x2 - 13} |0|_A = 0 minus#!_A(x1,x2) = 0 s!_A(x1) = 0 any!_A(x1) = max{0, x1 - 3} min!_A(x1,x2) = 0 |0|!_A = 0 partial status: pi(minus#) = [1] pi(s) = [1] pi(any) = [1] pi(min) = [1] 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 (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: any#_A(x1) = 0 s_A(x1) = max{2, x1 - 15} any#!_A(x1) = max{3, x1 - 61} s!_A(x1) = max{3, x1 - 61} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: any#_A(x1) = 0 s_A(x1) = max{7, x1 - 25} any#!_A(x1) = max{2, x1 - 71} s!_A(x1) = max{2, x1 - 70} partial status: pi(any#) = [1] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.