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



PROLOG
  ↳ PrologToPiTRSProof

perm2(Xs, .2(X, Ys)) :- app3(X1s, .2(X, X2s), Xs), app3(X1s, X2s, Zs), perm2(Zs, Ys).
perm2({}0, {}0).
app3(.2(X, Xs), Ys, .2(X, Zs)) :- app3(Xs, Ys, Zs).
app3({}0, Ys, Ys).


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


perm_2_in_ga2(Xs, ._22(X, Ys)) -> if_perm_2_in_1_ga4(Xs, X, Ys, app_3_in_aag3(X1s, ._22(X, X2s), Xs))
app_3_in_aag3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_in_aag3(Xs, Ys, Zs))
app_3_in_aag3([]_0, Ys, Ys) -> app_3_out_aag3([]_0, Ys, Ys)
if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_out_aag3(Xs, Ys, Zs)) -> app_3_out_aag3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_1_ga4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_in_gga3(X1s, X2s, Zs))
app_3_in_gga3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_in_gga3(Xs, Ys, Zs))
app_3_in_gga3([]_0, Ys, Ys) -> app_3_out_gga3([]_0, Ys, Ys)
if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_out_gga3(Xs, Ys, Zs)) -> app_3_out_gga3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_in_ga2(Zs, Ys))
perm_2_in_ga2([]_0, []_0) -> perm_2_out_ga2([]_0, []_0)
if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_out_ga2(Zs, Ys)) -> perm_2_out_ga2(Xs, ._22(X, Ys))

The argument filtering Pi contains the following mapping:
perm_2_in_ga2(x1, x2)  =  perm_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
if_perm_2_in_1_ga4(x1, x2, x3, x4)  =  if_perm_2_in_1_ga1(x4)
app_3_in_aag3(x1, x2, x3)  =  app_3_in_aag1(x3)
if_app_3_in_1_aag5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_aag2(x1, x5)
app_3_out_aag3(x1, x2, x3)  =  app_3_out_aag2(x1, x2)
if_perm_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_perm_2_in_2_ga2(x2, x6)
app_3_in_gga3(x1, x2, x3)  =  app_3_in_gga2(x1, x2)
if_app_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_gga2(x1, x5)
app_3_out_gga3(x1, x2, x3)  =  app_3_out_gga1(x3)
if_perm_2_in_3_ga5(x1, x2, x3, x4, x5)  =  if_perm_2_in_3_ga2(x2, x5)
perm_2_out_ga2(x1, x2)  =  perm_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:

perm_2_in_ga2(Xs, ._22(X, Ys)) -> if_perm_2_in_1_ga4(Xs, X, Ys, app_3_in_aag3(X1s, ._22(X, X2s), Xs))
app_3_in_aag3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_in_aag3(Xs, Ys, Zs))
app_3_in_aag3([]_0, Ys, Ys) -> app_3_out_aag3([]_0, Ys, Ys)
if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_out_aag3(Xs, Ys, Zs)) -> app_3_out_aag3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_1_ga4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_in_gga3(X1s, X2s, Zs))
app_3_in_gga3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_in_gga3(Xs, Ys, Zs))
app_3_in_gga3([]_0, Ys, Ys) -> app_3_out_gga3([]_0, Ys, Ys)
if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_out_gga3(Xs, Ys, Zs)) -> app_3_out_gga3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_in_ga2(Zs, Ys))
perm_2_in_ga2([]_0, []_0) -> perm_2_out_ga2([]_0, []_0)
if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_out_ga2(Zs, Ys)) -> perm_2_out_ga2(Xs, ._22(X, Ys))

