We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , afterNth(N, XS) -> snd(splitAt(N, XS)) , snd(pair(X, Y)) -> Y , and(tt(), X) -> activate(X) , fst(pair(X, Y)) -> X , head(cons(N, XS)) -> N , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) , sel(N, XS) -> head(afterNth(N, XS)) , tail(cons(N, XS)) -> activate(XS) , take(N, XS) -> fst(splitAt(N, XS)) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) We add the following weak dependency pairs: Strict DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , head^#(cons(N, XS)) -> c_11(N) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } and mark the set of starting terms. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , head^#(cons(N, XS)) -> c_11(N) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Strict Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , afterNth(N, XS) -> snd(splitAt(N, XS)) , snd(pair(X, Y)) -> Y , and(tt(), X) -> activate(X) , fst(pair(X, Y)) -> X , head(cons(N, XS)) -> N , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) , sel(N, XS) -> head(afterNth(N, XS)) , tail(cons(N, XS)) -> activate(XS) , take(N, XS) -> fst(splitAt(N, XS)) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) We replace rewrite rules by usable rules: Strict Usable Rules: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , afterNth(N, XS) -> snd(splitAt(N, XS)) , snd(pair(X, Y)) -> Y , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , head^#(cons(N, XS)) -> c_11(N) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Strict Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , afterNth(N, XS) -> snd(splitAt(N, XS)) , snd(pair(X, Y)) -> Y , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [0 0] x1 + [1 1] x2 + [1 0] x3 + [1 1] x4 + [0] [1 1] [0 0] [0 0] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [activate](x1) = [1 0] x1 + [0] [0 0] [0] [pair](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [snd](x1) = [1 1] x1 + [0] [0 0] [0] [natsFrom](x1) = [1 0] x1 + [1] [0 0] [0] [n__natsFrom](x1) = [1 0] x1 + [0] [0 1] [0] [s](x1) = [0 0] x1 + [0] [1 1] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [0 1] x1 + [1 1] x2 + [1 0] x3 + [1 0] x4 + [0] [1 0] [0 0] [0 0] [0 1] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 1] x1 + [0] [0 0] [0] [splitAt^#](x1, x2) = [0 1] x1 + [1 1] x2 + [0] [1 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [1 1] x1 + [0] [0 0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [1 1] x1 + [7] [0 0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_7](x1) = [1 0] x1 + [0] [0 1] [0] [snd^#](x1) = [1 1] x1 + [0] [0 0] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [0 1] x1 + [1 1] x2 + [2] [1 0] [0 0] [5] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 1] x1 + [0] [0 0] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 1] x1 + [0] [0 0] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0 1] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [c_13](x1) = [1 1] x1 + [0] [0 0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [0] [tail^#](x1) = [1 1] x1 + [0] [0 0] [5] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_16](x1) = [1 0] x1 + [0] [0 1] [0] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 1] X + [1 1] YS + [1 1] ZS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] X + [1 1] YS + [1 1] ZS + [0] [0 0] [0 0] [0 0] [0] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 1] XS + [0] [0 0] [0] >= [1 1] XS + [0] [0 0] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [1] [0 0] [0] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] >= [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 1] X + [1 1] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [1] [0 0] [0] ? [1 0] N + [0] [1 1] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [1] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 1] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 1] X + [1 1] YS + [1 1] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 1] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 1] X + [0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 1] X + [0] [0 0] [0] ? [1 1] X + [7] [0 0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 1] XS + [0] [0 0] [0] >= [1 1] XS + [0] [0 0] [0] = [c_4(XS)] [natsFrom^#(N)] = [1 1] N + [7] [0 0] [0] > [1 1] N + [0] [0 0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [1 1] X + [7] [0 0] [0] > [1 1] X + [0] [0 0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 1] X + [1 1] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 1] X + [2] [0 0] [5] > [1 1] X + [0] [0 0] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 1] X + [1 1] Y + [0] [0 0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 1] XS + [0] [0 0] [0 0] [0] ? [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 1] XS + [0] [0 0] [0 0] [5] >= [1 1] XS + [0] [0 0] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , snd^#(pair(X, Y)) -> c_8(Y) , fst^#(pair(X, Y)) -> c_10(X) , head^#(cons(N, XS)) -> c_11(N) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) } Strict Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , afterNth(N, XS) -> snd(splitAt(N, XS)) , snd(pair(X, Y)) -> Y , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Weak DPs: { natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , and^#(tt(), X) -> c_9(activate^#(X)) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [1 0] x1 + [1 1] x2 + [1 0] x3 + [1 1] x4 + [1] [0 1] [0 0] [0 1] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 0] x1 + [1 1] x2 + [0] [0 1] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [activate](x1) = [1 0] x1 + [0] [0 0] [0] [pair](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [snd](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom](x1) = [1 0] x1 + [1] [0 0] [3] [n__natsFrom](x1) = [1 0] x1 + [0] [0 1] [0] [s](x1) = [0 0] x1 + [0] [1 1] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [1 1] x1 + [1 1] x2 + [1 0] x3 + [1 1] x4 + [0] [0 0] [0 0] [0 0] [0 0] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 1] x2 + [0] [0 1] [0 0] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 1] x1 + [0] [0 0] [0] [splitAt^#](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [1 1] x1 + [0] [0 0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [1 1] x1 + [1] [0 0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_7](x1) = [1 0] x1 + [0] [0 1] [4] [snd^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 0] x1 + [1 1] x2 + [5] [0 1] [0 0] [4] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [1 0] x2 + [0] [0 0] [0] [c_13](x1) = [1 1] x1 + [0] [0 0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [0] [tail^#](x1) = [1 1] x1 + [2] [0 0] [4] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_16](x1) = [1 0] x1 + [0] [0 1] [0] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 1] XS + [1] [0 0] [0 1] [0 0] [0] > [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 1] X + [1 1] YS + [1 0] ZS + [0] [0 0] [0 0] [0 1] [0] >= [1 0] X + [1 1] YS + [1 0] ZS + [0] [0 0] [0 0] [0 1] [0] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] ? [1 1] N + [1 0] X + [1 0] XS + [1] [0 0] [0 1] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 0] XS + [0] [0 0] [0] ? [1 0] XS + [0] [0 1] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [1] [0 0] [3] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 0] XS + [0] [0 0] [0 0] [0] >= [1 1] N + [1 0] XS + [0] [0 0] [0 0] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 1] X + [1 0] Y + [0] [0 0] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [1] [0 0] [3] ? [1 0] N + [0] [1 2] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [1] [0 0] [3] ? [1 0] X + [0] [0 1] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 1] X + [1 1] YS + [1 0] ZS + [0] [0 0] [0 0] [0 1] [0] ? [1 1] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 1] X + [0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 1] X + [0] [0 0] [0] ? [1 1] X + [1] [0 0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 1] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 1] XS + [0] [0 0] [0] >= [1 1] XS + [0] [0 0] [0] = [c_4(XS)] [natsFrom^#(N)] = [1 1] N + [1] [0 0] [0] > [1 0] N + [0] [0 0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [1 1] X + [1] [0 0] [0] > [1 1] X + [0] [0 0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 0] XS + [0] [0 0] [0 0] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 1] X + [1 0] Y + [0] [0 0] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 1] X + [5] [0 0] [4] > [1 1] X + [0] [0 0] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 1] X + [1 0] Y + [0] [0 0] [0 1] [0] ? [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [0] [0 1] [0 1] [0] >= [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [0] [0 0] [0 0] [0] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 1] N + [1 1] XS + [2] [0 0] [0 0] [4] > [1 1] XS + [0] [0 0] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 0] XS + [0] [0 0] [0 0] [0] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , snd^#(pair(X, Y)) -> c_8(Y) , fst^#(pair(X, Y)) -> c_10(X) , head^#(cons(N, XS)) -> c_11(N) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , afterNth(N, XS) -> snd(splitAt(N, XS)) , snd(pair(X, Y)) -> Y , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Weak DPs: { natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , and^#(tt(), X) -> c_9(activate^#(X)) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [0 1] x1 + [1 0] x2 + [1 0] x3 + [1 1] x4 + [0] [1 0] [0 0] [0 0] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [activate](x1) = [1 0] x1 + [0] [0 0] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 0] x2 + [4] [0 0] [0 0] [4] [snd](x1) = [1 0] x1 + [0] [0 0] [0] [natsFrom](x1) = [1 0] x1 + [1] [0 0] [2] [n__natsFrom](x1) = [1 0] x1 + [0] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 0] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [0 0] x1 + [1 0] x2 + [1 0] x3 + [1 0] x4 + [0] [1 0] [0 0] [0 0] [0 0] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [1] [0 1] [0] [splitAt^#](x1, x2) = [0 1] x1 + [1 0] x2 + [0] [1 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [1 0] x1 + [0] [0 0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [1] [0 1] [0] [natsFrom^#](x1) = [0 0] x1 + [0] [1 0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 0] [7] [c_7](x1) = [1 0] x1 + [0] [0 1] [4] [snd^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 0] x1 + [1 0] x2 + [5] [0 0] [0 1] [4] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 0] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [4] [tail^#](x1) = [1 0] x1 + [4] [0 1] [4] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 0] [7] [c_16](x1) = [1 0] x1 + [4] [0 1] [4] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 0] N + [1 0] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 0] XS + [0] [0 0] [0] >= [1 0] XS + [0] [0 0] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [1] [0 0] [2] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 0] XS + [4] [0 0] [0 0] [4] > [1 1] N + [1 0] XS + [0] [0 0] [0 0] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [1] [0 0] [2] > [1 0] N + [0] [0 0] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [1] [0 0] [2] > [1 0] X + [0] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [1] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [1] [0 1] [0] > [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [1] [0 0] [0] ? [0 0] X + [1] [1 0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 0] XS + [0] [0 0] [0] >= [1 0] XS + [0] [0 0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0 0] N + [0] [1 0] [0] >= [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0 0] X + [0] [1 0] [0] >= [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 0] XS + [0] [0 0] [0 0] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [5] [0 1] [4] > [1 0] X + [1] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [0] [0 0] [0 0] [0] ? [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 0] [4] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [4] [0 0] [0 1] [4] > [1 0] XS + [1] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 0] [4] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , snd^#(pair(X, Y)) -> c_8(Y) , fst^#(pair(X, Y)) -> c_10(X) , head^#(cons(N, XS)) -> c_11(N) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , snd(pair(X, Y)) -> Y } Weak DPs: { activate^#(X) -> c_5(X) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , and^#(tt(), X) -> c_9(activate^#(X)) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , afterNth(N, XS) -> snd(splitAt(N, XS)) , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [0 0] x1 + [1 1] x2 + [1 0] x3 + [1 1] x4 + [0] [1 1] [0 0] [0 0] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [activate](x1) = [1 0] x1 + [0] [0 0] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 0] [4] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 0] x2 + [4] [0 0] [0 0] [4] [snd](x1) = [1 0] x1 + [0] [0 0] [0] [natsFrom](x1) = [1 0] x1 + [5] [0 0] [6] [n__natsFrom](x1) = [1 0] x1 + [0] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 1] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [0 1] x1 + [1 0] x2 + [1 0] x3 + [1 0] x4 + [0] [1 0] [0 0] [0 0] [0 1] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [0] [0 1] [0] [splitAt^#](x1, x2) = [0 1] x1 + [1 0] x2 + [0] [1 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [1 0] x1 + [0] [0 0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [1] [0 1] [0] [natsFrom^#](x1) = [0 0] x1 + [0] [1 0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 0] [7] [c_7](x1) = [1 0] x1 + [4] [0 1] [0] [snd^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 0] x1 + [1 0] x2 + [5] [0 0] [0 1] [5] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [1] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 0] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [4] [tail^#](x1) = [1 0] x1 + [4] [0 1] [4] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 0] [7] [c_16](x1) = [1 0] x1 + [4] [0 1] [4] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 1] YS + [1 0] ZS + [4] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 1] [0 0] [4] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 0] XS + [0] [0 0] [0] ? [1 0] XS + [0] [0 0] [4] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [5] [0 0] [6] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 0] XS + [4] [0 0] [0 0] [4] > [1 1] N + [1 0] XS + [0] [0 0] [0 0] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [5] [0 0] [6] > [1 0] N + [0] [0 0] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [5] [0 0] [6] > [1 0] X + [0] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 1] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [0 0] X + [1] [1 0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 0] XS + [0] [0 0] [0] >= [1 0] XS + [0] [0 0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0 0] N + [0] [1 0] [0] >= [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0 0] X + [0] [1 0] [0] >= [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 0] [0] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [5] [0 1] [5] > [1 0] X + [0] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [1] [0 1] [0 0] [4] > [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [0] [0 0] [0 0] [0] ? [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 0] [4] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [4] [0 0] [0 1] [4] > [1 0] XS + [0] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 0] XS + [5] [0 0] [0 0] [4] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , snd^#(pair(X, Y)) -> c_8(Y) , head^#(cons(N, XS)) -> c_11(N) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , snd(pair(X, Y)) -> Y } Weak DPs: { activate^#(X) -> c_5(X) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , afterNth(N, XS) -> snd(splitAt(N, XS)) , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [1 0] x1 + [1 0] x2 + [1 1] x3 + [1 0] x4 + [0] [0 0] [0 0] [0 0] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [activate](x1) = [1 0] x1 + [0] [0 0] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 0] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [1] [afterNth](x1, x2) = [1 1] x1 + [1 1] x2 + [4] [0 0] [0 0] [4] [snd](x1) = [1 0] x1 + [0] [0 0] [0] [natsFrom](x1) = [1 0] x1 + [7] [0 1] [4] [n__natsFrom](x1) = [1 0] x1 + [0] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 0] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [1 0] x4 + [0] [0 0] [0 0] [0 0] [0 0] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [0] [0 1] [0] [splitAt^#](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [1 0] x1 + [0] [0 0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [0 0] x1 + [1] [1 0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_7](x1) = [1 0] x1 + [0] [0 1] [4] [snd^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [0 0] x1 + [1 0] x2 + [5] [1 0] [0 1] [4] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [0] [tail^#](x1) = [1 0] x1 + [5] [0 1] [4] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_16](x1) = [1 0] x1 + [0] [0 1] [0] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 0] N + [1 1] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 1] [0 0] [1] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 0] N + [1 1] X + [1 1] XS + [1] [0 0] [0 0] [0 0] [0] > [1 0] N + [1 1] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 1] XS + [0] [0 0] [0] >= [1 0] XS + [0] [0 0] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [7] [0 1] [4] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 1] XS + [4] [0 0] [0 0] [4] > [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [7] [0 1] [4] > [1 0] N + [0] [0 1] [1] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [7] [0 1] [4] > [1 0] X + [0] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [0 0] X + [1] [1 0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 0] XS + [0] [0 0] [0] >= [1 0] XS + [0] [0 0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0 0] N + [1] [1 0] [0] > [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0 0] X + [1] [1 0] [0] > [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [0] [0 0] [0 0] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [5] [0 1] [4] > [1 0] X + [0] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 0] [0] >= [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [0] [0 1] [0 1] [1] >= [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [4] [0 0] [0 0] [4] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [5] [0 1] [0 1] [5] > [1 0] XS + [0] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , snd^#(pair(X, Y)) -> c_8(Y) , head^#(cons(N, XS)) -> c_11(N) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , snd(pair(X, Y)) -> Y } Weak DPs: { activate^#(X) -> c_5(X) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , afterNth(N, XS) -> snd(splitAt(N, XS)) , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [0 0] x1 + [1 1] x2 + [1 1] x3 + [1 1] x4 + [0] [1 1] [0 0] [0 0] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [activate](x1) = [1 0] x1 + [0] [0 0] [0] [pair](x1, x2) = [1 0] x1 + [1 1] x2 + [0] [0 1] [0 0] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 1] x2 + [4] [0 0] [0 0] [4] [snd](x1) = [1 1] x1 + [0] [0 0] [0] [natsFrom](x1) = [1 0] x1 + [7] [0 1] [4] [n__natsFrom](x1) = [1 0] x1 + [0] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 1] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [1 0] x1 + [1 0] x2 + [1 1] x3 + [1 1] x4 + [1] [0 0] [0 1] [0 0] [0 0] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [0] [0 1] [0] [splitAt^#](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [0 0] x1 + [0] [1 0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [1 0] x1 + [1] [0 1] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_7](x1) = [1 0] x1 + [4] [0 1] [4] [snd^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 0] x1 + [1 0] x2 + [4] [0 1] [0 1] [4] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0 0] x1 + [0] [0 1] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [0] [tail^#](x1) = [1 0] x1 + [5] [0 1] [5] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_16](x1) = [1 0] x1 + [4] [0 1] [4] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 1] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 1] X + [1 1] YS + [1 1] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 1] ZS + [0] [0 0] [0 1] [0 0] [0] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 1] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 1] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 1] XS + [0] [0 0] [0] >= [1 1] XS + [0] [0 0] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [7] [0 1] [4] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 1] XS + [4] [0 0] [0 0] [4] > [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 1] X + [1 1] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [7] [0 1] [4] > [1 0] N + [0] [0 1] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [7] [0 1] [4] > [1 0] X + [0] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 0] N + [1 1] X + [1 1] XS + [1] [0 1] [0 0] [0 0] [0] > [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 1] ZS + [0] [0 1] [0 1] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [1] [0 1] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 1] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] N + [1 1] X + [1 0] XS + [1] [0 1] [0 0] [0 0] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 1] XS + [0] [0 0] [0] ? [0 0] XS + [0] [1 0] [0] = [c_4(XS)] [natsFrom^#(N)] = [1 0] N + [1] [0 1] [0] > [0 0] N + [0] [0 1] [0] = [c_12(N, N)] [natsFrom^#(X)] = [1 0] X + [1] [0 1] [0] > [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [4] [0 0] [0 0] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 1] Y + [0] [0 1] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [4] [0 1] [4] > [1 0] X + [0] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 1] Y + [0] [0 1] [0 0] [0] >= [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [0] [0 0] [0 0] [0] ? [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [4] [0 0] [0 0] [0] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [5] [0 1] [0 1] [5] > [1 0] XS + [0] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [4] [0 0] [0 0] [4] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , snd^#(pair(X, Y)) -> c_8(Y) , head^#(cons(N, XS)) -> c_11(N) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , snd(pair(X, Y)) -> Y } Weak DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , activate^#(X) -> c_5(X) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , afterNth(N, XS) -> snd(splitAt(N, XS)) , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [0 0] x1 + [1 1] x2 + [1 1] x3 + [1 1] x4 + [0] [1 1] [0 0] [0 0] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [activate](x1) = [1 0] x1 + [0] [0 1] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [2] [0 1] [0 1] [1] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 1] x2 + [4] [0 0] [0 0] [0] [snd](x1) = [1 1] x1 + [0] [0 0] [0] [natsFrom](x1) = [1 0] x1 + [4] [0 1] [4] [n__natsFrom](x1) = [1 0] x1 + [0] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 1] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [1 1] x1 + [1 1] x2 + [1 0] x3 + [1 1] x4 + [0] [0 0] [0 0] [0 0] [0 0] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [0] [0 1] [0] [splitAt^#](x1, x2) = [0 1] x1 + [1 1] x2 + [0] [1 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [1 1] x1 + [0] [0 0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [0 0] x1 + [1] [1 1] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_7](x1) = [1 0] x1 + [4] [0 1] [4] [snd^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 1] x1 + [1 0] x2 + [4] [0 0] [0 1] [5] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 1] x1 + [0] [0 0] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [4] [tail^#](x1) = [1 0] x1 + [4] [0 1] [5] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_16](x1) = [1 0] x1 + [0] [0 1] [4] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 1] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 1] YS + [1 1] ZS + [3] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [2] [0 1] [0 1] [0 1] [1] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 1] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 1] XS + [0] [0 0] [0] ? [1 0] XS + [2] [0 1] [1] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [4] [0 1] [4] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 1] XS + [4] [0 0] [0 0] [0] > [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 1] X + [1 1] Y + [3] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [4] [0 1] [4] > [1 0] N + [0] [0 1] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [4] [0 1] [4] > [1 0] X + [0] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 1] YS + [1 1] ZS + [3] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [0 0] X + [1] [1 1] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 1] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 1] XS + [0] [0 0] [0] >= [1 1] XS + [0] [0 0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0 0] N + [1] [1 1] [0] > [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0 0] X + [1] [1 1] [0] > [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [4] [0 0] [0 0] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [2] [0 1] [0 1] [1] > [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [4] [0 1] [5] > [1 0] X + [0] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [2] [0 1] [0 1] [1] > [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] ? [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [4] [0 0] [0 0] [4] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [4] [0 1] [0 1] [5] > [1 0] XS + [0] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [0] [0 0] [0 0] [4] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , head^#(cons(N, XS)) -> c_11(N) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , snd(pair(X, Y)) -> Y } Weak DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , activate^#(X) -> c_5(X) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , afterNth(N, XS) -> snd(splitAt(N, XS)) , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [1 0] x4 + [0] [0 1] [0 0] [0 1] [0 1] [0] [tt] = [0] [0] [U12](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [activate](x1) = [1 0] x1 + [0] [0 0] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 1] x2 + [4] [0 0] [0 0] [4] [snd](x1) = [1 1] x1 + [0] [0 0] [0] [natsFrom](x1) = [1 0] x1 + [7] [0 1] [4] [n__natsFrom](x1) = [1 0] x1 + [0] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 0] [0] [0] = [7] [1] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [0 1] x1 + [1 0] x2 + [1 1] x3 + [1 1] x4 + [0] [1 0] [0 1] [0 0] [0 0] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [0] [0 1] [0] [splitAt^#](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [1 1] x1 + [0] [0 0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [1] [0 1] [0] [natsFrom^#](x1) = [0 0] x1 + [0] [1 0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_7](x1) = [1 0] x1 + [0] [0 1] [4] [snd^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 1] x1 + [1 0] x2 + [5] [0 0] [0 1] [5] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0 0] x1 + [0] [1 0] [0] [c_13](x1) = [0 0] x1 + [0] [1 0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [0] [tail^#](x1) = [1 0] x1 + [5] [0 1] [5] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_16](x1) = [1 0] x1 + [0] [0 1] [4] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 1] X + [1 1] YS + [1 1] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 1] [0 1] [0] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 0] XS + [8] [0 1] [0] > [1 0] XS + [0] [0 1] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [7] [0 1] [4] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 1] XS + [4] [0 0] [0 0] [4] > [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 1] X + [1 1] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [7] [0 1] [4] > [1 0] N + [0] [0 1] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [7] [0 1] [4] > [1 0] X + [0] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 0] N + [1 1] X + [1 1] XS + [0] [0 1] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 1] X + [1 1] YS + [1 1] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [0 0] X + [1] [1 0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 0] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] N + [1 1] X + [1 0] XS + [0] [0 1] [0 0] [0 0] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 1] XS + [8] [0 0] [0] > [1 1] XS + [0] [0 0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0 0] N + [0] [1 0] [0] >= [0 0] N + [0] [1 0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0 0] X + [0] [1 0] [0] >= [0 0] X + [0] [1 0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [0] [0 0] [0 1] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [5] [0 1] [5] > [1 0] X + [0] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [0] [0 1] [0 1] [0] >= [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [4] [0 0] [0 0] [4] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [5] [0 1] [0 1] [5] > [1 0] XS + [0] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [0] [0 0] [0 1] [4] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , head^#(cons(N, XS)) -> c_11(N) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , snd(pair(X, Y)) -> Y } Weak DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , activate^#(X) -> c_5(X) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , afterNth(N, XS) -> snd(splitAt(N, XS)) , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [0 0] x1 + [1 1] x2 + [1 0] x3 + [1 0] x4 + [0] [1 1] [0 0] [0 0] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [activate](x1) = [1 0] x1 + [0] [0 1] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [4] [snd](x1) = [1 0] x1 + [0] [0 0] [0] [natsFrom](x1) = [1 0] x1 + [7] [0 1] [6] [n__natsFrom](x1) = [1 0] x1 + [0] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 1] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [0 1] x1 + [1 1] x2 + [1 1] x3 + [1 1] x4 + [0] [1 0] [0 0] [0 0] [0 0] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [1] [0 1] [0] [splitAt^#](x1, x2) = [0 1] x1 + [1 1] x2 + [0] [1 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_7](x1) = [1 0] x1 + [4] [0 1] [4] [snd^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 1] x1 + [1 0] x2 + [4] [0 0] [0 1] [5] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 1] x1 + [0] [0 0] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [0] [tail^#](x1) = [1 0] x1 + [4] [0 1] [5] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_16](x1) = [1 0] x1 + [0] [0 1] [4] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 0] XS + [0] [0 1] [0] >= [1 0] XS + [0] [0 1] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [7] [0 1] [6] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 1] XS + [0] [0 0] [0 0] [4] >= [1 1] N + [1 0] XS + [0] [0 0] [0 0] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [7] [0 1] [6] > [1 0] N + [0] [0 1] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [7] [0 1] [6] > [1 0] X + [0] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 1] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [1] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [1] [0 1] [0] > [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [1] [0 0] [0] > [0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 1] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 1] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 1] XS + [0] [0 0] [0] >= [0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0] [0] >= [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0] [0] >= [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 1] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [4] [0 1] [5] > [1 0] X + [1] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 1] N + [1 1] XS + [0] [0 0] [0 0] [0] ? [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [4] [0 0] [0 0] [0] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [4] [0 1] [0 1] [5] > [1 0] XS + [1] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [0] [0 0] [0 1] [4] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , head^#(cons(N, XS)) -> c_11(N) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , snd(pair(X, Y)) -> Y } Weak DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , afterNth(N, XS) -> snd(splitAt(N, XS)) , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [0 1] x1 + [1 0] x2 + [1 0] x3 + [1 1] x4 + [0] [1 0] [0 0] [0 0] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [activate](x1) = [1 0] x1 + [0] [0 0] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 0] x2 + [4] [0 0] [0 1] [4] [snd](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom](x1) = [1 0] x1 + [7] [0 0] [0] [n__natsFrom](x1) = [1 0] x1 + [4] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 0] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [1 0] x4 + [1] [0 0] [0 0] [0 0] [0 0] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [1] [0 1] [0 1] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [0] [0 1] [0] [splitAt^#](x1, x2) = [0 1] x1 + [1 0] x2 + [0] [1 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_7](x1) = [1 0] x1 + [4] [0 1] [4] [snd^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 0] x1 + [1 0] x2 + [4] [0 0] [0 1] [4] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 0] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [0] [tail^#](x1) = [1 0] x1 + [4] [0 1] [4] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_16](x1) = [1 0] x1 + [4] [0 1] [4] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 0] N + [1 0] X + [1 1] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 1] [0 1] [0] >= [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 1] [0 1] [0] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 1] [0] >= [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 0] XS + [0] [0 1] [0] >= [1 0] XS + [0] [0 1] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [4] [0 0] [0] ? [1 0] X + [7] [0 0] [0] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 0] XS + [4] [0 0] [0 1] [4] > [1 1] N + [1 0] XS + [0] [0 0] [0 1] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [7] [0 0] [0] > [1 0] N + [4] [0 0] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [7] [0 0] [0] > [1 0] X + [4] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 0] N + [1 0] X + [1 0] XS + [1] [0 0] [0 0] [0 0] [0] >= [1 0] N + [1 0] X + [1 0] XS + [1] [0 0] [0 0] [0 0] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [1] [0 1] [0 1] [0 1] [0] > [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [4] [0 0] [0] > [0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 0] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] N + [1 0] X + [1 0] XS + [1] [0 0] [0 0] [0 0] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 0] XS + [0] [0 0] [0] >= [0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0] [0] >= [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0] [0] >= [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 1] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [4] [0 1] [4] > [1 0] X + [0] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [0] [0 0] [0 0] [0] ? [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 0] [0] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [4] [0 0] [0 1] [4] > [1 0] XS + [0] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 1] [4] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , head^#(cons(N, XS)) -> c_11(N) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , snd(pair(X, Y)) -> Y } Weak DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , afterNth(N, XS) -> snd(splitAt(N, XS)) , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [1 1] x1 + [1 1] x2 + [1 0] x3 + [1 0] x4 + [0] [0 0] [0 0] [0 0] [0 1] [0] [tt] = [5] [3] [U12](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 0] x2 + [5] [0 0] [0 1] [0] [activate](x1) = [1 0] x1 + [1] [0 1] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [4] [0 0] [0 1] [4] [afterNth](x1, x2) = [1 1] x1 + [1 1] x2 + [6] [0 0] [0 0] [0] [snd](x1) = [1 0] x1 + [0] [0 0] [0] [natsFrom](x1) = [1 0] x1 + [4] [0 0] [4] [n__natsFrom](x1) = [1 0] x1 + [0] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 1] [0] [0] = [0] [4] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [1 1] x1 + [1 1] x2 + [1 0] x3 + [1 0] x4 + [0] [0 0] [0 0] [0 1] [0 1] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [0] [0 1] [0] [splitAt^#](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_7](x1) = [1 0] x1 + [0] [0 1] [4] [snd^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 1] x1 + [1 0] x2 + [1] [0 0] [0 1] [5] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 1] x1 + [0] [0 0] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 1] x2 + [7] [0 0] [0 0] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [4] [tail^#](x1) = [1 0] x1 + [1] [0 1] [1] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_16](x1) = [1 0] x1 + [0] [0 1] [4] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [8] [0 0] [0 0] [0 1] [0] >= [1 1] N + [1 0] X + [1 0] XS + [8] [0 0] [0 0] [0 1] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 1] [0 1] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [5] [0 0] [0 1] [0 1] [4] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [9] [0 0] [0 0] [0 1] [4] >= [1 1] N + [1 0] X + [1 0] XS + [9] [0 0] [0 0] [0 1] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 0] XS + [9] [0 1] [0] > [1 0] XS + [0] [0 1] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [1] [0 1] [0] > [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [1] [0 0] [0] ? [1 0] X + [4] [0 0] [4] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 1] XS + [6] [0 0] [0 0] [0] > [1 1] N + [1 0] XS + [5] [0 0] [0 0] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 0] [0 0] [0] ? [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [4] [0 0] [4] >= [1 0] N + [4] [0 0] [4] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [4] [0 0] [4] > [1 0] X + [0] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [8] [0 0] [0 1] [0 1] [0] >= [1 1] N + [1 0] X + [1 0] XS + [8] [0 0] [0 1] [0 1] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] >= [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] >= [0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 1] XS + [8] [0 0] [0 0] [0 0] [0] ? [1 1] N + [1 0] X + [1 0] XS + [9] [0 0] [0 1] [0 1] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 1] XS + [4] [0 0] [0] > [0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0] [0] >= [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0] [0] >= [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [5] [0 0] [0 1] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [9] [0 1] [5] > [1 0] X + [0] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 1] XS + [8] [0 0] [0 0] [0] ? [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 1] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 1] XS + [6] [0 0] [0 0] [4] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [5] [0 0] [0 1] [5] > [1 0] XS + [0] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [5] [0 0] [0 1] [4] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , head^#(cons(N, XS)) -> c_11(N) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , activate(n__natsFrom(X)) -> natsFrom(X) , snd(pair(X, Y)) -> Y } Weak DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , afterNth(N, XS) -> snd(splitAt(N, XS)) , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [0 0] x1 + [1 1] x2 + [1 0] x3 + [1 0] x4 + [0] [1 1] [0 0] [0 0] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [activate](x1) = [1 0] x1 + [0] [0 1] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [1] [afterNth](x1, x2) = [1 1] x1 + [1 0] x2 + [4] [0 0] [0 1] [4] [snd](x1) = [1 0] x1 + [4] [0 1] [0] [natsFrom](x1) = [1 0] x1 + [4] [0 1] [7] [n__natsFrom](x1) = [1 0] x1 + [1] [0 0] [4] [s](x1) = [0 0] x1 + [0] [1 1] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [0 1] x1 + [1 1] x2 + [1 0] x3 + [1 0] x4 + [0] [1 0] [0 0] [0 1] [0 1] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [0] [0 1] [0] [splitAt^#](x1, x2) = [1 1] x1 + [1 1] x2 + [0] [0 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_7](x1) = [1 0] x1 + [4] [0 1] [4] [snd^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 0] x2 + [5] [0 1] [4] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 0] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [4] [tail^#](x1) = [1 0] x1 + [5] [0 1] [4] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_16](x1) = [1 0] x1 + [4] [0 1] [0] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [1] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [1] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 0] XS + [0] [0 1] [0] >= [1 0] XS + [0] [0 1] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [1] [0 0] [4] ? [1 0] X + [4] [0 1] [7] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 0] XS + [4] [0 0] [0 1] [4] >= [1 1] N + [1 0] XS + [4] [0 0] [0 1] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 0] X + [1 0] Y + [4] [0 1] [0 1] [0] > [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [4] [0 1] [7] > [1 0] N + [1] [0 1] [5] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [4] [0 1] [7] > [1 0] X + [1] [0 0] [4] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] >= [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [1] [0 0] [4] > [0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 1] N + [1 1] X + [1 1] XS + [1] [0 0] [0 0] [0 0] [0] ? [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 1] XS + [0] [0 0] [0] >= [0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0] [0] >= [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0] [0] >= [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 1] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [5] [0 1] [4] > [1 0] X + [0] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [0] [0 0] [0 0] [0] ? [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 0] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 0] [4] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [5] [0 1] [0 1] [5] > [1 0] XS + [0] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 1] [0] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , head^#(cons(N, XS)) -> c_11(N) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , activate(n__natsFrom(X)) -> natsFrom(X) } Weak DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , afterNth(N, XS) -> snd(splitAt(N, XS)) , snd(pair(X, Y)) -> Y , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [0 0] x1 + [1 1] x2 + [1 0] x3 + [1 0] x4 + [0] [1 1] [0 0] [0 0] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [activate](x1) = [1 0] x1 + [0] [0 1] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 0] x2 + [4] [0 0] [0 1] [4] [snd](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom](x1) = [1 0] x1 + [4] [0 1] [7] [n__natsFrom](x1) = [1 0] x1 + [0] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 1] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [1 1] x2 + [1 0] x3 + [1 0] x4 + [0] [0 0] [0 1] [0 1] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [0] [0 1] [0] [splitAt^#](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_7](x1) = [1 0] x1 + [4] [0 1] [0] [snd^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 0] x2 + [5] [0 1] [4] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 0] x1 + [1] [0 1] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [0] [tail^#](x1) = [1 0] x1 + [4] [0 1] [5] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_16](x1) = [1 0] x1 + [0] [0 1] [0] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 0] XS + [0] [0 1] [0] >= [1 0] XS + [0] [0 1] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [4] [0 1] [7] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 0] XS + [4] [0 0] [0 1] [4] > [1 1] N + [1 0] XS + [0] [0 0] [0 1] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [4] [0 1] [7] > [1 0] N + [0] [0 1] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [4] [0 1] [7] > [1 0] X + [0] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] >= [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] >= [0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] ? [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 0] XS + [0] [0 0] [0] >= [0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0] [0] >= [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0] [0] >= [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 1] [0] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [5] [0 1] [4] > [1 0] X + [0] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [1] [0 1] [0 1] [0] > [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [5] [0 0] [0 1] [4] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [4] [0 1] [0 1] [5] > [1 0] XS + [0] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [0] [0 0] [0 1] [0] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) } Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , activate(n__natsFrom(X)) -> natsFrom(X) } Weak DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , head^#(cons(N, XS)) -> c_11(N) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , afterNth(N, XS) -> snd(splitAt(N, XS)) , snd(pair(X, Y)) -> Y , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [0 0] x1 + [1 1] x2 + [1 0] x3 + [1 0] x4 + [0] [1 1] [0 0] [0 0] [0 0] [0] [tt] = [0] [0] [U12](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 0] [0] [splitAt](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [activate](x1) = [1 0] x1 + [0] [0 1] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [4] [0 1] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 0] x2 + [4] [0 0] [0 1] [4] [snd](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom](x1) = [1 0] x1 + [7] [0 1] [4] [n__natsFrom](x1) = [1 0] x1 + [0] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 1] [0] [0] = [0] [0] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [0 1] x1 + [1 1] x2 + [1 0] x3 + [1 0] x4 + [0] [1 0] [0 0] [0 1] [0 1] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [0] [0 1] [0] [splitAt^#](x1, x2) = [1 1] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [c_3](x1) = [1 0] x1 + [0] [0 1] [0] [c_4](x1) = [0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_7](x1) = [1 0] x1 + [0] [0 1] [0] [snd^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [1 0] x1 + [1 0] x2 + [5] [0 0] [0 1] [5] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [0] [tail^#](x1) = [1 0] x1 + [0] [0 1] [5] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_16](x1) = [1 0] x1 + [4] [0 1] [4] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] ? [1 0] X + [1 0] YS + [1 0] ZS + [4] [0 1] [0 1] [0 1] [0] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [4] [0 0] [0 1] [0 1] [0] > [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 0] XS + [0] [0 1] [0] >= [1 0] XS + [0] [0 1] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [7] [0 1] [4] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 0] XS + [4] [0 0] [0 1] [4] > [1 1] N + [1 0] XS + [0] [0 0] [0 1] [0] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [7] [0 1] [4] > [1 0] N + [4] [0 1] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [7] [0 1] [4] > [1 0] X + [0] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] >= [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] >= [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] >= [0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [4] [0 0] [0 1] [0 1] [0] > [1 1] N + [1 0] X + [1 0] XS + [0] [0 0] [0 1] [0 1] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 0] XS + [0] [0 1] [0] >= [0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0] [0] >= [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0] [0] >= [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [0] [0 0] [0 1] [0] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [5] [0 1] [5] > [1 0] X + [0] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [0] [0 1] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [4] [0 1] [0 1] [0] > [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 1] [4] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [4] [0 1] [0 1] [5] > [1 0] XS + [0] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [4] [0 0] [0 1] [4] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict Trs: { U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , activate(n__natsFrom(X)) -> natsFrom(X) } Weak DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , head^#(cons(N, XS)) -> c_11(N) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , afterNth(N, XS) -> snd(splitAt(N, XS)) , snd(pair(X, Y)) -> Y , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following nonconstant growth matrix-interpretation) The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [1 1] x1 + [1 1] x2 + [1 0] x3 + [1 0] x4 + [5] [0 0] [0 0] [0 1] [0 1] [4] [tt] = [1] [3] [U12](x1, x2) = [1 0] x1 + [1 0] x2 + [4] [0 1] [0 1] [0] [splitAt](x1, x2) = [1 1] x1 + [1 0] x2 + [5] [0 0] [0 1] [4] [activate](x1) = [1 0] x1 + [0] [0 1] [0] [pair](x1, x2) = [1 0] x1 + [1 0] x2 + [2] [0 1] [0 1] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [afterNth](x1, x2) = [1 1] x1 + [1 0] x2 + [6] [0 0] [0 1] [4] [snd](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom](x1) = [1 0] x1 + [7] [0 1] [4] [n__natsFrom](x1) = [1 0] x1 + [0] [0 0] [0] [s](x1) = [0 0] x1 + [1] [1 1] [3] [0] = [0] [0] [nil] = [0] [1] [U11^#](x1, x2, x3, x4) = [0 0] x1 + [1 1] x2 + [1 0] x3 + [1 0] x4 + [5] [1 1] [0 0] [0 1] [0 1] [0] [c_1](x1) = [1 0] x1 + [0] [0 1] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 1] [0 1] [0 1] [0] [activate^#](x1) = [1 0] x1 + [0] [0 1] [0] [splitAt^#](x1, x2) = [0 1] x1 + [1 0] x2 + [4] [1 0] [0 1] [4] [c_3](x1) = [1 0] x1 + [1] [0 1] [0] [c_4](x1) = [0] [0] [c_5](x1) = [1 0] x1 + [0] [0 1] [0] [c_6](x1) = [1 0] x1 + [0] [0 1] [0] [natsFrom^#](x1) = [0] [0] [afterNth^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_7](x1) = [1 0] x1 + [0] [0 1] [0] [snd^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_8](x1) = [1 0] x1 + [0] [0 1] [0] [and^#](x1, x2) = [0 1] x1 + [1 0] x2 + [4] [1 0] [0 1] [4] [c_9](x1) = [1 0] x1 + [0] [0 1] [0] [fst^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_10](x1) = [1 0] x1 + [0] [0 1] [0] [head^#](x1) = [1 0] x1 + [0] [0 1] [0] [c_11](x1) = [1 0] x1 + [0] [0 1] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_14](x1) = [1 0] x1 + [0] [0 1] [0] [tail^#](x1) = [1 0] x1 + [4] [0 1] [4] [c_15](x1) = [1 0] x1 + [0] [0 1] [0] [take^#](x1, x2) = [1 1] x1 + [1 0] x2 + [7] [0 0] [0 1] [7] [c_16](x1) = [1 0] x1 + [0] [0 1] [0] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [9] [0 0] [0 1] [0 1] [4] >= [1 1] N + [1 0] X + [1 0] XS + [9] [0 0] [0 1] [0 1] [4] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [6] [0 1] [0 1] [0 1] [0] > [1 0] X + [1 0] YS + [1 0] ZS + [2] [0 1] [0 1] [0 1] [0] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [9] [0 0] [0 1] [0 1] [4] >= [1 1] N + [1 0] X + [1 0] XS + [9] [0 0] [0 1] [0 1] [4] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 0] XS + [5] [0 1] [4] > [1 0] XS + [2] [0 1] [1] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] ? [1 0] X + [7] [0 1] [4] = [natsFrom(X)] [afterNth(N, XS)] = [1 1] N + [1 0] XS + [6] [0 0] [0 1] [4] > [1 1] N + [1 0] XS + [5] [0 0] [0 1] [4] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 0] X + [1 0] Y + [2] [0 1] [0 1] [0] > [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [7] [0 1] [4] > [1 0] N + [1] [0 1] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [7] [0 1] [4] > [1 0] X + [0] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [1 1] N + [1 0] X + [1 0] XS + [5] [0 0] [0 1] [0 1] [4] >= [1 1] N + [1 0] X + [1 0] XS + [5] [0 0] [0 1] [0 1] [4] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 0] ZS + [2] [0 1] [0 1] [0 1] [0] > [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 1] [0 1] [0 1] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 1] [0] >= [1 0] X + [0] [0 1] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [0] [0 0] [0] >= [0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [1 1] N + [1 0] X + [1 0] XS + [7] [0 0] [0 1] [0 1] [5] > [1 1] N + [1 0] X + [1 0] XS + [6] [0 0] [0 1] [0 1] [4] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [1 0] XS + [4] [0 1] [4] > [0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0] [0] >= [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0] [0] >= [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [5] [0 0] [0 1] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 0] Y + [2] [0 1] [0 1] [0] > [1 0] Y + [0] [0 1] [0] = [c_8(Y)] [and^#(tt(), X)] = [1 0] X + [7] [0 1] [5] > [1 0] X + [0] [0 1] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 0] Y + [2] [0 1] [0 1] [0] > [1 0] X + [0] [0 1] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [0] [0 1] [0 1] [0] >= [1 0] N + [0] [0 1] [0] = [c_11(N)] [sel^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [6] [0 0] [0 1] [4] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [1 0] N + [1 0] XS + [4] [0 1] [0 1] [4] > [1 0] XS + [0] [0 1] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [1 1] N + [1 0] XS + [7] [0 0] [0 1] [7] > [1 1] N + [1 0] XS + [5] [0 0] [0 1] [4] = [c_16(fst^#(splitAt(N, XS)))] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict Trs: { activate(n__natsFrom(X)) -> natsFrom(X) } Weak DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , head^#(cons(N, XS)) -> c_11(N) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , afterNth(N, XS) -> snd(splitAt(N, XS)) , snd(pair(X, Y)) -> Y , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(n^1)) We use the processor 'matrix interpretation of dimension 2' to orient following rules strictly. Trs: { activate(n__natsFrom(X)) -> natsFrom(X) } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^1)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(U11) = {3, 4}, Uargs(U12) = {1, 2}, Uargs(splitAt) = {1, 2}, Uargs(activate) = {1}, Uargs(pair) = {1, 2}, Uargs(cons) = {1, 2}, Uargs(snd) = {1}, Uargs(U11^#) = {4}, Uargs(c_1) = {1}, Uargs(U12^#) = {1, 2}, Uargs(c_2) = {1, 2, 3}, Uargs(activate^#) = {1}, Uargs(c_3) = {1}, Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(snd^#) = {1}, Uargs(c_8) = {1}, Uargs(c_9) = {1}, Uargs(fst^#) = {1}, Uargs(c_10) = {1}, Uargs(head^#) = {1}, Uargs(c_11) = {1}, Uargs(c_14) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed the following constructor-based matrix interpretation satisfying not(EDA) and not(IDA(1)). [U11](x1, x2, x3, x4) = [7 1] x1 + [4 4] x2 + [1 0] x3 + [1 4] x4 + [1] [0 0] [0 0] [0 0] [0 0] [0] [tt] = [1] [1] [U12](x1, x2) = [1 5] x1 + [1 0] x2 + [1] [0 1] [0 0] [0] [splitAt](x1, x2) = [1 4] x1 + [1 4] x2 + [5] [0 0] [0 0] [0] [activate](x1) = [1 0] x1 + [1] [0 1] [0] [pair](x1, x2) = [1 0] x1 + [1 1] x2 + [2] [0 0] [0 0] [0] [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [afterNth](x1, x2) = [4 4] x1 + [4 7] x2 + [6] [4 6] [4 6] [5] [snd](x1) = [1 0] x1 + [0] [1 0] [0] [natsFrom](x1) = [1 0] x1 + [2] [0 0] [0] [n__natsFrom](x1) = [1 0] x1 + [2] [0 0] [0] [s](x1) = [0 0] x1 + [0] [1 1] [2] [0] = [2] [2] [nil] = [0] [0] [U11^#](x1, x2, x3, x4) = [4 2] x1 + [2 4] x2 + [3 0] x3 + [2 4] x4 + [7] [0 0] [4 2] [0 4] [4 0] [0] [c_1](x1) = [1 1] x1 + [0] [0 0] [0] [U12^#](x1, x2) = [1 0] x1 + [1 0] x2 + [4] [0 1] [0 0] [0] [c_2](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [1 0] x3 + [0] [0 0] [0 0] [0 0] [0] [activate^#](x1) = [1 0] x1 + [0] [0 2] [0] [splitAt^#](x1, x2) = [0 4] x1 + [3 4] x2 + [7] [0 0] [0 0] [0] [c_3](x1) = [1 0] x1 + [0] [0 0] [0] [c_4](x1) = [0] [0] [c_5](x1) = [1 0] x1 + [0] [0 0] [0] [c_6](x1) = [1 0] x1 + [0] [0 0] [0] [natsFrom^#](x1) = [0] [0] [afterNth^#](x1, x2) = [7 7] x1 + [7 7] x2 + [7] [7 7] [7 7] [7] [c_7](x1) = [1 0] x1 + [0] [0 0] [4] [snd^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_8](x1) = [1 0] x1 + [0] [0 0] [0] [and^#](x1, x2) = [7 7] x2 + [5] [7 7] [4] [c_9](x1) = [4 0] x1 + [0] [0 0] [0] [fst^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_10](x1) = [1 0] x1 + [0] [0 0] [0] [head^#](x1) = [1 0] x1 + [0] [0 0] [0] [c_11](x1) = [1 0] x1 + [0] [0 0] [0] [c_12](x1, x2) = [0] [0] [c_13](x1) = [0] [0] [sel^#](x1, x2) = [7 7] x1 + [7 7] x2 + [7] [7 7] [7 7] [7] [c_14](x1) = [1 0] x1 + [0] [0 0] [4] [tail^#](x1) = [4 0] x1 + [7] [0 0] [5] [c_15](x1) = [4 0] x1 + [0] [0 0] [0] [take^#](x1, x2) = [7 7] x1 + [7 7] x2 + [7] [7 7] [7 7] [7] [c_16](x1) = [1 0] x1 + [0] [0 0] [4] The order satisfies the following ordering constraints: [U11(tt(), N, X, XS)] = [4 4] N + [1 0] X + [1 4] XS + [9] [0 0] [0 0] [0 0] [0] >= [1 4] N + [1 0] X + [1 4] XS + [9] [0 0] [0 0] [0 0] [0] = [U12(splitAt(activate(N), activate(XS)), activate(X))] [U12(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 1] ZS + [3] [0 0] [0 0] [0 0] [0] >= [1 0] X + [1 0] YS + [1 1] ZS + [3] [0 0] [0 0] [0 0] [0] = [pair(cons(activate(X), YS), ZS)] [splitAt(s(N), cons(X, XS))] = [4 4] N + [1 0] X + [1 4] XS + [13] [0 0] [0 0] [0 0] [0] > [4 4] N + [1 0] X + [1 4] XS + [10] [0 0] [0 0] [0 0] [0] = [U11(tt(), N, X, activate(XS))] [splitAt(0(), XS)] = [1 4] XS + [15] [0 0] [0] > [1 1] XS + [2] [0 0] [0] = [pair(nil(), XS)] [activate(X)] = [1 0] X + [1] [0 1] [0] > [1 0] X + [0] [0 1] [0] = [X] [activate(n__natsFrom(X))] = [1 0] X + [3] [0 0] [0] > [1 0] X + [2] [0 0] [0] = [natsFrom(X)] [afterNth(N, XS)] = [4 4] N + [4 7] XS + [6] [4 6] [4 6] [5] > [1 4] N + [1 4] XS + [5] [1 4] [1 4] [5] = [snd(splitAt(N, XS))] [snd(pair(X, Y))] = [1 0] X + [1 1] Y + [2] [1 0] [1 1] [2] > [1 0] Y + [0] [0 1] [0] = [Y] [natsFrom(N)] = [1 0] N + [2] [0 0] [0] >= [1 0] N + [2] [0 0] [0] = [cons(N, n__natsFrom(s(N)))] [natsFrom(X)] = [1 0] X + [2] [0 0] [0] >= [1 0] X + [2] [0 0] [0] = [n__natsFrom(X)] [U11^#(tt(), N, X, XS)] = [2 4] N + [3 0] X + [2 4] XS + [13] [4 2] [0 4] [4 0] [0] > [1 4] N + [1 0] X + [1 4] XS + [12] [0 0] [0 0] [0 0] [0] = [c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X)))] [U12^#(pair(YS, ZS), X)] = [1 0] X + [1 0] YS + [1 1] ZS + [6] [0 0] [0 0] [0 0] [0] > [1 0] X + [1 0] YS + [1 0] ZS + [0] [0 0] [0 0] [0 0] [0] = [c_2(activate^#(X), YS, ZS)] [activate^#(X)] = [1 0] X + [0] [0 2] [0] >= [1 0] X + [0] [0 0] [0] = [c_5(X)] [activate^#(n__natsFrom(X))] = [1 0] X + [2] [0 0] [0] > [0] [0] = [c_6(natsFrom^#(X))] [splitAt^#(s(N), cons(X, XS))] = [4 4] N + [3 0] X + [3 4] XS + [15] [0 0] [0 0] [0 0] [0] >= [2 4] N + [3 0] X + [2 4] XS + [15] [0 0] [0 0] [0 0] [0] = [c_3(U11^#(tt(), N, X, activate(XS)))] [splitAt^#(0(), XS)] = [3 4] XS + [15] [0 0] [0] > [0] [0] = [c_4(XS)] [natsFrom^#(N)] = [0] [0] >= [0] [0] = [c_12(N, N)] [natsFrom^#(X)] = [0] [0] >= [0] [0] = [c_13(X)] [afterNth^#(N, XS)] = [7 7] N + [7 7] XS + [7] [7 7] [7 7] [7] > [1 4] N + [1 4] XS + [5] [0 0] [0 0] [4] = [c_7(snd^#(splitAt(N, XS)))] [snd^#(pair(X, Y))] = [1 0] X + [1 1] Y + [2] [0 0] [0 0] [0] > [1 0] Y + [0] [0 0] [0] = [c_8(Y)] [and^#(tt(), X)] = [7 7] X + [5] [7 7] [4] > [4 0] X + [0] [0 0] [0] = [c_9(activate^#(X))] [fst^#(pair(X, Y))] = [1 0] X + [1 1] Y + [2] [0 0] [0 0] [0] > [1 0] X + [0] [0 0] [0] = [c_10(X)] [head^#(cons(N, XS))] = [1 0] N + [1 0] XS + [0] [0 0] [0 0] [0] >= [1 0] N + [0] [0 0] [0] = [c_11(N)] [sel^#(N, XS)] = [7 7] N + [7 7] XS + [7] [7 7] [7 7] [7] > [4 4] N + [4 7] XS + [6] [0 0] [0 0] [4] = [c_14(head^#(afterNth(N, XS)))] [tail^#(cons(N, XS))] = [4 0] N + [4 0] XS + [7] [0 0] [0 0] [5] > [4 0] XS + [0] [0 0] [0] = [c_15(activate^#(XS))] [take^#(N, XS)] = [7 7] N + [7 7] XS + [7] [7 7] [7 7] [7] > [1 4] N + [1 4] XS + [5] [0 0] [0 0] [4] = [c_16(fst^#(splitAt(N, XS)))] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Weak DPs: { U11^#(tt(), N, X, XS) -> c_1(U12^#(splitAt(activate(N), activate(XS)), activate(X))) , U12^#(pair(YS, ZS), X) -> c_2(activate^#(X), YS, ZS) , activate^#(X) -> c_5(X) , activate^#(n__natsFrom(X)) -> c_6(natsFrom^#(X)) , splitAt^#(s(N), cons(X, XS)) -> c_3(U11^#(tt(), N, X, activate(XS))) , splitAt^#(0(), XS) -> c_4(XS) , natsFrom^#(N) -> c_12(N, N) , natsFrom^#(X) -> c_13(X) , afterNth^#(N, XS) -> c_7(snd^#(splitAt(N, XS))) , snd^#(pair(X, Y)) -> c_8(Y) , and^#(tt(), X) -> c_9(activate^#(X)) , fst^#(pair(X, Y)) -> c_10(X) , head^#(cons(N, XS)) -> c_11(N) , sel^#(N, XS) -> c_14(head^#(afterNth(N, XS))) , tail^#(cons(N, XS)) -> c_15(activate^#(XS)) , take^#(N, XS) -> c_16(fst^#(splitAt(N, XS))) } Weak Trs: { U11(tt(), N, X, XS) -> U12(splitAt(activate(N), activate(XS)), activate(X)) , U12(pair(YS, ZS), X) -> pair(cons(activate(X), YS), ZS) , splitAt(s(N), cons(X, XS)) -> U11(tt(), N, X, activate(XS)) , splitAt(0(), XS) -> pair(nil(), XS) , activate(X) -> X , activate(n__natsFrom(X)) -> natsFrom(X) , afterNth(N, XS) -> snd(splitAt(N, XS)) , snd(pair(X, Y)) -> Y , natsFrom(N) -> cons(N, n__natsFrom(s(N))) , natsFrom(X) -> n__natsFrom(X) } Obligation: runtime complexity Answer: YES(O(1),O(1)) Empty rules are trivially bounded Hurray, we answered YES(O(1),O(n^1))