YES We show the termination of the TRS R: empty(nil()) -> true() empty(cons(x,y)) -> false() tail(nil()) -> nil() tail(cons(x,y)) -> y head(cons(x,y)) -> x zero(|0|()) -> true() zero(s(x)) -> false() p(|0|()) -> |0|() p(s(|0|())) -> |0|() p(s(s(x))) -> s(p(s(x))) intlist(x) -> if_intlist(empty(x),x) if_intlist(true(),x) -> nil() if_intlist(false(),x) -> cons(s(head(x)),intlist(tail(x))) int(x,y) -> if_int(zero(x),zero(y),x,y) if_int(true(),b,x,y) -> if1(b,x,y) if_int(false(),b,x,y) -> if2(b,x,y) if1(true(),x,y) -> cons(|0|(),nil()) if1(false(),x,y) -> cons(|0|(),int(s(|0|()),y)) if2(true(),x,y) -> nil() if2(false(),x,y) -> intlist(int(p(x),p(y))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: p#(s(s(x))) -> p#(s(x)) p2: intlist#(x) -> if_intlist#(empty(x),x) p3: intlist#(x) -> empty#(x) p4: if_intlist#(false(),x) -> head#(x) p5: if_intlist#(false(),x) -> intlist#(tail(x)) p6: if_intlist#(false(),x) -> tail#(x) p7: int#(x,y) -> if_int#(zero(x),zero(y),x,y) p8: int#(x,y) -> zero#(x) p9: int#(x,y) -> zero#(y) p10: if_int#(true(),b,x,y) -> if1#(b,x,y) p11: if_int#(false(),b,x,y) -> if2#(b,x,y) p12: if1#(false(),x,y) -> int#(s(|0|()),y) p13: if2#(false(),x,y) -> intlist#(int(p(x),p(y))) p14: if2#(false(),x,y) -> int#(p(x),p(y)) p15: if2#(false(),x,y) -> p#(x) p16: if2#(false(),x,y) -> p#(y) and R consists of: r1: empty(nil()) -> true() r2: empty(cons(x,y)) -> false() r3: tail(nil()) -> nil() r4: tail(cons(x,y)) -> y r5: head(cons(x,y)) -> x r6: zero(|0|()) -> true() r7: zero(s(x)) -> false() r8: p(|0|()) -> |0|() r9: p(s(|0|())) -> |0|() r10: p(s(s(x))) -> s(p(s(x))) r11: intlist(x) -> if_intlist(empty(x),x) r12: if_intlist(true(),x) -> nil() r13: if_intlist(false(),x) -> cons(s(head(x)),intlist(tail(x))) r14: int(x,y) -> if_int(zero(x),zero(y),x,y) r15: if_int(true(),b,x,y) -> if1(b,x,y) r16: if_int(false(),b,x,y) -> if2(b,x,y) r17: if1(true(),x,y) -> cons(|0|(),nil()) r18: if1(false(),x,y) -> cons(|0|(),int(s(|0|()),y)) r19: if2(true(),x,y) -> nil() r20: if2(false(),x,y) -> intlist(int(p(x),p(y))) The estimated dependency graph contains the following SCCs: {p7, p10, p11, p12, p14} {p1} {p2, p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if_int#(false(),b,x,y) -> if2#(b,x,y) p2: if2#(false(),x,y) -> int#(p(x),p(y)) p3: int#(x,y) -> if_int#(zero(x),zero(y),x,y) p4: if_int#(true(),b,x,y) -> if1#(b,x,y) p5: if1#(false(),x,y) -> int#(s(|0|()),y) and R consists of: r1: empty(nil()) -> true() r2: empty(cons(x,y)) -> false() r3: tail(nil()) -> nil() r4: tail(cons(x,y)) -> y r5: head(cons(x,y)) -> x r6: zero(|0|()) -> true() r7: zero(s(x)) -> false() r8: p(|0|()) -> |0|() r9: p(s(|0|())) -> |0|() r10: p(s(s(x))) -> s(p(s(x))) r11: intlist(x) -> if_intlist(empty(x),x) r12: if_intlist(true(),x) -> nil() r13: if_intlist(false(),x) -> cons(s(head(x)),intlist(tail(x))) r14: int(x,y) -> if_int(zero(x),zero(y),x,y) r15: if_int(true(),b,x,y) -> if1(b,x,y) r16: if_int(false(),b,x,y) -> if2(b,x,y) r17: if1(true(),x,y) -> cons(|0|(),nil()) r18: if1(false(),x,y) -> cons(|0|(),int(s(|0|()),y)) r19: if2(true(),x,y) -> nil() r20: if2(false(),x,y) -> intlist(int(p(x),p(y))) The set of usable rules consists of r6, r7, r8, r9, r10 Take the reduction pair: max/plus interpretations on natural numbers: if_int#_A(x1,x2,x3,x4) = max{x1 + 1, x2 + 7, x3 + 2, x4 + 9} false_A = 10 if2#_A(x1,x2,x3) = max{10, x1 + 7, x2 + 1, x3 + 9} int#_A(x1,x2) = max{x1 + 3, x2 + 9} p_A(x1) = max{0, x1 - 3} zero_A(x1) = x1 + 1 true_A = 1 if1#_A(x1,x2,x3) = max{x1 + 6, x2 + 1, x3 + 9} s_A(x1) = x1 + 9 |0|_A = 0 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: if_int#(false(),b,x,y) -> if2#(b,x,y) p2: int#(x,y) -> if_int#(zero(x),zero(y),x,y) p3: if_int#(true(),b,x,y) -> if1#(b,x,y) p4: if1#(false(),x,y) -> int#(s(|0|()),y) and R consists of: r1: empty(nil()) -> true() r2: empty(cons(x,y)) -> false() r3: tail(nil()) -> nil() r4: tail(cons(x,y)) -> y r5: head(cons(x,y)) -> x r6: zero(|0|()) -> true() r7: zero(s(x)) -> false() r8: p(|0|()) -> |0|() r9: p(s(|0|())) -> |0|() r10: p(s(s(x))) -> s(p(s(x))) r11: intlist(x) -> if_intlist(empty(x),x) r12: if_intlist(true(),x) -> nil() r13: if_intlist(false(),x) -> cons(s(head(x)),intlist(tail(x))) r14: int(x,y) -> if_int(zero(x),zero(y),x,y) r15: if_int(true(),b,x,y) -> if1(b,x,y) r16: if_int(false(),b,x,y) -> if2(b,x,y) r17: if1(true(),x,y) -> cons(|0|(),nil()) r18: if1(false(),x,y) -> cons(|0|(),int(s(|0|()),y)) r19: if2(true(),x,y) -> nil() r20: if2(false(),x,y) -> intlist(int(p(x),p(y))) The estimated dependency graph contains the following SCCs: {p2, p3, p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: int#(x,y) -> if_int#(zero(x),zero(y),x,y) p2: if_int#(true(),b,x,y) -> if1#(b,x,y) p3: if1#(false(),x,y) -> int#(s(|0|()),y) and R consists of: r1: empty(nil()) -> true() r2: empty(cons(x,y)) -> false() r3: tail(nil()) -> nil() r4: tail(cons(x,y)) -> y r5: head(cons(x,y)) -> x r6: zero(|0|()) -> true() r7: zero(s(x)) -> false() r8: p(|0|()) -> |0|() r9: p(s(|0|())) -> |0|() r10: p(s(s(x))) -> s(p(s(x))) r11: intlist(x) -> if_intlist(empty(x),x) r12: if_intlist(true(),x) -> nil() r13: if_intlist(false(),x) -> cons(s(head(x)),intlist(tail(x))) r14: int(x,y) -> if_int(zero(x),zero(y),x,y) r15: if_int(true(),b,x,y) -> if1(b,x,y) r16: if_int(false(),b,x,y) -> if2(b,x,y) r17: if1(true(),x,y) -> cons(|0|(),nil()) r18: if1(false(),x,y) -> cons(|0|(),int(s(|0|()),y)) r19: if2(true(),x,y) -> nil() r20: if2(false(),x,y) -> intlist(int(p(x),p(y))) The set of usable rules consists of r6, r7 Take the reduction pair: max/plus interpretations on natural numbers: int#_A(x1,x2) = x1 + 5 if_int#_A(x1,x2,x3,x4) = max{x1 - 1, x3 + 1} zero_A(x1) = x1 + 5 true_A = 7 if1#_A(x1,x2,x3) = 6 false_A = 1 s_A(x1) = max{0, x1 - 4} |0|_A = 2 The next rules are strictly ordered: p1, p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: if_int#(true(),b,x,y) -> if1#(b,x,y) and R consists of: r1: empty(nil()) -> true() r2: empty(cons(x,y)) -> false() r3: tail(nil()) -> nil() r4: tail(cons(x,y)) -> y r5: head(cons(x,y)) -> x r6: zero(|0|()) -> true() r7: zero(s(x)) -> false() r8: p(|0|()) -> |0|() r9: p(s(|0|())) -> |0|() r10: p(s(s(x))) -> s(p(s(x))) r11: intlist(x) -> if_intlist(empty(x),x) r12: if_intlist(true(),x) -> nil() r13: if_intlist(false(),x) -> cons(s(head(x)),intlist(tail(x))) r14: int(x,y) -> if_int(zero(x),zero(y),x,y) r15: if_int(true(),b,x,y) -> if1(b,x,y) r16: if_int(false(),b,x,y) -> if2(b,x,y) r17: if1(true(),x,y) -> cons(|0|(),nil()) r18: if1(false(),x,y) -> cons(|0|(),int(s(|0|()),y)) r19: if2(true(),x,y) -> nil() r20: if2(false(),x,y) -> intlist(int(p(x),p(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: p#(s(s(x))) -> p#(s(x)) and R consists of: r1: empty(nil()) -> true() r2: empty(cons(x,y)) -> false() r3: tail(nil()) -> nil() r4: tail(cons(x,y)) -> y r5: head(cons(x,y)) -> x r6: zero(|0|()) -> true() r7: zero(s(x)) -> false() r8: p(|0|()) -> |0|() r9: p(s(|0|())) -> |0|() r10: p(s(s(x))) -> s(p(s(x))) r11: intlist(x) -> if_intlist(empty(x),x) r12: if_intlist(true(),x) -> nil() r13: if_intlist(false(),x) -> cons(s(head(x)),intlist(tail(x))) r14: int(x,y) -> if_int(zero(x),zero(y),x,y) r15: if_int(true(),b,x,y) -> if1(b,x,y) r16: if_int(false(),b,x,y) -> if2(b,x,y) r17: if1(true(),x,y) -> cons(|0|(),nil()) r18: if1(false(),x,y) -> cons(|0|(),int(s(|0|()),y)) r19: if2(true(),x,y) -> nil() r20: if2(false(),x,y) -> intlist(int(p(x),p(y))) The set of usable rules consists of (no rules) Take the reduction pair: max/plus interpretations on natural numbers: p#_A(x1) = max{0, x1 - 1} s_A(x1) = x1 + 2 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: intlist#(x) -> if_intlist#(empty(x),x) p2: if_intlist#(false(),x) -> intlist#(tail(x)) and R consists of: r1: empty(nil()) -> true() r2: empty(cons(x,y)) -> false() r3: tail(nil()) -> nil() r4: tail(cons(x,y)) -> y r5: head(cons(x,y)) -> x r6: zero(|0|()) -> true() r7: zero(s(x)) -> false() r8: p(|0|()) -> |0|() r9: p(s(|0|())) -> |0|() r10: p(s(s(x))) -> s(p(s(x))) r11: intlist(x) -> if_intlist(empty(x),x) r12: if_intlist(true(),x) -> nil() r13: if_intlist(false(),x) -> cons(s(head(x)),intlist(tail(x))) r14: int(x,y) -> if_int(zero(x),zero(y),x,y) r15: if_int(true(),b,x,y) -> if1(b,x,y) r16: if_int(false(),b,x,y) -> if2(b,x,y) r17: if1(true(),x,y) -> cons(|0|(),nil()) r18: if1(false(),x,y) -> cons(|0|(),int(s(|0|()),y)) r19: if2(true(),x,y) -> nil() r20: if2(false(),x,y) -> intlist(int(p(x),p(y))) The set of usable rules consists of r1, r2, r3, r4 Take the reduction pair: max/plus interpretations on natural numbers: intlist#_A(x1) = x1 + 2 if_intlist#_A(x1,x2) = max{x1 + 2, x2 - 1} empty_A(x1) = x1 false_A = 2 tail_A(x1) = max{1, x1 - 4} nil_A = 1 true_A = 1 cons_A(x1,x2) = max{x1 + 2, x2 + 4} 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: intlist#(x) -> if_intlist#(empty(x),x) and R consists of: r1: empty(nil()) -> true() r2: empty(cons(x,y)) -> false() r3: tail(nil()) -> nil() r4: tail(cons(x,y)) -> y r5: head(cons(x,y)) -> x r6: zero(|0|()) -> true() r7: zero(s(x)) -> false() r8: p(|0|()) -> |0|() r9: p(s(|0|())) -> |0|() r10: p(s(s(x))) -> s(p(s(x))) r11: intlist(x) -> if_intlist(empty(x),x) r12: if_intlist(true(),x) -> nil() r13: if_intlist(false(),x) -> cons(s(head(x)),intlist(tail(x))) r14: int(x,y) -> if_int(zero(x),zero(y),x,y) r15: if_int(true(),b,x,y) -> if1(b,x,y) r16: if_int(false(),b,x,y) -> if2(b,x,y) r17: if1(true(),x,y) -> cons(|0|(),nil()) r18: if1(false(),x,y) -> cons(|0|(),int(s(|0|()),y)) r19: if2(true(),x,y) -> nil() r20: if2(false(),x,y) -> intlist(int(p(x),p(y))) The estimated dependency graph contains the following SCCs: (no SCCs)