The argument filtering Pi contains the following mapping:
perm_2_in_ga2(x1, x2)  =  perm_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
if_perm_2_in_1_ga4(x1, x2, x3, x4)  =  if_perm_2_in_1_ga1(x4)
app_3_in_aag3(x1, x2, x3)  =  app_3_in_aag1(x3)
if_app_3_in_1_aag5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_aag2(x1, x5)
app_3_out_aag3(x1, x2, x3)  =  app_3_out_aag2(x1, x2)
if_perm_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_perm_2_in_2_ga2(x2, x6)
app_3_in_gga3(x1, x2, x3)  =  app_3_in_gga2(x1, x2)
if_app_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_gga2(x1, x5)
app_3_out_gga3(x1, x2, x3)  =  app_3_out_gga1(x3)
if_perm_2_in_3_ga5(x1, x2, x3, x4, x5)  =  if_perm_2_in_3_ga2(x2, x5)
perm_2_out_ga2(x1, x2)  =  perm_2_out_ga1(x2)


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

PERM_2_IN_GA2(Xs, ._22(X, Ys)) -> IF_PERM_2_IN_1_GA4(Xs, X, Ys, app_3_in_aag3(X1s, ._22(X, X2s), Xs))
PERM_2_IN_GA2(Xs, ._22(X, Ys)) -> APP_3_IN_AAG3(X1s, ._22(X, X2s), Xs)
APP_3_IN_AAG3(._22(X, Xs), Ys, ._22(X, Zs)) -> IF_APP_3_IN_1_AAG5(X, Xs, Ys, Zs, app_3_in_aag3(Xs, Ys, Zs))
APP_3_IN_AAG3(._22(X, Xs), Ys, ._22(X, Zs)) -> APP_3_IN_AAG3(Xs, Ys, Zs)
IF_PERM_2_IN_1_GA4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> IF_PERM_2_IN_2_GA6(Xs, X, Ys, X1s, X2s, app_3_in_gga3(X1s, X2s, Zs))
IF_PERM_2_IN_1_GA4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> APP_3_IN_GGA3(X1s, X2s, Zs)
APP_3_IN_GGA3(._22(X, Xs), Ys, ._22(X, Zs)) -> IF_APP_3_IN_1_GGA5(X, Xs, Ys, Zs, app_3_in_gga3(Xs, Ys, Zs))
APP_3_IN_GGA3(._22(X, Xs), Ys, ._22(X, Zs)) -> APP_3_IN_GGA3(Xs, Ys, Zs)
IF_PERM_2_IN_2_GA6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> IF_PERM_2_IN_3_GA5(Xs, X, Ys, Zs, perm_2_in_ga2(Zs, Ys))
IF_PERM_2_IN_2_GA6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> PERM_2_IN_GA2(Zs, Ys)

The TRS R consists of the following rules:

perm_2_in_ga2(Xs, ._22(X, Ys)) -> if_perm_2_in_1_ga4(Xs, X, Ys, app_3_in_aag3(X1s, ._22(X, X2s), Xs))
app_3_in_aag3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_in_aag3(Xs, Ys, Zs))
app_3_in_aag3([]_0, Ys, Ys) -> app_3_out_aag3([]_0, Ys, Ys)
if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_out_aag3(Xs, Ys, Zs)) -> app_3_out_aag3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_1_ga4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_in_gga3(X1s, X2s, Zs))
app_3_in_gga3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_in_gga3(Xs, Ys, Zs))
app_3_in_gga3([]_0, Ys, Ys) -> app_3_out_gga3([]_0, Ys, Ys)
if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_out_gga3(Xs, Ys, Zs)) -> app_3_out_gga3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_in_ga2(Zs, Ys))
perm_2_in_ga2([]_0, []_0) -> perm_2_out_ga2([]_0, []_0)
if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_out_ga2(Zs, Ys)) -> perm_2_out_ga2(Xs, ._22(X, Ys))

