Term Rewriting System R:
[t, n, x, a, b, c]
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)
fold(t, x, 0) -> t
fold(t, x, s(n)) -> f(fold(t, x, n), x)

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

FOLDB(t, s(n)) -> F(foldB(t, n), B)
FOLDB(t, s(n)) -> FOLDB(t, n)
FOLDC(t, s(n)) -> F(foldC(t, n), C)
FOLDC(t, s(n)) -> FOLDC(t, n)
F(t, x) -> F'(t, g(x))
F(t, x) -> 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), A) -> FOLDB(triple(s(a), 0, c), b)
F''(triple(a, b, c)) -> FOLDC(triple(a, b, 0), c)
FOLD(t, x, s(n)) -> F(fold(t, x, n), x)
FOLD(t, x, s(n)) -> FOLD(t, x, n)

Furthermore, R contains two SCCs.


   R
DPs
       →DP Problem 1
Modular Removal of Rules
       →DP Problem 2
SCP


Dependency Pairs:

FOLDB(t, s(n)) -> FOLDB(t, n)
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)) -> FOLDC(triple(a, b, 0), c)
F'(triple(a, b, c), A) -> F''(foldB(triple(s(a), 0, c), b))
F'(triple(a, b, c), B) -> F(triple(a, b, c), A)
F(t, x) -> F'(t, g(x))
FOLDB(t, s(n)) -> F(foldB(t, n), B)


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)
fold(t, x, 0) -> t
fold(t, x, s(n)) -> f(fold(t, x, n), x)





We have the following set of usable rules:

foldC(t, 0) -> t
foldC(t, s(n)) -> f(foldC(t, n), C)
foldB(t, 0) -> t
foldB(t, s(n)) -> f(foldB(t, n), B)
g(A) -> A
g(B) -> A
g(B) -> B
g(C) -> A
g(C) -> B
g(C) -> 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)
To remove rules and DPs from this DP problem we used the following monotonic and CE-compatible order: Polynomial ordering.
Polynomial interpretation:
  POL(foldB(x1, x2))=  x1 + x2  
  POL(FOLDC(x1, x2))=  x1 + x2  
  POL(triple(x1, x2, x3))=  x1 + x2 + x3  
  POL(f'(x1, x2))=  x1 + x2  
  POL(f(x1, x2))=  x1 + x2  
  POL(F(x1, x2))=  x1 + x2  
  POL(foldC(x1, x2))=  x1 + x2  
  POL(FOLDB(x1, x2))=  x1 + x2  
  POL(F''(x1))=  x1  
  POL(0)=  0  
  POL(C)=  0  
  POL(g(x1))=  x1  
  POL(B)=  0  
  POL(F'(x1, x2))=  x1 + x2  
  POL(s(x1))=  x1  
  POL(f''(x1))=  x1  
  POL(A)=  0  

We have the following set D of usable symbols: {foldB, FOLDC, triple, f', F, f, foldC, FOLDB, F'', C, 0, B, g, F', s, f'', A}
No Dependency Pairs can be deleted.
2 non usable rules have been deleted.

The result of this processor delivers one new DP problem.



   R
DPs
       →DP Problem 1
MRR
           →DP Problem 3
Modular Removal of Rules
       →DP Problem 2
SCP


Dependency Pairs:

FOLDB(t, s(n)) -> FOLDB(t, n)
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)) -> FOLDC(triple(a, b, 0), c)
F'(triple(a, b, c), A) -> F''(foldB(triple(s(a), 0, c), b))
F'(triple(a, b, c), B) -> F(triple(a, b, c), A)
F(t, x) -> F'(t, g(x))
FOLDB(t, s(n)) -> F(foldB(t, n), B)


Rules:


foldC(t, 0) -> t
foldC(t, s(n)) -> f(foldC(t, n), C)
f(t, x) -> f'(t, g(x))
foldB(t, 0) -> t
foldB(t, s(n)) -> f(foldB(t, n), B)
g(A) -> A
g(B) -> A
g(B) -> B
g(C) -> A
g(C) -> B
g(C) -> C
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)





We have the following set of usable rules:

