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

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

ap(f, x) → x
ap(ap(ap(g, x), y), ap(s, z)) → ap(ap(ap(g, x), y), ap(ap(x, y), 0))

The set Q consists of the following terms:

ap(f, x0)
ap(ap(ap(g, x0), x1), ap(s, x2))



QTRS
  ↳ DependencyPairsProof

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

ap(f, x) → x
ap(ap(ap(g, x), y), ap(s, z)) → ap(ap(ap(g, x), y), ap(ap(x, y), 0))

The set Q consists of the following terms:

ap(f, x0)
ap(ap(ap(g, x0), x1), ap(s, x2))


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

AP(ap(ap(g, x), y), ap(s, z)) → AP(ap(x, y), 0)
AP(ap(ap(g, x), y), ap(s, z)) → AP(ap(ap(g, x), y), ap(ap(x, y), 0))
AP(ap(ap(g, x), y), ap(s, z)) → AP(x, y)

The TRS R consists of the following rules:

ap(f, x) → x
ap(ap(ap(g, x), y), ap(s, z)) → ap(ap(ap(g, x), y), ap(ap(x, y), 0))

The set Q consists of the following terms:

ap(f, x0)
ap(ap(ap(g, x0), x1), ap(s, x2))

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:

AP(ap(ap(g, x), y), ap(s, z)) → AP(ap(x, y), 0)
AP(ap(ap(g, x), y), ap(s, z)) → AP(ap(ap(g, x), y), ap(ap(x, y), 0))
AP(ap(ap(g, x), y), ap(s, z)) → AP(x, y)

The TRS R consists of the following rules:

ap(f, x) → x
ap(ap(ap(g, x), y), ap(s, z)) → ap(ap(ap(g, x), y), ap(ap(x, y), 0))

The set Q consists of the following terms:

ap(f, x0)
ap(ap(ap(g, x0), x1), ap(s, x2))

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:

AP(ap(ap(g, x), y), ap(s, z)) → AP(ap(ap(g, x), y), ap(ap(x, y), 0))
AP(ap(ap(g, x), y), ap(s, z)) → AP(x, y)

The TRS R consists of the following rules:

ap(f, x) → x
ap(ap(ap(g, x), y), ap(s, z)) → ap(ap(ap(g, x), y), ap(ap(x, y), 0))

The set Q consists of the following terms:

ap(f, x0)
ap(ap(ap(g, x0), x1), ap(s, x2))

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.


AP(ap(ap(g, x), y), ap(s, z)) → AP(x, y)
The remaining pairs can at least be oriented weakly.

AP(ap(ap(g, x), y), ap(s, z)) → AP(ap(ap(g, x), y), ap(ap(x, y), 0))
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(AP(x1, x2)) = x1   
POL(ap(x1, x2)) = 1 + x1 + x2   
POL(f) = 0   
POL(g) = 1   
POL(s) = 0   

The following usable rules [17] were oriented: none



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

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

AP(ap(ap(g, x), y), ap(s, z)) → AP(ap(ap(g, x), y), ap(ap(x, y), 0))

The TRS R consists of the following rules:

ap(f, x) → x
ap(ap(ap(g, x), y), ap(s, z)) → ap(ap(ap(g, x), y), ap(ap(x, y), 0))

The set Q consists of the following terms:

ap(f, x0)
ap(ap(ap(g, x0), x1), ap(s, x2))

We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule AP(ap(ap(g, x), y), ap(s, z)) → AP(ap(ap(g, x), y), ap(ap(x, y), 0)) at position [1] we obtained the following new rules:

AP(ap(ap(g, ap(ap(g, x0), x1)), ap(s, x2)), ap(s, y2)) → AP(ap(ap(g, ap(ap(g, x0), x1)), ap(s, x2)), ap(ap(ap(ap(g, x0), x1), ap(ap(x0, x1), 0)), 0))
AP(ap(ap(g, f), x0), ap(s, y2)) → AP(ap(ap(g, f), x0), ap(x0, 0))



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

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

AP(ap(ap(g, f), x0), ap(s, y2)) → AP(ap(ap(g, f), x0), ap(x0, 0))
AP(ap(ap(g, ap(ap(g, x0), x1)), ap(s, x2)), ap(s, y2)) → AP(ap(ap(g, ap(ap(g, x0), x1)), ap(s, x2)), ap(ap(ap(ap(g, x0), x1), ap(ap(x0, x1), 0)), 0))

The TRS R consists of the following rules:

ap(f, x) → x
ap(ap(ap(g, x), y), ap(s, z)) → ap(ap(ap(g, x), y), ap(ap(x, y), 0))

The set Q consists of the following terms:

ap(f, x0)
ap(ap(ap(g, x0), x1), ap(s, x2))

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 2 SCCs.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ QDPOrderProof
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ DependencyGraphProof
                    ↳ AND
QDP
                        ↳ UsableRulesProof
                      ↳ QDP

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

AP(ap(ap(g, f), x0), ap(s, y2)) → AP(ap(ap(g, f), x0), ap(x0, 0))

The TRS R consists of the following rules:

ap(f, x) → x
ap(ap(ap(g, x), y), ap(s, z)) → ap(ap(ap(g, x), y), ap(ap(x, y), 0))

The set Q consists of the following terms:

ap(f, x0)
ap(ap(ap(g, x0), x1), ap(s, x2))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ QDPOrderProof
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ DependencyGraphProof
                    ↳ AND
                      ↳ QDP
                        ↳ UsableRulesProof
QDP
                            ↳ NonTerminationProof
                      ↳ QDP

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

AP(ap(ap(g, f), x0), ap(s, y2)) → AP(ap(ap(g, f), x0), ap(x0, 0))

The TRS R consists of the following rules:

ap(f, x) → x

The set Q consists of the following terms:

ap(f, x0)
ap(ap(ap(g, x0), x1), ap(s, x2))

We have to consider all minimal (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

AP(ap(ap(g, f), x0), ap(s, y2)) → AP(ap(ap(g, f), x0), ap(x0, 0))

The TRS R consists of the following rules:

ap(f, x) → x


s = AP(ap(ap(g, f), x0), ap(s, y2)) evaluates to t =AP(ap(ap(g, f), x0), ap(x0, 0))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from AP(ap(ap(g, f), s), ap(s, 0)) to AP(ap(ap(g, f), s), ap(s, 0)).





↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ QDPOrderProof
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ DependencyGraphProof
                    ↳ AND
                      ↳ QDP
QDP

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

AP(ap(ap(g, ap(ap(g, x0), x1)), ap(s, x2)), ap(s, y2)) → AP(ap(ap(g, ap(ap(g, x0), x1)), ap(s, x2)), ap(ap(ap(ap(g, x0), x1), ap(ap(x0, x1), 0)), 0))

The TRS R consists of the following rules:

ap(f, x) → x
ap(ap(ap(g, x), y), ap(s, z)) → ap(ap(ap(g, x), y), ap(ap(x, y), 0))

The set Q consists of the following terms:

ap(f, x0)
ap(ap(ap(g, x0), x1), ap(s, x2))

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