The argument filtering Pi contains the following mapping:
perm_2_in_ga2(x1, x2)  =  perm_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
if_perm_2_in_1_ga4(x1, x2, x3, x4)  =  if_perm_2_in_1_ga1(x4)
app_3_in_aag3(x1, x2, x3)  =  app_3_in_aag1(x3)
if_app_3_in_1_aag5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_aag2(x1, x5)
app_3_out_aag3(x1, x2, x3)  =  app_3_out_aag2(x1, x2)
if_perm_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_perm_2_in_2_ga2(x2, x6)
app_3_in_gga3(x1, x2, x3)  =  app_3_in_gga2(x1, x2)
if_app_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_gga2(x1, x5)
app_3_out_gga3(x1, x2, x3)  =  app_3_out_gga1(x3)
if_perm_2_in_3_ga5(x1, x2, x3, x4, x5)  =  if_perm_2_in_3_ga2(x2, x5)
perm_2_out_ga2(x1, x2)  =  perm_2_out_ga1(x2)
IF_APP_3_IN_1_GGA5(x1, x2, x3, x4, x5)  =  IF_APP_3_IN_1_GGA2(x1, x5)
IF_APP_3_IN_1_AAG5(x1, x2, x3, x4, x5)  =  IF_APP_3_IN_1_AAG2(x1, x5)
IF_PERM_2_IN_3_GA5(x1, x2, x3, x4, x5)  =  IF_PERM_2_IN_3_GA2(x2, x5)
APP_3_IN_GGA3(x1, x2, x3)  =  APP_3_IN_GGA2(x1, x2)
APP_3_IN_AAG3(x1, x2, x3)  =  APP_3_IN_AAG1(x3)
PERM_2_IN_GA2(x1, x2)  =  PERM_2_IN_GA1(x1)
IF_PERM_2_IN_2_GA6(x1, x2, x3, x4, x5, x6)  =  IF_PERM_2_IN_2_GA2(x2, x6)
IF_PERM_2_IN_1_GA4(x1, x2, x3, x4)  =  IF_PERM_2_IN_1_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:

PERM_2_IN_GA2(Xs, ._22(X, Ys)) -> IF_PERM_2_IN_1_GA4(Xs, X, Ys, app_3_in_aag3(X1s, ._22(X, X2s), Xs))
PERM_2_IN_GA2(Xs, ._22(X, Ys)) -> APP_3_IN_AAG3(X1s, ._22(X, X2s), Xs)
APP_3_IN_AAG3(._22(X, Xs), Ys, ._22(X, Zs)) -> IF_APP_3_IN_1_AAG5(X, Xs, Ys, Zs, app_3_in_aag3(Xs, Ys, Zs))
APP_3_IN_AAG3(._22(X, Xs), Ys, ._22(X, Zs)) -> APP_3_IN_AAG3(Xs, Ys, Zs)
IF_PERM_2_IN_1_GA4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> IF_PERM_2_IN_2_GA6(Xs, X, Ys, X1s, X2s, app_3_in_gga3(X1s, X2s, Zs))
IF_PERM_2_IN_1_GA4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> APP_3_IN_GGA3(X1s, X2s, Zs)
APP_3_IN_GGA3(._22(X, Xs), Ys, ._22(X, Zs)) -> IF_APP_3_IN_1_GGA5(X, Xs, Ys, Zs, app_3_in_gga3(Xs, Ys, Zs))
APP_3_IN_GGA3(._22(X, Xs), Ys, ._22(X, Zs)) -> APP_3_IN_GGA3(Xs, Ys, Zs)
IF_PERM_2_IN_2_GA6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> IF_PERM_2_IN_3_GA5(Xs, X, Ys, Zs, perm_2_in_ga2(Zs, Ys))
IF_PERM_2_IN_2_GA6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> PERM_2_IN_GA2(Zs, Ys)

The TRS R consists of the following rules:

perm_2_in_ga2(Xs, ._22(X, Ys)) -> if_perm_2_in_1_ga4(Xs, X, Ys, app_3_in_aag3(X1s, ._22(X, X2s), Xs))
app_3_in_aag3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_in_aag3(Xs, Ys, Zs))
app_3_in_aag3([]_0, Ys, Ys) -> app_3_out_aag3([]_0, Ys, Ys)
if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_out_aag3(Xs, Ys, Zs)) -> app_3_out_aag3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_1_ga4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_in_gga3(X1s, X2s, Zs))
app_3_in_gga3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_in_gga3(Xs, Ys, Zs))
app_3_in_gga3([]_0, Ys, Ys) -> app_3_out_gga3([]_0, Ys, Ys)
if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_out_gga3(Xs, Ys, Zs)) -> app_3_out_gga3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_in_ga2(Zs, Ys))
perm_2_in_ga2([]_0, []_0) -> perm_2_out_ga2([]_0, []_0)
if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_out_ga2(Zs, Ys)) -> perm_2_out_ga2(Xs, ._22(X, Ys))

The argument filtering Pi contains the following mapping:
perm_2_in_ga2(x1, x2)  =  perm_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
if_perm_2_in_1_ga4(x1, x2, x3, x4)  =  if_perm_2_in_1_ga1(x4)
app_3_in_aag3(x1, x2, x3)  =  app_3_in_aag1(x3)
if_app_3_in_1_aag5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_aag2(x1, x5)
app_3_out_aag3(x1, x2, x3)  =  app_3_out_aag2(x1, x2)
if_perm_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_perm_2_in_2_ga2(x2, x6)
app_3_in_gga3(x1, x2, x3)  =  app_3_in_gga2(x1, x2)
if_app_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_gga2(x1, x5)
app_3_out_gga3(x1, x2, x3)  =  app_3_out_gga1(x3)
if_perm_2_in_3_ga5(x1, x2, x3, x4, x5)  =  if_perm_2_in_3_ga2(x2, x5)
perm_2_out_ga2(x1, x2)  =  perm_2_out_ga1(x2)
IF_APP_3_IN_1_GGA5(x1, x2, x3, x4, x5)  =  IF_APP_3_IN_1_GGA2(x1, x5)
IF_APP_3_IN_1_AAG5(x1, x2, x3, x4, x5)  =  IF_APP_3_IN_1_AAG2(x1, x5)
IF_PERM_2_IN_3_GA5(x1, x2, x3, x4, x5)  =  IF_PERM_2_IN_3_GA2(x2, x5)
APP_3_IN_GGA3(x1, x2, x3)  =  APP_3_IN_GGA2(x1, x2)
APP_3_IN_AAG3(x1, x2, x3)  =  APP_3_IN_AAG1(x3)
PERM_2_IN_GA2(x1, x2)  =  PERM_2_IN_GA1(x1)
IF_PERM_2_IN_2_GA6(x1, x2, x3, x4, x5, x6)  =  IF_PERM_2_IN_2_GA2(x2, x6)
IF_PERM_2_IN_1_GA4(x1, x2, x3, x4)  =  IF_PERM_2_IN_1_GA1(x4)

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

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

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

APP_3_IN_GGA3(._22(X, Xs), Ys, ._22(X, Zs)) -> APP_3_IN_GGA3(Xs, Ys, Zs)

The TRS R consists of the following rules:

perm_2_in_ga2(Xs, ._22(X, Ys)) -> if_perm_2_in_1_ga4(Xs, X, Ys, app_3_in_aag3(X1s, ._22(X, X2s), Xs))
app_3_in_aag3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_in_aag3(Xs, Ys, Zs))
app_3_in_aag3([]_0, Ys, Ys) -> app_3_out_aag3([]_0, Ys, Ys)
if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_out_aag3(Xs, Ys, Zs)) -> app_3_out_aag3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_1_ga4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_in_gga3(X1s, X2s, Zs))
app_3_in_gga3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_in_gga3(Xs, Ys, Zs))
app_3_in_gga3([]_0, Ys, Ys) -> app_3_out_gga3([]_0, Ys, Ys)
if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_out_gga3(Xs, Ys, Zs)) -> app_3_out_gga3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_in_ga2(Zs, Ys))
perm_2_in_ga2([]_0, []_0) -> perm_2_out_ga2([]_0, []_0)
if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_out_ga2(Zs, Ys)) -> perm_2_out_ga2(Xs, ._22(X, Ys))

