Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, 0) → t
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, 0) → t
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

F'(triple(a, b, c), A) → FOLDB(triple(s(a), 0, c), b)
FOLDC(t, s(n)) → FOLDC(t, n)
F(t, x) → G(x)
FOLDB(t, s(n)) → F(foldB(t, n), B)
FOLDC(t, s(n)) → F(foldC(t, n), C)
F'(triple(a, b, c), B) → F(triple(a, b, c), A)
F(t, x) → F'(t, g(x))
F'(triple(a, b, c), A) → F''(foldB(triple(s(a), 0, c), b))
FOLDB(t, s(n)) → FOLDB(t, n)
F''(triple(a, b, c)) → FOLDC(triple(a, b, 0), c)

The TRS R consists of the following rules:

g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, 0) → t
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

F'(triple(a, b, c), A) → FOLDB(triple(s(a), 0, c), b)
FOLDC(t, s(n)) → FOLDC(t, n)
F(t, x) → G(x)
FOLDB(t, s(n)) → F(foldB(t, n), B)
FOLDC(t, s(n)) → F(foldC(t, n), C)
F'(triple(a, b, c), B) → F(triple(a, b, c), A)
F(t, x) → F'(t, g(x))
F'(triple(a, b, c), A) → F''(foldB(triple(s(a), 0, c), b))
FOLDB(t, s(n)) → FOLDB(t, n)
F''(triple(a, b, c)) → FOLDC(triple(a, b, 0), c)

The TRS R consists of the following rules:

g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, 0) → t
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
QDP
          ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

F'(triple(a, b, c), A) → FOLDB(triple(s(a), 0, c), b)
FOLDC(t, s(n)) → FOLDC(t, n)
FOLDB(t, s(n)) → F(foldB(t, n), B)
FOLDC(t, s(n)) → F(foldC(t, n), C)
F'(triple(a, b, c), B) → F(triple(a, b, c), A)
F(t, x) → F'(t, g(x))
F'(triple(a, b, c), A) → F''(foldB(triple(s(a), 0, c), b))
FOLDB(t, s(n)) → FOLDB(t, n)
F''(triple(a, b, c)) → FOLDC(triple(a, b, 0), c)

The TRS R consists of the following rules:

g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, 0) → t
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


FOLDB(t, s(n)) → F(foldB(t, n), B)
FOLDB(t, s(n)) → FOLDB(t, n)
The remaining pairs can at least be oriented weakly.

F'(triple(a, b, c), A) → FOLDB(triple(s(a), 0, c), b)
FOLDC(t, s(n)) → FOLDC(t, n)
FOLDC(t, s(n)) → F(foldC(t, n), C)
F'(triple(a, b, c), B) → F(triple(a, b, c), A)
F(t, x) → F'(t, g(x))
F'(triple(a, b, c), A) → F''(foldB(triple(s(a), 0, c), b))
F''(triple(a, b, c)) → FOLDC(triple(a, b, 0), c)
Used ordering: Polynomial interpretation [25,35]:

POL(F''(x1)) = (4)x_1   
POL(f''(x1)) = (4)x_1   
POL(f(x1, x2)) = x_1   
POL(g(x1)) = 0   
POL(C) = 0   
POL(FOLDC(x1, x2)) = (4)x_1   
POL(A) = 0   
POL(triple(x1, x2, x3)) = x_2   
POL(0) = 0   
POL(f'(x1, x2)) = x_1   
POL(foldC(x1, x2)) = x_1   
POL(F'(x1, x2)) = (2)x_1   
POL(B) = 0   
POL(foldB(x1, x2)) = (2)x_1   
POL(s(x1)) = 1 + x_1   
POL(FOLDB(x1, x2)) = (4)x_1 + (2)x_2   
POL(F(x1, x2)) = (2)x_1   
The value of delta used in the strict ordering is 2.
The following usable rules [17] were oriented:

foldB(t, 0) → t
foldC(t, 0) → t
foldB(t, s(n)) → f(foldB(t, n), B)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f(t, x) → f'(t, g(x))
foldC(t, s(n)) → f(foldC(t, n), C)
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)
f'(triple(a, b, c), C) → triple(a, b, s(c))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ QDPOrderProof
QDP
              ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

FOLDC(t, s(n)) → FOLDC(t, n)
F'(triple(a, b, c), A) → FOLDB(triple(s(a), 0, c), b)
FOLDC(t, s(n)) → F(foldC(t, n), C)
F(t, x) → F'(t, g(x))
F'(triple(a, b, c), B) → F(triple(a, b, c), A)
F'(triple(a, b, c), A) → F''(foldB(triple(s(a), 0, c), b))
F''(triple(a, b, c)) → FOLDC(triple(a, b, 0), c)

The TRS R consists of the following rules:

g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, 0) → t
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ QDPOrderProof
            ↳ QDP
              ↳ DependencyGraphProof
QDP
                  ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

FOLDC(t, s(n)) → FOLDC(t, n)
FOLDC(t, s(n)) → F(foldC(t, n), C)
F(t, x) → F'(t, g(x))
F'(triple(a, b, c), B) → F(triple(a, b, c), A)
F'(triple(a, b, c), A) → F''(foldB(triple(s(a), 0, c), b))
F''(triple(a, b, c)) → FOLDC(triple(a, b, 0), c)

The TRS R consists of the following rules:

g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, 0) → t
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


FOLDC(t, s(n)) → FOLDC(t, n)
F'(triple(a, b, c), B) → F(triple(a, b, c), A)
F'(triple(a, b, c), A) → F''(foldB(triple(s(a), 0, c), b))
The remaining pairs can at least be oriented weakly.

FOLDC(t, s(n)) → F(foldC(t, n), C)
F(t, x) → F'(t, g(x))
F''(triple(a, b, c)) → FOLDC(triple(a, b, 0), c)
Used ordering: Polynomial interpretation [25,35]:

POL(F''(x1)) = (4)x_1   
POL(f''(x1)) = 3 + x_1   
POL(f(x1, x2)) = 3 + x_1 + x_2   
POL(g(x1)) = x_1   
POL(C) = 1   
POL(FOLDC(x1, x2)) = (4)x_1 + (4)x_2   
POL(A) = 0   
POL(triple(x1, x2, x3)) = (4)x_2 + x_3   
POL(0) = 0   
POL(f'(x1, x2)) = 3 + x_1 + x_2   
POL(foldC(x1, x2)) = 3 + x_1 + x_2   
POL(F'(x1, x2)) = 1 + (4)x_1 + x_2   
POL(B) = 1   
POL(foldB(x1, x2)) = x_1 + x_2   
POL(s(x1)) = 4 + x_1   
POL(F(x1, x2)) = 1 + (4)x_1 + (3)x_2   
The value of delta used in the strict ordering is 1.
The following usable rules [17] were oriented:

foldB(t, 0) → t
g(C) → C
foldC(t, 0) → t
foldB(t, s(n)) → f(foldB(t, n), B)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f(t, x) → f'(t, g(x))
foldC(t, s(n)) → f(foldC(t, n), C)
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)
f'(triple(a, b, c), C) → triple(a, b, s(c))
g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ QDPOrderProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ QDP
                  ↳ QDPOrderProof
QDP
                      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

FOLDC(t, s(n)) → F(foldC(t, n), C)
F(t, x) → F'(t, g(x))
F''(triple(a, b, c)) → FOLDC(triple(a, b, 0), c)

The TRS R consists of the following rules:

g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, 0) → t
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 3 less nodes.