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



PROLOG
  ↳ PrologToPiTRSProof

fold3(X, .2(Y, Ys), Z) :- op3(X, Y, V), fold3(V, Ys, Z).
fold3(X, {}0, X).
op3(a0, b0, c0).


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


fold_3_in_gga3(X, ._22(Y, Ys), Z) -> if_fold_3_in_1_gga5(X, Y, Ys, Z, op_3_in_gga3(X, Y, V))
op_3_in_gga3(a_0, b_0, c_0) -> op_3_out_gga3(a_0, b_0, c_0)
if_fold_3_in_1_gga5(X, Y, Ys, Z, op_3_out_gga3(X, Y, V)) -> if_fold_3_in_2_gga6(X, Y, Ys, Z, V, fold_3_in_gga3(V, Ys, Z))
fold_3_in_gga3(X, []_0, X) -> fold_3_out_gga3(X, []_0, X)
if_fold_3_in_2_gga6(X, Y, Ys, Z, V, fold_3_out_gga3(V, Ys, Z)) -> fold_3_out_gga3(X, ._22(Y, Ys), Z)

The argument filtering Pi contains the following mapping:
fold_3_in_gga3(x1, x2, x3)  =  fold_3_in_gga2(x1, x2)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
a_0  =  a_0
b_0  =  b_0
c_0  =  c_0
if_fold_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_fold_3_in_1_gga2(x3, x5)
op_3_in_gga3(x1, x2, x3)  =  op_3_in_gga2(x1, x2)
op_3_out_gga3(x1, x2, x3)  =  op_3_out_gga1(x3)
if_fold_3_in_2_gga6(x1, x2, x3, x4, x5, x6)  =  if_fold_3_in_2_gga1(x6)
fold_3_out_gga3(x1, x2, x3)  =  fold_3_out_gga1(x3)

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:

fold_3_in_gga3(X, ._22(Y, Ys), Z) -> if_fold_3_in_1_gga5(X, Y, Ys, Z, op_3_in_gga3(X, Y, V))
op_3_in_gga3(a_0, b_0, c_0) -> op_3_out_gga3(a_0, b_0, c_0)
if_fold_3_in_1_gga5(X, Y, Ys, Z, op_3_out_gga3(X, Y, V)) -> if_fold_3_in_2_gga6(X, Y, Ys, Z, V, fold_3_in_gga3(V, Ys, Z))
fold_3_in_gga3(X, []_0, X) -> fold_3_out_gga3(X, []_0, X)
if_fold_3_in_2_gga6(X, Y, Ys, Z, V, fold_3_out_gga3(V, Ys, Z)) -> fold_3_out_gga3(X, ._22(Y, Ys), Z)

The argument filtering Pi contains the following mapping:
fold_3_in_gga3(x1, x2, x3)  =  fold_3_in_gga2(x1, x2)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
a_0  =  a_0
b_0  =  b_0
c_0  =  c_0
if_fold_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_fold_3_in_1_gga2(x3, x5)
op_3_in_gga3(x1, x2, x3)  =  op_3_in_gga2(x1, x2)
op_3_out_gga3(x1, x2, x3)  =  op_3_out_gga1(x3)
if_fold_3_in_2_gga6(x1, x2, x3, x4, x5, x6)  =  if_fold_3_in_2_gga1(x6)
fold_3_out_gga3(x1, x2, x3)  =  fold_3_out_gga1(x3)


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

FOLD_3_IN_GGA3(X, ._22(Y, Ys), Z) -> IF_FOLD_3_IN_1_GGA5(X, Y, Ys, Z, op_3_in_gga3(X, Y, V))
FOLD_3_IN_GGA3(X, ._22(Y, Ys), Z) -> OP_3_IN_GGA3(X, Y, V)
IF_FOLD_3_IN_1_GGA5(X, Y, Ys, Z, op_3_out_gga3(X, Y, V)) -> IF_FOLD_3_IN_2_GGA6(X, Y, Ys, Z, V, fold_3_in_gga3(V, Ys, Z))
IF_FOLD_3_IN_1_GGA5(X, Y, Ys, Z, op_3_out_gga3(X, Y, V)) -> FOLD_3_IN_GGA3(V, Ys, Z)

The TRS R consists of the following rules:

