YES We show the termination of the TRS R: is_empty(nil()) -> true() is_empty(cons(x,l)) -> false() hd(cons(x,l)) -> x tl(cons(x,l)) -> l append(l1,l2) -> ifappend(l1,l2,is_empty(l1)) ifappend(l1,l2,true()) -> l2 ifappend(l1,l2,false()) -> cons(hd(l1),append(tl(l1),l2)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: append#(l1,l2) -> ifappend#(l1,l2,is_empty(l1)) p2: append#(l1,l2) -> is_empty#(l1) p3: ifappend#(l1,l2,false()) -> hd#(l1) p4: ifappend#(l1,l2,false()) -> append#(tl(l1),l2) p5: ifappend#(l1,l2,false()) -> tl#(l1) and R consists of: r1: is_empty(nil()) -> true() r2: is_empty(cons(x,l)) -> false() r3: hd(cons(x,l)) -> x r4: tl(cons(x,l)) -> l r5: append(l1,l2) -> ifappend(l1,l2,is_empty(l1)) r6: ifappend(l1,l2,true()) -> l2 r7: ifappend(l1,l2,false()) -> cons(hd(l1),append(tl(l1),l2)) The estimated dependency graph contains the following SCCs: {p1, p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: append#(l1,l2) -> ifappend#(l1,l2,is_empty(l1)) p2: ifappend#(l1,l2,false()) -> append#(tl(l1),l2) and R consists of: r1: is_empty(nil()) -> true() r2: is_empty(cons(x,l)) -> false() r3: hd(cons(x,l)) -> x r4: tl(cons(x,l)) -> l r5: append(l1,l2) -> ifappend(l1,l2,is_empty(l1)) r6: ifappend(l1,l2,true()) -> l2 r7: ifappend(l1,l2,false()) -> cons(hd(l1),append(tl(l1),l2)) The set of usable rules consists of r1, r2, r4 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: append#_A(x1,x2) = max{0, x1 - 2, x2 - 8} ifappend#_A(x1,x2,x3) = max{0, x1 - 2, x2 - 8, x3 - 7} is_empty_A(x1) = x1 + 2 false_A = 5 tl_A(x1) = max{1, x1 - 1} nil_A = 0 true_A = 0 cons_A(x1,x2) = max{x1 - 3, x2 + 6} append#!_A(x1,x2) = x1 + 3 ifappend#!_A(x1,x2,x3) = max{x1 + 2, x3 - 1} is_empty!_A(x1) = x1 + 9 false!_A = 5 tl!_A(x1) = max{8, x1 - 16} nil!_A = 6 true!_A = 5 cons!_A(x1,x2) = max{6, x1 - 3, x2 - 1} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: append#_A(x1,x2) = max{0, x1 - 6, x2 - 3} ifappend#_A(x1,x2,x3) = max{0, x1 - 6, x2 - 3, x3 - 2} is_empty_A(x1) = max{0, x1 - 4} false_A = 0 tl_A(x1) = max{5, x1 - 1} nil_A = 0 true_A = 0 cons_A(x1,x2) = max{7, x1 - 1, x2 + 3} append#!_A(x1,x2) = max{0, x1 - 5} ifappend#!_A(x1,x2,x3) = max{0, x1 - 5, x3 - 6} is_empty!_A(x1) = max{0, x1 - 6} false!_A = 0 tl!_A(x1) = max{2, x1 - 6} nil!_A = 1 true!_A = 0 cons!_A(x1,x2) = max{2, x1 - 9, x2 - 3} partial status: pi(append#) = [] pi(ifappend#) = [] pi(is_empty) = [1] pi(false) = [] pi(tl) = [1] pi(nil) = [] pi(true) = [] pi(cons) = [1, 2] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ifappend#(l1,l2,false()) -> append#(tl(l1),l2) and R consists of: r1: is_empty(nil()) -> true() r2: is_empty(cons(x,l)) -> false() r3: hd(cons(x,l)) -> x r4: tl(cons(x,l)) -> l r5: append(l1,l2) -> ifappend(l1,l2,is_empty(l1)) r6: ifappend(l1,l2,true()) -> l2 r7: ifappend(l1,l2,false()) -> cons(hd(l1),append(tl(l1),l2)) The estimated dependency graph contains the following SCCs: (no SCCs)