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, r23 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: g#_A(x1,x2) = 14 s_A(x1) = x1 + 13 minus_A(x1,x2) = x1 m_A(x1,x2) = x1 + x2 + 4 n_A(x1,x2) = x1 + x2 + 12 k_A(x1,x2) = x1 |0|_A() = 2 f_A(x1) = 14 true_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: g#_A(x1,x2) = 0 s_A(x1) = x1 + 117 minus_A(x1,x2) = x1 m_A(x1,x2) = max{x1 + 90, x2 + 1} n_A(x1,x2) = max{x1 + 15, x2 - 22} k_A(x1,x2) = x1 + 3 |0|_A = 14 f_A(x1) = max{43, x1 - 97} true_A = 16 g#!_A(x1,x2) = max{68, x1 - 29, x2 - 48} s!_A(x1) = 25 minus!_A(x1,x2) = x2 + 85 m!_A(x1,x2) = max{25, x1 - 93} n!_A(x1,x2) = max{24, x2 - 97} k!_A(x1,x2) = max{25, x1 - 133, x2 - 95} |0|!_A = 23 f!_A(x1) = max{1266, x1 - 72} true!_A = 16 partial status: pi(g#) = [] pi(s) = [] pi(minus) = [1] pi(m) = [1, 2] pi(n) = [1, 2] pi(k) = [1] pi(|0|) = [] pi(f) = [] pi(true) = [] 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: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: f#_A(x1) = x1 s_A(x1) = x1 + 40 h#_A(x1) = x1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: f#_A(x1) = max{0, x1 - 96} s_A(x1) = max{52, x1 + 43} h#_A(x1) = max{0, x1 - 53} f#!_A(x1) = max{1, x1 - 97} s!_A(x1) = 0 h#!_A(x1) = max{2, x1 - 53} partial status: pi(f#) = [] pi(s) = [] 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 r15, r16 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: k#_A(x1,x2) = x1 + x2 + 1 s_A(x1) = x1 + 7 minus_A(x1,x2) = x1 |0|_A() = 4 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: k#_A(x1,x2) = max{0, x1 - 63, x2 - 74} s_A(x1) = max{62, x1 + 51} minus_A(x1,x2) = max{52, x1 + 51, x2 - 650} |0|_A = 24 k#!_A(x1,x2) = max{21, x1 - 63, x2 - 64} s!_A(x1) = 21 minus!_A(x1,x2) = max{9, x2 - 52} |0|!_A = 22 partial status: pi(k#) = [2] pi(s) = [] pi(minus) = [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: 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: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: minus#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 7 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{0, x1 - 56, x2 - 56} s_A(x1) = x1 + 55 minus#!_A(x1,x2) = max{143, x1 - 56, x2 - 56} s!_A(x1) = max{142, x1 + 137} partial status: pi(minus#) = [2] 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 r2, r3 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: m#_A(x1,x2) = x1 + x2 + 9 s_A(x1) = x1 + 8 n_A(x1,x2) = x2 + 3 |0|_A() = 2 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: m#_A(x1,x2) = max{0, x1 - 10, x2 - 10} s_A(x1) = x1 + 9 n_A(x1,x2) = max{87, x1 + 78} |0|_A = 5 m#!_A(x1,x2) = max{1, x1 - 10, x2 - 77} s!_A(x1) = max{0, x1 - 78} n!_A(x1,x2) = max{x1 + 37, x2 - 6} |0|!_A = 39 partial status: pi(m#) = [2] 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 (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: n#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 7 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: n#_A(x1,x2) = max{0, x1 - 21, x2 - 21} s_A(x1) = x1 + 20 n#!_A(x1,x2) = max{5, x1 - 21, x2 - 21} s!_A(x1) = 4 partial status: pi(n#) = [2] 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: 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 r13, r17, r18, r19, r20, r23, r27, r28, r29 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: p#_A(x1,x2) = 3 s_A(x1) = 37 if_A(x1,x2,x3) = x2 + x3 + 5 gt_A(x1,x2) = 2 not_A(x1) = 8 id_A(x1) = x1 + 4 p_A(x1,x2) = x1 + x2 + 18 |0|_A() = 36 true_A() = 1 false_A() = 1 f_A(x1) = 2 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: p#_A(x1,x2) = 0 s_A(x1) = max{266, x1 + 257} if_A(x1,x2,x3) = max{x1 - 4, x2 + 112, x3} gt_A(x1,x2) = max{265, x1 - 508, x2 - 260} not_A(x1) = max{261, x1 - 4} id_A(x1) = x1 + 118 p_A(x1,x2) = max{18, x1 - 776, x2 + 8} |0|_A = 259 true_A = 1 false_A = 1 f_A(x1) = max{298, x1 - 267} p#!_A(x1,x2) = max{1, x1 - 231, x2 - 259} s!_A(x1) = max{295, x1 + 8} if!_A(x1,x2,x3) = max{2191, x1 + 388, x2 + 2188, x3 - 119} gt!_A(x1,x2) = max{297, x1 - 478, x2 - 267} not!_A(x1) = max{2190, x1 + 793} id!_A(x1) = max{296, x1 + 27} p!_A(x1,x2) = x1 + 28 |0|!_A = 92 true!_A = 91 false!_A = 91 f!_A(x1) = max{296, x1 - 525} partial status: pi(p#) = [] pi(s) = [] pi(if) = [2] pi(gt) = [] pi(not) = [] pi(id) = [1] pi(p) = [1, 2] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(f) = [] 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, r18, r19, r27, r28, r29 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: p#_A(x1,x2) = x1 + 8 id_A(x1) = x1 + 9 s_A(x1) = 7 if_A(x1,x2,x3) = x2 + x3 + 13 gt_A(x1,x2) = 2 n_A(x1,x2) = x1 + 15 |0|_A() = 2 true_A() = 1 false_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: p#_A(x1,x2) = max{0, x1 - 193, x2 - 172} id_A(x1) = x1 + 15 s_A(x1) = max{20, x1 + 16} if_A(x1,x2,x3) = max{171, x1 - 3, x2 + 15, x3} gt_A(x1,x2) = max{18, x1 - 22, x2 - 22} n_A(x1,x2) = max{16, x1 - 190, x2 - 37} |0|_A = 16 true_A = 18 false_A = 18 p#!_A(x1,x2) = max{175, x1 - 244, x2 + 4} id!_A(x1) = max{177, x1 - 245} s!_A(x1) = max{177, x1 + 16} if!_A(x1,x2,x3) = max{315, x2 + 161, x3 + 19} gt!_A(x1,x2) = max{176, x1 - 248, x2 - 229} n!_A(x1,x2) = max{315, x1 - 21, x2 - 21} |0|!_A = 18 true!_A = 17 false!_A = 17 partial status: pi(p#) = [1] pi(id) = [1] pi(s) = [] pi(if) = [2, 3] pi(gt) = [] pi(n) = [1] pi(|0|) = [] pi(true) = [] pi(false) = [] 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 (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: gt#_A(x1,x2) = x1 + x2 + 8 s_A(x1) = x1 + 7 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: gt#_A(x1,x2) = max{0, x1 - 17, x2 - 17} s_A(x1) = max{27, x1 + 16} gt#!_A(x1,x2) = max{21, x1 - 28, x2 - 28} s!_A(x1) = 20 partial status: pi(gt#) = [2] pi(s) = [] The following rules are removed: p1 Then no dependency pair remains.