The argument filtering Pi contains the following mapping:
perm_2_in_ga2(x1, x2)  =  perm_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
if_perm_2_in_1_ga4(x1, x2, x3, x4)  =  if_perm_2_in_1_ga1(x4)
app_3_in_aag3(x1, x2, x3)  =  app_3_in_aag1(x3)
if_app_3_in_1_aag5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_aag2(x1, x5)
app_3_out_aag3(x1, x2, x3)  =  app_3_out_aag2(x1, x2)
if_perm_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_perm_2_in_2_ga2(x2, x6)
app_3_in_gga3(x1, x2, x3)  =  app_3_in_gga2(x1, x2)
if_app_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_gga2(x1, x5)
app_3_out_gga3(x1, x2, x3)  =  app_3_out_gga1(x3)
if_perm_2_in_3_ga5(x1, x2, x3, x4, x5)  =  if_perm_2_in_3_ga2(x2, x5)
perm_2_out_ga2(x1, x2)  =  perm_2_out_ga1(x2)
APP_3_IN_GGA3(x1, x2, x3)  =  APP_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
              ↳ PiDP

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

APP_3_IN_GGA3(._22(X, Xs), Ys, ._22(X, Zs)) -> APP_3_IN_GGA3(Xs, Ys, Zs)

R is empty.
The argument filtering Pi contains the following mapping:
._22(x1, x2)  =  ._22(x1, x2)
APP_3_IN_GGA3(x1, x2, x3)  =  APP_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
              ↳ PiDP

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

APP_3_IN_GGA2(._22(X, Xs), Ys) -> APP_3_IN_GGA2(Xs, Ys)

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

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

APP_3_IN_AAG3(._22(X, Xs), Ys, ._22(X, Zs)) -> APP_3_IN_AAG3(Xs, Ys, Zs)

The TRS R consists of the following rules:

perm_2_in_ga2(Xs, ._22(X, Ys)) -> if_perm_2_in_1_ga4(Xs, X, Ys, app_3_in_aag3(X1s, ._22(X, X2s), Xs))
app_3_in_aag3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_in_aag3(Xs, Ys, Zs))
app_3_in_aag3([]_0, Ys, Ys) -> app_3_out_aag3([]_0, Ys, Ys)
if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_out_aag3(Xs, Ys, Zs)) -> app_3_out_aag3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_1_ga4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_in_gga3(X1s, X2s, Zs))
app_3_in_gga3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_in_gga3(Xs, Ys, Zs))
app_3_in_gga3([]_0, Ys, Ys) -> app_3_out_gga3([]_0, Ys, Ys)
if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_out_gga3(Xs, Ys, Zs)) -> app_3_out_gga3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_in_ga2(Zs, Ys))
perm_2_in_ga2([]_0, []_0) -> perm_2_out_ga2([]_0, []_0)
if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_out_ga2(Zs, Ys)) -> perm_2_out_ga2(Xs, ._22(X, Ys))

The argument filtering Pi contains the following mapping:
perm_2_in_ga2(x1, x2)  =  perm_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
if_perm_2_in_1_ga4(x1, x2, x3, x4)  =  if_perm_2_in_1_ga1(x4)
app_3_in_aag3(x1, x2, x3)  =  app_3_in_aag1(x3)
if_app_3_in_1_aag5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_aag2(x1, x5)
app_3_out_aag3(x1, x2, x3)  =  app_3_out_aag2(x1, x2)
if_perm_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_perm_2_in_2_ga2(x2, x6)
app_3_in_gga3(x1, x2, x3)  =  app_3_in_gga2(x1, x2)
if_app_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_gga2(x1, x5)
app_3_out_gga3(x1, x2, x3)  =  app_3_out_gga1(x3)
if_perm_2_in_3_ga5(x1, x2, x3, x4, x5)  =  if_perm_2_in_3_ga2(x2, x5)
perm_2_out_ga2(x1, x2)  =  perm_2_out_ga1(x2)
APP_3_IN_AAG3(x1, x2, x3)  =  APP_3_IN_AAG1(x3)

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
              ↳ PiDP

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

