Left Termination of the query pattern p(b,f) w.r.t. the given Prolog program could successfully be proven:



PROLOG
  ↳ PrologToPiTRSProof

p2(X, Z) :- q2(X, Y), p2(Y, Z).
p2(X, X).
q2(a0, b0).


With regard to the inferred argument filtering the predicates were used in the following modes:
p2: (b,f)
Transforming PROLOG into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:


p_2_in_ga2(X, Z) -> if_p_2_in_1_ga3(X, Z, q_2_in_ga2(X, Y))
q_2_in_ga2(a_0, b_0) -> q_2_out_ga2(a_0, b_0)
if_p_2_in_1_ga3(X, Z, q_2_out_ga2(X, Y)) -> if_p_2_in_2_ga4(X, Z, Y, p_2_in_ga2(Y, Z))
p_2_in_ga2(X, X) -> p_2_out_ga2(X, X)
if_p_2_in_2_ga4(X, Z, Y, p_2_out_ga2(Y, Z)) -> p_2_out_ga2(X, Z)

The argument filtering Pi contains the following mapping:
p_2_in_ga2(x1, x2)  =  p_2_in_ga1(x1)
a_0  =  a_0
b_0  =  b_0
if_p_2_in_1_ga3(x1, x2, x3)  =  if_p_2_in_1_ga1(x3)
q_2_in_ga2(x1, x2)  =  q_2_in_ga1(x1)
q_2_out_ga2(x1, x2)  =  q_2_out_ga1(x2)
if_p_2_in_2_ga4(x1, x2, x3, x4)  =  if_p_2_in_2_ga1(x4)
p_2_out_ga2(x1, x2)  =  p_2_out_ga1(x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of PROLOG



↳ PROLOG
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

p_2_in_ga2(X, Z) -> if_p_2_in_1_ga3(X, Z, q_2_in_ga2(X, Y))
q_2_in_ga2(a_0, b_0) -> q_2_out_ga2(a_0, b_0)
if_p_2_in_1_ga3(X, Z, q_2_out_ga2(X, Y)) -> if_p_2_in_2_ga4(X, Z, Y, p_2_in_ga2(Y, Z))
p_2_in_ga2(X, X) -> p_2_out_ga2(X, X)
if_p_2_in_2_ga4(X, Z, Y, p_2_out_ga2(Y, Z)) -> p_2_out_ga2(X, Z)

The argument filtering Pi contains the following mapping:
p_2_in_ga2(x1, x2)  =  p_2_in_ga1(x1)
a_0  =  a_0
b_0  =  b_0
if_p_2_in_1_ga3(x1, x2, x3)  =  if_p_2_in_1_ga1(x3)
q_2_in_ga2(x1, x2)  =  q_2_in_ga1(x1)
q_2_out_ga2(x1, x2)  =  q_2_out_ga1(x2)
if_p_2_in_2_ga4(x1, x2, x3, x4)  =  if_p_2_in_2_ga1(x4)
p_2_out_ga2(x1, x2)  =  p_2_out_ga1(x2)


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

P_2_IN_GA2(X, Z) -> IF_P_2_IN_1_GA3(X, Z, q_2_in_ga2(X, Y))
P_2_IN_GA2(X, Z) -> Q_2_IN_GA2(X, Y)
IF_P_2_IN_1_GA3(X, Z, q_2_out_ga2(X, Y)) -> IF_P_2_IN_2_GA4(X, Z, Y, p_2_in_ga2(Y, Z))
IF_P_2_IN_1_GA3(X, Z, q_2_out_ga2(X, Y)) -> P_2_IN_GA2(Y, Z)

The TRS R consists of the following rules:

p_2_in_ga2(X, Z) -> if_p_2_in_1_ga3(X, Z, q_2_in_ga2(X, Y))
q_2_in_ga2(a_0, b_0) -> q_2_out_ga2(a_0, b_0)
if_p_2_in_1_ga3(X, Z, q_2_out_ga2(X, Y)) -> if_p_2_in_2_ga4(X, Z, Y, p_2_in_ga2(Y, Z))
p_2_in_ga2(X, X) -> p_2_out_ga2(X, X)
if_p_2_in_2_ga4(X, Z, Y, p_2_out_ga2(Y, Z)) -> p_2_out_ga2(X, Z)

The argument filtering Pi contains the following mapping:
p_2_in_ga2(x1, x2)  =  p_2_in_ga1(x1)
a_0  =  a_0
b_0  =  b_0
if_p_2_in_1_ga3(x1, x2, x3)  =  if_p_2_in_1_ga1(x3)
q_2_in_ga2(x1, x2)  =  q_2_in_ga1(x1)
q_2_out_ga2(x1, x2)  =  q_2_out_ga1(x2)
if_p_2_in_2_ga4(x1, x2, x3, x4)  =  if_p_2_in_2_ga1(x4)
p_2_out_ga2(x1, x2)  =  p_2_out_ga1(x2)
Q_2_IN_GA2(x1, x2)  =  Q_2_IN_GA1(x1)
IF_P_2_IN_1_GA3(x1, x2, x3)  =  IF_P_2_IN_1_GA1(x3)
P_2_IN_GA2(x1, x2)  =  P_2_IN_GA1(x1)
IF_P_2_IN_2_GA4(x1, x2, x3, x4)  =  IF_P_2_IN_2_GA1(x4)

We have to consider all (P,R,Pi)-chains

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

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

P_2_IN_GA2(X, Z) -> IF_P_2_IN_1_GA3(X, Z, q_2_in_ga2(X, Y))
P_2_IN_GA2(X, Z) -> Q_2_IN_GA2(X, Y)
IF_P_2_IN_1_GA3(X, Z, q_2_out_ga2(X, Y)) -> IF_P_2_IN_2_GA4(X, Z, Y, p_2_in_ga2(Y, Z))
IF_P_2_IN_1_GA3(X, Z, q_2_out_ga2(X, Y)) -> P_2_IN_GA2(Y, Z)

The TRS R consists of the following rules:

p_2_in_ga2(X, Z) -> if_p_2_in_1_ga3(X, Z, q_2_in_ga2(X, Y))
q_2_in_ga2(a_0, b_0) -> q_2_out_ga2(a_0, b_0)
if_p_2_in_1_ga3(X, Z, q_2_out_ga2(X, Y)) -> if_p_2_in_2_ga4(X, Z, Y, p_2_in_ga2(Y, Z))
p_2_in_ga2(X, X) -> p_2_out_ga2(X, X)
if_p_2_in_2_ga4(X, Z, Y, p_2_out_ga2(Y, Z)) -> p_2_out_ga2(X, Z)

The argument filtering Pi contains the following mapping:
p_2_in_ga2(x1, x2)  =  p_2_in_ga1(x1)
a_0  =  a_0
b_0  =  b_0
if_p_2_in_1_ga3(x1, x2, x3)  =  if_p_2_in_1_ga1(x3)
q_2_in_ga2(x1, x2)  =  q_2_in_ga1(x1)
q_2_out_ga2(x1, x2)  =  q_2_out_ga1(x2)
if_p_2_in_2_ga4(x1, x2, x3, x4)  =  if_p_2_in_2_ga1(x4)
p_2_out_ga2(x1, x2)  =  p_2_out_ga1(x2)
Q_2_IN_GA2(x1, x2)  =  Q_2_IN_GA1(x1)
IF_P_2_IN_1_GA3(x1, x2, x3)  =  IF_P_2_IN_1_GA1(x3)
P_2_IN_GA2(x1, x2)  =  P_2_IN_GA1(x1)
IF_P_2_IN_2_GA4(x1, x2, x3, x4)  =  IF_P_2_IN_2_GA1(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph contains 1 SCC with 2 less nodes.

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
PiDP
              ↳ UsableRulesProof

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

P_2_IN_GA2(X, Z) -> IF_P_2_IN_1_GA3(X, Z, q_2_in_ga2(X, Y))
IF_P_2_IN_1_GA3(X, Z, q_2_out_ga2(X, Y)) -> P_2_IN_GA2(Y, Z)

The TRS R consists of the following rules:

p_2_in_ga2(X, Z) -> if_p_2_in_1_ga3(X, Z, q_2_in_ga2(X, Y))
q_2_in_ga2(a_0, b_0) -> q_2_out_ga2(a_0, b_0)
if_p_2_in_1_ga3(X, Z, q_2_out_ga2(X, Y)) -> if_p_2_in_2_ga4(X, Z, Y, p_2_in_ga2(Y, Z))
p_2_in_ga2(X, X) -> p_2_out_ga2(X, X)
if_p_2_in_2_ga4(X, Z, Y, p_2_out_ga2(Y, Z)) -> p_2_out_ga2(X, Z)

The argument filtering Pi contains the following mapping:
p_2_in_ga2(x1, x2)  =  p_2_in_ga1(x1)
a_0  =  a_0
b_0  =  b_0
if_p_2_in_1_ga3(x1, x2, x3)  =  if_p_2_in_1_ga1(x3)
q_2_in_ga2(x1, x2)  =  q_2_in_ga1(x1)
q_2_out_ga2(x1, x2)  =  q_2_out_ga1(x2)
if_p_2_in_2_ga4(x1, x2, x3, x4)  =  if_p_2_in_2_ga1(x4)
p_2_out_ga2(x1, x2)  =  p_2_out_ga1(x2)
IF_P_2_IN_1_GA3(x1, x2, x3)  =  IF_P_2_IN_1_GA1(x3)
P_2_IN_GA2(x1, x2)  =  P_2_IN_GA1(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting we can delete all non-usable rules from R.

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ UsableRulesProof
PiDP
                  ↳ PiDPToQDPProof

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

P_2_IN_GA2(X, Z) -> IF_P_2_IN_1_GA3(X, Z, q_2_in_ga2(X, Y))
IF_P_2_IN_1_GA3(X, Z, q_2_out_ga2(X, Y)) -> P_2_IN_GA2(Y, Z)

The TRS R consists of the following rules:

q_2_in_ga2(a_0, b_0) -> q_2_out_ga2(a_0, b_0)

The argument filtering Pi contains the following mapping:
a_0  =  a_0
b_0  =  b_0
q_2_in_ga2(x1, x2)  =  q_2_in_ga1(x1)
q_2_out_ga2(x1, x2)  =  q_2_out_ga1(x2)
IF_P_2_IN_1_GA3(x1, x2, x3)  =  IF_P_2_IN_1_GA1(x3)
P_2_IN_GA2(x1, x2)  =  P_2_IN_GA1(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem into ordinary QDP problem by application of Pi.

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ UsableRulesProof
                ↳ PiDP
                  ↳ PiDPToQDPProof
QDP
                      ↳ QDPSizeChangeProof

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

P_2_IN_GA1(X) -> IF_P_2_IN_1_GA1(q_2_in_ga1(X))
IF_P_2_IN_1_GA1(q_2_out_ga1(Y)) -> P_2_IN_GA1(Y)

The TRS R consists of the following rules:

q_2_in_ga1(a_0) -> q_2_out_ga1(b_0)

The set Q consists of the following terms:

q_2_in_ga1(x0)

We have to consider all (P,Q,R)-chains.
The head symbols of this DP problem are {IF_P_2_IN_1_GA1, P_2_IN_GA1}.
We used the following order together with the size-change analysis to show that there are no infinite chains for this DP problem.

Order:Polynomial interpretation:


POL(q_2_in_ga1(x1)) = x1   
POL(a_0) = 1   
POL(q_2_out_ga1(x1)) = 1 + x1   
POL(b_0) = 0   

From the DPs we obtained the following set of size-change graphs:

We oriented the following set of usable rules.


q_2_in_ga1(a_0) -> q_2_out_ga1(b_0)