The rewrite relation of the following TRS is considered.
g(A) | → | A | (1) |
g(B) | → | A | (2) |
g(B) | → | B | (3) |
g(C) | → | A | (4) |
g(C) | → | B | (5) |
g(C) | → | C | (6) |
foldB(t,0) | → | t | (7) |
foldB(t,s(n)) | → | f(foldB(t,n),B) | (8) |
foldC(t,0) | → | t | (9) |
foldC(t,s(n)) | → | f(foldC(t,n),C) | (10) |
f(t,x) | → | f'(t,g(x)) | (11) |
f'(triple(a,b,c),C) | → | triple(a,b,s(c)) | (12) |
f'(triple(a,b,c),B) | → | f(triple(a,b,c),A) | (13) |
f'(triple(a,b,c),A) | → | f''(foldB(triple(s(a),0,c),b)) | (14) |
f''(triple(a,b,c)) | → | foldC(triple(a,b,0),c) | (15) |
fold(t,x,0) | → | t | (16) |
fold(t,x,s(n)) | → | f(fold(t,x,n),x) | (17) |
foldB#(t,s(n)) | → | foldB#(t,n) | (18) |
foldB#(t,s(n)) | → | f#(foldB(t,n),B) | (19) |
foldC#(t,s(n)) | → | foldC#(t,n) | (20) |
foldC#(t,s(n)) | → | f#(foldC(t,n),C) | (21) |
f#(t,x) | → | g#(x) | (22) |
f#(t,x) | → | f'#(t,g(x)) | (23) |
f'#(triple(a,b,c),B) | → | f#(triple(a,b,c),A) | (24) |
f'#(triple(a,b,c),A) | → | foldB#(triple(s(a),0,c),b) | (25) |
f'#(triple(a,b,c),A) | → | f''#(foldB(triple(s(a),0,c),b)) | (26) |
f''#(triple(a,b,c)) | → | foldC#(triple(a,b,0),c) | (27) |
fold#(t,x,s(n)) | → | fold#(t,x,n) | (28) |
fold#(t,x,s(n)) | → | f#(fold(t,x,n),x) | (29) |
The dependency pairs are split into 2 components.
fold#(t,x,s(n)) | → | fold#(t,x,n) | (28) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
fold#(t,x,s(n)) | → | fold#(t,x,n) | (28) |
3 | > | 3 | |
2 | ≥ | 2 | |
1 | ≥ | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
f#(t,x) | → | f'#(t,g(x)) | (23) |
f'#(triple(a,b,c),B) | → | f#(triple(a,b,c),A) | (24) |
f'#(triple(a,b,c),A) | → | foldB#(triple(s(a),0,c),b) | (25) |
foldB#(t,s(n)) | → | foldB#(t,n) | (18) |
foldB#(t,s(n)) | → | f#(foldB(t,n),B) | (19) |
f'#(triple(a,b,c),A) | → | f''#(foldB(triple(s(a),0,c),b)) | (26) |
f''#(triple(a,b,c)) | → | foldC#(triple(a,b,0),c) | (27) |
foldC#(t,s(n)) | → | foldC#(t,n) | (20) |
foldC#(t,s(n)) | → | f#(foldC(t,n),C) | (21) |
[f''#(x1)] | = | 4 · x1 + 1 |
[0] | = | 0 |
[f#(x1, x2)] | = | 4 · x1 + 4 · x2 + 4 |
[foldC(x1, x2)] | = | 1 · x1 + 1 · x2 + 1 |
[g(x1)] | = | 1 · x1 + 0 |
[C] | = | 5 |
[foldC#(x1, x2)] | = | 4 · x1 + 4 · x2 + 0 |
[f'#(x1, x2)] | = | 4 · x1 + 4 · x2 + 1 |
[foldB(x1, x2)] | = | 1 · x1 + 1 · x2 + 0 |
[triple(x1, x2, x3)] | = | 0 · x1 + 2 · x2 + 1 · x3 + 0 |
[A] | = | 0 |
[f(x1, x2)] | = | 1 · x1 + 1 · x2 + 2 |
[foldB#(x1, x2)] | = | 4 · x1 + 4 · x2 + 1 |
[f''(x1)] | = | 1 · x1 + 2 |
[f'(x1, x2)] | = | 1 · x1 + 1 · x2 + 2 |
[s(x1)] | = | 1 · x1 + 7 |
[B] | = | 5 |
g(A) | → | A | (1) |
g(B) | → | A | (2) |
g(B) | → | B | (3) |
g(C) | → | A | (4) |
g(C) | → | B | (5) |
g(C) | → | C | (6) |
foldB(t,0) | → | t | (7) |
foldB(t,s(n)) | → | f(foldB(t,n),B) | (8) |
f(t,x) | → | f'(t,g(x)) | (11) |
f'(triple(a,b,c),C) | → | triple(a,b,s(c)) | (12) |
f'(triple(a,b,c),B) | → | f(triple(a,b,c),A) | (13) |
f'(triple(a,b,c),A) | → | f''(foldB(triple(s(a),0,c),b)) | (14) |
f''(triple(a,b,c)) | → | foldC(triple(a,b,0),c) | (15) |
foldC(t,0) | → | t | (9) |
foldC(t,s(n)) | → | f(foldC(t,n),C) | (10) |
f#(t,x) | → | f'#(t,g(x)) | (23) |
f'#(triple(a,b,c),B) | → | f#(triple(a,b,c),A) | (24) |
foldB#(t,s(n)) | → | foldB#(t,n) | (18) |
foldB#(t,s(n)) | → | f#(foldB(t,n),B) | (19) |
f''#(triple(a,b,c)) | → | foldC#(triple(a,b,0),c) | (27) |
foldC#(t,s(n)) | → | foldC#(t,n) | (20) |
The dependency pairs are split into 0 components.