(0) Obligation:

Generalized rewrite system (where rules with free variables on rhs are allowed):
The TRS R consists of the following rules:

sel(0, cons) → X
sel(s, cons) → sel(X, Z)
dbl(0) → 0
dbl(s) → s
dbls(nil) → nil
dbls(cons) → cons
indx(nil) → nil
indx(cons) → cons
fromcons