Term Rewriting System R:
[x, y]
-(x, 0) -> x
-(0, s(y)) -> 0
-(s(x), s(y)) -> -(x, y)
f(0) -> 0
f(s(x)) -> -(s(x), g(f(x)))
g(0) -> s(0)
g(s(x)) -> -(s(x), f(g(x)))

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

-'(s(x), s(y)) -> -'(x, y)
F(s(x)) -> -'(s(x), g(f(x)))
F(s(x)) -> G(f(x))
F(s(x)) -> F(x)
G(s(x)) -> -'(s(x), f(g(x)))
G(s(x)) -> F(g(x))
G(s(x)) -> G(x)

Furthermore, R contains two SCCs.


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


Dependency Pair:

-'(s(x), s(y)) -> -'(x, y)


Rules:


-(x, 0) -> x
-(0, s(y)) -> 0
-(s(x), s(y)) -> -(x, y)
f(0) -> 0
f(s(x)) -> -(s(x), g(f(x)))
g(0) -> s(0)
g(s(x)) -> -(s(x), f(g(x)))





The following dependency pair can be strictly oriented:

-'(s(x), s(y)) -> -'(x, y)


There are no usable rules w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(-'(x1, x2))=  x1  
  POL(s(x1))=  1 + x1  

resulting in one new DP problem.



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


Dependency Pair:


Rules:


-(x, 0) -> x
-(0, s(y)) -> 0
-(s(x), s(y)) -> -(x, y)
f(0) -> 0
f(s(x)) -> -(s(x), g(f(x)))
g(0) -> s(0)
g(s(x)) -> -(s(x), f(g(x)))





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Narrowing Transformation


Dependency Pairs:

G(s(x)) -> G(x)
F(s(x)) -> F(x)
G(s(x)) -> F(g(x))
F(s(x)) -> G(f(x))


Rules:


-(x, 0) -> x
-(0, s(y)) -> 0
-(s(x), s(y)) -> -(x, y)
f(0) -> 0
f(s(x)) -> -(s(x), g(f(x)))
g(0) -> s(0)
g(s(x)) -> -(s(x), f(g(x)))





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

F(s(x)) -> G(f(x))
two new Dependency Pairs are created:

F(s(0)) -> G(0)
F(s(s(x''))) -> G(-(s(x''), g(f(x''))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Nar
           →DP Problem 4
Narrowing Transformation


Dependency Pairs:

F(s(s(x''))) -> G(-(s(x''), g(f(x''))))
F(s(x)) -> F(x)
G(s(x)) -> F(g(x))
G(s(x)) -> G(x)


Rules:


-(x, 0) -> x
-(0, s(y)) -> 0
-(s(x), s(y)) -> -(x, y)
f(0) -> 0
f(s(x)) -> -(s(x), g(f(x)))
g(0) -> s(0)
g(s(x)) -> -(s(x), f(g(x)))





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

G(s(x)) -> F(g(x))
two new Dependency Pairs are created:

G(s(0)) -> F(s(0))
G(s(s(x''))) -> F(-(s(x''), f(g(x''))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Nar
           →DP Problem 4
Nar
             ...
               →DP Problem 5
Polynomial Ordering


Dependency Pairs:

G(s(s(x''))) -> F(-(s(x''), f(g(x''))))
F(s(x)) -> F(x)
G(s(0)) -> F(s(0))
G(s(x)) -> G(x)
F(s(s(x''))) -> G(-(s(x''), g(f(x''))))


Rules:


-(x, 0) -> x
-(0, s(y)) -> 0
-(s(x), s(y)) -> -(x, y)
f(0) -> 0
f(s(x)) -> -(s(x), g(f(x)))
g(0) -> s(0)
g(s(x)) -> -(s(x), f(g(x)))





The following dependency pairs can be strictly oriented:

G(s(s(x''))) -> F(-(s(x''), f(g(x''))))
F(s(x)) -> F(x)
G(s(x)) -> G(x)
F(s(s(x''))) -> G(-(s(x''), g(f(x''))))


Additionally, the following usable rules w.r.t. to the implicit AFS can be oriented:

-(x, 0) -> x
-(0, s(y)) -> 0
-(s(x), s(y)) -> -(x, y)


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(0)=  0  
  POL(g(x1))=  0  
  POL(G(x1))=  x1  
  POL(s(x1))=  1 + x1  
  POL(-(x1, x2))=  x1  
  POL(f(x1))=  0  
  POL(F(x1))=  x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Nar
           →DP Problem 4
Nar
             ...
               →DP Problem 6
Dependency Graph


Dependency Pair:

G(s(0)) -> F(s(0))


Rules:


-(x, 0) -> x
-(0, s(y)) -> 0
-(s(x), s(y)) -> -(x, y)
f(0) -> 0
f(s(x)) -> -(s(x), g(f(x)))
g(0) -> s(0)
g(s(x)) -> -(s(x), f(g(x)))





Using the Dependency Graph resulted in no new DP problems.

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