foldC(t, 0) -> t
foldC(t, s(n)) -> f(foldC(t, n), C)
foldB(t, 0) -> t
foldB(t, s(n)) -> f(foldB(t, n), B)
g(A) -> A
g(B) -> A
g(B) -> B
g(C) -> A
g(C) -> B
g(C) -> 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)
To remove rules and DPs from this DP problem we used the following monotonic and CE-compatible order: Polynomial ordering.
Polynomial interpretation:
  POL(foldB(x1, x2))=  x1 + x2  
  POL(FOLDC(x1, x2))=  x1 + x2  
  POL(triple(x1, x2, x3))=  x1 + x2 + x3  
  POL(f'(x1, x2))=  1 + x1 + x2  
  POL(f(x1, x2))=  1 + x1 + x2  
  POL(F(x1, x2))=  1 + x1 + x2  
  POL(foldC(x1, x2))=  x1 + x2  
  POL(FOLDB(x1, x2))=  x1 + x2  
  POL(F''(x1))=  x1  
  POL(0)=  0  
  POL(C)=  0  
  POL(g(x1))=  x1  
  POL(B)=  0  
  POL(F'(x1, x2))=  1 + x1 + x2  
  POL(s(x1))=  1 + x1  
  POL(f''(x1))=  x1  
  POL(A)=  0  

We have the following set D of usable symbols: {foldB, FOLDC, triple, f', F, f, foldC, FOLDB, F'', C, 0, B, g, F', s, f'', A}
The following Dependency Pairs can be deleted as the lhs is strictly greater than the corresponding rhs:

FOLDB(t, s(n)) -> FOLDB(t, n)
FOLDC(t, s(n)) -> FOLDC(t, n)

No Rules can be deleted.

The result of this processor delivers one new DP problem.



   R
DPs
       →DP Problem 1
MRR
           →DP Problem 3
MRR
             ...
               →DP Problem 4
Negative Polynomial Order
       →DP Problem 2
SCP


Dependency Pairs:

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


Rules:


foldC(t, 0) -> t
foldC(t, s(n)) -> f(foldC(t, n), C)
f(t, x) -> f'(t, g(x))
foldB(t, 0) -> t
foldB(t, s(n)) -> f(foldB(t, n), B)
g(A) -> A
g(B) -> A
g(B) -> B
g(C) -> A
g(C) -> B
g(C) -> C
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)





The following Dependency Pair can be strictly oriented using the given order.

F'(triple(a, b, c), A) -> FOLDB(triple(s(a), 0, c), b)


Moreover, the following usable rules (regarding the implicit AFS) are oriented.

foldC(t, 0) -> t
foldC(t, s(n)) -> f(foldC(t, n), C)
foldB(t, 0) -> t
foldB(t, s(n)) -> f(foldB(t, n), B)
g(A) -> A
g(B) -> A
g(B) -> B
g(C) -> A
g(C) -> B
g(C) -> 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)


Used ordering:
Polynomial Order with Interpretation:

POL( F'(x1, x2) ) = x1 + 1

POL( triple(x1, ..., x3) ) = x2

POL( FOLDB(x1, x2) ) = x1 + x2

POL( 0 ) = 0

POL( FOLDC(x1, x2) ) = x1 + 1

POL( F(x1, x2) ) = x1 + 1

POL( foldC(x1, x2) ) = x1

POL( s(x1) ) = 1

POL( foldB(x1, x2) ) = x1

POL( F''(x1) ) = x1 + 1

POL( f(x1, x2) ) = x1

POL( g(x1) ) = 0

POL( A ) = 0

POL( B ) = 0

POL( C ) = 0

POL( f'(x1, x2) ) = x1

POL( f''(x1) ) = x1


This results in one new DP problem.


   R
DPs
       →DP Problem 1
MRR
           →DP Problem 3
MRR
             ...
               →DP Problem 5
Dependency Graph
       →DP Problem 2
SCP


Dependency Pairs:

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


Rules:


foldC(t, 0) -> t
foldC(t, s(n)) -> f(foldC(t, n), C)
f(t, x) -> f'(t, g(x))
foldB(t, 0) -> t
foldB(t, s(n)) -> f(foldB(t, n), B)
g(A) -> A
g(B) -> A
g(B) -> B
g(C) -> A
g(C) -> B
g(C) -> C
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)





Using the Dependency Graph the DP problem was split into 1 DP problems.


   R
DPs
       →DP Problem 1
MRR
           →DP Problem 3
MRR
             ...
               →DP Problem 6
Negative Polynomial Order
       →DP Problem 2
SCP


Dependency Pairs:

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


Rules:


foldC(t, 0) -> t
foldC(t, s(n)) -> f(foldC(t, n), C)
f(t, x) -> f'(t, g(x))
foldB(t, 0) -> t
foldB(t, s(n)) -> f(foldB(t, n), B)
g(A) -> A
g(B) -> A
g(B) -> B
g(C) -> A
g(C) -> B
g(C) -> C
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)





