Certification Problem

Input (TPDB TRS_Standard/Transformed_CSR_04/Ex2_Luc02a_Z)

The rewrite relation of the following TRS is considered.

terms(N) cons(recip(sqr(N)),n__terms(s(N))) (1)
sqr(0) 0 (2)
sqr(s(X)) s(add(sqr(X),dbl(X))) (3)
dbl(0) 0 (4)
dbl(s(X)) s(s(dbl(X))) (5)
add(0,X) X (6)
add(s(X),Y) s(add(X,Y)) (7)
first(0,X) nil (8)
first(s(X),cons(Y,Z)) cons(Y,n__first(X,activate(Z))) (9)
terms(X) n__terms(X) (10)
first(X1,X2) n__first(X1,X2) (11)
activate(n__terms(X)) terms(X) (12)
activate(n__first(X1,X2)) first(X1,X2) (13)
activate(X) X (14)

Property / Task

Prove or disprove termination.

Answer / Result

Yes.

Proof (by AProVE @ termCOMP 2023)

1 Rule Removal

Using the
prec(terms) = 5 stat(terms) = mul
prec(cons) = 1 stat(cons) = mul
prec(sqr) = 4 stat(sqr) = mul
prec(s) = 0 stat(s) = mul
prec(0) = 2 stat(0) = mul
prec(add) = 3 stat(add) = lex
prec(dbl) = 2 stat(dbl) = mul
prec(first) = 5 stat(first) = mul
prec(nil) = 2 stat(nil) = mul
prec(n__first) = 0 stat(n__first) = mul
prec(activate) = 5 stat(activate) = mul

π(terms) = [1]
π(cons) = [1,2]
π(recip) = 1
π(sqr) = [1]
π(n__terms) = 1
π(s) = [1]
π(0) = []
π(add) = [2,1]
π(dbl) = [1]
π(first) = [1,2]
π(nil) = []
π(n__first) = [1,2]
π(activate) = [1]

all of the following rules can be deleted.
terms(N) cons(recip(sqr(N)),n__terms(s(N))) (1)
sqr(0) 0 (2)
sqr(s(X)) s(add(sqr(X),dbl(X))) (3)
dbl(0) 0 (4)
dbl(s(X)) s(s(dbl(X))) (5)
add(0,X) X (6)
add(s(X),Y) s(add(X,Y)) (7)
first(0,X) nil (8)
first(s(X),cons(Y,Z)) cons(Y,n__first(X,activate(Z))) (9)
terms(X) n__terms(X) (10)
first(X1,X2) n__first(X1,X2) (11)
activate(n__first(X1,X2)) first(X1,X2) (13)
activate(X) X (14)

1.1 Rule Removal

Using the Knuth Bendix order with w0 = 1 and the following precedence and weight functions
prec(activate) = 2 weight(activate) = 1
prec(n__terms) = 0 weight(n__terms) = 1
prec(terms) = 1 weight(terms) = 2
all of the following rules can be deleted.
activate(n__terms(X)) terms(X) (12)

1.1.1 R is empty

There are no rules in the TRS. Hence, it is terminating.