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, r21, r22, r28 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: g#_A(x1,x2) = max{x1 + 68, x2 - 8} s_A(x1) = x1 + 139 minus_A(x1,x2) = x1 m_A(x1,x2) = max{x1 + 71, x2 + 1} n_A(x1,x2) = x1 + 5 k_A(x1,x2) = x1 + 61 |0|_A = 2 and_A(x1,x2) = max{2, x1 - 889, x2 - 889} false_A = 1 true_A = 1 gt_A(x1,x2) = max{1668, x1 + 277, x2 - 139} base order 2: 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 + 1 minus_A(x1,x2) = x1 m_A(x1,x2) = x1 + x2 + 1 n_A(x1,x2) = x1 + x2 + 1 k_A(x1,x2) = x1 + 2 |0|_A() = 1 and_A(x1,x2) = x2 false_A() = 2 true_A() = 4 gt_A(x1,x2) = x2 + 2 g#!_A(x1,x2) = x2 + 1 s!_A(x1) = 5 minus!_A(x1,x2) = 5 m!_A(x1,x2) = x1 + x2 + 4 n!_A(x1,x2) = x1 + x2 + 4 k!_A(x1,x2) = 7 |0|!_A() = 1 and!_A(x1,x2) = 6 false!_A() = 0 true!_A() = 0 gt!_A(x1,x2) = 4 partial status: pi(g#) = [] pi(s) = [1] pi(minus) = [1] pi(m) = [] pi(n) = [1] pi(k) = [] pi(|0|) = [] pi(and) = [] pi(false) = [] pi(true) = [] pi(gt) = [] 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 r2, r3, r13 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: f#_A(x1) = max{20, x1 - 20} s_A(x1) = max{62, x1 + 40} h#_A(x1) = max{41, x1 - 41} n_A(x1,x2) = x2 + 270 |0|_A = 63 p_A(x1,x2) = max{97, x1 + 29, x2} base order 2: 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 + 6 h#_A(x1) = x1 n_A(x1,x2) = x1 + x2 + 1 |0|_A() = 8 p_A(x1,x2) = x2 + 2 f#!_A(x1) = 14 s!_A(x1) = x1 + 12 h#!_A(x1) = 13 n!_A(x1,x2) = 11 |0|!_A() = 10 p!_A(x1,x2) = x1 + x2 + 1 partial status: pi(f#) = [] pi(s) = [] pi(h#) = [] pi(n) = [2] pi(|0|) = [] pi(p) = [2] 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, r23 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: k#_A(x1,x2) = max{0, x2 - 1} s_A(x1) = x1 + 51 minus_A(x1,x2) = max{49, x1, x2 + 48} n_A(x1,x2) = max{x1 + 45, x2 + 145} |0|_A = 52 f_A(x1) = max{14, x1 - 53} true_A = 13 base order 2: 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) = 0 s_A(x1) = x1 + 7 minus_A(x1,x2) = x1 + 6 n_A(x1,x2) = x2 |0|_A() = 1 f_A(x1) = 3 true_A() = 3 k#!_A(x1,x2) = x1 s!_A(x1) = 8 minus!_A(x1,x2) = 11 n!_A(x1,x2) = 7 |0|!_A() = 9 f!_A(x1) = 7 true!_A() = 0 partial status: pi(k#) = [] pi(s) = [] pi(minus) = [1, 2] pi(n) = [2] pi(|0|) = [] pi(f) = [] pi(true) = [] 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 r2, r3 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: minus#_A(x1,x2) = 1 s_A(x1) = x1 + 24 n_A(x1,x2) = max{171, x2 - 5} |0|_A = 44 base order 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 + x2 s_A(x1) = x1 + 4 n_A(x1,x2) = x1 + x2 + 3 |0|_A() = 2 minus#!_A(x1,x2) = x1 + x2 + 21 s!_A(x1) = x1 + 20 n!_A(x1,x2) = 22 |0|!_A() = 21 partial status: pi(minus#) = [] pi(s) = [] 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: 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 r2, r3 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: m#_A(x1,x2) = 1 s_A(x1) = 0 n_A(x1,x2) = max{50, x1 - 27} |0|_A = 49 base order 2: 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 + 1 n_A(x1,x2) = x1 + x2 + 1 |0|_A() = 3 m#!_A(x1,x2) = x1 + x2 + 9 s!_A(x1) = 8 n!_A(x1,x2) = 10 |0|!_A() = 9 partial status: pi(m#) = [] pi(s) = [] 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: 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 r2, r3, r13 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: n#_A(x1,x2) = x1 + 17 s_A(x1) = max{40, x1 + 16} n_A(x1,x2) = x2 + 294 |0|_A = 43 p_A(x1,x2) = max{140, x1 - 62, x2 + 102} base order 2: 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 + 2 n_A(x1,x2) = x1 + x2 + 3 |0|_A() = 6 p_A(x1,x2) = x2 + 3 n#!_A(x1,x2) = x1 + x2 + 6 s!_A(x1) = x1 + 5 n!_A(x1,x2) = 7 |0|!_A() = 7 p!_A(x1,x2) = x1 + x2 + 8 partial status: pi(n#) = [1] pi(s) = [] pi(n) = [2] pi(|0|) = [] pi(p) = [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: 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 r2, r3, r17, r18, r19, r20, r27, r28, r29 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: p#_A(x1,x2) = max{32, x1 + 3, x2 - 26} s_A(x1) = max{41, x1 + 30} if_A(x1,x2,x3) = max{25, x1 - 9, x2, x3} gt_A(x1,x2) = max{30, x1 - 74} not_A(x1) = max{40, x1 - 1} id_A(x1) = max{28, x1 + 21} n_A(x1,x2) = x2 + 104 |0|_A = 73 true_A = 7 false_A = 1 base order 2: 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) = x1 + 4 if_A(x1,x2,x3) = x2 + x3 + 1 gt_A(x1,x2) = x1 + 2 not_A(x1) = 10 id_A(x1) = x1 + 1 n_A(x1,x2) = x1 + x2 + 1 |0|_A() = 2 true_A() = 6 false_A() = 3 p#!_A(x1,x2) = x1 + 3 s!_A(x1) = 9 if!_A(x1,x2,x3) = 17 gt!_A(x1,x2) = x2 + 6 not!_A(x1) = 18 id!_A(x1) = 7 n!_A(x1,x2) = x1 + x2 + 17 |0|!_A() = 8 true!_A() = 0 false!_A() = 0 partial status: pi(p#) = [1] pi(s) = [] pi(if) = [2, 3] pi(gt) = [] pi(not) = [] pi(id) = [] pi(n) = [2] pi(|0|) = [] pi(true) = [] pi(false) = [] The following rules are removed: p1, p2, p3 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 r2, r3, r13 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: gt#_A(x1,x2) = max{x1 + 7, x2 - 35} s_A(x1) = max{34, x1 + 6} n_A(x1,x2) = max{x1 + 148, x2 + 154} |0|_A = 23 p_A(x1,x2) = max{36, x2 + 6} base order 2: 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 + 4 n_A(x1,x2) = x1 + x2 + 3 |0|_A() = 11 p_A(x1,x2) = x2 + 3 gt#!_A(x1,x2) = x1 + x2 + 41 s!_A(x1) = 40 n!_A(x1,x2) = 14 |0|!_A() = 14 p!_A(x1,x2) = x1 + 35 partial status: pi(gt#) = [1] pi(s) = [] pi(n) = [1, 2] pi(|0|) = [] pi(p) = [2] The following rules are removed: p1 Then no dependency pair remains.