The rewrite relation of the following TRS is considered.
double(0) | → | 0 | (1) |
double(s(x)) | → | s(s(double(x))) | (2) |
half(0) | → | 0 | (3) |
half(s(0)) | → | 0 | (4) |
half(s(s(x))) | → | s(half(x)) | (5) |
-(x,0) | → | x | (6) |
-(s(x),s(y)) | → | -(x,y) | (7) |
if(0,y,z) | → | y | (8) |
if(s(x),y,z) | → | z | (9) |
half(double(x)) | → | x | (10) |
[-(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[double(x1)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[half(x1)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[if(x1, x2, x3)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[0] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[s(x1)] | = |
|
half(0) | → | 0 | (3) |
half(s(0)) | → | 0 | (4) |
half(double(x)) | → | x | (10) |
[-(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||
[double(x1)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||
[half(x1)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||
[if(x1, x2, x3)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||
[0] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||
[s(x1)] | = |
|
-(x,0) | → | x | (6) |
[-(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||
[double(x1)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||
[half(x1)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||
[if(x1, x2, x3)] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||
[0] | = |
|
||||||||||||||||||||||||||||||||||||||||||||||||
[s(x1)] | = |
|
if(0,y,z) | → | y | (8) |
if(s(x),y,z) | → | z | (9) |
[-(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
[double(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
[half(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
[0] | = |
|
||||||||||||||||||||||||||||||||||||
[s(x1)] | = |
|
double(0) | → | 0 | (1) |
[-(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
[double(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
[half(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
[s(x1)] | = |
|
half(s(s(x))) | → | s(half(x)) | (5) |
-(s(x),s(y)) | → | -(x,y) | (7) |
[double(x1)] | = |
|
||||||||||||||||||||||||||||||||||||||
[s(x1)] | = |
|
double(s(x)) | → | s(s(double(x))) | (2) |
There are no rules in the TRS. Hence, it is terminating.