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) = max{0, x1 - 87, x2 - 136} s_A(x1) = max{112, x1 + 86} minus_A(x1,x2) = max{40, x1 + 25} max_A(x1,x2) = max{39, x1 + 13, x2 + 3} min_A(x1,x2) = max{51, x1 + 25} |0|_A = 27 any_A(x1) = max{1, x1 - 113} gcd#!_A(x1,x2) = max{24, x1 - 39, x2 - 82} s!_A(x1) = x1 + 6 minus!_A(x1,x2) = max{5, x1 - 32} max!_A(x1,x2) = max{46, x1 - 28, x2 - 68} min!_A(x1,x2) = max{3, x1 - 28} |0|!_A = 1 any!_A(x1) = max{4, x1 - 108} 2. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: gcd#_A(x1,x2) = x2 s_A(x1) = x1 + 2 minus_A(x1,x2) = x1 + 3 max_A(x1,x2) = x1 + x2 + 1 min_A(x1,x2) = x2 |0|_A() = 0 any_A(x1) = 2 gcd#!_A(x1,x2) = 3 s!_A(x1) = x1 + 2 minus!_A(x1,x2) = 4 max!_A(x1,x2) = x1 + x2 + 4 min!_A(x1,x2) = x1 + 1 |0|!_A() = 0 any!_A(x1) = 5 partial status: pi(gcd#) = [1, 2] pi(s) = [1] 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 r1, r2 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{7, x1 + 3} min_A(x1,x2) = max{29, x1 - 8, x2 - 8} |0|_A = 7 min#!_A(x1,x2) = max{x1 - 1, x2 + 9} s!_A(x1) = 0 min!_A(x1,x2) = max{1, x1 - 39, x2 - 31} |0|!_A = 0 2. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: min#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 3 min_A(x1,x2) = x1 + x2 + 1 |0|_A() = 1 min#!_A(x1,x2) = x2 s!_A(x1) = 8 min!_A(x1,x2) = 1 |0|!_A() = 0 partial status: pi(min#) = [2] pi(s) = [1] pi(min) = [1, 2] 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 (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{6, x1 - 8} max#!_A(x1,x2) = 52 s!_A(x1) = x1 + 51 2. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: max#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 1 max#!_A(x1,x2) = x1 + x2 s!_A(x1) = 3 partial status: pi(max#) = [] pi(s) = [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: 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 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) = 0 s_A(x1) = max{14, x1 - 4} any_A(x1) = max{9, x1 + 4} minus#!_A(x1,x2) = 0 s!_A(x1) = max{0, x1 - 57} any!_A(x1) = max{0, x1 - 43} 2. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: minus#_A(x1,x2) = x1 s_A(x1) = x1 any_A(x1) = x1 minus#!_A(x1,x2) = 1 s!_A(x1) = x1 + 1 any!_A(x1) = x1 + 2 partial status: pi(minus#) = [1] pi(s) = [1] 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: 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, >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 - 10} min_A(x1,x2) = max{x1, x2} |0|_A = 1 any#!_A(x1) = 1 s!_A(x1) = 3 min!_A(x1,x2) = 2 |0|!_A = 1 2. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: any#_A(x1) = x1 s_A(x1) = x1 + 2 min_A(x1,x2) = x1 + x2 + 1 |0|_A() = 1 any#!_A(x1) = x1 s!_A(x1) = x1 + 4 min!_A(x1,x2) = 3 |0|!_A() = 0 partial status: pi(any#) = [1] pi(s) = [1] pi(min) = [1] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains.