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!): max/plus interpretation on natural numbers: g#_A(x1,x2) = 0 s_A(x1) = x1 + 41 minus_A(x1,x2) = x1 m_A(x1,x2) = max{x1 + 4, x2 + 21} n_A(x1,x2) = max{x1 + 7, x2 - 17} k_A(x1,x2) = x1 + 5 |0|_A = 7 g#!_A(x1,x2) = max{1, x1 - 39, x2 - 53} s!_A(x1) = 208 minus!_A(x1,x2) = 2 m!_A(x1,x2) = max{442, x1 - 42} n!_A(x1,x2) = max{x1 + 400, x2 + 182} k!_A(x1,x2) = max{432, x1 + 392} |0|!_A = 207 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: g#_A(x1,x2) = 0 s_A(x1) = max{50, x1} minus_A(x1,x2) = max{243, x1, x2 - 17} m_A(x1,x2) = max{x1 + 243, x2} n_A(x1,x2) = max{191, x1 - 64} k_A(x1,x2) = x2 |0|_A = 1 g#!_A(x1,x2) = x2 + 48 s!_A(x1) = x1 + 115 minus!_A(x1,x2) = max{0, x2 - 192} m!_A(x1,x2) = max{358, x1 - 51} n!_A(x1,x2) = max{306, x1 + 114, x2 + 116} k!_A(x1,x2) = max{309, x1 + 16, x2 - 51} |0|!_A = 305 partial status: pi(g#) = [] pi(s) = [1] pi(minus) = [1] pi(m) = [1, 2] pi(n) = [2] 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!): max/plus interpretation on natural numbers: f#_A(x1) = max{0, x1 - 6} s_A(x1) = x1 + 5 h#_A(x1) = max{0, x1 - 6} f#!_A(x1) = max{2, x1 - 6} s!_A(x1) = 0 h#!_A(x1) = max{1, x1 - 2} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: f#_A(x1) = max{0, x1 - 17} s_A(x1) = x1 + 16 h#_A(x1) = max{0, x1 - 17} f#!_A(x1) = max{1, x1 - 29} s!_A(x1) = max{0, x1 - 1600} h#!_A(x1) = max{2, x1 - 14} 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 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!): max/plus interpretation on natural numbers: k#_A(x1,x2) = max{0, x1 - 392, x2 - 28} s_A(x1) = max{26, x1 + 24} minus_A(x1,x2) = max{391, x1 + 24, x2 - 151} |0|_A = 30 k#!_A(x1,x2) = max{0, x1 - 1802, x2 - 49} s!_A(x1) = max{32, x1 + 1} minus!_A(x1,x2) = max{0, x1 - 1779} |0|!_A = 3 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: k#_A(x1,x2) = max{0, x1 - 1366, x2 - 245} s_A(x1) = max{243, x1 + 227} minus_A(x1,x2) = max{1365, x1 + 227, x2 - 3149} |0|_A = 9 k#!_A(x1,x2) = max{7, x1 - 1584, x2 - 463} s!_A(x1) = max{5, x1 - 237} minus!_A(x1,x2) = max{6, x1 - 4753, x2 - 244} |0|!_A = 2 partial status: pi(k#) = [1] pi(s) = [1] 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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{0, x1 - 8, x2 - 8} s_A(x1) = x1 + 7 minus#!_A(x1,x2) = max{1, x1 - 8, x2 - 8} s!_A(x1) = 0 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{0, x1 - 73, x2 - 73} s_A(x1) = x1 + 72 minus#!_A(x1,x2) = max{1, x1 - 73, x2 - 73} s!_A(x1) = max{0, x1 - 3218} partial status: pi(minus#) = [2] 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: 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 (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: m#_A(x1,x2) = max{0, x1 - 1, x2 - 1} s_A(x1) = x1 m#!_A(x1,x2) = 0 s!_A(x1) = 0 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: m#_A(x1,x2) = max{0, x1 - 50, x2 - 50} s_A(x1) = x1 + 49 m#!_A(x1,x2) = max{10, x1 - 50, x2 - 1} s!_A(x1) = max{144, x1 + 142} partial status: pi(m#) = [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: 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!): max/plus interpretation on natural numbers: n#_A(x1,x2) = max{0, x1 - 1, x2 - 1} s_A(x1) = x1 n#!_A(x1,x2) = max{1, x1 - 1, x2 - 1} s!_A(x1) = 5 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: n#_A(x1,x2) = max{0, x1 - 11, x2 - 11} s_A(x1) = x1 + 10 n#!_A(x1,x2) = max{x1 - 11, x2 + 25} s!_A(x1) = x1 + 24 partial status: pi(n#) = [] 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, 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!): max/plus interpretation on natural numbers: p#_A(x1,x2) = 0 s_A(x1) = max{75, x1 + 13} if_A(x1,x2,x3) = max{x1 - 13, x2 + 13, x3} gt_A(x1,x2) = max{26, x1 - 229, x2 - 14} not_A(x1) = max{26, x1 - 13} id_A(x1) = max{4, x1} true_A = 1 false_A = 1 |0|_A = 10 p#!_A(x1,x2) = 3 s!_A(x1) = 5 if!_A(x1,x2,x3) = max{x1 - 88, x2 + 481, x3 - 2} gt!_A(x1,x2) = max{6, x1 - 76, x2 - 14} not!_A(x1) = max{483, x1 - 27} id!_A(x1) = max{2, x1 - 7} true!_A = 1 false!_A = 0 |0|!_A = 4 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: p#_A(x1,x2) = max{0, x1 - 9, x2 - 10} s_A(x1) = x1 + 11 if_A(x1,x2,x3) = max{8, x1 - 66, x2 + 3, x3} gt_A(x1,x2) = max{43, x2 - 23} not_A(x1) = max{43, x1 - 66} id_A(x1) = x1 + 3 true_A = 43 false_A = 1 |0|_A = 65 p#!_A(x1,x2) = max{x1 + 96, x2 + 96} s!_A(x1) = 101 if!_A(x1,x2,x3) = max{73, x1 - 76, x2 - 108, x3 - 102} gt!_A(x1,x2) = max{109, x1 - 66, x2 - 66} not!_A(x1) = max{100, x1 + 30} id!_A(x1) = max{108, x1 - 112} true!_A = 31 false!_A = 31 |0|!_A = 103 partial status: pi(p#) = [] pi(s) = [1] pi(if) = [1, 2, 3] pi(gt) = [2] pi(not) = [1] pi(id) = [1] pi(true) = [] pi(false) = [] pi(|0|) = [] 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))) p2: 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 estimated dependency graph contains the following SCCs: {p1, p2} -- 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))) p2: 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, 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!): max/plus interpretation on natural numbers: p#_A(x1,x2) = max{0, x1 - 50} id_A(x1) = max{36, x1} s_A(x1) = x1 + 17 if_A(x1,x2,x3) = max{20, x1 - 34, x2 + 13, x3 + 9} gt_A(x1,x2) = max{34, x1 - 98, x2 - 88} true_A = 0 false_A = 34 |0|_A = 12 p#!_A(x1,x2) = max{0, x1 - 50} id!_A(x1) = max{0, x1 - 48} s!_A(x1) = x1 + 206 if!_A(x1,x2,x3) = max{0, x2 - 33} gt!_A(x1,x2) = max{225, x1 - 18, x2 - 18} true!_A = 3 false!_A = 0 |0|!_A = 4 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: p#_A(x1,x2) = max{0, x1 - 84, x2 - 85} id_A(x1) = max{9, x1} s_A(x1) = max{83, x1 + 22} if_A(x1,x2,x3) = max{18, x1 - 1, x2 + 9, x3} gt_A(x1,x2) = max{23, x1 - 84, x2 - 84} true_A = 11 false_A = 2 |0|_A = 61 p#!_A(x1,x2) = 1 id!_A(x1) = x1 + 84 s!_A(x1) = 0 if!_A(x1,x2,x3) = max{4, x1 - 404, x2 - 7, x3 - 314} gt!_A(x1,x2) = max{63, x1 - 84, x2 - 84} true!_A = 0 false!_A = 0 |0|!_A = 6 partial status: pi(p#) = [1] pi(id) = [1] pi(s) = [1] pi(if) = [2, 3] pi(gt) = [2] pi(true) = [] pi(false) = [] 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: 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 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: gt#_A(x1,x2) = max{0, x1 - 17, x2 - 17} s_A(x1) = max{112, x1 + 16} n_A(x1,x2) = max{197, x1 - 214, x2 - 214} |0|_A = 117 gt#!_A(x1,x2) = max{7, x1 - 104, x2 - 113} s!_A(x1) = 6 n!_A(x1,x2) = max{8, x1 - 1095, x2 - 702} |0|!_A = 7 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{9, x1} n_A(x1,x2) = max{165, x1 - 10, x2 - 10} |0|_A = 9 gt#!_A(x1,x2) = max{1, x1 - 10, x2 - 10} s!_A(x1) = max{112, x1 - 54} n!_A(x1,x2) = max{112, x1 - 53, x2 - 53} |0|!_A = 112 partial status: pi(gt#) = [] pi(s) = [] pi(n) = [1, 2] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains.