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



PROLOG
  ↳ PrologToPiTRSProof

f3(A, {}0, RES) :- g3(A, {}0, RES).
f3(.2(A, As), .2(B, Bs), RES) :- f3(.2(B, .2(A, As)), Bs, RES).
g3({}0, RES, RES).
g3(.2(C, Cs), D, RES) :- g3(Cs, .2(C, D), RES).


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


f_3_in_gga3(A, []_0, RES) -> if_f_3_in_1_gga3(A, RES, g_3_in_gga3(A, []_0, RES))
g_3_in_gga3([]_0, RES, RES) -> g_3_out_gga3([]_0, RES, RES)
g_3_in_gga3(._22(C, Cs), D, RES) -> if_g_3_in_1_gga5(C, Cs, D, RES, g_3_in_gga3(Cs, ._22(C, D), RES))
if_g_3_in_1_gga5(C, Cs, D, RES, g_3_out_gga3(Cs, ._22(C, D), RES)) -> g_3_out_gga3(._22(C, Cs), D, RES)
if_f_3_in_1_gga3(A, RES, g_3_out_gga3(A, []_0, RES)) -> f_3_out_gga3(A, []_0, RES)
f_3_in_gga3(._22(A, As), ._22(B, Bs), RES) -> if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_in_gga3(._22(B, ._22(A, As)), Bs, RES))
if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_out_gga3(._22(B, ._22(A, As)), Bs, RES)) -> f_3_out_gga3(._22(A, As), ._22(B, Bs), RES)

The argument filtering Pi contains the following mapping:
f_3_in_gga3(x1, x2, x3)  =  f_3_in_gga2(x1, x2)
[]_0  =  []_0
._22(x1, x2)  =  ._22(x1, x2)
if_f_3_in_1_gga3(x1, x2, x3)  =  if_f_3_in_1_gga1(x3)
g_3_in_gga3(x1, x2, x3)  =  g_3_in_gga2(x1, x2)
g_3_out_gga3(x1, x2, x3)  =  g_3_out_gga1(x3)
if_g_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_g_3_in_1_gga1(x5)
f_3_out_gga3(x1, x2, x3)  =  f_3_out_gga1(x3)
if_f_3_in_2_gga6(x1, x2, x3, x4, x5, x6)  =  if_f_3_in_2_gga1(x6)

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:

f_3_in_gga3(A, []_0, RES) -> if_f_3_in_1_gga3(A, RES, g_3_in_gga3(A, []_0, RES))
g_3_in_gga3([]_0, RES, RES) -> g_3_out_gga3([]_0, RES, RES)
g_3_in_gga3(._22(C, Cs), D, RES) -> if_g_3_in_1_gga5(C, Cs, D, RES, g_3_in_gga3(Cs, ._22(C, D), RES))
if_g_3_in_1_gga5(C, Cs, D, RES, g_3_out_gga3(Cs, ._22(C, D), RES)) -> g_3_out_gga3(._22(C, Cs), D, RES)
if_f_3_in_1_gga3(A, RES, g_3_out_gga3(A, []_0, RES)) -> f_3_out_gga3(A, []_0, RES)
f_3_in_gga3(._22(A, As), ._22(B, Bs), RES) -> if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_in_gga3(._22(B, ._22(A, As)), Bs, RES))
if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_out_gga3(._22(B, ._22(A, As)), Bs, RES)) -> f_3_out_gga3(._22(A, As), ._22(B, Bs), RES)

The argument filtering Pi contains the following mapping:
f_3_in_gga3(x1, x2, x3)  =  f_3_in_gga2(x1, x2)
[]_0  =  []_0
._22(x1, x2)  =  ._22(x1, x2)
if_f_3_in_1_gga3(x1, x2, x3)  =  if_f_3_in_1_gga1(x3)
g_3_in_gga3(x1, x2, x3)  =  g_3_in_gga2(x1, x2)
g_3_out_gga3(x1, x2, x3)  =  g_3_out_gga1(x3)
if_g_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_g_3_in_1_gga1(x5)
f_3_out_gga3(x1, x2, x3)  =  f_3_out_gga1(x3)
if_f_3_in_2_gga6(x1, x2, x3, x4, x5, x6)  =  if_f_3_in_2_gga1(x6)


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

F_3_IN_GGA3(A, []_0, RES) -> IF_F_3_IN_1_GGA3(A, RES, g_3_in_gga3(A, []_0, RES))
F_3_IN_GGA3(A, []_0, RES) -> G_3_IN_GGA3(A, []_0, RES)
G_3_IN_GGA3(._22(C, Cs), D, RES) -> IF_G_3_IN_1_GGA5(C, Cs, D, RES, g_3_in_gga3(Cs, ._22(C, D), RES))
G_3_IN_GGA3(._22(C, Cs), D, RES) -> G_3_IN_GGA3(Cs, ._22(C, D), RES)
F_3_IN_GGA3(._22(A, As), ._22(B, Bs), RES) -> IF_F_3_IN_2_GGA6(A, As, B, Bs, RES, f_3_in_gga3(._22(B, ._22(A, As)), Bs, RES))
F_3_IN_GGA3(._22(A, As), ._22(B, Bs), RES) -> F_3_IN_GGA3(._22(B, ._22(A, As)), Bs, RES)

The TRS R consists of the following rules:

f_3_in_gga3(A, []_0, RES) -> if_f_3_in_1_gga3(A, RES, g_3_in_gga3(A, []_0, RES))
g_3_in_gga3([]_0, RES, RES) -> g_3_out_gga3([]_0, RES, RES)
g_3_in_gga3(._22(C, Cs), D, RES) -> if_g_3_in_1_gga5(C, Cs, D, RES, g_3_in_gga3(Cs, ._22(C, D), RES))
if_g_3_in_1_gga5(C, Cs, D, RES, g_3_out_gga3(Cs, ._22(C, D), RES)) -> g_3_out_gga3(._22(C, Cs), D, RES)
if_f_3_in_1_gga3(A, RES, g_3_out_gga3(A, []_0, RES)) -> f_3_out_gga3(A, []_0, RES)
f_3_in_gga3(._22(A, As), ._22(B, Bs), RES) -> if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_in_gga3(._22(B, ._22(A, As)), Bs, RES))
if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_out_gga3(._22(B, ._22(A, As)), Bs, RES)) -> f_3_out_gga3(._22(A, As), ._22(B, Bs), RES)

The argument filtering Pi contains the following mapping:
f_3_in_gga3(x1, x2, x3)  =  f_3_in_gga2(x1, x2)
[]_0  =  []_0
._22(x1, x2)  =  ._22(x1, x2)
if_f_3_in_1_gga3(x1, x2, x3)  =  if_f_3_in_1_gga1(x3)
g_3_in_gga3(x1, x2, x3)  =  g_3_in_gga2(x1, x2)
g_3_out_gga3(x1, x2, x3)  =  g_3_out_gga1(x3)
if_g_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_g_3_in_1_gga1(x5)
f_3_out_gga3(x1, x2, x3)  =  f_3_out_gga1(x3)
if_f_3_in_2_gga6(x1, x2, x3, x4, x5, x6)  =  if_f_3_in_2_gga1(x6)
IF_G_3_IN_1_GGA5(x1, x2, x3, x4, x5)  =  IF_G_3_IN_1_GGA1(x5)
G_3_IN_GGA3(x1, x2, x3)  =  G_3_IN_GGA2(x1, x2)
F_3_IN_GGA3(x1, x2, x3)  =  F_3_IN_GGA2(x1, x2)
IF_F_3_IN_2_GGA6(x1, x2, x3, x4, x5, x6)  =  IF_F_3_IN_2_GGA1(x6)
IF_F_3_IN_1_GGA3(x1, x2, x3)  =  IF_F_3_IN_1_GGA1(x3)

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:

F_3_IN_GGA3(A, []_0, RES) -> IF_F_3_IN_1_GGA3(A, RES, g_3_in_gga3(A, []_0, RES))
F_3_IN_GGA3(A, []_0, RES) -> G_3_IN_GGA3(A, []_0, RES)
G_3_IN_GGA3(._22(C, Cs), D, RES) -> IF_G_3_IN_1_GGA5(C, Cs, D, RES, g_3_in_gga3(Cs, ._22(C, D), RES))
G_3_IN_GGA3(._22(C, Cs), D, RES) -> G_3_IN_GGA3(Cs, ._22(C, D), RES)
F_3_IN_GGA3(._22(A, As), ._22(B, Bs), RES) -> IF_F_3_IN_2_GGA6(A, As, B, Bs, RES, f_3_in_gga3(._22(B, ._22(A, As)), Bs, RES))
F_3_IN_GGA3(._22(A, As), ._22(B, Bs), RES) -> F_3_IN_GGA3(._22(B, ._22(A, As)), Bs, RES)

