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) |
foldf(x,nil) | → | x | (7) |
foldf(x,cons(y,z)) | → | f(foldf(x,z),y) | (8) |
f(t,x) | → | f'(t,g(x)) | (9) |
f'(triple(a,b,c),C) | → | triple(a,b,cons(C,c)) | (10) |
f'(triple(a,b,c),B) | → | f(triple(a,b,c),A) | (11) |
f'(triple(a,b,c),A) | → | f''(foldf(triple(cons(A,a),nil,c),b)) | (12) |
f''(triple(a,b,c)) | → | foldf(triple(a,b,nil),c) | (13) |
[g(x1)] | = | 1 · x1 |
[A] | = | 0 |
[B] | = | 0 |
[C] | = | 2 |
[foldf(x1, x2)] | = | 1 · x1 + 1 · x2 |
[nil] | = | 0 |
[cons(x1, x2)] | = | 1 · x1 + 1 · x2 |
[f(x1, x2)] | = | 1 · x1 + 1 · x2 |
[f'(x1, x2)] | = | 1 · x1 + 1 · x2 |
[triple(x1, x2, x3)] | = | 2 · x1 + 1 · x2 + 1 · x3 |
[f''(x1)] | = | 1 · x1 |
g(C) | → | A | (4) |
g(C) | → | B | (5) |
[g(x1)] | = | 1 · x1 |
[A] | = | 0 |
[B] | = | 1 |
[C] | = | 0 |
[foldf(x1, x2)] | = | 1 · x1 + 1 · x2 |
[nil] | = | 0 |
[cons(x1, x2)] | = | 1 · x1 + 1 · x2 |
[f(x1, x2)] | = | 1 · x1 + 1 · x2 |
[f'(x1, x2)] | = | 1 · x1 + 1 · x2 |
[triple(x1, x2, x3)] | = | 1 · x1 + 1 · x2 + 1 · x3 |
[f''(x1)] | = | 1 · x1 |
g(B) | → | A | (2) |
f'(triple(a,b,c),B) | → | f(triple(a,b,c),A) | (11) |
[g(x1)] | = | 2 · x1 |
[A] | = | 0 |
[B] | = | 1 |
[C] | = | 0 |
[foldf(x1, x2)] | = | 1 · x1 + 1 · x2 |
[nil] | = | 0 |
[cons(x1, x2)] | = | 2 · x1 + 1 · x2 |
[f(x1, x2)] | = | 1 · x1 + 2 · x2 |
[f'(x1, x2)] | = | 1 · x1 + 1 · x2 |
[triple(x1, x2, x3)] | = | 2 · x1 + 1 · x2 + 1 · x3 |
[f''(x1)] | = | 1 · x1 |
g(B) | → | B | (3) |
[g(x1)] | = | 1 · x1 |
[A] | = | 0 |
[C] | = | 0 |
[foldf(x1, x2)] | = | 1 · x1 + 2 · x2 |
[nil] | = | 0 |
[cons(x1, x2)] | = | 1 + 2 · x1 + 1 · x2 |
[f(x1, x2)] | = | 2 + 1 · x1 + 2 · x2 |
[f'(x1, x2)] | = | 2 + 1 · x1 + 2 · x2 |
[triple(x1, x2, x3)] | = | 2 + 1 · x1 + 2 · x2 + 2 · x3 |
[f''(x1)] | = | 1 · x1 |
f'(triple(a,b,c),A) | → | f''(foldf(triple(cons(A,a),nil,c),b)) | (12) |
prec(A) | = | 8 | weight(A) | = | 1 | ||||
prec(C) | = | 1 | weight(C) | = | 1 | ||||
prec(nil) | = | 0 | weight(nil) | = | 1 | ||||
prec(g) | = | 9 | weight(g) | = | 0 | ||||
prec(f'') | = | 7 | weight(f'') | = | 1 | ||||
prec(foldf) | = | 6 | weight(foldf) | = | 0 | ||||
prec(cons) | = | 2 | weight(cons) | = | 0 | ||||
prec(f) | = | 5 | weight(f) | = | 0 | ||||
prec(f') | = | 4 | weight(f') | = | 0 | ||||
prec(triple) | = | 3 | weight(triple) | = | 0 |
g(A) | → | A | (1) |
g(C) | → | C | (6) |
foldf(x,nil) | → | x | (7) |
foldf(x,cons(y,z)) | → | f(foldf(x,z),y) | (8) |
f(t,x) | → | f'(t,g(x)) | (9) |
f'(triple(a,b,c),C) | → | triple(a,b,cons(C,c)) | (10) |
f''(triple(a,b,c)) | → | foldf(triple(a,b,nil),c) | (13) |
There are no rules in the TRS. Hence, it is terminating.