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 r3, r4, r5, r6, r10, r11, r12, r13 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: ifinter#_A(x1,x2,x3,x4) = x3 + x4 + 3 false_A() = 0 inter#_A(x1,x2) = x1 + x2 + 2 cons_A(x1,x2) = x1 + x2 + 2 mem_A(x1,x2) = x2 true_A() = 0 app_A(x1,x2) = x1 + x2 + 1 eq_A(x1,x2) = x1 + x2 + 3 |0|_A() = 1 s_A(x1) = x1 + 1 ifmem_A(x1,x2,x3) = x3 + 1 nil_A() = 1 precedence: ifinter# = inter# = true = app = eq > cons = |0| = s = nil > mem = ifmem > false partial status: pi(ifinter#) = [] pi(false) = [] pi(inter#) = [] pi(cons) = [2] pi(mem) = [] pi(true) = [] pi(app) = [2] pi(eq) = [] pi(|0|) = [] pi(s) = [1] pi(ifmem) = [] pi(nil) = [] The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: inter#(l1,cons(x,l2)) -> ifinter#(mem(x,l1),x,l2,l1) 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: inter#(l1,cons(x,l2)) -> ifinter#(mem(x,l1),x,l2,l1) p2: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) p3: inter#(app(l1,l2),l3) -> inter#(l1,l3) p4: inter#(app(l1,l2),l3) -> inter#(l2,l3) p5: inter#(l1,app(l2,l3)) -> inter#(l1,l2) p6: inter#(l1,app(l2,l3)) -> inter#(l1,l3) p7: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,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 r3, r4, r5, r6, r10, r11, r12, r13 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: inter#_A(x1,x2) = x1 + x2 + 2 cons_A(x1,x2) = x2 + 2 ifinter#_A(x1,x2,x3,x4) = x3 + x4 + 3 mem_A(x1,x2) = x2 + 5 true_A() = 1 app_A(x1,x2) = x1 + x2 + 1 eq_A(x1,x2) = x2 + 1 |0|_A() = 2 s_A(x1) = x1 + 2 false_A() = 0 ifmem_A(x1,x2,x3) = x3 + 6 nil_A() = 0 precedence: inter# = cons = ifinter# = true = eq > mem = app = |0| = ifmem = nil > s = false partial status: pi(inter#) = [2] pi(cons) = [2] pi(ifinter#) = [] pi(mem) = [] pi(true) = [] pi(app) = [1, 2] pi(eq) = [] pi(|0|) = [] pi(s) = [] pi(false) = [] pi(ifmem) = [] pi(nil) = [] The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ifinter#(true(),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) 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#(true(),x,l1,l2) -> inter#(l1,l2) p2: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,l1,l2) p3: inter#(l1,app(l2,l3)) -> inter#(l1,l3) 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 r3, r4, r5, r6, r10, r11, r12, r13 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: ifinter#_A(x1,x2,x3,x4) = x3 + x4 + 3 true_A() = 1 inter#_A(x1,x2) = x1 + x2 + 2 cons_A(x1,x2) = x1 + x2 + 4 mem_A(x1,x2) = x2 + 2 app_A(x1,x2) = x1 + x2 + 1 eq_A(x1,x2) = x1 + x2 + 3 |0|_A() = 4 s_A(x1) = x1 + 2 false_A() = 3 ifmem_A(x1,x2,x3) = x3 + 3 nil_A() = 2 precedence: ifinter# = inter# = cons > true = mem = app = eq = |0| = s = false = ifmem = nil partial status: pi(ifinter#) = [] pi(true) = [] pi(inter#) = [] pi(cons) = [2] pi(mem) = [] pi(app) = [2] pi(eq) = [] pi(|0|) = [] pi(s) = [] pi(false) = [] pi(ifmem) = [] pi(nil) = [] The next rules are strictly ordered: p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) p2: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,l1,l2) p3: inter#(l1,app(l2,l3)) -> 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#(true(),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) 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 r3, r4, r5, r6, r10, r11, r12, r13 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: ifinter#_A(x1,x2,x3,x4) = x3 + 3 true_A() = 1 inter#_A(x1,x2) = x1 + 2 app_A(x1,x2) = x1 + x2 + 3 cons_A(x1,x2) = x2 + 4 mem_A(x1,x2) = x2 + 7 eq_A(x1,x2) = 2 |0|_A() = 2 s_A(x1) = 3 false_A() = 1 ifmem_A(x1,x2,x3) = x3 + 8 nil_A() = 0 precedence: true = app > ifinter# = inter# = cons > mem = eq = |0| = s = false = ifmem = nil partial status: pi(ifinter#) = [] pi(true) = [] pi(inter#) = [] pi(app) = [2] pi(cons) = [2] pi(mem) = [2] pi(eq) = [] pi(|0|) = [] pi(s) = [] pi(false) = [] pi(ifmem) = [3] pi(nil) = [] 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: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) p2: inter#(app(l1,l2),l3) -> inter#(l2,l3) p3: inter#(l1,app(l2,l3)) -> inter#(l1,l2) p4: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,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} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) p2: inter#(cons(x,l1),l2) -> ifinter#(mem(x,l2),x,l1,l2) p3: inter#(l1,app(l2,l3)) -> inter#(l1,l2) p4: 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 r3, r4, r5, r6, r10, r11, r12, r13 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: ifinter#_A(x1,x2,x3,x4) = x3 + x4 + 6 true_A() = 2 inter#_A(x1,x2) = x1 + x2 + 3 cons_A(x1,x2) = x2 + 5 mem_A(x1,x2) = x2 + 3 app_A(x1,x2) = x1 + x2 + 1 eq_A(x1,x2) = 3 |0|_A() = 1 s_A(x1) = 4 false_A() = 2 ifmem_A(x1,x2,x3) = x3 + 4 nil_A() = 0 precedence: ifinter# = inter# > true = cons > mem = app = eq = |0| = s = false = ifmem = nil partial status: pi(ifinter#) = [] pi(true) = [] pi(inter#) = [] pi(cons) = [2] pi(mem) = [2] pi(app) = [1, 2] pi(eq) = [] pi(|0|) = [] pi(s) = [] pi(false) = [] pi(ifmem) = [3] pi(nil) = [] 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: ifinter#(true(),x,l1,l2) -> inter#(l1,l2) p2: inter#(l1,app(l2,l3)) -> inter#(l1,l2) p3: 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 estimated dependency graph contains the following SCCs: {p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: inter#(l1,app(l2,l3)) -> inter#(l1,l2) 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 (no rules) Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: inter#_A(x1,x2) = x1 + x2 + 2 app_A(x1,x2) = x1 + x2 + 1 precedence: inter# = app partial status: pi(inter#) = [] pi(app) = [2] The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: 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 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#(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 (no rules) Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: inter#_A(x1,x2) = x1 app_A(x1,x2) = x1 + x2 + 1 precedence: inter# = app partial status: pi(inter#) = [] pi(app) = [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: 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 r3, r4, r5, r6 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: ifmem#_A(x1,x2,x3) = x3 + 2 false_A() = 2 mem#_A(x1,x2) = x2 + 1 cons_A(x1,x2) = x1 + x2 + 4 eq_A(x1,x2) = 3 |0|_A() = 3 true_A() = 0 s_A(x1) = x1 + 4 precedence: cons > ifmem# > mem# > false = eq = |0| = true = s partial status: pi(ifmem#) = [] pi(false) = [] pi(mem#) = [2] pi(cons) = [1] pi(eq) = [] pi(|0|) = [] pi(true) = [] pi(s) = [1] 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: 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 (no rules) Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: eq#_A(x1,x2) = x2 s_A(x1) = x1 + 1 precedence: eq# = s partial status: pi(eq#) = [2] pi(s) = [1] 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: 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 r7, r8, r9 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: app#_A(x1,x2) = x1 + x2 + 3 cons_A(x1,x2) = x1 + x2 + 1 app_A(x1,x2) = x1 + x2 + 2 nil_A() = 1 precedence: app# = cons = app = nil partial status: pi(app#) = [] pi(cons) = [1, 2] pi(app) = [1] pi(nil) = [] The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(l1,l2),l3) -> app#(l2,l3) 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#(app(l1,l2),l3) -> app#(l2,l3) 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 r7, r8, r9 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: app#_A(x1,x2) = x1 + x2 + 3 app_A(x1,x2) = x1 + x2 + 2 nil_A() = 1 cons_A(x1,x2) = x1 + x2 + 1 precedence: app# = app = nil = cons partial status: pi(app#) = [1] pi(app) = [1] pi(nil) = [] pi(cons) = [1, 2] The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: 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} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: 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 r7, r8, r9 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: app#_A(x1,x2) = x1 + x2 + 1 app_A(x1,x2) = x1 + x2 + 2 nil_A() = 1 cons_A(x1,x2) = x1 + x2 + 1 precedence: app# = app = nil = cons partial status: pi(app#) = [1] pi(app) = [1] pi(nil) = [] pi(cons) = [1, 2] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.