fold_3_in_gga3(X, ._22(Y, Ys), Z) -> if_fold_3_in_1_gga5(X, Y, Ys, Z, op_3_in_gga3(X, Y, V))
op_3_in_gga3(a_0, b_0, c_0) -> op_3_out_gga3(a_0, b_0, c_0)
if_fold_3_in_1_gga5(X, Y, Ys, Z, op_3_out_gga3(X, Y, V)) -> if_fold_3_in_2_gga6(X, Y, Ys, Z, V, fold_3_in_gga3(V, Ys, Z))
fold_3_in_gga3(X, []_0, X) -> fold_3_out_gga3(X, []_0, X)
if_fold_3_in_2_gga6(X, Y, Ys, Z, V, fold_3_out_gga3(V, Ys, Z)) -> fold_3_out_gga3(X, ._22(Y, Ys), Z)

The argument filtering Pi contains the following mapping:
fold_3_in_gga3(x1, x2, x3)  =  fold_3_in_gga2(x1, x2)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
a_0  =  a_0
b_0  =  b_0
c_0  =  c_0
if_fold_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_fold_3_in_1_gga2(x3, x5)
op_3_in_gga3(x1, x2, x3)  =  op_3_in_gga2(x1, x2)
op_3_out_gga3(x1, x2, x3)  =  op_3_out_gga1(x3)
if_fold_3_in_2_gga6(x1, x2, x3, x4, x5, x6)  =  if_fold_3_in_2_gga1(x6)
fold_3_out_gga3(x1, x2, x3)  =  fold_3_out_gga1(x3)
FOLD_3_IN_GGA3(x1, x2, x3)  =  FOLD_3_IN_GGA2(x1, x2)
IF_FOLD_3_IN_1_GGA5(x1, x2, x3, x4, x5)  =  IF_FOLD_3_IN_1_GGA2(x3, x5)
IF_FOLD_3_IN_2_GGA6(x1, x2, x3, x4, x5, x6)  =  IF_FOLD_3_IN_2_GGA1(x6)
OP_3_IN_GGA3(x1, x2, x3)  =  OP_3_IN_GGA2(x1, x2)

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:

FOLD_3_IN_GGA3(X, ._22(Y, Ys), Z) -> IF_FOLD_3_IN_1_GGA5(X, Y, Ys, Z, op_3_in_gga3(X, Y, V))
FOLD_3_IN_GGA3(X, ._22(Y, Ys), Z) -> OP_3_IN_GGA3(X, Y, V)
IF_FOLD_3_IN_1_GGA5(X, Y, Ys, Z, op_3_out_gga3(X, Y, V)) -> IF_FOLD_3_IN_2_GGA6(X, Y, Ys, Z, V, fold_3_in_gga3(V, Ys, Z))
IF_FOLD_3_IN_1_GGA5(X, Y, Ys, Z, op_3_out_gga3(X, Y, V)) -> FOLD_3_IN_GGA3(V, Ys, Z)

The TRS R consists of the following rules:

fold_3_in_gga3(X, ._22(Y, Ys), Z) -> if_fold_3_in_1_gga5(X, Y, Ys, Z, op_3_in_gga3(X, Y, V))
op_3_in_gga3(a_0, b_0, c_0) -> op_3_out_gga3(a_0, b_0, c_0)
if_fold_3_in_1_gga5(X, Y, Ys, Z, op_3_out_gga3(X, Y, V)) -> if_fold_3_in_2_gga6(X, Y, Ys, Z, V, fold_3_in_gga3(V, Ys, Z))
fold_3_in_gga3(X, []_0, X) -> fold_3_out_gga3(X, []_0, X)
if_fold_3_in_2_gga6(X, Y, Ys, Z, V, fold_3_out_gga3(V, Ys, Z)) -> fold_3_out_gga3(X, ._22(Y, Ys), Z)

The argument filtering Pi contains the following mapping:
fold_3_in_gga3(x1, x2, x3)  =  fold_3_in_gga2(x1, x2)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
a_0  =  a_0
b_0  =  b_0
c_0  =  c_0
if_fold_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_fold_3_in_1_gga2(x3, x5)
op_3_in_gga3(x1, x2, x3)  =  op_3_in_gga2(x1, x2)
op_3_out_gga3(x1, x2, x3)  =  op_3_out_gga1(x3)
if_fold_3_in_2_gga6(x1, x2, x3, x4, x5, x6)  =  if_fold_3_in_2_gga1(x6)
fold_3_out_gga3(x1, x2, x3)  =  fold_3_out_gga1(x3)
FOLD_3_IN_GGA3(x1, x2, x3)  =  FOLD_3_IN_GGA2(x1, x2)
IF_FOLD_3_IN_1_GGA5(x1, x2, x3, x4, x5)  =  IF_FOLD_3_IN_1_GGA2(x3, x5)
IF_FOLD_3_IN_2_GGA6(x1, x2, x3, x4, x5, x6)  =  IF_FOLD_3_IN_2_GGA1(x6)
OP_3_IN_GGA3(x1, x2, x3)  =  OP_3_IN_GGA2(x1, x2)

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:

