YES We show the termination of the TRS R: app(app(map(),f),nil()) -> nil() app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) app(app(minus(),x),|0|()) -> x app(app(minus(),app(s(),x)),app(s(),y)) -> app(app(minus(),app(p(),app(s(),x))),app(p(),app(s(),y))) app(p(),app(s(),x)) -> x app(app(div(),|0|()),app(s(),y)) -> |0|() app(app(div(),app(s(),x)),app(s(),y)) -> app(s(),app(app(div(),app(app(minus(),x),app(id(),y))),app(s(),y))) app(id(),x) -> x app(id(),x) -> app(s(),app(s(),app(s(),x))) app(id(),app(p(),x)) -> app(id(),app(s(),app(id(),x))) Instead we prove termination of the uncurried system: app(cons_0(),y) -> cons_1(y) app(cons_1(x1),y) -> cons_2(x1,y) app(div_0(),y) -> div_1(y) app(div_1(x1),y) -> div_2(x1,y) app(id_0(),y) -> id_1(y) app(map_0(),y) -> map_1(y) app(map_1(x1),y) -> map_2(x1,y) app(minus_0(),y) -> minus_1(y) app(minus_1(x1),y) -> minus_2(x1,y) app(p_0(),y) -> p_1(y) app(s_0(),y) -> s_1(y) map_2(f,nil_0()) -> nil_0() map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) minus_2(x,|0|_0()) -> x minus_2(s_1(x),s_1(y)) -> minus_2(p_1(s_1(x)),p_1(s_1(y))) p_1(s_1(x)) -> x div_2(|0|_0(),s_1(y)) -> |0|_0() div_2(s_1(x),s_1(y)) -> s_1(div_2(minus_2(x,id_1(y)),s_1(y))) id_1(x) -> x id_1(x) -> s_1(s_1(s_1(x))) id_1(p_1(x)) -> id_1(s_1(id_1(x))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(div_1(x1),y) -> div_2#(x1,y) p2: app#(id_0(),y) -> id_1#(y) p3: app#(map_1(x1),y) -> map_2#(x1,y) p4: app#(minus_1(x1),y) -> minus_2#(x1,y) p5: app#(p_0(),y) -> p_1#(y) p6: map_2#(f,cons_2(x,xs)) -> app#(f,x) p7: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) p8: minus_2#(s_1(x),s_1(y)) -> minus_2#(p_1(s_1(x)),p_1(s_1(y))) p9: minus_2#(s_1(x),s_1(y)) -> p_1#(s_1(x)) p10: minus_2#(s_1(x),s_1(y)) -> p_1#(s_1(y)) p11: div_2#(s_1(x),s_1(y)) -> div_2#(minus_2(x,id_1(y)),s_1(y)) p12: div_2#(s_1(x),s_1(y)) -> minus_2#(x,id_1(y)) p13: div_2#(s_1(x),s_1(y)) -> id_1#(y) p14: id_1#(p_1(x)) -> id_1#(s_1(id_1(x))) p15: id_1#(p_1(x)) -> id_1#(x) and R consists of: r1: app(cons_0(),y) -> cons_1(y) r2: app(cons_1(x1),y) -> cons_2(x1,y) r3: app(div_0(),y) -> div_1(y) r4: app(div_1(x1),y) -> div_2(x1,y) r5: app(id_0(),y) -> id_1(y) r6: app(map_0(),y) -> map_1(y) r7: app(map_1(x1),y) -> map_2(x1,y) r8: app(minus_0(),y) -> minus_1(y) r9: app(minus_1(x1),y) -> minus_2(x1,y) r10: app(p_0(),y) -> p_1(y) r11: app(s_0(),y) -> s_1(y) r12: map_2(f,nil_0()) -> nil_0() r13: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r14: minus_2(x,|0|_0()) -> x r15: minus_2(s_1(x),s_1(y)) -> minus_2(p_1(s_1(x)),p_1(s_1(y))) r16: p_1(s_1(x)) -> x r17: div_2(|0|_0(),s_1(y)) -> |0|_0() r18: div_2(s_1(x),s_1(y)) -> s_1(div_2(minus_2(x,id_1(y)),s_1(y))) r19: id_1(x) -> x r20: id_1(x) -> s_1(s_1(s_1(x))) r21: id_1(p_1(x)) -> id_1(s_1(id_1(x))) The estimated dependency graph contains the following SCCs: {p3, p6, p7} {p11} {p15} {p8} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: map_2#(f,cons_2(x,xs)) -> app#(f,x) p2: app#(map_1(x1),y) -> map_2#(x1,y) p3: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) and R consists of: r1: app(cons_0(),y) -> cons_1(y) r2: app(cons_1(x1),y) -> cons_2(x1,y) r3: app(div_0(),y) -> div_1(y) r4: app(div_1(x1),y) -> div_2(x1,y) r5: app(id_0(),y) -> id_1(y) r6: app(map_0(),y) -> map_1(y) r7: app(map_1(x1),y) -> map_2(x1,y) r8: app(minus_0(),y) -> minus_1(y) r9: app(minus_1(x1),y) -> minus_2(x1,y) r10: app(p_0(),y) -> p_1(y) r11: app(s_0(),y) -> s_1(y) r12: map_2(f,nil_0()) -> nil_0() r13: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r14: minus_2(x,|0|_0()) -> x r15: minus_2(s_1(x),s_1(y)) -> minus_2(p_1(s_1(x)),p_1(s_1(y))) r16: p_1(s_1(x)) -> x r17: div_2(|0|_0(),s_1(y)) -> |0|_0() r18: div_2(s_1(x),s_1(y)) -> s_1(div_2(minus_2(x,id_1(y)),s_1(y))) r19: id_1(x) -> x r20: id_1(x) -> s_1(s_1(s_1(x))) r21: id_1(p_1(x)) -> id_1(s_1(id_1(x))) 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: map_2#_A(x1,x2) = max{0, x1 - 6, x2 - 6} cons_2_A(x1,x2) = max{5, x1 + 4, x2} app#_A(x1,x2) = max{0, x1 - 8, x2 - 2} map_1_A(x1) = max{7, x1 + 2} map_2#!_A(x1,x2) = max{3, x1 - 2, x2 - 6} cons_2!_A(x1,x2) = max{6, x1 + 2, x2 + 4} app#!_A(x1,x2) = max{3, x1 - 3, x2 - 5} map_1!_A(x1) = max{2, x1 - 76} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: map_2#_A(x1,x2) = max{0, x1 - 3, x2 - 35} cons_2_A(x1,x2) = max{x1 + 4, x2 + 34} app#_A(x1,x2) = max{0, x1 - 3, x2 - 31} map_1_A(x1) = x1 + 2 map_2#!_A(x1,x2) = max{4, x1 - 1, x2 - 35} cons_2!_A(x1,x2) = max{3, x1 - 35, x2 - 66} app#!_A(x1,x2) = max{4, x1 - 3, x2 - 35} map_1!_A(x1) = max{5, x1 - 2} partial status: pi(map_2#) = [2] pi(cons_2) = [1, 2] pi(app#) = [2] pi(map_1) = [1] 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: div_2#(s_1(x),s_1(y)) -> div_2#(minus_2(x,id_1(y)),s_1(y)) and R consists of: r1: app(cons_0(),y) -> cons_1(y) r2: app(cons_1(x1),y) -> cons_2(x1,y) r3: app(div_0(),y) -> div_1(y) r4: app(div_1(x1),y) -> div_2(x1,y) r5: app(id_0(),y) -> id_1(y) r6: app(map_0(),y) -> map_1(y) r7: app(map_1(x1),y) -> map_2(x1,y) r8: app(minus_0(),y) -> minus_1(y) r9: app(minus_1(x1),y) -> minus_2(x1,y) r10: app(p_0(),y) -> p_1(y) r11: app(s_0(),y) -> s_1(y) r12: map_2(f,nil_0()) -> nil_0() r13: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r14: minus_2(x,|0|_0()) -> x r15: minus_2(s_1(x),s_1(y)) -> minus_2(p_1(s_1(x)),p_1(s_1(y))) r16: p_1(s_1(x)) -> x r17: div_2(|0|_0(),s_1(y)) -> |0|_0() r18: div_2(s_1(x),s_1(y)) -> s_1(div_2(minus_2(x,id_1(y)),s_1(y))) r19: id_1(x) -> x r20: id_1(x) -> s_1(s_1(s_1(x))) r21: id_1(p_1(x)) -> id_1(s_1(id_1(x))) The set of usable rules consists of r14, 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: div_2#_A(x1,x2) = max{0, x1 - 11, x2 - 10} s_1_A(x1) = x1 + 6 minus_2_A(x1,x2) = max{8, x1} id_1_A(x1) = 0 |0|_0_A = 8 p_1_A(x1) = max{8, x1 - 6} div_2#!_A(x1,x2) = max{x1 + 2, x2 + 5} s_1!_A(x1) = max{9, x1 + 6} minus_2!_A(x1,x2) = 0 id_1!_A(x1) = max{13, x1} |0|_0!_A = 7 p_1!_A(x1) = 0 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: div_2#_A(x1,x2) = 0 s_1_A(x1) = max{14, x1 + 8} minus_2_A(x1,x2) = x1 + 9 id_1_A(x1) = max{29, x1 - 9} |0|_0_A = 13 p_1_A(x1) = max{11, x1 - 5} div_2#!_A(x1,x2) = 2 s_1!_A(x1) = max{39, x1 + 8} minus_2!_A(x1,x2) = max{3, x1 - 4} id_1!_A(x1) = max{38, x1 - 38} |0|_0!_A = 9 p_1!_A(x1) = 2 partial status: pi(div_2#) = [1] pi(s_1) = [1] pi(minus_2) = [1] pi(id_1) = [1] pi(|0|_0) = [] pi(p_1) = [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: id_1#(p_1(x)) -> id_1#(x) and R consists of: r1: app(cons_0(),y) -> cons_1(y) r2: app(cons_1(x1),y) -> cons_2(x1,y) r3: app(div_0(),y) -> div_1(y) r4: app(div_1(x1),y) -> div_2(x1,y) r5: app(id_0(),y) -> id_1(y) r6: app(map_0(),y) -> map_1(y) r7: app(map_1(x1),y) -> map_2(x1,y) r8: app(minus_0(),y) -> minus_1(y) r9: app(minus_1(x1),y) -> minus_2(x1,y) r10: app(p_0(),y) -> p_1(y) r11: app(s_0(),y) -> s_1(y) r12: map_2(f,nil_0()) -> nil_0() r13: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r14: minus_2(x,|0|_0()) -> x r15: minus_2(s_1(x),s_1(y)) -> minus_2(p_1(s_1(x)),p_1(s_1(y))) r16: p_1(s_1(x)) -> x r17: div_2(|0|_0(),s_1(y)) -> |0|_0() r18: div_2(s_1(x),s_1(y)) -> s_1(div_2(minus_2(x,id_1(y)),s_1(y))) r19: id_1(x) -> x r20: id_1(x) -> s_1(s_1(s_1(x))) r21: id_1(p_1(x)) -> id_1(s_1(id_1(x))) 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: id_1#_A(x1) = x1 p_1_A(x1) = max{8, x1 + 3} id_1#!_A(x1) = max{4, x1 - 81} p_1!_A(x1) = max{4, x1 - 80} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: id_1#_A(x1) = x1 p_1_A(x1) = max{5, x1 + 1} id_1#!_A(x1) = max{3, x1 - 63} p_1!_A(x1) = max{3, x1 - 62} partial status: pi(id_1#) = [1] pi(p_1) = [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: minus_2#(s_1(x),s_1(y)) -> minus_2#(p_1(s_1(x)),p_1(s_1(y))) and R consists of: r1: app(cons_0(),y) -> cons_1(y) r2: app(cons_1(x1),y) -> cons_2(x1,y) r3: app(div_0(),y) -> div_1(y) r4: app(div_1(x1),y) -> div_2(x1,y) r5: app(id_0(),y) -> id_1(y) r6: app(map_0(),y) -> map_1(y) r7: app(map_1(x1),y) -> map_2(x1,y) r8: app(minus_0(),y) -> minus_1(y) r9: app(minus_1(x1),y) -> minus_2(x1,y) r10: app(p_0(),y) -> p_1(y) r11: app(s_0(),y) -> s_1(y) r12: map_2(f,nil_0()) -> nil_0() r13: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r14: minus_2(x,|0|_0()) -> x r15: minus_2(s_1(x),s_1(y)) -> minus_2(p_1(s_1(x)),p_1(s_1(y))) r16: p_1(s_1(x)) -> x r17: div_2(|0|_0(),s_1(y)) -> |0|_0() r18: div_2(s_1(x),s_1(y)) -> s_1(div_2(minus_2(x,id_1(y)),s_1(y))) r19: id_1(x) -> x r20: id_1(x) -> s_1(s_1(s_1(x))) r21: id_1(p_1(x)) -> id_1(s_1(id_1(x))) The set of usable rules consists of 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: minus_2#_A(x1,x2) = max{0, x1 - 25, x2 - 10} s_1_A(x1) = x1 + 9 p_1_A(x1) = max{8, x1 - 5} minus_2#!_A(x1,x2) = x2 + 4 s_1!_A(x1) = 3 p_1!_A(x1) = 3 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus_2#_A(x1,x2) = max{0, x1 - 19, x2 - 13} s_1_A(x1) = x1 + 5 p_1_A(x1) = max{12, x1} minus_2#!_A(x1,x2) = 0 s_1!_A(x1) = 4 p_1!_A(x1) = max{0, x1 - 26} partial status: pi(minus_2#) = [1] pi(s_1) = [1] pi(p_1) = [1] The following rules are removed: p1 Then no dependency pair remains.