YES We show the termination of the TRS R: a__first(|0|(),X) -> nil() a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) a__from(X) -> cons(mark(X),from(s(X))) mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) mark(from(X)) -> a__from(mark(X)) mark(|0|()) -> |0|() mark(nil()) -> nil() mark(s(X)) -> s(mark(X)) mark(cons(X1,X2)) -> cons(mark(X1),X2) a__first(X1,X2) -> first(X1,X2) a__from(X) -> from(X) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a__first#(s(X),cons(Y,Z)) -> mark#(Y) p2: a__from#(X) -> mark#(X) p3: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) p4: mark#(first(X1,X2)) -> mark#(X1) p5: mark#(first(X1,X2)) -> mark#(X2) p6: mark#(from(X)) -> a__from#(mark(X)) p7: mark#(from(X)) -> mark#(X) p8: mark#(s(X)) -> mark#(X) p9: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6, p7, p8, p9} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a__first#(s(X),cons(Y,Z)) -> mark#(Y) p2: mark#(cons(X1,X2)) -> mark#(X1) p3: mark#(s(X)) -> mark#(X) p4: mark#(from(X)) -> mark#(X) p5: mark#(from(X)) -> a__from#(mark(X)) p6: a__from#(X) -> mark#(X) p7: mark#(first(X1,X2)) -> mark#(X2) p8: mark#(first(X1,X2)) -> mark#(X1) p9: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11 Take the reduction pair: max/plus interpretations on natural numbers: a__first#_A(x1,x2) = max{9, x1 + 7, x2 + 6} s_A(x1) = x1 cons_A(x1,x2) = max{2, x1, x2 - 4} mark#_A(x1) = x1 + 6 from_A(x1) = max{4, x1} a__from#_A(x1) = x1 + 6 mark_A(x1) = x1 first_A(x1,x2) = max{x1 + 2, x2 + 3} a__first_A(x1,x2) = max{x1 + 2, x2 + 3} |0|_A = 1 nil_A = 2 a__from_A(x1) = max{4, x1} The next rules are strictly ordered: p7, p8 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a__first#(s(X),cons(Y,Z)) -> mark#(Y) p2: mark#(cons(X1,X2)) -> mark#(X1) p3: mark#(s(X)) -> mark#(X) p4: mark#(from(X)) -> mark#(X) p5: mark#(from(X)) -> a__from#(mark(X)) p6: a__from#(X) -> mark#(X) p7: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6, p7} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a__first#(s(X),cons(Y,Z)) -> mark#(Y) p2: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) p3: mark#(from(X)) -> a__from#(mark(X)) p4: a__from#(X) -> mark#(X) p5: mark#(from(X)) -> mark#(X) p6: mark#(s(X)) -> mark#(X) p7: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11 Take the reduction pair: max/plus interpretations on natural numbers: a__first#_A(x1,x2) = max{x1 + 2, x2 + 5} s_A(x1) = max{3, x1} cons_A(x1,x2) = max{4, x1 + 2, x2 - 3} mark#_A(x1) = max{1, x1 - 3} first_A(x1,x2) = max{x1 + 12, x2 + 16} mark_A(x1) = x1 + 7 from_A(x1) = max{11, x1 + 10} a__from#_A(x1) = max{1, x1} a__first_A(x1,x2) = max{x1 + 12, x2 + 16} |0|_A = 3 nil_A = 4 a__from_A(x1) = max{11, x1 + 10} The next rules are strictly ordered: p1, p5 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) p2: mark#(from(X)) -> a__from#(mark(X)) p3: a__from#(X) -> mark#(X) p4: mark#(s(X)) -> mark#(X) p5: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p2, p3, p4, p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(from(X)) -> a__from#(mark(X)) p2: a__from#(X) -> mark#(X) p3: mark#(cons(X1,X2)) -> mark#(X1) p4: mark#(s(X)) -> mark#(X) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11 Take the reduction pair: max/plus interpretations on natural numbers: mark#_A(x1) = max{1, x1 - 3} from_A(x1) = max{11, x1 + 10} a__from#_A(x1) = max{8, x1} mark_A(x1) = x1 + 7 cons_A(x1,x2) = max{4, x1 + 2, x2 - 3} s_A(x1) = max{3, x1} a__first_A(x1,x2) = max{x1 + 7, x2 + 7} |0|_A = 3 nil_A = 4 first_A(x1,x2) = max{x1 + 7, x2 + 7} a__from_A(x1) = max{11, x1 + 10} The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mark#(from(X)) -> a__from#(mark(X)) p2: mark#(cons(X1,X2)) -> mark#(X1) p3: mark#(s(X)) -> mark#(X) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(cons(X1,X2)) -> mark#(X1) p2: mark#(s(X)) -> mark#(X) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The set of usable rules consists of (no rules) Take the reduction pair: max/plus interpretations on natural numbers: mark#_A(x1) = max{0, x1 - 1} cons_A(x1,x2) = x1 + 1 s_A(x1) = x1 + 2 The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The set of usable rules consists of (no rules) Take the reduction pair: max/plus interpretations on natural numbers: mark#_A(x1) = x1 cons_A(x1,x2) = max{x1 + 1, x2 + 1} The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.