YES We show the termination of the TRS R: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) active(nats(N)) -> mark(cons(N,nats(s(N)))) active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) active(cons(X1,X2)) -> cons(active(X1),X2) active(s(X)) -> s(active(X)) active(sieve(X)) -> sieve(active(X)) active(nats(X)) -> nats(active(X)) filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) cons(mark(X1),X2) -> mark(cons(X1,X2)) s(mark(X)) -> mark(s(X)) sieve(mark(X)) -> mark(sieve(X)) nats(mark(X)) -> mark(nats(X)) proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) proper(|0|()) -> ok(|0|()) proper(s(X)) -> s(proper(X)) proper(sieve(X)) -> sieve(proper(X)) proper(nats(X)) -> nats(proper(X)) proper(zprimes()) -> ok(zprimes()) filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) s(ok(X)) -> ok(s(X)) sieve(ok(X)) -> ok(sieve(X)) nats(ok(X)) -> ok(nats(X)) top(mark(X)) -> top(proper(X)) top(ok(X)) -> top(active(X)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: active#(filter(cons(X,Y),|0|(),M)) -> cons#(|0|(),filter(Y,M,M)) p2: active#(filter(cons(X,Y),|0|(),M)) -> filter#(Y,M,M) p3: active#(filter(cons(X,Y),s(N),M)) -> cons#(X,filter(Y,N,M)) p4: active#(filter(cons(X,Y),s(N),M)) -> filter#(Y,N,M) p5: active#(sieve(cons(|0|(),Y))) -> cons#(|0|(),sieve(Y)) p6: active#(sieve(cons(|0|(),Y))) -> sieve#(Y) p7: active#(sieve(cons(s(N),Y))) -> cons#(s(N),sieve(filter(Y,N,N))) p8: active#(sieve(cons(s(N),Y))) -> sieve#(filter(Y,N,N)) p9: active#(sieve(cons(s(N),Y))) -> filter#(Y,N,N) p10: active#(nats(N)) -> cons#(N,nats(s(N))) p11: active#(nats(N)) -> nats#(s(N)) p12: active#(nats(N)) -> s#(N) p13: active#(zprimes()) -> sieve#(nats(s(s(|0|())))) p14: active#(zprimes()) -> nats#(s(s(|0|()))) p15: active#(zprimes()) -> s#(s(|0|())) p16: active#(zprimes()) -> s#(|0|()) p17: active#(filter(X1,X2,X3)) -> filter#(active(X1),X2,X3) p18: active#(filter(X1,X2,X3)) -> active#(X1) p19: active#(filter(X1,X2,X3)) -> filter#(X1,active(X2),X3) p20: active#(filter(X1,X2,X3)) -> active#(X2) p21: active#(filter(X1,X2,X3)) -> filter#(X1,X2,active(X3)) p22: active#(filter(X1,X2,X3)) -> active#(X3) p23: active#(cons(X1,X2)) -> cons#(active(X1),X2) p24: active#(cons(X1,X2)) -> active#(X1) p25: active#(s(X)) -> s#(active(X)) p26: active#(s(X)) -> active#(X) p27: active#(sieve(X)) -> sieve#(active(X)) p28: active#(sieve(X)) -> active#(X) p29: active#(nats(X)) -> nats#(active(X)) p30: active#(nats(X)) -> active#(X) p31: filter#(mark(X1),X2,X3) -> filter#(X1,X2,X3) p32: filter#(X1,mark(X2),X3) -> filter#(X1,X2,X3) p33: filter#(X1,X2,mark(X3)) -> filter#(X1,X2,X3) p34: cons#(mark(X1),X2) -> cons#(X1,X2) p35: s#(mark(X)) -> s#(X) p36: sieve#(mark(X)) -> sieve#(X) p37: nats#(mark(X)) -> nats#(X) p38: proper#(filter(X1,X2,X3)) -> filter#(proper(X1),proper(X2),proper(X3)) p39: proper#(filter(X1,X2,X3)) -> proper#(X1) p40: proper#(filter(X1,X2,X3)) -> proper#(X2) p41: proper#(filter(X1,X2,X3)) -> proper#(X3) p42: proper#(cons(X1,X2)) -> cons#(proper(X1),proper(X2)) p43: proper#(cons(X1,X2)) -> proper#(X1) p44: proper#(cons(X1,X2)) -> proper#(X2) p45: proper#(s(X)) -> s#(proper(X)) p46: proper#(s(X)) -> proper#(X) p47: proper#(sieve(X)) -> sieve#(proper(X)) p48: proper#(sieve(X)) -> proper#(X) p49: proper#(nats(X)) -> nats#(proper(X)) p50: proper#(nats(X)) -> proper#(X) p51: filter#(ok(X1),ok(X2),ok(X3)) -> filter#(X1,X2,X3) p52: cons#(ok(X1),ok(X2)) -> cons#(X1,X2) p53: s#(ok(X)) -> s#(X) p54: sieve#(ok(X)) -> sieve#(X) p55: nats#(ok(X)) -> nats#(X) p56: top#(mark(X)) -> top#(proper(X)) p57: top#(mark(X)) -> proper#(X) p58: top#(ok(X)) -> top#(active(X)) p59: top#(ok(X)) -> active#(X) and R consists of: r1: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) r2: active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) r3: active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) r4: active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) r5: active(nats(N)) -> mark(cons(N,nats(s(N)))) r6: active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) r7: active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) r8: active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) r9: active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) r10: active(cons(X1,X2)) -> cons(active(X1),X2) r11: active(s(X)) -> s(active(X)) r12: active(sieve(X)) -> sieve(active(X)) r13: active(nats(X)) -> nats(active(X)) r14: filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) r15: filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) r16: filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) r17: cons(mark(X1),X2) -> mark(cons(X1,X2)) r18: s(mark(X)) -> mark(s(X)) r19: sieve(mark(X)) -> mark(sieve(X)) r20: nats(mark(X)) -> mark(nats(X)) r21: proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) r22: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) r23: proper(|0|()) -> ok(|0|()) r24: proper(s(X)) -> s(proper(X)) r25: proper(sieve(X)) -> sieve(proper(X)) r26: proper(nats(X)) -> nats(proper(X)) r27: proper(zprimes()) -> ok(zprimes()) r28: filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) r29: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) r30: s(ok(X)) -> ok(s(X)) r31: sieve(ok(X)) -> ok(sieve(X)) r32: nats(ok(X)) -> ok(nats(X)) r33: top(mark(X)) -> top(proper(X)) r34: top(ok(X)) -> top(active(X)) The estimated dependency graph contains the following SCCs: {p56, p58} {p18, p20, p22, p24, p26, p28, p30} {p39, p40, p41, p43, p44, p46, p48, p50} {p31, p32, p33, p51} {p34, p52} {p36, p54} {p37, p55} {p35, p53} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: top#(ok(X)) -> top#(active(X)) p2: top#(mark(X)) -> top#(proper(X)) and R consists of: r1: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) r2: active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) r3: active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) r4: active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) r5: active(nats(N)) -> mark(cons(N,nats(s(N)))) r6: active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) r7: active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) r8: active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) r9: active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) r10: active(cons(X1,X2)) -> cons(active(X1),X2) r11: active(s(X)) -> s(active(X)) r12: active(sieve(X)) -> sieve(active(X)) r13: active(nats(X)) -> nats(active(X)) r14: filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) r15: filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) r16: filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) r17: cons(mark(X1),X2) -> mark(cons(X1,X2)) r18: s(mark(X)) -> mark(s(X)) r19: sieve(mark(X)) -> mark(sieve(X)) r20: nats(mark(X)) -> mark(nats(X)) r21: proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) r22: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) r23: proper(|0|()) -> ok(|0|()) r24: proper(s(X)) -> s(proper(X)) r25: proper(sieve(X)) -> sieve(proper(X)) r26: proper(nats(X)) -> nats(proper(X)) r27: proper(zprimes()) -> ok(zprimes()) r28: filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) r29: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) r30: s(ok(X)) -> ok(s(X)) r31: sieve(ok(X)) -> ok(sieve(X)) r32: nats(ok(X)) -> ok(nats(X)) r33: top(mark(X)) -> top(proper(X)) r34: top(ok(X)) -> top(active(X)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23, r24, r25, r26, r27, r28, r29, r30, r31, r32 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: top#_A(x1) = ((0,1),(0,0)) x1 + (0,2) ok_A(x1) = x1 active_A(x1) = ((0,1),(0,1)) x1 + (2,0) mark_A(x1) = ((0,0),(0,1)) x1 + (2,1) proper_A(x1) = ((0,1),(0,1)) x1 filter_A(x1,x2,x3) = ((0,0),(0,1)) x1 + ((0,0),(0,1)) x2 + ((0,0),(0,1)) x3 + (2,13) cons_A(x1,x2) = ((0,0),(0,1)) x1 + (4,5) s_A(x1) = x1 sieve_A(x1) = x1 + (1,7) nats_A(x1) = x1 + (6,6) |0|_A() = (0,6) zprimes_A() = (1,20) precedence: active = proper = zprimes > sieve = nats > |0| > filter = cons > s > top# = ok = mark partial status: pi(top#) = [] pi(ok) = [] pi(active) = [] pi(mark) = [] pi(proper) = [] pi(filter) = [] pi(cons) = [] pi(s) = [] pi(sieve) = [] pi(nats) = [] pi(|0|) = [] pi(zprimes) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: top#_A(x1) = (8,0) ok_A(x1) = (0,0) active_A(x1) = (5,2) mark_A(x1) = (0,0) proper_A(x1) = (7,2) filter_A(x1,x2,x3) = (2,0) cons_A(x1,x2) = (3,2) s_A(x1) = (0,2) sieve_A(x1) = (4,2) nats_A(x1) = (5,0) |0|_A() = (1,1) zprimes_A() = (6,2) precedence: zprimes > |0| > cons > s > active > sieve > ok = filter > mark > top# > proper > nats partial status: pi(top#) = [] pi(ok) = [] pi(active) = [] pi(mark) = [] pi(proper) = [] pi(filter) = [] pi(cons) = [] pi(s) = [] pi(sieve) = [] pi(nats) = [] pi(|0|) = [] pi(zprimes) = [] 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: top#(ok(X)) -> top#(active(X)) and R consists of: r1: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) r2: active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) r3: active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) r4: active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) r5: active(nats(N)) -> mark(cons(N,nats(s(N)))) r6: active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) r7: active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) r8: active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) r9: active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) r10: active(cons(X1,X2)) -> cons(active(X1),X2) r11: active(s(X)) -> s(active(X)) r12: active(sieve(X)) -> sieve(active(X)) r13: active(nats(X)) -> nats(active(X)) r14: filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) r15: filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) r16: filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) r17: cons(mark(X1),X2) -> mark(cons(X1,X2)) r18: s(mark(X)) -> mark(s(X)) r19: sieve(mark(X)) -> mark(sieve(X)) r20: nats(mark(X)) -> mark(nats(X)) r21: proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) r22: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) r23: proper(|0|()) -> ok(|0|()) r24: proper(s(X)) -> s(proper(X)) r25: proper(sieve(X)) -> sieve(proper(X)) r26: proper(nats(X)) -> nats(proper(X)) r27: proper(zprimes()) -> ok(zprimes()) r28: filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) r29: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) r30: s(ok(X)) -> ok(s(X)) r31: sieve(ok(X)) -> ok(sieve(X)) r32: nats(ok(X)) -> ok(nats(X)) r33: top(mark(X)) -> top(proper(X)) r34: top(ok(X)) -> top(active(X)) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: top#(ok(X)) -> top#(active(X)) and R consists of: r1: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) r2: active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) r3: active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) r4: active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) r5: active(nats(N)) -> mark(cons(N,nats(s(N)))) r6: active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) r7: active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) r8: active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) r9: active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) r10: active(cons(X1,X2)) -> cons(active(X1),X2) r11: active(s(X)) -> s(active(X)) r12: active(sieve(X)) -> sieve(active(X)) r13: active(nats(X)) -> nats(active(X)) r14: filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) r15: filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) r16: filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) r17: cons(mark(X1),X2) -> mark(cons(X1,X2)) r18: s(mark(X)) -> mark(s(X)) r19: sieve(mark(X)) -> mark(sieve(X)) r20: nats(mark(X)) -> mark(nats(X)) r21: proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) r22: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) r23: proper(|0|()) -> ok(|0|()) r24: proper(s(X)) -> s(proper(X)) r25: proper(sieve(X)) -> sieve(proper(X)) r26: proper(nats(X)) -> nats(proper(X)) r27: proper(zprimes()) -> ok(zprimes()) r28: filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) r29: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) r30: s(ok(X)) -> ok(s(X)) r31: sieve(ok(X)) -> ok(sieve(X)) r32: nats(ok(X)) -> ok(nats(X)) r33: top(mark(X)) -> top(proper(X)) r34: top(ok(X)) -> top(active(X)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r28, r29, r30, r31, r32 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: top#_A(x1) = max{206, x1 + 205} ok_A(x1) = max{205, x1 + 126} active_A(x1) = x1 + 23 filter_A(x1,x2,x3) = max{78, x1 + 4, x2 + 6, x3 + 6} mark_A(x1) = max{79, x1} cons_A(x1,x2) = max{x1 + 65, x2 + 23} s_A(x1) = max{70, x1} sieve_A(x1) = x1 + 35 nats_A(x1) = max{125, x1 + 46} |0|_A = 3 zprimes_A = 161 precedence: top# = active > filter = cons > ok = s = sieve = nats > mark = |0| = zprimes partial status: pi(top#) = [1] pi(ok) = [1] pi(active) = [1] pi(filter) = [1, 2, 3] pi(mark) = [1] pi(cons) = [1, 2] pi(s) = [1] pi(sieve) = [1] pi(nats) = [1] pi(|0|) = [] pi(zprimes) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: top#_A(x1) = x1 + 62 ok_A(x1) = max{60, x1 + 40} active_A(x1) = x1 filter_A(x1,x2,x3) = max{x1 - 18, x2 + 9, x3 + 9} mark_A(x1) = x1 + 150 cons_A(x1,x2) = max{x1 + 36, x2 + 51} s_A(x1) = x1 + 24 sieve_A(x1) = x1 + 39 nats_A(x1) = x1 + 25 |0|_A = 35 zprimes_A = 148 precedence: top# = ok = active = filter = mark = cons = s = sieve = nats = |0| = zprimes partial status: pi(top#) = [] pi(ok) = [1] pi(active) = [1] pi(filter) = [3] pi(mark) = [1] pi(cons) = [1, 2] pi(s) = [1] pi(sieve) = [1] pi(nats) = [1] pi(|0|) = [] pi(zprimes) = [] 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: active#(nats(X)) -> active#(X) p2: active#(sieve(X)) -> active#(X) p3: active#(s(X)) -> active#(X) p4: active#(cons(X1,X2)) -> active#(X1) p5: active#(filter(X1,X2,X3)) -> active#(X3) p6: active#(filter(X1,X2,X3)) -> active#(X2) p7: active#(filter(X1,X2,X3)) -> active#(X1) and R consists of: r1: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) r2: active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) r3: active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) r4: active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) r5: active(nats(N)) -> mark(cons(N,nats(s(N)))) r6: active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) r7: active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) r8: active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) r9: active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) r10: active(cons(X1,X2)) -> cons(active(X1),X2) r11: active(s(X)) -> s(active(X)) r12: active(sieve(X)) -> sieve(active(X)) r13: active(nats(X)) -> nats(active(X)) r14: filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) r15: filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) r16: filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) r17: cons(mark(X1),X2) -> mark(cons(X1,X2)) r18: s(mark(X)) -> mark(s(X)) r19: sieve(mark(X)) -> mark(sieve(X)) r20: nats(mark(X)) -> mark(nats(X)) r21: proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) r22: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) r23: proper(|0|()) -> ok(|0|()) r24: proper(s(X)) -> s(proper(X)) r25: proper(sieve(X)) -> sieve(proper(X)) r26: proper(nats(X)) -> nats(proper(X)) r27: proper(zprimes()) -> ok(zprimes()) r28: filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) r29: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) r30: s(ok(X)) -> ok(s(X)) r31: sieve(ok(X)) -> ok(sieve(X)) r32: nats(ok(X)) -> ok(nats(X)) r33: top(mark(X)) -> top(proper(X)) r34: top(ok(X)) -> top(active(X)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: active#_A(x1) = max{2, x1 + 1} nats_A(x1) = max{1, x1} sieve_A(x1) = max{1, x1} s_A(x1) = max{1, x1} cons_A(x1,x2) = max{x1, x2} filter_A(x1,x2,x3) = max{1, x1, x2, x3} precedence: active# = nats = sieve = s = cons = filter partial status: pi(active#) = [1] pi(nats) = [1] pi(sieve) = [1] pi(s) = [1] pi(cons) = [1, 2] pi(filter) = [1, 2, 3] 2. weighted path order base order: max/plus interpretations on natural numbers: active#_A(x1) = x1 + 3 nats_A(x1) = x1 + 1 sieve_A(x1) = x1 + 1 s_A(x1) = x1 + 1 cons_A(x1,x2) = max{x1 + 1, x2} filter_A(x1,x2,x3) = max{x1 + 1, x2 + 1, x3 + 1} precedence: active# = nats = sieve = s = cons = filter partial status: pi(active#) = [] pi(nats) = [1] pi(sieve) = [1] pi(s) = [1] pi(cons) = [2] pi(filter) = [3] The next rules are strictly ordered: p1, p2, p3, p4, p5, p6, p7 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: proper#(nats(X)) -> proper#(X) p2: proper#(sieve(X)) -> proper#(X) p3: proper#(s(X)) -> proper#(X) p4: proper#(cons(X1,X2)) -> proper#(X2) p5: proper#(cons(X1,X2)) -> proper#(X1) p6: proper#(filter(X1,X2,X3)) -> proper#(X3) p7: proper#(filter(X1,X2,X3)) -> proper#(X2) p8: proper#(filter(X1,X2,X3)) -> proper#(X1) and R consists of: r1: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) r2: active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) r3: active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) r4: active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) r5: active(nats(N)) -> mark(cons(N,nats(s(N)))) r6: active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) r7: active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) r8: active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) r9: active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) r10: active(cons(X1,X2)) -> cons(active(X1),X2) r11: active(s(X)) -> s(active(X)) r12: active(sieve(X)) -> sieve(active(X)) r13: active(nats(X)) -> nats(active(X)) r14: filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) r15: filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) r16: filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) r17: cons(mark(X1),X2) -> mark(cons(X1,X2)) r18: s(mark(X)) -> mark(s(X)) r19: sieve(mark(X)) -> mark(sieve(X)) r20: nats(mark(X)) -> mark(nats(X)) r21: proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) r22: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) r23: proper(|0|()) -> ok(|0|()) r24: proper(s(X)) -> s(proper(X)) r25: proper(sieve(X)) -> sieve(proper(X)) r26: proper(nats(X)) -> nats(proper(X)) r27: proper(zprimes()) -> ok(zprimes()) r28: filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) r29: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) r30: s(ok(X)) -> ok(s(X)) r31: sieve(ok(X)) -> ok(sieve(X)) r32: nats(ok(X)) -> ok(nats(X)) r33: top(mark(X)) -> top(proper(X)) r34: top(ok(X)) -> top(active(X)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: proper#_A(x1) = max{2, x1 + 1} nats_A(x1) = max{1, x1} sieve_A(x1) = max{1, x1} s_A(x1) = max{1, x1} cons_A(x1,x2) = max{x1, x2} filter_A(x1,x2,x3) = max{1, x1, x2, x3} precedence: proper# = nats = sieve = s = cons = filter partial status: pi(proper#) = [1] pi(nats) = [1] pi(sieve) = [1] pi(s) = [1] pi(cons) = [1, 2] pi(filter) = [1, 2, 3] 2. weighted path order base order: max/plus interpretations on natural numbers: proper#_A(x1) = x1 + 2 nats_A(x1) = x1 + 1 sieve_A(x1) = x1 + 1 s_A(x1) = x1 + 1 cons_A(x1,x2) = max{x1 + 1, x2 + 1} filter_A(x1,x2,x3) = max{x1 + 1, x2 + 1, x3 + 1} precedence: proper# = nats = sieve = s = cons = filter partial status: pi(proper#) = [] pi(nats) = [1] pi(sieve) = [1] pi(s) = [1] pi(cons) = [2] pi(filter) = [3] The next rules are strictly ordered: p1, p2, p3, p4, p5, p6, p7, p8 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: filter#(mark(X1),X2,X3) -> filter#(X1,X2,X3) p2: filter#(ok(X1),ok(X2),ok(X3)) -> filter#(X1,X2,X3) p3: filter#(X1,X2,mark(X3)) -> filter#(X1,X2,X3) p4: filter#(X1,mark(X2),X3) -> filter#(X1,X2,X3) and R consists of: r1: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) r2: active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) r3: active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) r4: active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) r5: active(nats(N)) -> mark(cons(N,nats(s(N)))) r6: active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) r7: active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) r8: active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) r9: active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) r10: active(cons(X1,X2)) -> cons(active(X1),X2) r11: active(s(X)) -> s(active(X)) r12: active(sieve(X)) -> sieve(active(X)) r13: active(nats(X)) -> nats(active(X)) r14: filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) r15: filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) r16: filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) r17: cons(mark(X1),X2) -> mark(cons(X1,X2)) r18: s(mark(X)) -> mark(s(X)) r19: sieve(mark(X)) -> mark(sieve(X)) r20: nats(mark(X)) -> mark(nats(X)) r21: proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) r22: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) r23: proper(|0|()) -> ok(|0|()) r24: proper(s(X)) -> s(proper(X)) r25: proper(sieve(X)) -> sieve(proper(X)) r26: proper(nats(X)) -> nats(proper(X)) r27: proper(zprimes()) -> ok(zprimes()) r28: filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) r29: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) r30: s(ok(X)) -> ok(s(X)) r31: sieve(ok(X)) -> ok(sieve(X)) r32: nats(ok(X)) -> ok(nats(X)) r33: top(mark(X)) -> top(proper(X)) r34: top(ok(X)) -> top(active(X)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: filter#_A(x1,x2,x3) = max{x1 + 1, x2 + 1, x3 + 3} mark_A(x1) = max{1, x1} ok_A(x1) = max{3, x1 + 2} precedence: filter# = mark = ok partial status: pi(filter#) = [1, 2, 3] pi(mark) = [1] pi(ok) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: filter#_A(x1,x2,x3) = max{x1 + 1, x2 + 1} mark_A(x1) = x1 ok_A(x1) = x1 precedence: filter# = mark = ok partial status: pi(filter#) = [1, 2] pi(mark) = [1] pi(ok) = [1] The next rules are strictly ordered: p1, p2, p3, p4 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: cons#(mark(X1),X2) -> cons#(X1,X2) p2: cons#(ok(X1),ok(X2)) -> cons#(X1,X2) and R consists of: r1: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) r2: active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) r3: active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) r4: active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) r5: active(nats(N)) -> mark(cons(N,nats(s(N)))) r6: active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) r7: active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) r8: active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) r9: active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) r10: active(cons(X1,X2)) -> cons(active(X1),X2) r11: active(s(X)) -> s(active(X)) r12: active(sieve(X)) -> sieve(active(X)) r13: active(nats(X)) -> nats(active(X)) r14: filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) r15: filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) r16: filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) r17: cons(mark(X1),X2) -> mark(cons(X1,X2)) r18: s(mark(X)) -> mark(s(X)) r19: sieve(mark(X)) -> mark(sieve(X)) r20: nats(mark(X)) -> mark(nats(X)) r21: proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) r22: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) r23: proper(|0|()) -> ok(|0|()) r24: proper(s(X)) -> s(proper(X)) r25: proper(sieve(X)) -> sieve(proper(X)) r26: proper(nats(X)) -> nats(proper(X)) r27: proper(zprimes()) -> ok(zprimes()) r28: filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) r29: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) r30: s(ok(X)) -> ok(s(X)) r31: sieve(ok(X)) -> ok(sieve(X)) r32: nats(ok(X)) -> ok(nats(X)) r33: top(mark(X)) -> top(proper(X)) r34: top(ok(X)) -> top(active(X)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: cons#_A(x1,x2) = max{2, x1 + 1, x2 + 1} mark_A(x1) = max{1, x1} ok_A(x1) = max{1, x1} precedence: cons# = mark = ok partial status: pi(cons#) = [1, 2] pi(mark) = [1] pi(ok) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: cons#_A(x1,x2) = max{x1 + 1, x2 - 2} mark_A(x1) = x1 ok_A(x1) = max{4, x1 + 1} precedence: cons# = mark = ok partial status: pi(cons#) = [1] pi(mark) = [1] pi(ok) = [1] The next rules are strictly ordered: p1, p2 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: sieve#(mark(X)) -> sieve#(X) p2: sieve#(ok(X)) -> sieve#(X) and R consists of: r1: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) r2: active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) r3: active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) r4: active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) r5: active(nats(N)) -> mark(cons(N,nats(s(N)))) r6: active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) r7: active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) r8: active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) r9: active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) r10: active(cons(X1,X2)) -> cons(active(X1),X2) r11: active(s(X)) -> s(active(X)) r12: active(sieve(X)) -> sieve(active(X)) r13: active(nats(X)) -> nats(active(X)) r14: filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) r15: filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) r16: filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) r17: cons(mark(X1),X2) -> mark(cons(X1,X2)) r18: s(mark(X)) -> mark(s(X)) r19: sieve(mark(X)) -> mark(sieve(X)) r20: nats(mark(X)) -> mark(nats(X)) r21: proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) r22: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) r23: proper(|0|()) -> ok(|0|()) r24: proper(s(X)) -> s(proper(X)) r25: proper(sieve(X)) -> sieve(proper(X)) r26: proper(nats(X)) -> nats(proper(X)) r27: proper(zprimes()) -> ok(zprimes()) r28: filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) r29: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) r30: s(ok(X)) -> ok(s(X)) r31: sieve(ok(X)) -> ok(sieve(X)) r32: nats(ok(X)) -> ok(nats(X)) r33: top(mark(X)) -> top(proper(X)) r34: top(ok(X)) -> top(active(X)) The set of usable rules consists of (no rules) Take the monotone reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: sieve#_A(x1) = max{6, x1 + 4} mark_A(x1) = max{4, x1 + 3} ok_A(x1) = max{2, x1 + 1} precedence: sieve# = mark = ok partial status: pi(sieve#) = [1] pi(mark) = [1] pi(ok) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: sieve#_A(x1) = x1 + 1 mark_A(x1) = x1 ok_A(x1) = x1 precedence: sieve# = mark = ok partial status: pi(sieve#) = [1] pi(mark) = [1] pi(ok) = [1] The next rules are strictly ordered: p1, p2 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: nats#(mark(X)) -> nats#(X) p2: nats#(ok(X)) -> nats#(X) and R consists of: r1: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) r2: active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) r3: active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) r4: active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) r5: active(nats(N)) -> mark(cons(N,nats(s(N)))) r6: active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) r7: active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) r8: active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) r9: active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) r10: active(cons(X1,X2)) -> cons(active(X1),X2) r11: active(s(X)) -> s(active(X)) r12: active(sieve(X)) -> sieve(active(X)) r13: active(nats(X)) -> nats(active(X)) r14: filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) r15: filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) r16: filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) r17: cons(mark(X1),X2) -> mark(cons(X1,X2)) r18: s(mark(X)) -> mark(s(X)) r19: sieve(mark(X)) -> mark(sieve(X)) r20: nats(mark(X)) -> mark(nats(X)) r21: proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) r22: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) r23: proper(|0|()) -> ok(|0|()) r24: proper(s(X)) -> s(proper(X)) r25: proper(sieve(X)) -> sieve(proper(X)) r26: proper(nats(X)) -> nats(proper(X)) r27: proper(zprimes()) -> ok(zprimes()) r28: filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) r29: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) r30: s(ok(X)) -> ok(s(X)) r31: sieve(ok(X)) -> ok(sieve(X)) r32: nats(ok(X)) -> ok(nats(X)) r33: top(mark(X)) -> top(proper(X)) r34: top(ok(X)) -> top(active(X)) The set of usable rules consists of (no rules) Take the monotone reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: nats#_A(x1) = x1 + 2 mark_A(x1) = x1 ok_A(x1) = x1 + 2 precedence: mark > ok > nats# partial status: pi(nats#) = [1] pi(mark) = [1] pi(ok) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: nats#_A(x1) = x1 + 1 mark_A(x1) = x1 ok_A(x1) = x1 precedence: nats# = mark = ok partial status: pi(nats#) = [1] pi(mark) = [1] pi(ok) = [1] The next rules are strictly ordered: p1, p2 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: s#(mark(X)) -> s#(X) p2: s#(ok(X)) -> s#(X) and R consists of: r1: active(filter(cons(X,Y),|0|(),M)) -> mark(cons(|0|(),filter(Y,M,M))) r2: active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) r3: active(sieve(cons(|0|(),Y))) -> mark(cons(|0|(),sieve(Y))) r4: active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) r5: active(nats(N)) -> mark(cons(N,nats(s(N)))) r6: active(zprimes()) -> mark(sieve(nats(s(s(|0|()))))) r7: active(filter(X1,X2,X3)) -> filter(active(X1),X2,X3) r8: active(filter(X1,X2,X3)) -> filter(X1,active(X2),X3) r9: active(filter(X1,X2,X3)) -> filter(X1,X2,active(X3)) r10: active(cons(X1,X2)) -> cons(active(X1),X2) r11: active(s(X)) -> s(active(X)) r12: active(sieve(X)) -> sieve(active(X)) r13: active(nats(X)) -> nats(active(X)) r14: filter(mark(X1),X2,X3) -> mark(filter(X1,X2,X3)) r15: filter(X1,mark(X2),X3) -> mark(filter(X1,X2,X3)) r16: filter(X1,X2,mark(X3)) -> mark(filter(X1,X2,X3)) r17: cons(mark(X1),X2) -> mark(cons(X1,X2)) r18: s(mark(X)) -> mark(s(X)) r19: sieve(mark(X)) -> mark(sieve(X)) r20: nats(mark(X)) -> mark(nats(X)) r21: proper(filter(X1,X2,X3)) -> filter(proper(X1),proper(X2),proper(X3)) r22: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2)) r23: proper(|0|()) -> ok(|0|()) r24: proper(s(X)) -> s(proper(X)) r25: proper(sieve(X)) -> sieve(proper(X)) r26: proper(nats(X)) -> nats(proper(X)) r27: proper(zprimes()) -> ok(zprimes()) r28: filter(ok(X1),ok(X2),ok(X3)) -> ok(filter(X1,X2,X3)) r29: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2)) r30: s(ok(X)) -> ok(s(X)) r31: sieve(ok(X)) -> ok(sieve(X)) r32: nats(ok(X)) -> ok(nats(X)) r33: top(mark(X)) -> top(proper(X)) r34: top(ok(X)) -> top(active(X)) The set of usable rules consists of (no rules) Take the monotone reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: s#_A(x1) = max{6, x1 + 4} mark_A(x1) = max{4, x1 + 3} ok_A(x1) = max{2, x1 + 1} precedence: s# = mark = ok partial status: pi(s#) = [1] pi(mark) = [1] pi(ok) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: s#_A(x1) = x1 + 1 mark_A(x1) = x1 ok_A(x1) = x1 precedence: s# = mark = ok partial status: pi(s#) = [1] pi(mark) = [1] pi(ok) = [1] The next rules are strictly ordered: p1, p2 We remove them from the problem. Then no dependency pair remains.