Certification Problem
Input (TPDB TRS_Standard/SK90/2.39)
The rewrite relation of the following TRS is considered.
|
rev(nil) |
→ |
nil |
(1) |
|
rev(.(x,y)) |
→ |
++(rev(y),.(x,nil)) |
(2) |
|
car(.(x,y)) |
→ |
x |
(3) |
|
cdr(.(x,y)) |
→ |
y |
(4) |
|
null(nil) |
→ |
true |
(5) |
|
null(.(x,y)) |
→ |
false |
(6) |
|
++(nil,y) |
→ |
y |
(7) |
|
++(.(x,y),z) |
→ |
.(x,++(y,z)) |
(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
| [rev(x1)] |
= |
2 · x1
|
| [nil] |
= |
0 |
| [.(x1, x2)] |
= |
2 · x1 + 1 · x2
|
| [++(x1, x2)] |
= |
1 · x1 + 1 · x2
|
| [car(x1)] |
= |
2 · x1
|
| [cdr(x1)] |
= |
2 · x1
|
| [null(x1)] |
= |
1 + 2 · x1
|
| [true] |
= |
1 |
| [false] |
= |
0 |
all of the following rules can be deleted.
1.1 Rule Removal
Using the
| prec(rev) |
= |
4 |
|
stat(rev) |
= |
mul
|
| prec(nil) |
= |
2 |
|
stat(nil) |
= |
mul
|
| prec(.) |
= |
0 |
|
stat(.) |
= |
mul
|
| prec(++) |
= |
3 |
|
stat(++) |
= |
mul
|
| prec(true) |
= |
1 |
|
stat(true) |
= |
mul
|
| π(rev) |
= |
[1] |
| π(nil) |
= |
[] |
| π(.) |
= |
[1,2] |
| π(++) |
= |
[1,2] |
| π(car) |
= |
1 |
| π(cdr) |
= |
1 |
| π(null) |
= |
1 |
| π(true) |
= |
[] |
all of the following rules can be deleted.
|
rev(nil) |
→ |
nil |
(1) |
|
rev(.(x,y)) |
→ |
++(rev(y),.(x,nil)) |
(2) |
|
car(.(x,y)) |
→ |
x |
(3) |
|
cdr(.(x,y)) |
→ |
y |
(4) |
|
null(nil) |
→ |
true |
(5) |
|
++(nil,y) |
→ |
y |
(7) |
|
++(.(x,y),z) |
→ |
.(x,++(y,z)) |
(8) |
1.1.1 R is empty
There are no rules in the TRS. Hence, it is terminating.