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
Polynomial Ordering
       →DP Problem 2
Polo


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)





The following dependency pairs can be strictly oriented:

FOLDB(t, s(n)) -> FOLDB(t, n)
FOLDB(t, s(n)) -> F(foldB(t, n), B)


Additionally, the following rules can be oriented:

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


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(fold(x1, x2, x3))=  x1  
  POL(foldB(x1, x2))=  x1  
  POL(FOLDC(x1, x2))=  x1  
  POL(triple(x1, x2, x3))=  x2  
  POL(f'(x1, x2))=  x1  
  POL(F(x1, x2))=  x1  
  POL(f(x1, x2))=  x1  
  POL(foldC(x1, x2))=  x1  
  POL(FOLDB(x1, x2))=  x1 + x2  
  POL(F''(x1))=  x1  
  POL(C)=  0  
  POL(0)=  0  
  POL(B)=  0  
  POL(g(x1))=  0  
  POL(F'(x1, x2))=  x1  
  POL(s(x1))=  1 + x1  
  POL(f''(x1))=  x1  
  POL(A)=  0  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 3
Dependency Graph
       →DP Problem 2
Polo


Dependency Pairs:

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))


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)





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


   R
DPs
       →DP Problem 1
Polo
           →DP Problem 3
DGraph
             ...
               →DP Problem 4
Polynomial Ordering
       →DP Problem 2
Polo


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)
FOLDC(t, s(n)) -> FOLDC(t, 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)





The following dependency pairs can be strictly oriented:

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


Additionally, the following rules can be oriented:

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


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(fold(x1, x2, x3))=  x1 + x3  
  POL(foldB(x1, x2))=  x1 + x2  
  POL(FOLDC(x1, x2))=  x1 + x2  
  POL(triple(x1, x2, x3))=  x2 + x3  
  POL(f'(x1, x2))=  1 + x1  
  POL(F(x1, x2))=  1 + x1  
  POL(f(x1, x2))=  1 + x1  
  POL(foldC(x1, x2))=  x1 + x2  
  POL(F''(x1))=  1 + x1  
  POL(C)=  0  
  POL(0)=  0  
  POL(g(x1))=  0  
  POL(B)=  0  
  POL(F'(x1, x2))=  1 + x1  
  POL(s(x1))=  1 + x1  
  POL(f''(x1))=  x1  
  POL(A)=  0  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 3
DGraph
             ...
               →DP Problem 5
Dependency Graph
       →DP Problem 2
Polo


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:


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)





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


   R
DPs
       →DP Problem 1
Polo
           →DP Problem 3
DGraph
             ...
               →DP Problem 6
Polynomial Ordering
       →DP Problem 2
Polo


Dependency Pairs:

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


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)





The following dependency pair can be strictly oriented:

F(t, x) -> F'(t, g(x))


Additionally, the following rules can be oriented:

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


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(fold(x1, x2, x3))=  x1  
  POL(foldB(x1, x2))=  x1  
  POL(triple(x1, x2, x3))=  0  
  POL(f'(x1, x2))=  0  
  POL(F(x1, x2))=  1 + x2  
  POL(f(x1, x2))=  0  
  POL(foldC(x1, x2))=  x1  
  POL(C)=  1  
  POL(0)=  0  
  POL(g(x1))=  x1  
  POL(B)=  1  
  POL(F'(x1, x2))=  x2  
  POL(s(x1))=  0  
  POL(f''(x1))=  0  
  POL(A)=  0  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 3
DGraph
             ...
               →DP Problem 7
Dependency Graph
       →DP Problem 2
Polo


Dependency Pair:

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


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)





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polynomial Ordering


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)





The following dependency pair can be strictly oriented:

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


Additionally, the following rules can be oriented:

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


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(fold(x1, x2, x3))=  x1  
  POL(foldB(x1, x2))=  x1  
  POL(triple(x1, x2, x3))=  0  
  POL(f'(x1, x2))=  0  
  POL(FOLD(x1, x2, x3))=  x3  
  POL(f(x1, x2))=  0  
  POL(foldC(x1, x2))=  x1  
  POL(C)=  0  
  POL(0)=  0  
  POL(g(x1))=  0  
  POL(B)=  0  
  POL(s(x1))=  1 + x1  
  POL(f''(x1))=  0  
  POL(A)=  0  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
           →DP Problem 8
Dependency Graph


Dependency Pair:


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)





Using the Dependency Graph resulted in no new DP problems.

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