The TRS R consists of the following rules:

f_3_in_gga3(A, []_0, RES) -> if_f_3_in_1_gga3(A, RES, g_3_in_gga3(A, []_0, RES))
g_3_in_gga3([]_0, RES, RES) -> g_3_out_gga3([]_0, RES, RES)
g_3_in_gga3(._22(C, Cs), D, RES) -> if_g_3_in_1_gga5(C, Cs, D, RES, g_3_in_gga3(Cs, ._22(C, D), RES))
if_g_3_in_1_gga5(C, Cs, D, RES, g_3_out_gga3(Cs, ._22(C, D), RES)) -> g_3_out_gga3(._22(C, Cs), D, RES)
if_f_3_in_1_gga3(A, RES, g_3_out_gga3(A, []_0, RES)) -> f_3_out_gga3(A, []_0, RES)
f_3_in_gga3(._22(A, As), ._22(B, Bs), RES) -> if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_in_gga3(._22(B, ._22(A, As)), Bs, RES))
if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_out_gga3(._22(B, ._22(A, As)), Bs, RES)) -> f_3_out_gga3(._22(A, As), ._22(B, Bs), RES)

The argument filtering Pi contains the following mapping:
f_3_in_gga3(x1, x2, x3)  =  f_3_in_gga2(x1, x2)
[]_0  =  []_0
._22(x1, x2)  =  ._22(x1, x2)
if_f_3_in_1_gga3(x1, x2, x3)  =  if_f_3_in_1_gga1(x3)
g_3_in_gga3(x1, x2, x3)  =  g_3_in_gga2(x1, x2)
g_3_out_gga3(x1, x2, x3)  =  g_3_out_gga1(x3)
if_g_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_g_3_in_1_gga1(x5)
f_3_out_gga3(x1, x2, x3)  =  f_3_out_gga1(x3)
if_f_3_in_2_gga6(x1, x2, x3, x4, x5, x6)  =  if_f_3_in_2_gga1(x6)
IF_G_3_IN_1_GGA5(x1, x2, x3, x4, x5)  =  IF_G_3_IN_1_GGA1(x5)
G_3_IN_GGA3(x1, x2, x3)  =  G_3_IN_GGA2(x1, x2)
F_3_IN_GGA3(x1, x2, x3)  =  F_3_IN_GGA2(x1, x2)
IF_F_3_IN_2_GGA6(x1, x2, x3, x4, x5, x6)  =  IF_F_3_IN_2_GGA1(x6)
IF_F_3_IN_1_GGA3(x1, x2, x3)  =  IF_F_3_IN_1_GGA1(x3)

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

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

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

G_3_IN_GGA3(._22(C, Cs), D, RES) -> G_3_IN_GGA3(Cs, ._22(C, D), RES)

The TRS R consists of the following rules:

f_3_in_gga3(A, []_0, RES) -> if_f_3_in_1_gga3(A, RES, g_3_in_gga3(A, []_0, RES))
g_3_in_gga3([]_0, RES, RES) -> g_3_out_gga3([]_0, RES, RES)
g_3_in_gga3(._22(C, Cs), D, RES) -> if_g_3_in_1_gga5(C, Cs, D, RES, g_3_in_gga3(Cs, ._22(C, D), RES))
if_g_3_in_1_gga5(C, Cs, D, RES, g_3_out_gga3(Cs, ._22(C, D), RES)) -> g_3_out_gga3(._22(C, Cs), D, RES)
if_f_3_in_1_gga3(A, RES, g_3_out_gga3(A, []_0, RES)) -> f_3_out_gga3(A, []_0, RES)
f_3_in_gga3(._22(A, As), ._22(B, Bs), RES) -> if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_in_gga3(._22(B, ._22(A, As)), Bs, RES))
if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_out_gga3(._22(B, ._22(A, As)), Bs, RES)) -> f_3_out_gga3(._22(A, As), ._22(B, Bs), RES)