APP_3_IN_AAG3(._22(X, Xs), Ys, ._22(X, Zs)) -> APP_3_IN_AAG3(Xs, Ys, Zs)

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

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
              ↳ PiDP

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

APP_3_IN_AAG1(._22(X, Zs)) -> APP_3_IN_AAG1(Zs)

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

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

IF_PERM_2_IN_2_GA6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> PERM_2_IN_GA2(Zs, Ys)
PERM_2_IN_GA2(Xs, ._22(X, Ys)) -> IF_PERM_2_IN_1_GA4(Xs, X, Ys, app_3_in_aag3(X1s, ._22(X, X2s), Xs))
IF_PERM_2_IN_1_GA4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> IF_PERM_2_IN_2_GA6(Xs, X, Ys, X1s, X2s, app_3_in_gga3(X1s, X2s, Zs))

The TRS R consists of the following rules:

perm_2_in_ga2(Xs, ._22(X, Ys)) -> if_perm_2_in_1_ga4(Xs, X, Ys, app_3_in_aag3(X1s, ._22(X, X2s), Xs))
app_3_in_aag3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_in_aag3(Xs, Ys, Zs))
app_3_in_aag3([]_0, Ys, Ys) -> app_3_out_aag3([]_0, Ys, Ys)
if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_out_aag3(Xs, Ys, Zs)) -> app_3_out_aag3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_1_ga4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_in_gga3(X1s, X2s, Zs))
app_3_in_gga3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_in_gga3(Xs, Ys, Zs))
app_3_in_gga3([]_0, Ys, Ys) -> app_3_out_gga3([]_0, Ys, Ys)
if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_out_gga3(Xs, Ys, Zs)) -> app_3_out_gga3(._22(X, Xs), Ys, ._22(X, Zs))
if_perm_2_in_2_ga6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_in_ga2(Zs, Ys))
perm_2_in_ga2([]_0, []_0) -> perm_2_out_ga2([]_0, []_0)
if_perm_2_in_3_ga5(Xs, X, Ys, Zs, perm_2_out_ga2(Zs, Ys)) -> perm_2_out_ga2(Xs, ._22(X, Ys))

The argument filtering Pi contains the following mapping:
perm_2_in_ga2(x1, x2)  =  perm_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
if_perm_2_in_1_ga4(x1, x2, x3, x4)  =  if_perm_2_in_1_ga1(x4)
app_3_in_aag3(x1, x2, x3)  =  app_3_in_aag1(x3)
if_app_3_in_1_aag5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_aag2(x1, x5)
app_3_out_aag3(x1, x2, x3)  =  app_3_out_aag2(x1, x2)
if_perm_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_perm_2_in_2_ga2(x2, x6)
app_3_in_gga3(x1, x2, x3)  =  app_3_in_gga2(x1, x2)
if_app_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_gga2(x1, x5)
app_3_out_gga3(x1, x2, x3)  =  app_3_out_gga1(x3)
if_perm_2_in_3_ga5(x1, x2, x3, x4, x5)  =  if_perm_2_in_3_ga2(x2, x5)
perm_2_out_ga2(x1, x2)  =  perm_2_out_ga1(x2)
PERM_2_IN_GA2(x1, x2)  =  PERM_2_IN_GA1(x1)
IF_PERM_2_IN_2_GA6(x1, x2, x3, x4, x5, x6)  =  IF_PERM_2_IN_2_GA2(x2, x6)
IF_PERM_2_IN_1_GA4(x1, x2, x3, x4)  =  IF_PERM_2_IN_1_GA1(x4)

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

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

