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 r2, r3, r6, r7, r8, r9, r10, r12, r15, r17, r18, r19 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: if_int#_A(x1,x2,x3,x4) = max{x2 - 46, x3 + 27, x4 + 68} false_A = 141 if2#_A(x1,x2,x3) = max{x1 - 47, x2 + 23, x3 + 58} int#_A(x1,x2) = max{x1 + 27, x2 + 68} p_A(x1) = max{25, x1 - 11} zero_A(x1) = x1 + 106 true_A = 72 if1#_A(x1,x2,x3) = max{x1 - 125, x3 + 68} s_A(x1) = max{36, x1 + 24} |0|_A = 17 empty_A(x1) = 142 cons_A(x1,x2) = max{2, x1 - 170} tail_A(x1) = max{144, x1 - 174} nil_A = 71 if_intlist_A(x1,x2) = max{145, x1 - 170, x2 - 173} if_int_A(x1,x2,x3,x4) = max{172, x1 - 71, x2 - 107, x3 - 151, x4 - 1} if1_A(x1,x2,x3) = max{2, x1 - 295, x2 - 152, x3 - 2} int_A(x1,x2) = max{171, x1 - 39, x2 - 3} if2_A(x1,x2,x3) = max{172, x1 - 328, x2 - 151, x3 - 10} base order 2: precedence: if_int > if_intlist = if2 > if2# = tail > p = empty > if_int# = false = int# = zero = if1# = if1 > true = s = int > |0| = cons = nil partial status: pi(if_int#) = [4] pi(false) = [] pi(if2#) = [] pi(int#) = [2] pi(p) = [] pi(zero) = [] pi(true) = [] pi(if1#) = [3] pi(s) = [] pi(|0|) = [] pi(empty) = [] pi(cons) = [] pi(tail) = [] pi(nil) = [] pi(if_intlist) = [] pi(if_int) = [] pi(if1) = [] pi(int) = [] pi(if2) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: if2#(false(),x,y) -> int#(p(x),p(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, r8, r10, r12, r17, r19 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: int#_A(x1,x2) = max{4, x1 + 2} if_int#_A(x1,x2,x3,x4) = max{3, x1 - 10, x3 + 1} zero_A(x1) = x1 + 9 true_A = 16 if1#_A(x1,x2,x3) = 5 false_A = 8 s_A(x1) = 0 |0|_A = 7 tail_A(x1) = max{54, x1 - 2} nil_A = 1 p_A(x1) = max{35, x1 - 28} if_intlist_A(x1,x2) = max{10, x1 - 54} if1_A(x1,x2,x3) = max{17, x1 - 45, x2 - 63, x3 - 42} cons_A(x1,x2) = max{9, x1 - 45, x2} if2_A(x1,x2,x3) = max{3, x1 - 72, x2 - 64, x3 - 71} base order 2: precedence: p > tail = if1 = if2 > cons > zero = if_intlist > true = false > int# = if_int# = nil > if1# > s > |0| partial status: pi(int#) = [1] pi(if_int#) = [] pi(zero) = [1] pi(true) = [] pi(if1#) = [] pi(false) = [] pi(s) = [] pi(|0|) = [] pi(tail) = [] pi(nil) = [] pi(p) = [] pi(if_intlist) = [] pi(if1) = [] pi(cons) = [2] pi(if2) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: int#(x,y) -> if_int#(zero(x),zero(y),x,y) p2: 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: (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 r2, r3, r7, r9, r10, r12, r17, r19 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: p#_A(x1) = x1 + 16 s_A(x1) = x1 + 17 empty_A(x1) = max{4, x1 - 10} cons_A(x1,x2) = max{2, x1 - 30, x2 - 6} false_A = 1 tail_A(x1) = max{8, x1 - 11} nil_A = 0 zero_A(x1) = max{7, x1 - 21} p_A(x1) = max{3, x1 - 14} |0|_A = 2 if_intlist_A(x1,x2) = max{19, x1 - 19, x2 - 10} true_A = 3 if1_A(x1,x2,x3) = max{20, x1 - 32, x2 - 14, x3 - 14} if2_A(x1,x2,x3) = max{9, x1 - 23, x2 - 13, x3 - 13} base order 2: precedence: if_intlist = if1 = if2 > tail = p > p# = s = empty = zero > true > cons = nil = |0| > false partial status: pi(p#) = [1] pi(s) = [1] pi(empty) = [] pi(cons) = [] pi(false) = [] pi(tail) = [] pi(nil) = [] pi(zero) = [] pi(p) = [] pi(|0|) = [] pi(if_intlist) = [] pi(true) = [] pi(if1) = [] pi(if2) = [] 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, r17, r19 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: intlist#_A(x1) = x1 + 16 if_intlist#_A(x1,x2) = max{x1 - 12, x2 + 15} empty_A(x1) = max{15, x1 + 11} false_A = 54 tail_A(x1) = max{22, x1 - 17} nil_A = 18 true_A = 19 cons_A(x1,x2) = max{54, x1 - 10, x2 + 41} zero_A(x1) = max{55, x1 - 95} s_A(x1) = x1 + 53 p_A(x1) = max{119, x1 - 107} |0|_A = 7 if_intlist_A(x1,x2) = max{99, x1 - 33, x2 + 13} if1_A(x1,x2,x3) = max{60, x1 - 148, x2 - 2, x3 - 53} if2_A(x1,x2,x3) = max{53, x1 - 75, x2 - 108, x3 - 108} base order 2: precedence: zero = if1 > true = s = p = if_intlist > intlist# = cons > if_intlist# = false > empty = tail = |0| = if2 > nil partial status: pi(intlist#) = [1] pi(if_intlist#) = [] pi(empty) = [1] pi(false) = [] pi(tail) = [] pi(nil) = [] pi(true) = [] pi(cons) = [] pi(zero) = [] pi(s) = [] pi(p) = [] pi(|0|) = [] pi(if_intlist) = [2] pi(if1) = [] pi(if2) = [] 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)