YES We show the termination of the TRS R: if(true(),x,y) -> x if(false(),x,y) -> y eq(|0|(),|0|()) -> true() eq(|0|(),s(x)) -> false() eq(s(x),|0|()) -> false() eq(s(x),s(y)) -> eq(x,y) app(nil(),l) -> l app(cons(x,l1),l2) -> cons(x,app(l1,l2)) app(app(l1,l2),l3) -> app(l1,app(l2,l3)) mem(x,nil()) -> false() mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) ifmem(true(),x,l) -> true() ifmem(false(),x,l) -> mem(x,l) inter(x,nil()) -> nil() inter(nil(),x) -> nil() inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) ifinter(false(),x,l1,l2) -> inter(l1,l2) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: eq#(s(x),s(y)) -> eq#(x,y) p2: app#(cons(x,l1),l2) -> app#(l1,l2) p3: app#(app(l1,l2),l3) -> app#(l1,app(l2,l3)) p4: app#(app(l1,l2),l3) -> app#(l2,l3) p5: mem#(x,cons(y,l)) -> ifmem#(eq(x,y),x,l) p6: mem#(x,cons(y,l)) -> eq#(x,y) p7: ifmem#(false(),x,l) -> mem#(x,l) p8: inter#(app(l1,l2),l3) -> app#(inter(l1,l3),inter(l2,l3)) p9: inter#(app(l1,l2),l3) -> inter#(l1,l3) p10: inter#(app(l1,l2),l3) -> inter#(l2,l3) p11: inter#(l1,app(l2,l3)) -> app#(inter(l1,l2),inter(l1,l3)) p12: inter#(l1,app(l2,l3)) -> inter#(l1,l2) p13: inter#(l1,app(l2,l3)) -> inter#(l1,l3) p14: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,l1,l2) p15: inter#(cons(x,l1),l2) -> mem#(x,l2) p16: inter#(l1,cons(x,l2)) -> ifinter#(mem(x,l1),x,l2,l1) p17: inter#(l1,cons(x,l2)) -> mem#(x,l1) p18: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) p19: ifinter#(false(),x,l1,l2) -> inter#(l1,l2) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The estimated dependency graph contains the following SCCs: {p9, p10, p12, p13, p14, p16, p18, p19} {p5, p7} {p1} {p2, p3, p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: ifinter#(false(),x,l1,l2) -> inter#(l1,l2) p2: inter#(l1,cons(x,l2)) -> ifinter#(mem(x,l1),x,l2,l1) p3: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) p4: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,l1,l2) p5: inter#(l1,app(l2,l3)) -> inter#(l1,l3) p6: inter#(l1,app(l2,l3)) -> inter#(l1,l2) p7: inter#(app(l1,l2),l3) -> inter#(l2,l3) p8: inter#(app(l1,l2),l3) -> inter#(l1,l3) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The set of usable rules consists of r1, r2, r3, r4, r5, r12, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: ifinter#_A(x1,x2,x3,x4) = max{x2 + 22, x3 + 37, x4 + 35} false_A = 20 inter#_A(x1,x2) = max{x1 + 36, x2 + 35} cons_A(x1,x2) = max{14, x1 - 12, x2 + 7} mem_A(x1,x2) = max{19, x1 + 6, x2 + 4} true_A = 13 app_A(x1,x2) = max{4, x1, x2} if_A(x1,x2,x3) = max{x2 + 1, x3 + 1} eq_A(x1,x2) = max{30, x1 + 9, x2 - 2} |0|_A = 3 s_A(x1) = max{21, x1 - 10} ifmem_A(x1,x2,x3) = max{20, x1 - 2, x2 + 6, x3 + 12} inter_A(x1,x2) = max{12, x1 + 3, x2 + 1} nil_A = 13 base order 2: precedence: false = eq = ifmem > cons = s > true > ifinter# = inter# = if = |0| > mem > app = inter > nil partial status: pi(ifinter#) = [] pi(false) = [] pi(inter#) = [] pi(cons) = [2] pi(mem) = [] pi(true) = [] pi(app) = [1, 2] pi(if) = [2, 3] pi(eq) = [] pi(|0|) = [] pi(s) = [] pi(ifmem) = [3] pi(inter) = [2] pi(nil) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ifinter#(false(),x,l1,l2) -> inter#(l1,l2) p2: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) p3: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,l1,l2) p4: inter#(l1,app(l2,l3)) -> inter#(l1,l3) p5: inter#(l1,app(l2,l3)) -> inter#(l1,l2) p6: inter#(app(l1,l2),l3) -> inter#(l2,l3) p7: inter#(app(l1,l2),l3) -> inter#(l1,l3) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) 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: ifinter#(false(),x,l1,l2) -> inter#(l1,l2) p2: inter#(app(l1,l2),l3) -> inter#(l1,l3) p3: inter#(app(l1,l2),l3) -> inter#(l2,l3) p4: inter#(l1,app(l2,l3)) -> inter#(l1,l2) p5: inter#(l1,app(l2,l3)) -> inter#(l1,l3) p6: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,l1,l2) p7: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: ifinter#_A(x1,x2,x3,x4) = x4 + 30 false_A = 27 inter#_A(x1,x2) = x2 + 30 app_A(x1,x2) = max{55, x1 + 31, x2 + 32} cons_A(x1,x2) = max{x1, x2 - 22} mem_A(x1,x2) = max{x1 - 12, x2 + 26} true_A = 6 if_A(x1,x2,x3) = max{x2 + 1, x3 + 1} eq_A(x1,x2) = max{3, x1 - 23, x2 + 2} |0|_A = 28 s_A(x1) = x1 + 27 nil_A = 0 inter_A(x1,x2) = max{21, x1 - 20, x2 - 11} base order 2: precedence: |0| > true > ifinter# = inter# = app = if = inter > cons = nil > mem > eq > s > false partial status: pi(ifinter#) = [] pi(false) = [] pi(inter#) = [] pi(app) = [1, 2] pi(cons) = [1] pi(mem) = [2] pi(true) = [] pi(if) = [2, 3] pi(eq) = [2] pi(|0|) = [] pi(s) = [1] pi(nil) = [] pi(inter) = [] The following rules are removed: p5 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ifinter#(false(),x,l1,l2) -> inter#(l1,l2) p2: inter#(app(l1,l2),l3) -> inter#(l1,l3) p3: inter#(app(l1,l2),l3) -> inter#(l2,l3) p4: inter#(l1,app(l2,l3)) -> inter#(l1,l2) p5: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,l1,l2) p6: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: ifinter#(false(),x,l1,l2) -> inter#(l1,l2) p2: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,l1,l2) p3: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) p4: inter#(l1,app(l2,l3)) -> inter#(l1,l2) p5: inter#(app(l1,l2),l3) -> inter#(l2,l3) p6: inter#(app(l1,l2),l3) -> inter#(l1,l3) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The set of usable rules consists of r1, r2, r3, r4, r5, r10, r12, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: ifinter#_A(x1,x2,x3,x4) = x4 + 24 false_A = 1 inter#_A(x1,x2) = x2 + 24 cons_A(x1,x2) = max{2, x1 - 26, x2 - 14} mem_A(x1,x2) = max{3, x1 - 45, x2 - 45} true_A = 1 app_A(x1,x2) = max{x1 + 25, x2 - 19} if_A(x1,x2,x3) = max{x1, x2 + 1, x3 + 1} eq_A(x1,x2) = max{3, x1 - 45, x2 - 21} |0|_A = 2 s_A(x1) = max{2, x1 - 46} nil_A = 2 ifmem_A(x1,x2,x3) = max{3, x1 - 4, x2 - 45, x3 - 45} inter_A(x1,x2) = max{13, x1 - 18, x2 - 18} base order 2: precedence: app = if = |0| = ifmem = inter > mem = nil > eq > true = s > ifinter# = inter# > false = cons partial status: pi(ifinter#) = [] pi(false) = [] pi(inter#) = [] pi(cons) = [] pi(mem) = [] pi(true) = [] pi(app) = [1] pi(if) = [1, 2, 3] pi(eq) = [] pi(|0|) = [] pi(s) = [] pi(nil) = [] pi(ifmem) = [] pi(inter) = [] The following rules are removed: p4 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ifinter#(false(),x,l1,l2) -> inter#(l1,l2) p2: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,l1,l2) p3: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) p4: inter#(app(l1,l2),l3) -> inter#(l2,l3) p5: inter#(app(l1,l2),l3) -> inter#(l1,l3) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: ifinter#(false(),x,l1,l2) -> inter#(l1,l2) p2: inter#(app(l1,l2),l3) -> inter#(l1,l3) p3: inter#(app(l1,l2),l3) -> inter#(l2,l3) p4: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,l1,l2) p5: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The set of usable rules consists of r1, r2, r3, r4, r5 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: ifinter#_A(x1,x2,x3,x4) = max{x2 + 26, x3 + 16} false_A = 25 inter#_A(x1,x2) = max{15, x1 - 1} app_A(x1,x2) = max{37, x1 + 18, x2 + 17} cons_A(x1,x2) = max{37, x1 + 28, x2 + 18} mem_A(x1,x2) = max{14, x1 + 9, x2 - 27} true_A = 12 if_A(x1,x2,x3) = max{x2 + 1, x3 + 1} eq_A(x1,x2) = max{49, x1 + 22, x2 - 1} |0|_A = 4 s_A(x1) = x1 + 2 base order 2: precedence: eq > true > inter# > false > mem = if = |0| = s > app = cons > ifinter# partial status: pi(ifinter#) = [] pi(false) = [] pi(inter#) = [] pi(app) = [1, 2] pi(cons) = [2] pi(mem) = [1] pi(true) = [] pi(if) = [2, 3] pi(eq) = [1] pi(|0|) = [] pi(s) = [1] The following rules are removed: p4 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ifinter#(false(),x,l1,l2) -> inter#(l1,l2) p2: inter#(app(l1,l2),l3) -> inter#(l1,l3) p3: inter#(app(l1,l2),l3) -> inter#(l2,l3) p4: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The estimated dependency graph contains the following SCCs: {p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: inter#(app(l1,l2),l3) -> inter#(l1,l3) p2: inter#(app(l1,l2),l3) -> inter#(l2,l3) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The set of usable rules consists of r1, r2, r3, r4, r5, r7, r10, r12, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: inter#_A(x1,x2) = max{8, x1 - 1} app_A(x1,x2) = max{x1 + 10, x2 + 5} if_A(x1,x2,x3) = max{x2 + 1, x3 + 1} true_A = 1 false_A = 1 eq_A(x1,x2) = max{10, x1 - 3, x2 - 23} |0|_A = 2 s_A(x1) = max{2, x1 - 24} nil_A = 2 mem_A(x1,x2) = max{9, x1 - 15, x2 - 10} ifmem_A(x1,x2,x3) = max{10, x1 - 11, x2 - 1, x3 - 1} inter_A(x1,x2) = max{6, x1 - 29, x2 - 29} base order 2: precedence: if = eq = |0| = ifmem = inter > app = s = nil = mem > inter# = false > true partial status: pi(inter#) = [] pi(app) = [2] pi(if) = [2, 3] pi(true) = [] pi(false) = [] pi(eq) = [] pi(|0|) = [] pi(s) = [] pi(nil) = [] pi(mem) = [] pi(ifmem) = [] pi(inter) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: inter#(app(l1,l2),l3) -> inter#(l1,l3) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: inter#(app(l1,l2),l3) -> inter#(l1,l3) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The set of usable rules consists of r1, r2, r3, r4, r5, r10, r12, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: inter#_A(x1,x2) = x1 + 8 app_A(x1,x2) = max{x1 + 12, x2 + 1} if_A(x1,x2,x3) = max{x2 + 1, x3 + 1} true_A = 1 false_A = 1 eq_A(x1,x2) = max{3, x1 - 28, x2 - 28} |0|_A = 2 s_A(x1) = max{2, x1 - 29} mem_A(x1,x2) = max{4, x1 - 27, x2 - 10} nil_A = 2 ifmem_A(x1,x2,x3) = max{4, x1 - 4, x2 - 27, x3 - 10} inter_A(x1,x2) = max{5, x1 - 9, x2 - 8} base order 2: precedence: if = |0| = ifmem = inter > app = mem = nil > inter# = eq > s > true = false partial status: pi(inter#) = [1] pi(app) = [1] pi(if) = [2, 3] pi(true) = [] pi(false) = [] pi(eq) = [] pi(|0|) = [] pi(s) = [] pi(mem) = [] pi(nil) = [] pi(ifmem) = [] pi(inter) = [] 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: ifmem#(false(),x,l) -> mem#(x,l) p2: mem#(x,cons(y,l)) -> ifmem#(eq(x,y),x,l) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The set of usable rules consists of r1, r2, r3, r4, r5, r10, r12, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: ifmem#_A(x1,x2,x3) = max{3, x3 - 2} false_A = 1 mem#_A(x1,x2) = max{2, x2 - 3} cons_A(x1,x2) = max{7, x1 - 2, x2 + 2} eq_A(x1,x2) = max{4, x1 - 25, x2 - 25} if_A(x1,x2,x3) = max{x2 + 1, x3 + 1} true_A = 1 |0|_A = 24 s_A(x1) = max{2, x1 - 26} mem_A(x1,x2) = max{8, x1 - 24, x2 - 20} nil_A = 2 ifmem_A(x1,x2,x3) = max{9, x1 - 27, x2 - 23, x3 - 17} inter_A(x1,x2) = max{19, x1 - 19, x2 - 10} base order 2: precedence: ifmem = inter > mem# = mem > ifmem# = eq = if = nil > cons = |0| = s > false = true partial status: pi(ifmem#) = [] pi(false) = [] pi(mem#) = [] pi(cons) = [2] pi(eq) = [] pi(if) = [2, 3] pi(true) = [] pi(|0|) = [] pi(s) = [] pi(mem) = [] pi(nil) = [] pi(ifmem) = [] pi(inter) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ifmem#(false(),x,l) -> mem#(x,l) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: eq#(s(x),s(y)) -> eq#(x,y) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The set of usable rules consists of r1, r2, r3, r4, r5, r10, r12, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: eq#_A(x1,x2) = max{4, x1 + 2} s_A(x1) = max{67, x1 + 3} if_A(x1,x2,x3) = max{x2 + 1, x3 + 1} true_A = 6 false_A = 4 eq_A(x1,x2) = max{18, x1 - 68, x2 - 48} |0|_A = 53 mem_A(x1,x2) = max{19, x1 - 2, x2 - 19} nil_A = 14 ifmem_A(x1,x2,x3) = max{20, x1 - 19, x2 - 1, x3 - 18} inter_A(x1,x2) = max{15, x1 - 40, x2 - 28} base order 2: precedence: ifmem > mem > eq > eq# = s = if = |0| = inter > true = nil > false partial status: pi(eq#) = [1] pi(s) = [1] pi(if) = [2, 3] pi(true) = [] pi(false) = [] pi(eq) = [] pi(|0|) = [] pi(mem) = [] pi(nil) = [] pi(ifmem) = [] pi(inter) = [] 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: app#(cons(x,l1),l2) -> app#(l1,l2) p2: app#(app(l1,l2),l3) -> app#(l2,l3) p3: app#(app(l1,l2),l3) -> app#(l1,app(l2,l3)) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The set of usable rules consists of r1, r2, r3, r4, r5, r7, r10, r12, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = x1 + 23 cons_A(x1,x2) = max{x1 - 11, x2 + 24} app_A(x1,x2) = max{x1 + 10, x2 + 5} if_A(x1,x2,x3) = max{x2 + 1, x3 + 1} true_A = 5 false_A = 1 eq_A(x1,x2) = max{x1 - 7, x2 + 6} |0|_A = 6 s_A(x1) = max{2, x1 - 8} nil_A = 10 mem_A(x1,x2) = max{44, x1 - 1, x2 + 18} ifmem_A(x1,x2,x3) = max{8, x1 - 16, x2 - 2, x3 - 1} inter_A(x1,x2) = max{10, x2 - 26} base order 2: precedence: mem > app# = app = eq = ifmem = inter > cons = if = |0| = s = nil > true = false partial status: pi(app#) = [] pi(cons) = [2] pi(app) = [] pi(if) = [2, 3] pi(true) = [] pi(false) = [] pi(eq) = [2] pi(|0|) = [] pi(s) = [] pi(nil) = [] pi(mem) = [] pi(ifmem) = [] pi(inter) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(cons(x,l1),l2) -> app#(l1,l2) p2: app#(app(l1,l2),l3) -> app#(l1,app(l2,l3)) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(cons(x,l1),l2) -> app#(l1,l2) p2: app#(app(l1,l2),l3) -> app#(l1,app(l2,l3)) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The set of usable rules consists of r1, r2, r3, r4, r5, r7, r10, r12, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = x1 + 5 cons_A(x1,x2) = max{8, x1 - 3, x2 + 6} app_A(x1,x2) = max{11, x1 + 7, x2 + 7} if_A(x1,x2,x3) = max{x1, x2 + 1, x3 + 1} true_A = 32 false_A = 1 eq_A(x1,x2) = max{33, x1 - 34, x2 - 34} |0|_A = 33 s_A(x1) = max{32, x1 - 33} nil_A = 2 mem_A(x1,x2) = max{11, x1 - 2, x2 - 66} ifmem_A(x1,x2,x3) = max{33, x1 - 34, x2 - 2, x3 - 59} inter_A(x1,x2) = max{10, x1 - 82, x2 - 82} base order 2: precedence: ifmem > if = mem > eq = |0| > true > inter > cons = app = nil > app# = false > s partial status: pi(app#) = [1] pi(cons) = [] pi(app) = [2] pi(if) = [1, 2, 3] pi(true) = [] pi(false) = [] pi(eq) = [] pi(|0|) = [] pi(s) = [] pi(nil) = [] pi(mem) = [] pi(ifmem) = [] pi(inter) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(cons(x,l1),l2) -> app#(l1,l2) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(cons(x,l1),l2) -> app#(l1,l2) and R consists of: r1: if(true(),x,y) -> x r2: if(false(),x,y) -> y r3: eq(|0|(),|0|()) -> true() r4: eq(|0|(),s(x)) -> false() r5: eq(s(x),|0|()) -> false() r6: eq(s(x),s(y)) -> eq(x,y) r7: app(nil(),l) -> l r8: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r9: app(app(l1,l2),l3) -> app(l1,app(l2,l3)) r10: mem(x,nil()) -> false() r11: mem(x,cons(y,l)) -> ifmem(eq(x,y),x,l) r12: ifmem(true(),x,l) -> true() r13: ifmem(false(),x,l) -> mem(x,l) r14: inter(x,nil()) -> nil() r15: inter(nil(),x) -> nil() r16: inter(app(l1,l2),l3) -> app(inter(l1,l3),inter(l2,l3)) r17: inter(l1,app(l2,l3)) -> app(inter(l1,l2),inter(l1,l3)) r18: inter(cons(x,l1),l2) -> ifinter(mem(x,l2),x,l1,l2) r19: inter(l1,cons(x,l2)) -> ifinter(mem(x,l1),x,l2,l1) r20: ifinter(true(),x,l1,l2) -> cons(x,inter(l1,l2)) r21: ifinter(false(),x,l1,l2) -> inter(l1,l2) The set of usable rules consists of r1, r2, r3, r4, r5, r10, r12, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = max{5, x1 + 1} cons_A(x1,x2) = max{x1 + 8, x2 + 8} if_A(x1,x2,x3) = max{x2 + 1, x3 + 1} true_A = 2 false_A = 2 eq_A(x1,x2) = max{9, x1 - 6, x2 - 4} |0|_A = 3 s_A(x1) = max{5, x1 - 7} mem_A(x1,x2) = max{10, x1 - 2, x2 - 10} nil_A = 3 ifmem_A(x1,x2,x3) = max{9, x1 - 10, x2 - 3, x3 - 11} inter_A(x1,x2) = max{4, x1 - 22} base order 2: precedence: mem > eq = |0| = ifmem > true > cons = if = s > app# = inter > nil > false partial status: pi(app#) = [1] pi(cons) = [] pi(if) = [2, 3] pi(true) = [] pi(false) = [] pi(eq) = [] pi(|0|) = [] pi(s) = [] pi(mem) = [] pi(nil) = [] pi(ifmem) = [] pi(inter) = [] The following rules are removed: p1 Then no dependency pair remains.