IF_PERM_2_IN_2_GA6(Xs, X, Ys, X1s, X2s, app_3_out_gga3(X1s, X2s, Zs)) -> PERM_2_IN_GA2(Zs, Ys)
PERM_2_IN_GA2(Xs, ._22(X, Ys)) -> IF_PERM_2_IN_1_GA4(Xs, X, Ys, app_3_in_aag3(X1s, ._22(X, X2s), Xs))
IF_PERM_2_IN_1_GA4(Xs, X, Ys, app_3_out_aag3(X1s, ._22(X, X2s), Xs)) -> IF_PERM_2_IN_2_GA6(Xs, X, Ys, X1s, X2s, app_3_in_gga3(X1s, X2s, Zs))

The TRS R consists of the following rules:

app_3_in_aag3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_in_aag3(Xs, Ys, Zs))
app_3_in_aag3([]_0, Ys, Ys) -> app_3_out_aag3([]_0, Ys, Ys)
app_3_in_gga3(._22(X, Xs), Ys, ._22(X, Zs)) -> if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_in_gga3(Xs, Ys, Zs))
app_3_in_gga3([]_0, Ys, Ys) -> app_3_out_gga3([]_0, Ys, Ys)
if_app_3_in_1_aag5(X, Xs, Ys, Zs, app_3_out_aag3(Xs, Ys, Zs)) -> app_3_out_aag3(._22(X, Xs), Ys, ._22(X, Zs))
if_app_3_in_1_gga5(X, Xs, Ys, Zs, app_3_out_gga3(Xs, Ys, Zs)) -> app_3_out_gga3(._22(X, Xs), Ys, ._22(X, Zs))

The argument filtering Pi contains the following mapping:
._22(x1, x2)  =  ._22(x1, x2)
[]_0  =  []_0
app_3_in_aag3(x1, x2, x3)  =  app_3_in_aag1(x3)
if_app_3_in_1_aag5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_aag2(x1, x5)
app_3_out_aag3(x1, x2, x3)  =  app_3_out_aag2(x1, x2)
app_3_in_gga3(x1, x2, x3)  =  app_3_in_gga2(x1, x2)
if_app_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_app_3_in_1_gga2(x1, x5)
app_3_out_gga3(x1, x2, x3)  =  app_3_out_gga1(x3)
PERM_2_IN_GA2(x1, x2)  =  PERM_2_IN_GA1(x1)
IF_PERM_2_IN_2_GA6(x1, x2, x3, x4, x5, x6)  =  IF_PERM_2_IN_2_GA2(x2, x6)
IF_PERM_2_IN_1_GA4(x1, x2, x3, x4)  =  IF_PERM_2_IN_1_GA1(x4)

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

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

IF_PERM_2_IN_2_GA2(X, app_3_out_gga1(Zs)) -> PERM_2_IN_GA1(Zs)
PERM_2_IN_GA1(Xs) -> IF_PERM_2_IN_1_GA1(app_3_in_aag1(Xs))
IF_PERM_2_IN_1_GA1(app_3_out_aag2(X1s, ._22(X, X2s))) -> IF_PERM_2_IN_2_GA2(X, app_3_in_gga2(X1s, X2s))

The TRS R consists of the following rules:

app_3_in_aag1(._22(X, Zs)) -> if_app_3_in_1_aag2(X, app_3_in_aag1(Zs))
app_3_in_aag1(Ys) -> app_3_out_aag2([]_0, Ys)
app_3_in_gga2(._22(X, Xs), Ys) -> if_app_3_in_1_gga2(X, app_3_in_gga2(Xs, Ys))
app_3_in_gga2([]_0, Ys) -> app_3_out_gga1(Ys)
if_app_3_in_1_aag2(X, app_3_out_aag2(Xs, Ys)) -> app_3_out_aag2(._22(X, Xs), Ys)
if_app_3_in_1_gga2(X, app_3_out_gga1(Zs)) -> app_3_out_gga1(._22(X, Zs))

The set Q consists of the following terms:

app_3_in_aag1(x0)
app_3_in_gga2(x0, x1)
if_app_3_in_1_aag2(x0, x1)
if_app_3_in_1_gga2(x0, x1)