FOLD_3_IN_GGA3(X, ._22(Y, Ys), Z) -> IF_FOLD_3_IN_1_GGA5(X, Y, Ys, Z, op_3_in_gga3(X, Y, V))
IF_FOLD_3_IN_1_GGA5(X, Y, Ys, Z, op_3_out_gga3(X, Y, V)) -> FOLD_3_IN_GGA3(V, Ys, Z)

The TRS R consists of the following rules:

fold_3_in_gga3(X, ._22(Y, Ys), Z) -> if_fold_3_in_1_gga5(X, Y, Ys, Z, op_3_in_gga3(X, Y, V))
op_3_in_gga3(a_0, b_0, c_0) -> op_3_out_gga3(a_0, b_0, c_0)
if_fold_3_in_1_gga5(X, Y, Ys, Z, op_3_out_gga3(X, Y, V)) -> if_fold_3_in_2_gga6(X, Y, Ys, Z, V, fold_3_in_gga3(V, Ys, Z))
fold_3_in_gga3(X, []_0, X) -> fold_3_out_gga3(X, []_0, X)
if_fold_3_in_2_gga6(X, Y, Ys, Z, V, fold_3_out_gga3(V, Ys, Z)) -> fold_3_out_gga3(X, ._22(Y, Ys), Z)

The argument filtering Pi contains the following mapping:
fold_3_in_gga3(x1, x2, x3)  =  fold_3_in_gga2(x1, x2)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
a_0  =  a_0
b_0  =  b_0
c_0  =  c_0
if_fold_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_fold_3_in_1_gga2(x3, x5)
op_3_in_gga3(x1, x2, x3)  =  op_3_in_gga2(x1, x2)
op_3_out_gga3(x1, x2, x3)  =  op_3_out_gga1(x3)
if_fold_3_in_2_gga6(x1, x2, x3, x4, x5, x6)  =  if_fold_3_in_2_gga1(x6)
fold_3_out_gga3(x1, x2, x3)  =  fold_3_out_gga1(x3)
FOLD_3_IN_GGA3(x1, x2, x3)  =  FOLD_3_IN_GGA2(x1, x2)
IF_FOLD_3_IN_1_GGA5(x1, x2, x3, x4, x5)  =  IF_FOLD_3_IN_1_GGA2(x3, x5)

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:

FOLD_3_IN_GGA3(X, ._22(Y, Ys), Z) -> IF_FOLD_3_IN_1_GGA5(X, Y, Ys, Z, op_3_in_gga3(X, Y, V))
IF_FOLD_3_IN_1_GGA5(X, Y, Ys, Z, op_3_out_gga3(X, Y, V)) -> FOLD_3_IN_GGA3(V, Ys, Z)

The TRS R consists of the following rules:

op_3_in_gga3(a_0, b_0, c_0) -> op_3_out_gga3(a_0, b_0, c_0)

The argument filtering Pi contains the following mapping:
._22(x1, x2)  =  ._22(x1, x2)
a_0  =  a_0
b_0  =  b_0
c_0  =  c_0
op_3_in_gga3(x1, x2, x3)  =  op_3_in_gga2(x1, x2)
op_3_out_gga3(x1, x2, x3)  =  op_3_out_gga1(x3)
FOLD_3_IN_GGA3(x1, x2, x3)  =  FOLD_3_IN_GGA2(x1, x2)
IF_FOLD_3_IN_1_GGA5(x1, x2, x3, x4, x5)  =  IF_FOLD_3_IN_1_GGA2(x3, x5)

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:

FOLD_3_IN_GGA2(X, ._22(Y, Ys)) -> IF_FOLD_3_IN_1_GGA2(Ys, op_3_in_gga2(X, Y))
IF_FOLD_3_IN_1_GGA2(Ys, op_3_out_gga1(V)) -> FOLD_3_IN_GGA2(V, Ys)

The TRS R consists of the following rules:

op_3_in_gga2(a_0, b_0) -> op_3_out_gga1(c_0)

The set Q consists of the following terms:

op_3_in_gga2(x0, x1)

We have to consider all (P,Q,R)-chains.
The head symbols of this DP problem are {IF_FOLD_3_IN_1_GGA2, FOLD_3_IN_GGA2}.
By using the subterm criterion together with the size-change analysis we have proven that there are no infinite chains for this DP problem.

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