Certification Problem
Input (TPDB TRS_Standard/Transformed_CSR_04/Ex6_Luc98_Z)
The rewrite relation of the following TRS is considered.
first(0,X) |
→ |
nil |
(1) |
first(s(X),cons(Y,Z)) |
→ |
cons(Y,n__first(X,activate(Z))) |
(2) |
from(X) |
→ |
cons(X,n__from(s(X))) |
(3) |
first(X1,X2) |
→ |
n__first(X1,X2) |
(4) |
from(X) |
→ |
n__from(X) |
(5) |
activate(n__first(X1,X2)) |
→ |
first(X1,X2) |
(6) |
activate(n__from(X)) |
→ |
from(X) |
(7) |
activate(X) |
→ |
X |
(8) |
Property / Task
Prove or disprove termination.Answer / Result
Yes.Proof (by AProVE @ termCOMP 2023)
1 Rule Removal
Using the
linear polynomial interpretation over the naturals
[first(x1, x2)] |
= |
2 · x1 + 2 · x2
|
[0] |
= |
0 |
[nil] |
= |
0 |
[s(x1)] |
= |
1 · x1
|
[cons(x1, x2)] |
= |
1 + 1 · x1 + 1 · x2
|
[n__first(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[activate(x1)] |
= |
2 · x1
|
[from(x1)] |
= |
2 + 2 · x1
|
[n__from(x1)] |
= |
1 + 1 · x1
|
all of the following rules can be deleted.
first(s(X),cons(Y,Z)) |
→ |
cons(Y,n__first(X,activate(Z))) |
(2) |
from(X) |
→ |
n__from(X) |
(5) |
1.1 Rule Removal
Using the
linear polynomial interpretation over the naturals
[first(x1, x2)] |
= |
2 + 2 · x1 + 2 · x2
|
[0] |
= |
0 |
[nil] |
= |
1 |
[from(x1)] |
= |
1 + 2 · x1
|
[cons(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[n__from(x1)] |
= |
1 · x1
|
[s(x1)] |
= |
1 · x1
|
[n__first(x1, x2)] |
= |
2 + 2 · x1 + 1 · x2
|
[activate(x1)] |
= |
1 + 2 · x1
|
all of the following rules can be deleted.
first(0,X) |
→ |
nil |
(1) |
from(X) |
→ |
cons(X,n__from(s(X))) |
(3) |
activate(n__first(X1,X2)) |
→ |
first(X1,X2) |
(6) |
activate(X) |
→ |
X |
(8) |
1.1.1 Rule Removal
Using the
Knuth Bendix order with w0 = 1 and the following precedence and weight functions
prec(activate) |
= |
4 |
|
weight(activate) |
= |
1 |
|
|
|
prec(n__from) |
= |
2 |
|
weight(n__from) |
= |
1 |
|
|
|
prec(from) |
= |
3 |
|
weight(from) |
= |
2 |
|
|
|
prec(first) |
= |
1 |
|
weight(first) |
= |
0 |
|
|
|
prec(n__first) |
= |
0 |
|
weight(n__first) |
= |
0 |
|
|
|
all of the following rules can be deleted.
first(X1,X2) |
→ |
n__first(X1,X2) |
(4) |
activate(n__from(X)) |
→ |
from(X) |
(7) |
1.1.1.1 R is empty
There are no rules in the TRS. Hence, it is terminating.