The following Dependency Pair can be strictly oriented using the given order.

F''(triple(a, b, c)) -> FOLDC(triple(a, b, 0), c)


Moreover, the following usable rules (regarding the implicit AFS) are oriented.

foldB(t, 0) -> t
foldB(t, s(n)) -> f(foldB(t, n), B)
g(A) -> A
g(B) -> A
g(B) -> B
g(C) -> A
g(C) -> B
g(C) -> C
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)


Used ordering:
Polynomial Order with Interpretation:

POL( F''(x1) ) = x1 + 1

POL( triple(x1, ..., x3) ) = x3

POL( FOLDC(x1, x2) ) = x1 + x2

POL( 0 ) = 0

POL( s(x1) ) = x1 + 1

POL( F(x1, x2) ) = x1 + 1

POL( foldC(x1, x2) ) = x1 + x2

POL( F'(x1, x2) ) = x1 + 1

POL( foldB(x1, x2) ) = x1

POL( f(x1, x2) ) = x1 + x2

POL( B ) = 0

POL( g(x1) ) = x1

POL( A ) = 0

POL( C ) = 1

POL( f'(x1, x2) ) = x1 + x2

POL( f''(x1) ) = x1


This results in one new DP problem.


   R
DPs
       →DP Problem 1
MRR
           →DP Problem 3
MRR
             ...
               →DP Problem 7
Dependency Graph
       →DP Problem 2
SCP


Dependency Pairs:

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


Rules:


foldC(t, 0) -> t
foldC(t, s(n)) -> f(foldC(t, n), C)
f(t, x) -> f'(t, g(x))
foldB(t, 0) -> t
foldB(t, s(n)) -> f(foldB(t, n), B)
g(A) -> A
g(B) -> A
g(B) -> B
g(C) -> A
g(C) -> B
g(C) -> C
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)





Using the Dependency Graph the DP problem was split into 1 DP problems.


   R
DPs
       →DP Problem 1
MRR
           →DP Problem 3
MRR
             ...
               →DP Problem 8
Narrowing Transformation
       →DP Problem 2
SCP


Dependency Pairs:

F(t, x) -> F'(t, g(x))
F'(triple(a, b, c), B) -> F(triple(a, b, c), A)


Rules:


foldC(t, 0) -> t
foldC(t, s(n)) -> f(foldC(t, n), C)
f(t, x) -> f'(t, g(x))
foldB(t, 0) -> t
foldB(t, s(n)) -> f(foldB(t, n), B)
g(A) -> A
g(B) -> A
g(B) -> B
g(C) -> A
g(C) -> B
g(C) -> C
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)





On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

F(t, x) -> F'(t, g(x))
six new Dependency Pairs are created:

F(t, A) -> F'(t, A)
F(t, B) -> F'(t, A)
F(t, B) -> F'(t, B)
F(t, C) -> F'(t, A)
F(t, C) -> F'(t, B)
F(t, C) -> F'(t, C)

The transformation is resulting in no new DP problems.



   R
DPs
       →DP Problem 1
MRR
       →DP Problem 2
Size-Change Principle


Dependency Pair:

FOLD(t, x, s(n)) -> FOLD(t, x, n)


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)
fold(t, x, 0) -> t
fold(t, x, s(n)) -> f(fold(t, x, n), x)





We number the DPs as follows:
  1. FOLD(t, x, s(n)) -> FOLD(t, x, n)
and get the following Size-Change Graph(s):
{1} , {1}
1=1
2=2
3>3

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1=1
2=2
3>3

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.

Termination of R successfully shown.
Duration:
0:03 minutes