The rewrite relation of the following TRS is considered.
f(f(f(a,x),y),z) | → | f(f(x,z),f(y,z)) | (1) |
f(f(b,x),y) | → | x | (2) |
f(c,y) | → | y | (3) |
We uncurry the binary symbol f in combination with the following symbol map which also determines the applicative arities of these symbols.
a | is mapped to | a, | a1(x1), | a2(x1, x2), | a3(x1, x2, x3) |
b | is mapped to | b, | b1(x1), | b2(x1, x2) | |
c | is mapped to | c, | c1(x1) |
a3(x,y,z) | → | f(f(x,z),f(y,z)) | (10) |
b2(x,y) | → | x | (11) |
c1(y) | → | y | (12) |
f(a,y1) | → | a1(y1) | (4) |
f(a1(x0),y1) | → | a2(x0,y1) | (5) |
f(a2(x0,x1),y1) | → | a3(x0,x1,y1) | (6) |
f(b,y1) | → | b1(y1) | (7) |
f(b1(x0),y1) | → | b2(x0,y1) | (8) |
f(c,y1) | → | c1(y1) | (9) |
a3(x0,x1,x2) |
b2(x0,x1) |
c1(x0) |
f(a,x0) |
f(a1(x0),x1) |
f(a2(x0,x1),x2) |
f(b,x0) |
f(b1(x0),x1) |
f(c,x0) |
a3#(x,y,z) | → | f#(f(x,z),f(y,z)) | (13) |
a3#(x,y,z) | → | f#(x,z) | (14) |
a3#(x,y,z) | → | f#(y,z) | (15) |
f#(a2(x0,x1),y1) | → | a3#(x0,x1,y1) | (16) |
f#(b1(x0),y1) | → | b2#(x0,y1) | (17) |
f#(c,y1) | → | c1#(y1) | (18) |
f#(b1(x0),y1) | → | b2#(x0,y1) | (17) |
f#(c,y1) | → | c1#(y1) | (18) |
a3#(a,y1,x0) | → | f#(a1(x0),f(y1,x0)) | (19) |
a3#(a1(x0),y1,x1) | → | f#(a2(x0,x1),f(y1,x1)) | (20) |
a3#(a2(x0,x1),y1,x2) | → | f#(a3(x0,x1,x2),f(y1,x2)) | (21) |
a3#(b,y1,x0) | → | f#(b1(x0),f(y1,x0)) | (22) |
a3#(b1(x0),y1,x1) | → | f#(b2(x0,x1),f(y1,x1)) | (23) |
a3#(c,y1,x0) | → | f#(c1(x0),f(y1,x0)) | (24) |
a3#(a,y1,x0) | → | f#(a1(x0),f(y1,x0)) | (19) |
a3#(b,y1,x0) | → | f#(b1(x0),f(y1,x0)) | (22) |
→ |
→ |
→ |
f#(a2(x0,x1),y1) | → | a3#(x0,x1,y1) | (16) |
a3#(x,y,z) | → | f#(y,z) | (15) |
a3#(a1(x0),y1,x1) | → | f#(a2(x0,x1),f(y1,x1)) | (20) |
a3#(a2(x0,x1),y1,x2) | → | f#(f(f(x0,x2),f(x1,x2)),f(y1,x2)) | (25) |
a3#(b1(x0),y1,x1) | → | f#(x0,f(y1,x1)) | (26) |
a3#(c,y1,x0) | → | f#(x0,f(y1,x0)) | (27) |
a3#(a2(y_0,y_1),x1,x2) | → | f#(a2(y_0,y_1),x2) | (28) |
f#(a2(x0,x1),y1) | → | a3#(x0,x1,y1) | (16) |
a3#(a1(x0),y1,x1) | → | f#(a2(x0,x1),f(y1,x1)) | (20) |
a3#(a2(x0,x1),y1,x2) | → | f#(f(f(x0,x2),f(x1,x2)),f(y1,x2)) | (25) |
a3#(b1(x0),y1,x1) | → | f#(x0,f(y1,x1)) | (26) |
a3#(c,y1,x0) | → | f#(x0,f(y1,x0)) | (27) |
a3#(a2(y_0,y_1),x1,x2) | → | f#(a2(y_0,y_1),x2) | (28) |
a3#(x0,a2(y_0,y_1),x2) | → | f#(a2(y_0,y_1),x2) | (29) |
a3#(a1(x0),y1,x1) | → | f#(a2(x0,x1),f(y1,x1)) | (20) |
a3#(a2(x0,x1),y1,x2) | → | f#(f(f(x0,x2),f(x1,x2)),f(y1,x2)) | (25) |
a3#(b1(x0),y1,x1) | → | f#(x0,f(y1,x1)) | (26) |
a3#(c,y1,x0) | → | f#(x0,f(y1,x0)) | (27) |
a3#(a2(y_0,y_1),x1,x2) | → | f#(a2(y_0,y_1),x2) | (28) |
a3#(x0,a2(y_0,y_1),x2) | → | f#(a2(y_0,y_1),x2) | (29) |
f#(a2(a1(y_0),x1),x2) | → | a3#(a1(y_0),x1,x2) | (30) |
f#(a2(a2(y_0,y_1),x1),x2) | → | a3#(a2(y_0,y_1),x1,x2) | (31) |
f#(a2(b1(y_0),x1),x2) | → | a3#(b1(y_0),x1,x2) | (32) |
f#(a2(c,x1),x2) | → | a3#(c,x1,x2) | (33) |
f#(a2(x0,a2(y_1,y_2)),x2) | → | a3#(x0,a2(y_1,y_2),x2) | (34) |
t0 | = | a3#(c,c,f(c,a2(c,c))) |
→R | a3#(c,c,c1(a2(c,c))) | |
→R | a3#(c,c,a2(c,c)) | |
→P | f#(a2(c,c),f(c,a2(c,c))) | |
→P | a3#(c,c,f(c,a2(c,c))) | |
= | t4 |