YES We show the termination of the TRS R: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) n(|0|(),y) -> |0|() n(x,|0|()) -> |0|() n(s(x),s(y)) -> s(n(x,y)) m(|0|(),y) -> y m(x,|0|()) -> x m(s(x),s(y)) -> s(m(x,y)) k(|0|(),s(y)) -> |0|() k(s(x),s(y)) -> s(k(minus(x,y),s(y))) t(x) -> p(x,x) p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) p(|0|(),y) -> y p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) minus(x,|0|()) -> x minus(s(x),s(y)) -> minus(x,y) id(x) -> x if(true(),x,y) -> x if(false(),x,y) -> y not(x) -> if(x,false(),true()) and(x,false()) -> false() and(true(),true()) -> true() f(|0|()) -> true() f(s(x)) -> h(x) h(|0|()) -> false() h(s(x)) -> f(x) gt(s(x),|0|()) -> true() gt(|0|(),y) -> false() gt(s(x),s(y)) -> gt(x,y) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: g#(s(x),s(y)) -> if#(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) p2: g#(s(x),s(y)) -> and#(f(s(x)),f(s(y))) p3: g#(s(x),s(y)) -> f#(s(x)) p4: g#(s(x),s(y)) -> f#(s(y)) p5: g#(s(x),s(y)) -> t#(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))) p6: g#(s(x),s(y)) -> g#(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|())))) p7: g#(s(x),s(y)) -> k#(minus(m(x,y),n(x,y)),s(s(|0|()))) p8: g#(s(x),s(y)) -> minus#(m(x,y),n(x,y)) p9: g#(s(x),s(y)) -> m#(x,y) p10: g#(s(x),s(y)) -> n#(x,y) p11: g#(s(x),s(y)) -> k#(n(s(x),s(y)),s(s(|0|()))) p12: g#(s(x),s(y)) -> n#(s(x),s(y)) p13: g#(s(x),s(y)) -> g#(minus(m(x,y),n(x,y)),n(s(x),s(y))) p14: n#(s(x),s(y)) -> n#(x,y) p15: m#(s(x),s(y)) -> m#(x,y) p16: k#(s(x),s(y)) -> k#(minus(x,y),s(y)) p17: k#(s(x),s(y)) -> minus#(x,y) p18: t#(x) -> p#(x,x) p19: p#(s(x),s(y)) -> p#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) p20: p#(s(x),s(y)) -> if#(gt(x,y),x,y) p21: p#(s(x),s(y)) -> gt#(x,y) p22: p#(s(x),s(y)) -> if#(not(gt(x,y)),id(x),id(y)) p23: p#(s(x),s(y)) -> not#(gt(x,y)) p24: p#(s(x),s(y)) -> id#(x) p25: p#(s(x),s(y)) -> id#(y) p26: p#(s(x),x) -> p#(if(gt(x,x),id(x),id(x)),s(x)) p27: p#(s(x),x) -> if#(gt(x,x),id(x),id(x)) p28: p#(s(x),x) -> gt#(x,x) p29: p#(s(x),x) -> id#(x) p30: p#(id(x),s(y)) -> p#(x,if(gt(s(y),y),y,s(y))) p31: p#(id(x),s(y)) -> if#(gt(s(y),y),y,s(y)) p32: p#(id(x),s(y)) -> gt#(s(y),y) p33: minus#(s(x),s(y)) -> minus#(x,y) p34: not#(x) -> if#(x,false(),true()) p35: f#(s(x)) -> h#(x) p36: h#(s(x)) -> f#(x) p37: gt#(s(x),s(y)) -> gt#(x,y) and R consists of: r1: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) r2: n(|0|(),y) -> |0|() r3: n(x,|0|()) -> |0|() r4: n(s(x),s(y)) -> s(n(x,y)) r5: m(|0|(),y) -> y r6: m(x,|0|()) -> x r7: m(s(x),s(y)) -> s(m(x,y)) r8: k(|0|(),s(y)) -> |0|() r9: k(s(x),s(y)) -> s(k(minus(x,y),s(y))) r10: t(x) -> p(x,x) r11: p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r12: p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) r13: p(|0|(),y) -> y r14: p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) r15: minus(x,|0|()) -> x r16: minus(s(x),s(y)) -> minus(x,y) r17: id(x) -> x r18: if(true(),x,y) -> x r19: if(false(),x,y) -> y r20: not(x) -> if(x,false(),true()) r21: and(x,false()) -> false() r22: and(true(),true()) -> true() r23: f(|0|()) -> true() r24: f(s(x)) -> h(x) r25: h(|0|()) -> false() r26: h(s(x)) -> f(x) r27: gt(s(x),|0|()) -> true() r28: gt(|0|(),y) -> false() r29: gt(s(x),s(y)) -> gt(x,y) The estimated dependency graph contains the following SCCs: {p6, p13} {p35, p36} {p16} {p33} {p15} {p14} {p19, p26, p30} {p37} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: g#(s(x),s(y)) -> g#(minus(m(x,y),n(x,y)),n(s(x),s(y))) p2: g#(s(x),s(y)) -> g#(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|())))) and R consists of: r1: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) r2: n(|0|(),y) -> |0|() r3: n(x,|0|()) -> |0|() r4: n(s(x),s(y)) -> s(n(x,y)) r5: m(|0|(),y) -> y r6: m(x,|0|()) -> x r7: m(s(x),s(y)) -> s(m(x,y)) r8: k(|0|(),s(y)) -> |0|() r9: k(s(x),s(y)) -> s(k(minus(x,y),s(y))) r10: t(x) -> p(x,x) r11: p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r12: p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) r13: p(|0|(),y) -> y r14: p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) r15: minus(x,|0|()) -> x r16: minus(s(x),s(y)) -> minus(x,y) r17: id(x) -> x r18: if(true(),x,y) -> x r19: if(false(),x,y) -> y r20: not(x) -> if(x,false(),true()) r21: and(x,false()) -> false() r22: and(true(),true()) -> true() r23: f(|0|()) -> true() r24: f(s(x)) -> h(x) r25: h(|0|()) -> false() r26: h(s(x)) -> f(x) r27: gt(s(x),|0|()) -> true() r28: gt(|0|(),y) -> false() r29: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r2, r3, r4, r5, r6, r7, r8, r9, r15, r16 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: g#_A(x1,x2) = 0 s_A(x1) = x1 minus_A(x1,x2) = x1 m_A(x1,x2) = x1 + x2 n_A(x1,x2) = 0 k_A(x1,x2) = 0 |0|_A() = 0 g#!_A(x1,x2) = x1 + x2 + 1 s!_A(x1) = 4 minus!_A(x1,x2) = 4 m!_A(x1,x2) = 7 n!_A(x1,x2) = 7 k!_A(x1,x2) = 5 |0|!_A() = 2 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: g#_A(x1,x2) = 0 s_A(x1) = max{60, x1 + 22} minus_A(x1,x2) = x1 m_A(x1,x2) = max{25, x1 + 1, x2 + 3} n_A(x1,x2) = x1 + 11 k_A(x1,x2) = x1 + 3 |0|_A = 11 g#!_A(x1,x2) = max{81, x1 + 54, x2 + 39} s!_A(x1) = 0 minus!_A(x1,x2) = 0 m!_A(x1,x2) = max{80, x1 - 61, x2 - 61} n!_A(x1,x2) = x1 + 77 k!_A(x1,x2) = max{0, x1 - 34} |0|!_A = 139 partial status: pi(g#) = [] pi(s) = [1] pi(minus) = [1] pi(m) = [1, 2] pi(n) = [] pi(k) = [] pi(|0|) = [] The following rules are removed: p1, p2 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(x)) -> h#(x) p2: h#(s(x)) -> f#(x) and R consists of: r1: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) r2: n(|0|(),y) -> |0|() r3: n(x,|0|()) -> |0|() r4: n(s(x),s(y)) -> s(n(x,y)) r5: m(|0|(),y) -> y r6: m(x,|0|()) -> x r7: m(s(x),s(y)) -> s(m(x,y)) r8: k(|0|(),s(y)) -> |0|() r9: k(s(x),s(y)) -> s(k(minus(x,y),s(y))) r10: t(x) -> p(x,x) r11: p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r12: p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) r13: p(|0|(),y) -> y r14: p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) r15: minus(x,|0|()) -> x r16: minus(s(x),s(y)) -> minus(x,y) r17: id(x) -> x r18: if(true(),x,y) -> x r19: if(false(),x,y) -> y r20: not(x) -> if(x,false(),true()) r21: and(x,false()) -> false() r22: and(true(),true()) -> true() r23: f(|0|()) -> true() r24: f(s(x)) -> h(x) r25: h(|0|()) -> false() r26: h(s(x)) -> f(x) r27: gt(s(x),|0|()) -> true() r28: gt(|0|(),y) -> false() r29: gt(s(x),s(y)) -> gt(x,y) 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: f#_A(x1) = x1 s_A(x1) = x1 + 2 h#_A(x1) = x1 f#!_A(x1) = 4 s!_A(x1) = 4 h#!_A(x1) = 4 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: f#_A(x1) = max{0, x1 - 14} s_A(x1) = max{13, x1} h#_A(x1) = max{0, x1 - 14} f#!_A(x1) = 0 s!_A(x1) = x1 + 2 h#!_A(x1) = 2 partial status: pi(f#) = [1] pi(s) = [1] pi(h#) = [1] The following rules are removed: p1, p2 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: k#(s(x),s(y)) -> k#(minus(x,y),s(y)) and R consists of: r1: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) r2: n(|0|(),y) -> |0|() r3: n(x,|0|()) -> |0|() r4: n(s(x),s(y)) -> s(n(x,y)) r5: m(|0|(),y) -> y r6: m(x,|0|()) -> x r7: m(s(x),s(y)) -> s(m(x,y)) r8: k(|0|(),s(y)) -> |0|() r9: k(s(x),s(y)) -> s(k(minus(x,y),s(y))) r10: t(x) -> p(x,x) r11: p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r12: p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) r13: p(|0|(),y) -> y r14: p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) r15: minus(x,|0|()) -> x r16: minus(s(x),s(y)) -> minus(x,y) r17: id(x) -> x r18: if(true(),x,y) -> x r19: if(false(),x,y) -> y r20: not(x) -> if(x,false(),true()) r21: and(x,false()) -> false() r22: and(true(),true()) -> true() r23: f(|0|()) -> true() r24: f(s(x)) -> h(x) r25: h(|0|()) -> false() r26: h(s(x)) -> f(x) r27: gt(s(x),|0|()) -> true() r28: gt(|0|(),y) -> false() r29: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r3, r15, r16 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: k#_A(x1,x2) = x1 s_A(x1) = x1 + 3 minus_A(x1,x2) = x1 + 1 n_A(x1,x2) = x2 + 1 |0|_A() = 8 k#!_A(x1,x2) = x1 + 14 s!_A(x1) = 16 minus!_A(x1,x2) = 7 n!_A(x1,x2) = 13 |0|!_A() = 12 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: k#_A(x1,x2) = max{149, x1 - 27, x2 - 27} s_A(x1) = max{26, x1 + 5} minus_A(x1,x2) = max{176, x1 + 5, x2 - 218} n_A(x1,x2) = max{178, x1 - 27, x2 + 5} |0|_A = 6 k#!_A(x1,x2) = max{1364, x1 + 1187, x2 + 964} s!_A(x1) = x1 + 16 minus!_A(x1,x2) = max{x1 + 1436, x2 + 1210} n!_A(x1,x2) = 3 |0|!_A = 2 partial status: pi(k#) = [2] pi(s) = [1] pi(minus) = [1] pi(n) = [] 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,y) and R consists of: r1: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) r2: n(|0|(),y) -> |0|() r3: n(x,|0|()) -> |0|() r4: n(s(x),s(y)) -> s(n(x,y)) r5: m(|0|(),y) -> y r6: m(x,|0|()) -> x r7: m(s(x),s(y)) -> s(m(x,y)) r8: k(|0|(),s(y)) -> |0|() r9: k(s(x),s(y)) -> s(k(minus(x,y),s(y))) r10: t(x) -> p(x,x) r11: p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r12: p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) r13: p(|0|(),y) -> y r14: p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) r15: minus(x,|0|()) -> x r16: minus(s(x),s(y)) -> minus(x,y) r17: id(x) -> x r18: if(true(),x,y) -> x r19: if(false(),x,y) -> y r20: not(x) -> if(x,false(),true()) r21: and(x,false()) -> false() r22: and(true(),true()) -> true() r23: f(|0|()) -> true() r24: f(s(x)) -> h(x) r25: h(|0|()) -> false() r26: h(s(x)) -> f(x) r27: gt(s(x),|0|()) -> true() r28: gt(|0|(),y) -> false() r29: gt(s(x),s(y)) -> gt(x,y) 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: minus#_A(x1,x2) = x1 s_A(x1) = x1 + 9 minus#!_A(x1,x2) = x1 + x2 s!_A(x1) = 11 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{0, x1 - 9, x2 - 9} s_A(x1) = max{16, x1 + 8} minus#!_A(x1,x2) = max{1, x1 - 17, x2 - 17} s!_A(x1) = 0 partial status: pi(minus#) = [] 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: m#(s(x),s(y)) -> m#(x,y) and R consists of: r1: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) r2: n(|0|(),y) -> |0|() r3: n(x,|0|()) -> |0|() r4: n(s(x),s(y)) -> s(n(x,y)) r5: m(|0|(),y) -> y r6: m(x,|0|()) -> x r7: m(s(x),s(y)) -> s(m(x,y)) r8: k(|0|(),s(y)) -> |0|() r9: k(s(x),s(y)) -> s(k(minus(x,y),s(y))) r10: t(x) -> p(x,x) r11: p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r12: p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) r13: p(|0|(),y) -> y r14: p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) r15: minus(x,|0|()) -> x r16: minus(s(x),s(y)) -> minus(x,y) r17: id(x) -> x r18: if(true(),x,y) -> x r19: if(false(),x,y) -> y r20: not(x) -> if(x,false(),true()) r21: and(x,false()) -> false() r22: and(true(),true()) -> true() r23: f(|0|()) -> true() r24: f(s(x)) -> h(x) r25: h(|0|()) -> false() r26: h(s(x)) -> f(x) r27: gt(s(x),|0|()) -> true() r28: gt(|0|(),y) -> false() r29: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r3, 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: m#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 8 n_A(x1,x2) = x2 + 11 |0|_A() = 12 k_A(x1,x2) = x1 m#!_A(x1,x2) = x1 s!_A(x1) = x1 + 20 n!_A(x1,x2) = 20 |0|!_A() = 21 k!_A(x1,x2) = x1 + 21 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: m#_A(x1,x2) = max{0, x1 - 54, x2 - 54} s_A(x1) = x1 + 53 n_A(x1,x2) = max{661, x2 - 396} |0|_A = 0 k_A(x1,x2) = max{703, x1 - 12, x2 - 449} m#!_A(x1,x2) = max{61, x1 + 8} s!_A(x1) = 62 n!_A(x1,x2) = 62 |0|!_A = 7 k!_A(x1,x2) = max{5, x1 - 1099, x2 - 45} partial status: pi(m#) = [] pi(s) = [] pi(n) = [1, 2] pi(|0|) = [] pi(k) = [1, 2] 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: n#(s(x),s(y)) -> n#(x,y) and R consists of: r1: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) r2: n(|0|(),y) -> |0|() r3: n(x,|0|()) -> |0|() r4: n(s(x),s(y)) -> s(n(x,y)) r5: m(|0|(),y) -> y r6: m(x,|0|()) -> x r7: m(s(x),s(y)) -> s(m(x,y)) r8: k(|0|(),s(y)) -> |0|() r9: k(s(x),s(y)) -> s(k(minus(x,y),s(y))) r10: t(x) -> p(x,x) r11: p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r12: p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) r13: p(|0|(),y) -> y r14: p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) r15: minus(x,|0|()) -> x r16: minus(s(x),s(y)) -> minus(x,y) r17: id(x) -> x r18: if(true(),x,y) -> x r19: if(false(),x,y) -> y r20: not(x) -> if(x,false(),true()) r21: and(x,false()) -> false() r22: and(true(),true()) -> true() r23: f(|0|()) -> true() r24: f(s(x)) -> h(x) r25: h(|0|()) -> false() r26: h(s(x)) -> f(x) r27: gt(s(x),|0|()) -> true() r28: gt(|0|(),y) -> false() r29: gt(s(x),s(y)) -> gt(x,y) 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: n#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 3 n#!_A(x1,x2) = x1 + x2 s!_A(x1) = x1 + 6 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: n#_A(x1,x2) = max{0, x1 - 112, x2 - 112} s_A(x1) = max{277, x1 + 111} n#!_A(x1,x2) = max{164, x1 - 112} s!_A(x1) = max{306, x1 + 198} partial status: pi(n#) = [1] 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: p#(s(x),s(y)) -> p#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) p2: p#(id(x),s(y)) -> p#(x,if(gt(s(y),y),y,s(y))) p3: p#(s(x),x) -> p#(if(gt(x,x),id(x),id(x)),s(x)) and R consists of: r1: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) r2: n(|0|(),y) -> |0|() r3: n(x,|0|()) -> |0|() r4: n(s(x),s(y)) -> s(n(x,y)) r5: m(|0|(),y) -> y r6: m(x,|0|()) -> x r7: m(s(x),s(y)) -> s(m(x,y)) r8: k(|0|(),s(y)) -> |0|() r9: k(s(x),s(y)) -> s(k(minus(x,y),s(y))) r10: t(x) -> p(x,x) r11: p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r12: p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) r13: p(|0|(),y) -> y r14: p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) r15: minus(x,|0|()) -> x r16: minus(s(x),s(y)) -> minus(x,y) r17: id(x) -> x r18: if(true(),x,y) -> x r19: if(false(),x,y) -> y r20: not(x) -> if(x,false(),true()) r21: and(x,false()) -> false() r22: and(true(),true()) -> true() r23: f(|0|()) -> true() r24: f(s(x)) -> h(x) r25: h(|0|()) -> false() r26: h(s(x)) -> f(x) r27: gt(s(x),|0|()) -> true() r28: gt(|0|(),y) -> false() r29: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r17, r18, r19, r20, r23, r27, r28, r29 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: p#_A(x1,x2) = 0 s_A(x1) = 3 if_A(x1,x2,x3) = x2 + x3 + 1 gt_A(x1,x2) = 0 not_A(x1) = 1 id_A(x1) = x1 + 1 true_A() = 0 false_A() = 0 f_A(x1) = 4 |0|_A() = 1 p#!_A(x1,x2) = 7 s!_A(x1) = 9 if!_A(x1,x2,x3) = 10 gt!_A(x1,x2) = 6 not!_A(x1) = 11 id!_A(x1) = x1 + 8 true!_A() = 5 false!_A() = 0 f!_A(x1) = 8 |0|!_A() = 6 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: p#_A(x1,x2) = max{372, x1 - 235, x2 - 241} s_A(x1) = max{495, x1 + 374} if_A(x1,x2,x3) = max{x1 - 224, x2 + 145, x3} gt_A(x1,x2) = 98 not_A(x1) = max{837, x1 + 495} id_A(x1) = max{236, x1 + 89} true_A = 1 false_A = 2 f_A(x1) = 121 |0|_A = 526 p#!_A(x1,x2) = max{x1 + 125, x2 + 3} s!_A(x1) = max{0, x1 - 26} if!_A(x1,x2,x3) = max{1, x3 - 85} gt!_A(x1,x2) = max{x1 + 3, x2 + 376} not!_A(x1) = max{621, x1 + 525} id!_A(x1) = x1 + 1124 true!_A = 0 false!_A = 622 f!_A(x1) = max{495, x1 + 1} |0|!_A = 623 partial status: pi(p#) = [] pi(s) = [1] pi(if) = [2, 3] pi(gt) = [] pi(not) = [] pi(id) = [1] pi(true) = [] pi(false) = [] pi(f) = [1] pi(|0|) = [] The following rules are removed: p1, p3 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: p#(id(x),s(y)) -> p#(x,if(gt(s(y),y),y,s(y))) and R consists of: r1: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) r2: n(|0|(),y) -> |0|() r3: n(x,|0|()) -> |0|() r4: n(s(x),s(y)) -> s(n(x,y)) r5: m(|0|(),y) -> y r6: m(x,|0|()) -> x r7: m(s(x),s(y)) -> s(m(x,y)) r8: k(|0|(),s(y)) -> |0|() r9: k(s(x),s(y)) -> s(k(minus(x,y),s(y))) r10: t(x) -> p(x,x) r11: p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r12: p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) r13: p(|0|(),y) -> y r14: p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) r15: minus(x,|0|()) -> x r16: minus(s(x),s(y)) -> minus(x,y) r17: id(x) -> x r18: if(true(),x,y) -> x r19: if(false(),x,y) -> y r20: not(x) -> if(x,false(),true()) r21: and(x,false()) -> false() r22: and(true(),true()) -> true() r23: f(|0|()) -> true() r24: f(s(x)) -> h(x) r25: h(|0|()) -> false() r26: h(s(x)) -> f(x) r27: gt(s(x),|0|()) -> true() r28: gt(|0|(),y) -> false() r29: gt(s(x),s(y)) -> gt(x,y) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: p#(id(x),s(y)) -> p#(x,if(gt(s(y),y),y,s(y))) and R consists of: r1: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) r2: n(|0|(),y) -> |0|() r3: n(x,|0|()) -> |0|() r4: n(s(x),s(y)) -> s(n(x,y)) r5: m(|0|(),y) -> y r6: m(x,|0|()) -> x r7: m(s(x),s(y)) -> s(m(x,y)) r8: k(|0|(),s(y)) -> |0|() r9: k(s(x),s(y)) -> s(k(minus(x,y),s(y))) r10: t(x) -> p(x,x) r11: p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r12: p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) r13: p(|0|(),y) -> y r14: p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) r15: minus(x,|0|()) -> x r16: minus(s(x),s(y)) -> minus(x,y) r17: id(x) -> x r18: if(true(),x,y) -> x r19: if(false(),x,y) -> y r20: not(x) -> if(x,false(),true()) r21: and(x,false()) -> false() r22: and(true(),true()) -> true() r23: f(|0|()) -> true() r24: f(s(x)) -> h(x) r25: h(|0|()) -> false() r26: h(s(x)) -> f(x) r27: gt(s(x),|0|()) -> true() r28: gt(|0|(),y) -> false() r29: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r2, r3, 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: p#_A(x1,x2) = x1 id_A(x1) = x1 + 1 s_A(x1) = x1 + 2 if_A(x1,x2,x3) = x2 + 2 gt_A(x1,x2) = 5 n_A(x1,x2) = x1 + x2 + 1 |0|_A() = 1 k_A(x1,x2) = x1 p#!_A(x1,x2) = x1 + 11 id!_A(x1) = 10 s!_A(x1) = x1 + 9 if!_A(x1,x2,x3) = x1 + 2 gt!_A(x1,x2) = x2 + 7 n!_A(x1,x2) = x2 + 6 |0|!_A() = 5 k!_A(x1,x2) = 14 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: p#_A(x1,x2) = max{0, x1 - 22} id_A(x1) = x1 + 21 s_A(x1) = max{17, x1 - 986} if_A(x1,x2,x3) = max{5434, x1 - 987, x2 - 1452, x3 - 1469} gt_A(x1,x2) = max{1, x1 - 16, x2 - 465} n_A(x1,x2) = max{662, x1 - 358, x2 - 179} |0|_A = 6 k_A(x1,x2) = max{662, x1 + 178, x2 + 645} p#!_A(x1,x2) = 8 id!_A(x1) = max{0, x1 - 19} s!_A(x1) = 7 if!_A(x1,x2,x3) = max{983, x1 + 435, x2 - 40, x3 + 39} gt!_A(x1,x2) = max{1, x1 - 1, x2 - 18} n!_A(x1,x2) = max{x1 + 380, x2 - 7} |0|!_A = 5 k!_A(x1,x2) = max{350, x1 + 20, x2 - 984} partial status: pi(p#) = [1] pi(id) = [1] pi(s) = [1] pi(if) = [] pi(gt) = [] pi(n) = [] pi(|0|) = [] pi(k) = [] 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: gt#(s(x),s(y)) -> gt#(x,y) and R consists of: r1: g(s(x),s(y)) -> if(and(f(s(x)),f(s(y))),t(g(k(minus(m(x,y),n(x,y)),s(s(|0|()))),k(n(s(x),s(y)),s(s(|0|()))))),g(minus(m(x,y),n(x,y)),n(s(x),s(y)))) r2: n(|0|(),y) -> |0|() r3: n(x,|0|()) -> |0|() r4: n(s(x),s(y)) -> s(n(x,y)) r5: m(|0|(),y) -> y r6: m(x,|0|()) -> x r7: m(s(x),s(y)) -> s(m(x,y)) r8: k(|0|(),s(y)) -> |0|() r9: k(s(x),s(y)) -> s(k(minus(x,y),s(y))) r10: t(x) -> p(x,x) r11: p(s(x),s(y)) -> s(s(p(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r12: p(s(x),x) -> p(if(gt(x,x),id(x),id(x)),s(x)) r13: p(|0|(),y) -> y r14: p(id(x),s(y)) -> s(p(x,if(gt(s(y),y),y,s(y)))) r15: minus(x,|0|()) -> x r16: minus(s(x),s(y)) -> minus(x,y) r17: id(x) -> x r18: if(true(),x,y) -> x r19: if(false(),x,y) -> y r20: not(x) -> if(x,false(),true()) r21: and(x,false()) -> false() r22: and(true(),true()) -> true() r23: f(|0|()) -> true() r24: f(s(x)) -> h(x) r25: h(|0|()) -> false() r26: h(s(x)) -> f(x) r27: gt(s(x),|0|()) -> true() r28: gt(|0|(),y) -> false() r29: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r3 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: gt#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 8 n_A(x1,x2) = x2 + 1 |0|_A() = 4 gt#!_A(x1,x2) = x1 + 21 s!_A(x1) = x1 + 20 n!_A(x1,x2) = 22 |0|!_A() = 9 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: gt#_A(x1,x2) = max{0, x1 - 1, x2 - 1} s_A(x1) = max{2, x1} n_A(x1,x2) = max{38, x2 + 36} |0|_A = 26 gt#!_A(x1,x2) = x2 + 20 s!_A(x1) = 18 n!_A(x1,x2) = 0 |0|!_A = 18 partial status: pi(gt#) = [] pi(s) = [] pi(n) = [1, 2] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains.