Certification Problem

Input (TPDB TRS_Standard/CiME_04/filliatre)

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)

Property / Task

Prove or disprove termination.

Answer / Result

Yes.

Proof (by AProVE @ termCOMP 2023)

1 Rule Removal

Using the linear polynomial interpretation over the naturals
[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
all of the following rules can be deleted.
g(C) A (4)
g(C) B (5)

1.1 Rule Removal

Using the linear polynomial interpretation over the naturals
[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
all of the following rules can be deleted.
g(B) A (2)
f'(triple(a,b,c),B) f(triple(a,b,c),A) (11)

1.1.1 Rule Removal

Using the linear polynomial interpretation over the naturals
[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
all of the following rules can be deleted.
g(B) B (3)

1.1.1.1 Rule Removal

Using the linear polynomial interpretation over the naturals
[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
all of the following rules can be deleted.
f'(triple(a,b,c),A) f''(foldf(triple(cons(A,a),nil,c),b)) (12)

1.1.1.1.1 Rule Removal

Using the Knuth Bendix order with w0 = 1 and the following precedence and weight functions
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
all of the following rules can be deleted.
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)

1.1.1.1.1.1 R is empty

There are no rules in the TRS. Hence, it is terminating.