We have to consider all (P,Q,R)-chains.
The head symbols of this DP problem are {PERM_2_IN_GA1, IF_PERM_2_IN_2_GA2, IF_PERM_2_IN_1_GA1}.
By using a polynomial ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.

Strictly oriented rules of the TRS R:

app_3_in_gga2([]_0, Ys) -> app_3_out_gga1(Ys)

Used ordering: POLO with Polynomial interpretation:

POL(._22(x1, x2)) = 1 + x1 + x2   
POL(if_app_3_in_1_gga2(x1, x2)) = 1 + x1 + x2   
POL(IF_PERM_2_IN_2_GA2(x1, x2)) = 1 + x1 + x2   
POL(IF_PERM_2_IN_1_GA1(x1)) = x1   
POL(app_3_out_gga1(x1)) = 1 + x1   
POL(app_3_in_aag1(x1)) = 2 + x1   
POL(app_3_out_aag2(x1, x2)) = x1 + x2   
POL(if_app_3_in_1_aag2(x1, x2)) = 1 + x1 + x2   
POL([]_0) = 2   
POL(app_3_in_gga2(x1, x2)) = x1 + x2   
POL(PERM_2_IN_GA1(x1)) = 2 + x1   



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

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

IF_PERM_2_IN_2_GA2(X, app_3_out_gga1(Zs)) -> PERM_2_IN_GA1(Zs)
PERM_2_IN_GA1(Xs) -> IF_PERM_2_IN_1_GA1(app_3_in_aag1(Xs))
IF_PERM_2_IN_1_GA1(app_3_out_aag2(X1s, ._22(X, X2s))) -> IF_PERM_2_IN_2_GA2(X, app_3_in_gga2(X1s, X2s))

The TRS R consists of the following rules:

app_3_in_aag1(._22(X, Zs)) -> if_app_3_in_1_aag2(X, app_3_in_aag1(Zs))
app_3_in_aag1(Ys) -> app_3_out_aag2([]_0, Ys)
app_3_in_gga2(._22(X, Xs), Ys) -> if_app_3_in_1_gga2(X, app_3_in_gga2(Xs, Ys))
if_app_3_in_1_aag2(X, app_3_out_aag2(Xs, Ys)) -> app_3_out_aag2(._22(X, Xs), Ys)
if_app_3_in_1_gga2(X, app_3_out_gga1(Zs)) -> app_3_out_gga1(._22(X, Zs))

The set Q consists of the following terms:

app_3_in_aag1(x0)
app_3_in_gga2(x0, x1)
if_app_3_in_1_aag2(x0, x1)
if_app_3_in_1_gga2(x0, x1)

We have to consider all (P,Q,R)-chains.
The head symbols of this DP problem are {PERM_2_IN_GA1, IF_PERM_2_IN_2_GA2, IF_PERM_2_IN_1_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(._22(x1, x2)) = x2   
POL(if_app_3_in_1_gga2(x1, x2)) = x2   
POL(app_3_out_gga1(x1)) = 1 + x1   
POL(app_3_in_aag1(x1)) = x1   
POL(app_3_out_aag2(x1, x2)) = x2   
POL(if_app_3_in_1_aag2(x1, x2)) = x2   
POL([]_0) = 0   
POL(app_3_in_gga2(x1, x2)) = x2   

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

We oriented the following set of usable rules.


if_app_3_in_1_gga2(X, app_3_out_gga1(Zs)) -> app_3_out_gga1(._22(X, Zs))
if_app_3_in_1_aag2(X, app_3_out_aag2(Xs, Ys)) -> app_3_out_aag2(._22(X, Xs), Ys)
app_3_in_gga2(._22(X, Xs), Ys) -> if_app_3_in_1_gga2(X, app_3_in_gga2(Xs, Ys))
app_3_in_aag1(Ys) -> app_3_out_aag2([]_0, Ys)
app_3_in_aag1(._22(X, Zs)) -> if_app_3_in_1_aag2(X, app_3_in_aag1(Zs))