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 r3, r6, r7, r8, r9, r10 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: if_int#_A(x1,x2,x3,x4) = x2 + 1 false_A() = 4 if2#_A(x1,x2,x3) = x1 + 1 int#_A(x1,x2) = 5 p_A(x1) = 7 zero_A(x1) = 4 true_A() = 2 if1#_A(x1,x2,x3) = x1 + 1 s_A(x1) = 6 |0|_A() = 3 tail_A(x1) = 0 nil_A() = 0 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: if_int#_A(x1,x2,x3,x4) = max{37, x1 - 81, x2 - 26, x3 + 1, x4 + 36} false_A = 117 if2#_A(x1,x2,x3) = max{37, x1 - 60, x2 - 1, x3 + 18} int#_A(x1,x2) = max{56, x1 + 17, x2 + 36} p_A(x1) = max{21, x1 - 18} zero_A(x1) = max{82, x1 + 62} true_A = 82 if1#_A(x1,x2,x3) = max{x1 - 26, x2 + 1, x3 + 36} s_A(x1) = x1 + 55 |0|_A = 19 tail_A(x1) = 191 nil_A = 5 if_int#!_A(x1,x2,x3,x4) = max{x2 + 11, x3 + 19, x4 + 94} false!_A = 7 if2#!_A(x1,x2,x3) = max{x1 - 1, x2 + 19, x3 + 94} int#!_A(x1,x2) = max{x1 + 19, x2 + 94} p!_A(x1) = 1 zero!_A(x1) = x1 + 95 true!_A = 115 if1#!_A(x1,x2,x3) = max{x2 + 19, x3 + 94} s!_A(x1) = 4 |0|!_A = 116 tail!_A(x1) = max{3, x1 - 6} nil!_A = 2 partial status: pi(if_int#) = [] pi(false) = [] pi(if2#) = [] pi(int#) = [] pi(p) = [] pi(zero) = [] pi(true) = [] pi(if1#) = [] pi(s) = [] pi(|0|) = [] pi(tail) = [] pi(nil) = [] The following rules are removed: p2 -- 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 r3, r6, r7 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: int#_A(x1,x2) = x1 + x2 + 2 if_int#_A(x1,x2,x3,x4) = x1 + x4 + 1 zero_A(x1) = x1 + 1 true_A() = 6 if1#_A(x1,x2,x3) = x3 + 5 false_A() = 3 s_A(x1) = 2 |0|_A() = 7 tail_A(x1) = 8 nil_A() = 7 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: int#_A(x1,x2) = max{9, x1 + 4, x2 - 1} if_int#_A(x1,x2,x3,x4) = max{9, x3 - 1, x4 - 1} zero_A(x1) = x1 + 4 true_A = 5 if1#_A(x1,x2,x3) = max{9, x2 - 1, x3 - 1} false_A = 2 s_A(x1) = max{5, x1 - 4} |0|_A = 1 tail_A(x1) = max{23, x1 - 4} nil_A = 3 int#!_A(x1,x2) = max{x1 + 2, x2 + 6} if_int#!_A(x1,x2,x3,x4) = max{5, x1 - 4, x2 + 1} zero!_A(x1) = max{6, x1 - 6} true!_A = 6 if1#!_A(x1,x2,x3) = max{3, x2 + 1} false!_A = 6 s!_A(x1) = x1 + 15 |0|!_A = 7 tail!_A(x1) = max{7, x1 - 4} nil!_A = 8 partial status: pi(int#) = [] pi(if_int#) = [] pi(zero) = [] pi(true) = [] pi(if1#) = [] pi(false) = [] pi(s) = [] pi(|0|) = [] pi(tail) = [] pi(nil) = [] 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: 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 r7, r8 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: p#_A(x1) = x1 + 1 s_A(x1) = x1 + 10 zero_A(x1) = 6 false_A() = 4 p_A(x1) = 9 |0|_A() = 3 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: p#_A(x1) = 0 s_A(x1) = max{0, x1 - 20} zero_A(x1) = max{44, x1 - 3} false_A = 9 p_A(x1) = max{19, x1 - 30} |0|_A = 2 p#!_A(x1) = 0 s!_A(x1) = 0 zero!_A(x1) = max{6, x1 - 3} false!_A = 5 p!_A(x1) = x1 + 71 |0|!_A = 72 partial status: pi(p#) = [1] pi(s) = [1] pi(zero) = [] pi(false) = [] pi(p) = [] 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: 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, r7, r8, r12, r19 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: intlist#_A(x1) = x1 + 12 if_intlist#_A(x1,x2) = x2 + 12 empty_A(x1) = 11 false_A() = 10 tail_A(x1) = x1 nil_A() = 1 true_A() = 5 cons_A(x1,x2) = x2 + 5 zero_A(x1) = 11 s_A(x1) = x1 + 11 p_A(x1) = 9 |0|_A() = 8 if_intlist_A(x1,x2) = 18 if2_A(x1,x2,x3) = x2 + 13 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: intlist#_A(x1) = max{0, x1 - 1} if_intlist#_A(x1,x2) = max{0, x1 - 14, x2 - 2} empty_A(x1) = max{0, x1 - 69} false_A = 12 tail_A(x1) = max{0, x1 - 68} nil_A = 0 true_A = 0 cons_A(x1,x2) = max{81, x1 - 1, x2 + 68} zero_A(x1) = max{34, x1 - 1} s_A(x1) = max{33, x1 - 33} p_A(x1) = max{32, x1 - 66} |0|_A = 0 if_intlist_A(x1,x2) = max{52, x1 - 15, x2 - 68} if2_A(x1,x2,x3) = max{2, x1 - 134, x2 - 185, x3 - 220} intlist#!_A(x1) = max{4, x1 + 2} if_intlist#!_A(x1,x2) = max{x1 - 1, x2 + 2} empty!_A(x1) = max{3, x1 - 82} false!_A = 9 tail!_A(x1) = max{10, x1 - 89} nil!_A = 6 true!_A = 7 cons!_A(x1,x2) = max{8, x1 - 23, x2 - 4} zero!_A(x1) = max{12, x1 - 34} s!_A(x1) = 10 p!_A(x1) = 0 |0|!_A = 11 if_intlist!_A(x1,x2) = max{7, x1 - 35, x2 - 89} if2!_A(x1,x2,x3) = max{11, x1 - 13, x2 - 1, x3 + 5} partial status: pi(intlist#) = [] pi(if_intlist#) = [] pi(empty) = [] pi(false) = [] pi(tail) = [] pi(nil) = [] pi(true) = [] pi(cons) = [2] pi(zero) = [] pi(s) = [1] pi(p) = [] pi(|0|) = [] pi(if_intlist) = [] pi(if2) = [2] The following rules are removed: p2 -- 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)