The argument filtering Pi contains the following mapping:
f_3_in_gga3(x1, x2, x3)  =  f_3_in_gga2(x1, x2)
[]_0  =  []_0
._22(x1, x2)  =  ._22(x1, x2)
if_f_3_in_1_gga3(x1, x2, x3)  =  if_f_3_in_1_gga1(x3)
g_3_in_gga3(x1, x2, x3)  =  g_3_in_gga2(x1, x2)
g_3_out_gga3(x1, x2, x3)  =  g_3_out_gga1(x3)
if_g_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_g_3_in_1_gga1(x5)
f_3_out_gga3(x1, x2, x3)  =  f_3_out_gga1(x3)
if_f_3_in_2_gga6(x1, x2, x3, x4, x5, x6)  =  if_f_3_in_2_gga1(x6)
G_3_IN_GGA3(x1, x2, x3)  =  G_3_IN_GGA2(x1, x2)

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
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

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

G_3_IN_GGA3(._22(C, Cs), D, RES) -> G_3_IN_GGA3(Cs, ._22(C, D), RES)

R is empty.
The argument filtering Pi contains the following mapping:
._22(x1, x2)  =  ._22(x1, x2)
G_3_IN_GGA3(x1, x2, x3)  =  G_3_IN_GGA2(x1, x2)

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
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

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

G_3_IN_GGA2(._22(C, Cs), D) -> G_3_IN_GGA2(Cs, ._22(C, D))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
The head symbols of this DP problem are {G_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:



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

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

F_3_IN_GGA3(._22(A, As), ._22(B, Bs), RES) -> F_3_IN_GGA3(._22(B, ._22(A, As)), Bs, RES)

The TRS R consists of the following rules:

f_3_in_gga3(A, []_0, RES) -> if_f_3_in_1_gga3(A, RES, g_3_in_gga3(A, []_0, RES))
g_3_in_gga3([]_0, RES, RES) -> g_3_out_gga3([]_0, RES, RES)
g_3_in_gga3(._22(C, Cs), D, RES) -> if_g_3_in_1_gga5(C, Cs, D, RES, g_3_in_gga3(Cs, ._22(C, D), RES))
if_g_3_in_1_gga5(C, Cs, D, RES, g_3_out_gga3(Cs, ._22(C, D), RES)) -> g_3_out_gga3(._22(C, Cs), D, RES)
if_f_3_in_1_gga3(A, RES, g_3_out_gga3(A, []_0, RES)) -> f_3_out_gga3(A, []_0, RES)
f_3_in_gga3(._22(A, As), ._22(B, Bs), RES) -> if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_in_gga3(._22(B, ._22(A, As)), Bs, RES))
if_f_3_in_2_gga6(A, As, B, Bs, RES, f_3_out_gga3(._22(B, ._22(A, As)), Bs, RES)) -> f_3_out_gga3(._22(A, As), ._22(B, Bs), RES)

The argument filtering Pi contains the following mapping:
f_3_in_gga3(x1, x2, x3)  =  f_3_in_gga2(x1, x2)
[]_0  =  []_0
._22(x1, x2)  =  ._22(x1, x2)
if_f_3_in_1_gga3(x1, x2, x3)  =  if_f_3_in_1_gga1(x3)
g_3_in_gga3(x1, x2, x3)  =  g_3_in_gga2(x1, x2)
g_3_out_gga3(x1, x2, x3)  =  g_3_out_gga1(x3)
if_g_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_g_3_in_1_gga1(x5)
f_3_out_gga3(x1, x2, x3)  =  f_3_out_gga1(x3)
if_f_3_in_2_gga6(x1, x2, x3, x4, x5, x6)  =  if_f_3_in_2_gga1(x6)
F_3_IN_GGA3(x1, x2, x3)  =  F_3_IN_GGA2(x1, x2)

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
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

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

F_3_IN_GGA3(._22(A, As), ._22(B, Bs), RES) -> F_3_IN_GGA3(._22(B, ._22(A, As)), Bs, RES)

R is empty.
The argument filtering Pi contains the following mapping:
._22(x1, x2)  =  ._22(x1, x2)
F_3_IN_GGA3(x1, x2, x3)  =  F_3_IN_GGA2(x1, x2)

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
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof

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

F_3_IN_GGA2(._22(A, As), ._22(B, Bs)) -> F_3_IN_GGA2(._22(B, ._22(A, As)), Bs)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
The head symbols of this DP problem are {F_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: