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, r13, r15, r16, r22, r23, r24, r25, r26, r27, r28 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: g#_A(x1,x2) = max{433, x1 + 284, x2 + 241} s_A(x1) = max{233, x1 + 193} minus_A(x1,x2) = max{2, x1} m_A(x1,x2) = max{106, x1 + 41, x2 + 66} n_A(x1,x2) = max{15, x1} k_A(x1,x2) = max{50, x1 + 42} |0|_A = 14 p_A(x1,x2) = max{x1 + 211, x2 + 203} and_A(x1,x2) = max{1034, x1 - 4, x2 - 4} true_A = 2 f_A(x1) = max{3, x1 - 234} h_A(x1) = max{2, x1 - 194} false_A = 1 gt_A(x1,x2) = x2 + 2013 base order 2: precedence: minus = m > g# > n = k = and = gt > s > |0| = h > f > p > true = false partial status: pi(g#) = [] pi(s) = [] pi(minus) = [1] pi(m) = [1] pi(n) = [1] pi(k) = [] pi(|0|) = [] pi(p) = [1] pi(and) = [] pi(true) = [] pi(f) = [] pi(h) = [] pi(false) = [] pi(gt) = [] The following rules are removed: p2 -- SCC decomposition. 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))) 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: g#(s(x),s(y)) -> g#(minus(m(x,y),n(x,y)),n(s(x),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, r4, r5, r6, r7, r15, r16, r22, r23, r25, r27, r28 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: g#_A(x1,x2) = max{76, x1 + 1, x2 - 7} s_A(x1) = max{95, x1 + 84} minus_A(x1,x2) = max{86, x1 + 3} m_A(x1,x2) = max{5, x1, x2} n_A(x1,x2) = max{6, x1} |0|_A = 5 and_A(x1,x2) = max{94, x1 - 1} true_A = 0 f_A(x1) = 0 h_A(x1) = max{0, x1 - 96} false_A = 0 gt_A(x1,x2) = max{0, x1 - 488, x2 - 171} base order 2: precedence: n > gt > g# = s = minus = m > |0| = and = h > f = false > true partial status: pi(g#) = [1] pi(s) = [] pi(minus) = [] pi(m) = [1, 2] pi(n) = [1] pi(|0|) = [] pi(and) = [] pi(true) = [] pi(f) = [] pi(h) = [] pi(false) = [] pi(gt) = [] 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: 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, r8, r21, r22, r23, r25, r27, r28 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: f#_A(x1) = x1 + 9 s_A(x1) = x1 + 11 h#_A(x1) = max{10, x1 - 1} n_A(x1,x2) = max{69, x1 - 42, x2 - 42} |0|_A = 0 k_A(x1,x2) = max{58, x1 - 13, x2 - 95} and_A(x1,x2) = max{3, x1 - 11, x2 - 7} false_A = 0 true_A = 0 f_A(x1) = 12 h_A(x1) = max{0, x1 - 12} gt_A(x1,x2) = max{143, x1 - 400, x2 - 12} base order 2: precedence: n = and > s = k > f# = |0| = f = h = gt > h# = false = true partial status: pi(f#) = [1] pi(s) = [1] pi(h#) = [] pi(n) = [] pi(|0|) = [] pi(k) = [] pi(and) = [] pi(false) = [] pi(true) = [] pi(f) = [] pi(h) = [] pi(gt) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(x)) -> h#(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 estimated dependency graph contains the following SCCs: (no SCCs) -- 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, r22, r23, r24, r25, r26, r27, r28 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: k#_A(x1,x2) = max{1, x1 - 74} s_A(x1) = max{148, x1 + 109} minus_A(x1,x2) = max{73, x1} |0|_A = 1148 and_A(x1,x2) = max{x1 - 2, x2 + 281} true_A = 147 f_A(x1) = x1 + 216 h_A(x1) = x1 + 108 false_A = 74 gt_A(x1,x2) = max{245, x1 - 129, x2 - 1149} base order 2: precedence: gt > |0| = and > k# = s > minus = h > f = false > true partial status: pi(k#) = [] pi(s) = [1] pi(minus) = [1] pi(|0|) = [] pi(and) = [] pi(true) = [] pi(f) = [] pi(h) = [1] pi(false) = [] pi(gt) = [] 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, r8, r22, r23, r24, r25, r26, r27, r28 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{41, x1 + 39} s_A(x1) = max{55, x1 + 40} n_A(x1,x2) = max{3, x1 - 65, x2 - 56} |0|_A = 2 k_A(x1,x2) = max{54, x1 - 82, x2 - 229} and_A(x1,x2) = max{19, x1 - 62, x2 - 42} true_A = 1 f_A(x1) = max{41, x1 - 56} h_A(x1) = max{41, x1 - 96} false_A = 1 gt_A(x1,x2) = max{18, x1 - 756, x2 - 386} base order 2: precedence: k > n = and > minus# = s = gt > |0| = f = h > true = false partial status: pi(minus#) = [1] pi(s) = [1] pi(n) = [] pi(|0|) = [] pi(k) = [] pi(and) = [] pi(true) = [] pi(f) = [] pi(h) = [] pi(false) = [] pi(gt) = [] 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 r22, r23, r24, r25, r26, r27, r28 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: m#_A(x1,x2) = max{63, x1 + 1, x2 - 1} s_A(x1) = max{74, x1 + 65} and_A(x1,x2) = max{69, x1 - 659, x2 - 75} true_A = 66 f_A(x1) = max{67, x1 - 727} |0|_A = 186 h_A(x1) = max{67, x1 - 792} false_A = 66 gt_A(x1,x2) = max{68, x1 - 187, x2 - 187} base order 2: precedence: |0| > m# = and > s > f = h = gt > true = false partial status: pi(m#) = [1] pi(s) = [] pi(and) = [] pi(true) = [] pi(f) = [] pi(|0|) = [] pi(h) = [] pi(false) = [] pi(gt) = [] 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, r8, r22, r23, r24, r25, r26, r27, r28 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: n#_A(x1,x2) = max{30, x1 + 1, x2 - 1} s_A(x1) = max{40, x1 + 32} n_A(x1,x2) = max{6, x1 - 55, x2 - 33} |0|_A = 0 k_A(x1,x2) = max{248, x1 - 51, x2 - 73} and_A(x1,x2) = max{402, x1 - 8, x2 - 217} true_A = 0 f_A(x1) = max{0, x1 - 398} h_A(x1) = max{0, x1 - 430} false_A = 0 gt_A(x1,x2) = max{35, x1 - 41, x2 - 374} base order 2: precedence: k > n# = n = and > s = gt > |0| = f = h > true = false partial status: pi(n#) = [1] pi(s) = [1] pi(n) = [] pi(|0|) = [] pi(k) = [] pi(and) = [] pi(true) = [] pi(f) = [] pi(h) = [] pi(false) = [] pi(gt) = [] 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, r21, r22, r23, r24, r25, r26, r27, r28, r29 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: p#_A(x1,x2) = max{121, x1 + 77, x2 + 59} s_A(x1) = x1 + 62 if_A(x1,x2,x3) = max{52, x2 + 48, x3} gt_A(x1,x2) = max{0, x2 - 124} not_A(x1) = x1 + 45 id_A(x1) = x1 n_A(x1,x2) = max{15, x1 - 435, x2 - 155} |0|_A = 14 true_A = 0 false_A = 0 and_A(x1,x2) = max{63, x1 - 47, x2 - 64} f_A(x1) = max{46, x1 - 63} h_A(x1) = max{44, x1 - 15} base order 2: precedence: p# > if = gt > not = id > and > s = n > h > |0| = f > true = false partial status: pi(p#) = [] pi(s) = [1] pi(if) = [3] pi(gt) = [] pi(not) = [] pi(id) = [1] pi(n) = [] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(and) = [] pi(f) = [] pi(h) = [] The following rules are removed: p3 -- SCC decomposition. 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))) 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, p2} -- 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))) 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, r15, r16, r17, r18, r19, r20, r22, r25, r27, r28, r29 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: p#_A(x1,x2) = max{39, x1 - 48, x2 - 126} s_A(x1) = x1 + 252 if_A(x1,x2,x3) = max{164, x1 - 935, x2 + 152, x3} gt_A(x1,x2) = max{x1 - 484, x2 + 581} not_A(x1) = max{1188, x1 + 481} id_A(x1) = max{102, x1 + 88} n_A(x1,x2) = max{484, x1 - 488, x2 - 491} |0|_A = 483 k_A(x1,x2) = max{486, x1 - 742, x2 - 743} minus_A(x1,x2) = max{x1 + 253, x2 - 485} true_A = 482 false_A = 2 and_A(x1,x2) = max{484, x1 - 238, x2 - 3} h_A(x1) = max{1, x1 - 240} base order 2: precedence: not > if > gt > p# = minus = and > k > s = id = n > |0| = h > true = false partial status: pi(p#) = [] pi(s) = [1] pi(if) = [3] pi(gt) = [] pi(not) = [] pi(id) = [] pi(n) = [] pi(|0|) = [] pi(k) = [] pi(minus) = [1] pi(true) = [] pi(false) = [] pi(and) = [] pi(h) = [] The following rules are removed: p1 -- 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, r21, r22, r23, r25, r27, r28 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: p#_A(x1,x2) = max{6, x1 + 2} id_A(x1) = x1 + 7 s_A(x1) = max{0, x1 - 23} if_A(x1,x2,x3) = max{14, x1 - 44, x2 - 91, x3 - 17} gt_A(x1,x2) = max{10, x1 - 2, x2 - 25} n_A(x1,x2) = max{15, x1 - 2, x2 - 2} |0|_A = 1 k_A(x1,x2) = max{19, x1 - 44, x2 - 5} and_A(x1,x2) = max{22, x1 - 139, x2 - 24} false_A = 0 true_A = 0 f_A(x1) = max{0, x1 - 23} h_A(x1) = max{0, x1 - 23} base order 2: precedence: gt = n > p# = s = k = and > if = |0| = f = h > id = false = true partial status: pi(p#) = [1] pi(id) = [1] pi(s) = [] pi(if) = [] pi(gt) = [] pi(n) = [] pi(|0|) = [] pi(k) = [] pi(and) = [] pi(false) = [] pi(true) = [] pi(f) = [] pi(h) = [] 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 r22, r23, r24, r25, r26, r27, r28 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: gt#_A(x1,x2) = max{x1 + 93, x2 - 1} s_A(x1) = max{164, x1 + 94} and_A(x1,x2) = max{16, x1 - 96, x2 - 555} true_A = 15 f_A(x1) = max{95, x1 - 872} |0|_A = 297 h_A(x1) = max{95, x1 - 966} false_A = 0 gt_A(x1,x2) = max{16, x1 - 298, x2 - 298} base order 2: precedence: and > gt# = s = gt > f = |0| = h > true = false partial status: pi(gt#) = [1] pi(s) = [1] pi(and) = [] pi(true) = [] pi(f) = [] pi(|0|) = [] pi(h) = [] pi(false) = [] pi(gt) = [] The following rules are removed: p1 Then no dependency pair remains.