The rewrite relation of the following TRS is considered.
app(app(mapbt,f),app(leaf,x)) | → | app(leaf,app(f,x)) | (1) |
app(app(mapbt,f),app(app(app(branch,x),l),r)) | → | app(app(app(branch,app(f,x)),app(app(mapbt,f),l)),app(app(mapbt,f),r)) | (2) |
We uncurry the binary symbol app in combination with the following symbol map which also determines the applicative arities of these symbols.
mapbt | is mapped to | mapbt, | mapbt1(x1), | mapbt2(x1, x2) | |
leaf | is mapped to | leaf, | leaf1(x1) | ||
branch | is mapped to | branch, | branch1(x1), | branch2(x1, x2), | branch3(x1, x2, x3) |
mapbt2(f,leaf1(x)) | → | leaf1(app(f,x)) | (9) |
mapbt2(f,branch3(x,l,r)) | → | branch3(app(f,x),mapbt2(f,l),mapbt2(f,r)) | (10) |
app(mapbt,y1) | → | mapbt1(y1) | (3) |
app(mapbt1(x0),y1) | → | mapbt2(x0,y1) | (4) |
app(leaf,y1) | → | leaf1(y1) | (5) |
app(branch,y1) | → | branch1(y1) | (6) |
app(branch1(x0),y1) | → | branch2(x0,y1) | (7) |
app(branch2(x0,x1),y1) | → | branch3(x0,x1,y1) | (8) |
prec(mapbt2) | = | 2 | stat(mapbt2) | = | mul | |
prec(app) | = | 2 | stat(app) | = | mul | |
prec(branch3) | = | 1 | stat(branch3) | = | lex | |
prec(mapbt) | = | 3 | stat(mapbt) | = | mul | |
prec(leaf) | = | 4 | stat(leaf) | = | mul | |
prec(branch) | = | 5 | stat(branch) | = | mul | |
prec(branch2) | = | 0 | stat(branch2) | = | mul |
π(mapbt2) | = | [1,2] |
π(leaf1) | = | 1 |
π(app) | = | [1,2] |
π(branch3) | = | [1,2,3] |
π(mapbt) | = | [] |
π(mapbt1) | = | 1 |
π(leaf) | = | [] |
π(branch) | = | [] |
π(branch1) | = | 1 |
π(branch2) | = | [1,2] |
mapbt2(f,branch3(x,l,r)) | → | branch3(app(f,x),mapbt2(f,l),mapbt2(f,r)) | (10) |
app(mapbt,y1) | → | mapbt1(y1) | (3) |
app(leaf,y1) | → | leaf1(y1) | (5) |
app(branch,y1) | → | branch1(y1) | (6) |
app(branch1(x0),y1) | → | branch2(x0,y1) | (7) |
app(branch2(x0,x1),y1) | → | branch3(x0,x1,y1) | (8) |
prec(leaf1) | = | 3 | weight(leaf1) | = | 1 | ||||
prec(mapbt1) | = | 2 | weight(mapbt1) | = | 1 | ||||
prec(mapbt2) | = | 0 | weight(mapbt2) | = | 1 | ||||
prec(app) | = | 1 | weight(app) | = | 0 |
mapbt2(f,leaf1(x)) | → | leaf1(app(f,x)) | (9) |
app(mapbt1(x0),y1) | → | mapbt2(x0,y1) | (4) |
There are no rules in the TRS. Hence, it is terminating.