(0) Obligation:
Q restricted rewrite system:
The TRS R consists of the following rules:
natsFrom(N) → cons(N, n__natsFrom(n__s(N)))
fst(pair(XS, YS)) → XS
snd(pair(XS, YS)) → YS
splitAt(0, XS) → pair(nil, XS)
splitAt(s(N), cons(X, XS)) → u(splitAt(N, activate(XS)), N, X, activate(XS))
u(pair(YS, ZS), N, X, XS) → pair(cons(activate(X), YS), ZS)
head(cons(N, XS)) → N
tail(cons(N, XS)) → activate(XS)
sel(N, XS) → head(afterNth(N, XS))
take(N, XS) → fst(splitAt(N, XS))
afterNth(N, XS) → snd(splitAt(N, XS))
natsFrom(X) → n__natsFrom(X)
s(X) → n__s(X)
activate(n__natsFrom(X)) → natsFrom(activate(X))
activate(n__s(X)) → s(activate(X))
activate(X) → X
Q is empty.
(1) QTRSRRRProof (EQUIVALENT transformation)
Used ordering:
Combined order from the following AFS and order.
natsFrom(
x1) =
natsFrom(
x1)
cons(
x1,
x2) =
cons(
x1,
x2)
n__natsFrom(
x1) =
n__natsFrom(
x1)
n__s(
x1) =
n__s(
x1)
fst(
x1) =
x1
pair(
x1,
x2) =
pair(
x1,
x2)
snd(
x1) =
x1
splitAt(
x1,
x2) =
splitAt(
x1,
x2)
0 =
0
nil =
nil
s(
x1) =
s(
x1)
u(
x1,
x2,
x3,
x4) =
u(
x1,
x2,
x3,
x4)
activate(
x1) =
activate(
x1)
head(
x1) =
x1
tail(
x1) =
tail(
x1)
sel(
x1,
x2) =
sel(
x1,
x2)
afterNth(
x1,
x2) =
afterNth(
x1,
x2)
take(
x1,
x2) =
take(
x1,
x2)
Recursive path order with status [RPO].
Quasi-Precedence:
0 > nil > [nnatsFrom1, pair2]
tail1 > activate1 > natsFrom1 > cons2 > [nnatsFrom1, pair2]
tail1 > activate1 > natsFrom1 > [ns1, s1] > [nnatsFrom1, pair2]
sel2 > afterNth2 > [splitAt2, take2] > nil > [nnatsFrom1, pair2]
sel2 > afterNth2 > [splitAt2, take2] > u4 > activate1 > natsFrom1 > cons2 > [nnatsFrom1, pair2]
sel2 > afterNth2 > [splitAt2, take2] > u4 > activate1 > natsFrom1 > [ns1, s1] > [nnatsFrom1, pair2]
Status:
sel2: [1,2]
tail1: multiset
afterNth2: multiset
nnatsFrom1: multiset
activate1: [1]
ns1: multiset
take2: [1,2]
0: multiset
splitAt2: [1,2]
cons2: multiset
u4: multiset
pair2: multiset
s1: multiset
nil: multiset
natsFrom1: multiset
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:
natsFrom(N) → cons(N, n__natsFrom(n__s(N)))
fst(pair(XS, YS)) → XS
snd(pair(XS, YS)) → YS
splitAt(0, XS) → pair(nil, XS)
splitAt(s(N), cons(X, XS)) → u(splitAt(N, activate(XS)), N, X, activate(XS))
u(pair(YS, ZS), N, X, XS) → pair(cons(activate(X), YS), ZS)
head(cons(N, XS)) → N
tail(cons(N, XS)) → activate(XS)
sel(N, XS) → head(afterNth(N, XS))
afterNth(N, XS) → snd(splitAt(N, XS))
natsFrom(X) → n__natsFrom(X)
activate(n__natsFrom(X)) → natsFrom(activate(X))
activate(n__s(X)) → s(activate(X))
activate(X) → X
(2) Obligation:
Q restricted rewrite system:
The TRS R consists of the following rules:
take(N, XS) → fst(splitAt(N, XS))
s(X) → n__s(X)
Q is empty.
(3) QTRSRRRProof (EQUIVALENT transformation)
Used ordering:
Polynomial interpretation [POLO]:
POL(fst(x1)) = x1
POL(n__s(x1)) = x1
POL(s(x1)) = 1 + x1
POL(splitAt(x1, x2)) = x1 + x2
POL(take(x1, x2)) = 1 + x1 + x2
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:
take(N, XS) → fst(splitAt(N, XS))
s(X) → n__s(X)
(4) Obligation:
Q restricted rewrite system:
R is empty.
Q is empty.
(5) RisEmptyProof (EQUIVALENT transformation)
The TRS R is empty. Hence, termination is trivially proven.
(6) TRUE
(7) RisEmptyProof (EQUIVALENT transformation)
The TRS R is empty. Hence, termination is trivially proven.
(8) TRUE
(9) RisEmptyProof (EQUIVALENT transformation)
The TRS R is empty. Hence, termination is trivially proven.
(10) TRUE