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



PROLOG
  ↳ PrologToPiTRSProof

sum3(.2(s1(N), XS), .2(M, YS), ZS) :- sum3(.2(N, XS), .2(s1(M), YS), ZS).
sum3(.2(00, XS), YS, ZS) :- sum3(XS, YS, ZS).
sum3({}0, YS, YS).
weight2(.2(N, .2(M, XS)), X) :- sum3(.2(N, .2(M, XS)), .2(00, XS), YS), weight2(YS, X).
weight2(.2(X, {}0), X).


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


weight_2_in_ga2(._22(N, ._22(M, XS)), X) -> if_weight_2_in_1_ga5(N, M, XS, X, sum_3_in_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS))
sum_3_in_gga3(._22(s_11(N), XS), ._22(M, YS), ZS) -> if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_in_gga3(._22(N, XS), ._22(s_11(M), YS), ZS))
sum_3_in_gga3(._22(0_0, XS), YS, ZS) -> if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_in_gga3(XS, YS, ZS))
sum_3_in_gga3([]_0, YS, YS) -> sum_3_out_gga3([]_0, YS, YS)
if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_out_gga3(XS, YS, ZS)) -> sum_3_out_gga3(._22(0_0, XS), YS, ZS)
if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_out_gga3(._22(N, XS), ._22(s_11(M), YS), ZS)) -> sum_3_out_gga3(._22(s_11(N), XS), ._22(M, YS), ZS)
if_weight_2_in_1_ga5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_in_ga2(YS, X))
weight_2_in_ga2(._22(X, []_0), X) -> weight_2_out_ga2(._22(X, []_0), X)
if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_out_ga2(YS, X)) -> weight_2_out_ga2(._22(N, ._22(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_2_in_ga2(x1, x2)  =  weight_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
s_11(x1)  =  s_11(x1)
0_0  =  0_0
[]_0  =  []_0
if_weight_2_in_1_ga5(x1, x2, x3, x4, x5)  =  if_weight_2_in_1_ga1(x5)
sum_3_in_gga3(x1, x2, x3)  =  sum_3_in_gga2(x1, x2)
if_sum_3_in_1_gga6(x1, x2, x3, x4, x5, x6)  =  if_sum_3_in_1_gga1(x6)
if_sum_3_in_2_gga4(x1, x2, x3, x4)  =  if_sum_3_in_2_gga1(x4)
sum_3_out_gga3(x1, x2, x3)  =  sum_3_out_gga1(x3)
if_weight_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_weight_2_in_2_ga1(x6)
weight_2_out_ga2(x1, x2)  =  weight_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:

weight_2_in_ga2(._22(N, ._22(M, XS)), X) -> if_weight_2_in_1_ga5(N, M, XS, X, sum_3_in_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS))
sum_3_in_gga3(._22(s_11(N), XS), ._22(M, YS), ZS) -> if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_in_gga3(._22(N, XS), ._22(s_11(M), YS), ZS))
sum_3_in_gga3(._22(0_0, XS), YS, ZS) -> if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_in_gga3(XS, YS, ZS))
sum_3_in_gga3([]_0, YS, YS) -> sum_3_out_gga3([]_0, YS, YS)
if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_out_gga3(XS, YS, ZS)) -> sum_3_out_gga3(._22(0_0, XS), YS, ZS)
if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_out_gga3(._22(N, XS), ._22(s_11(M), YS), ZS)) -> sum_3_out_gga3(._22(s_11(N), XS), ._22(M, YS), ZS)
if_weight_2_in_1_ga5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_in_ga2(YS, X))
weight_2_in_ga2(._22(X, []_0), X) -> weight_2_out_ga2(._22(X, []_0), X)
if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_out_ga2(YS, X)) -> weight_2_out_ga2(._22(N, ._22(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_2_in_ga2(x1, x2)  =  weight_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
s_11(x1)  =  s_11(x1)
0_0  =  0_0
[]_0  =  []_0
if_weight_2_in_1_ga5(x1, x2, x3, x4, x5)  =  if_weight_2_in_1_ga1(x5)
sum_3_in_gga3(x1, x2, x3)  =  sum_3_in_gga2(x1, x2)
if_sum_3_in_1_gga6(x1, x2, x3, x4, x5, x6)  =  if_sum_3_in_1_gga1(x6)
if_sum_3_in_2_gga4(x1, x2, x3, x4)  =  if_sum_3_in_2_gga1(x4)
sum_3_out_gga3(x1, x2, x3)  =  sum_3_out_gga1(x3)
if_weight_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_weight_2_in_2_ga1(x6)
weight_2_out_ga2(x1, x2)  =  weight_2_out_ga1(x2)


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

WEIGHT_2_IN_GA2(._22(N, ._22(M, XS)), X) -> IF_WEIGHT_2_IN_1_GA5(N, M, XS, X, sum_3_in_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS))
WEIGHT_2_IN_GA2(._22(N, ._22(M, XS)), X) -> SUM_3_IN_GGA3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)
SUM_3_IN_GGA3(._22(s_11(N), XS), ._22(M, YS), ZS) -> IF_SUM_3_IN_1_GGA6(N, XS, M, YS, ZS, sum_3_in_gga3(._22(N, XS), ._22(s_11(M), YS), ZS))
SUM_3_IN_GGA3(._22(s_11(N), XS), ._22(M, YS), ZS) -> SUM_3_IN_GGA3(._22(N, XS), ._22(s_11(M), YS), ZS)
SUM_3_IN_GGA3(._22(0_0, XS), YS, ZS) -> IF_SUM_3_IN_2_GGA4(XS, YS, ZS, sum_3_in_gga3(XS, YS, ZS))
SUM_3_IN_GGA3(._22(0_0, XS), YS, ZS) -> SUM_3_IN_GGA3(XS, YS, ZS)
IF_WEIGHT_2_IN_1_GA5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> IF_WEIGHT_2_IN_2_GA6(N, M, XS, X, YS, weight_2_in_ga2(YS, X))
IF_WEIGHT_2_IN_1_GA5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> WEIGHT_2_IN_GA2(YS, X)

The TRS R consists of the following rules:

weight_2_in_ga2(._22(N, ._22(M, XS)), X) -> if_weight_2_in_1_ga5(N, M, XS, X, sum_3_in_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS))
sum_3_in_gga3(._22(s_11(N), XS), ._22(M, YS), ZS) -> if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_in_gga3(._22(N, XS), ._22(s_11(M), YS), ZS))
sum_3_in_gga3(._22(0_0, XS), YS, ZS) -> if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_in_gga3(XS, YS, ZS))
sum_3_in_gga3([]_0, YS, YS) -> sum_3_out_gga3([]_0, YS, YS)
if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_out_gga3(XS, YS, ZS)) -> sum_3_out_gga3(._22(0_0, XS), YS, ZS)
if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_out_gga3(._22(N, XS), ._22(s_11(M), YS), ZS)) -> sum_3_out_gga3(._22(s_11(N), XS), ._22(M, YS), ZS)
if_weight_2_in_1_ga5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_in_ga2(YS, X))
weight_2_in_ga2(._22(X, []_0), X) -> weight_2_out_ga2(._22(X, []_0), X)
if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_out_ga2(YS, X)) -> weight_2_out_ga2(._22(N, ._22(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_2_in_ga2(x1, x2)  =  weight_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
s_11(x1)  =  s_11(x1)
0_0  =  0_0
[]_0  =  []_0
if_weight_2_in_1_ga5(x1, x2, x3, x4, x5)  =  if_weight_2_in_1_ga1(x5)
sum_3_in_gga3(x1, x2, x3)  =  sum_3_in_gga2(x1, x2)
if_sum_3_in_1_gga6(x1, x2, x3, x4, x5, x6)  =  if_sum_3_in_1_gga1(x6)
if_sum_3_in_2_gga4(x1, x2, x3, x4)  =  if_sum_3_in_2_gga1(x4)
sum_3_out_gga3(x1, x2, x3)  =  sum_3_out_gga1(x3)
if_weight_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_weight_2_in_2_ga1(x6)
weight_2_out_ga2(x1, x2)  =  weight_2_out_ga1(x2)
WEIGHT_2_IN_GA2(x1, x2)  =  WEIGHT_2_IN_GA1(x1)
IF_SUM_3_IN_1_GGA6(x1, x2, x3, x4, x5, x6)  =  IF_SUM_3_IN_1_GGA1(x6)
SUM_3_IN_GGA3(x1, x2, x3)  =  SUM_3_IN_GGA2(x1, x2)
IF_WEIGHT_2_IN_2_GA6(x1, x2, x3, x4, x5, x6)  =  IF_WEIGHT_2_IN_2_GA1(x6)
IF_WEIGHT_2_IN_1_GA5(x1, x2, x3, x4, x5)  =  IF_WEIGHT_2_IN_1_GA1(x5)
IF_SUM_3_IN_2_GGA4(x1, x2, x3, x4)  =  IF_SUM_3_IN_2_GGA1(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:

WEIGHT_2_IN_GA2(._22(N, ._22(M, XS)), X) -> IF_WEIGHT_2_IN_1_GA5(N, M, XS, X, sum_3_in_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS))
WEIGHT_2_IN_GA2(._22(N, ._22(M, XS)), X) -> SUM_3_IN_GGA3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)
SUM_3_IN_GGA3(._22(s_11(N), XS), ._22(M, YS), ZS) -> IF_SUM_3_IN_1_GGA6(N, XS, M, YS, ZS, sum_3_in_gga3(._22(N, XS), ._22(s_11(M), YS), ZS))
SUM_3_IN_GGA3(._22(s_11(N), XS), ._22(M, YS), ZS) -> SUM_3_IN_GGA3(._22(N, XS), ._22(s_11(M), YS), ZS)
SUM_3_IN_GGA3(._22(0_0, XS), YS, ZS) -> IF_SUM_3_IN_2_GGA4(XS, YS, ZS, sum_3_in_gga3(XS, YS, ZS))
SUM_3_IN_GGA3(._22(0_0, XS), YS, ZS) -> SUM_3_IN_GGA3(XS, YS, ZS)
IF_WEIGHT_2_IN_1_GA5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> IF_WEIGHT_2_IN_2_GA6(N, M, XS, X, YS, weight_2_in_ga2(YS, X))
IF_WEIGHT_2_IN_1_GA5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> WEIGHT_2_IN_GA2(YS, X)

The TRS R consists of the following rules:

weight_2_in_ga2(._22(N, ._22(M, XS)), X) -> if_weight_2_in_1_ga5(N, M, XS, X, sum_3_in_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS))
sum_3_in_gga3(._22(s_11(N), XS), ._22(M, YS), ZS) -> if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_in_gga3(._22(N, XS), ._22(s_11(M), YS), ZS))
sum_3_in_gga3(._22(0_0, XS), YS, ZS) -> if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_in_gga3(XS, YS, ZS))
sum_3_in_gga3([]_0, YS, YS) -> sum_3_out_gga3([]_0, YS, YS)
if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_out_gga3(XS, YS, ZS)) -> sum_3_out_gga3(._22(0_0, XS), YS, ZS)
if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_out_gga3(._22(N, XS), ._22(s_11(M), YS), ZS)) -> sum_3_out_gga3(._22(s_11(N), XS), ._22(M, YS), ZS)
if_weight_2_in_1_ga5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_in_ga2(YS, X))
weight_2_in_ga2(._22(X, []_0), X) -> weight_2_out_ga2(._22(X, []_0), X)
if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_out_ga2(YS, X)) -> weight_2_out_ga2(._22(N, ._22(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_2_in_ga2(x1, x2)  =  weight_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
s_11(x1)  =  s_11(x1)
0_0  =  0_0
[]_0  =  []_0
if_weight_2_in_1_ga5(x1, x2, x3, x4, x5)  =  if_weight_2_in_1_ga1(x5)
sum_3_in_gga3(x1, x2, x3)  =  sum_3_in_gga2(x1, x2)
if_sum_3_in_1_gga6(x1, x2, x3, x4, x5, x6)  =  if_sum_3_in_1_gga1(x6)
if_sum_3_in_2_gga4(x1, x2, x3, x4)  =  if_sum_3_in_2_gga1(x4)
sum_3_out_gga3(x1, x2, x3)  =  sum_3_out_gga1(x3)
if_weight_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_weight_2_in_2_ga1(x6)
weight_2_out_ga2(x1, x2)  =  weight_2_out_ga1(x2)
WEIGHT_2_IN_GA2(x1, x2)  =  WEIGHT_2_IN_GA1(x1)
IF_SUM_3_IN_1_GGA6(x1, x2, x3, x4, x5, x6)  =  IF_SUM_3_IN_1_GGA1(x6)
SUM_3_IN_GGA3(x1, x2, x3)  =  SUM_3_IN_GGA2(x1, x2)
IF_WEIGHT_2_IN_2_GA6(x1, x2, x3, x4, x5, x6)  =  IF_WEIGHT_2_IN_2_GA1(x6)
IF_WEIGHT_2_IN_1_GA5(x1, x2, x3, x4, x5)  =  IF_WEIGHT_2_IN_1_GA1(x5)
IF_SUM_3_IN_2_GGA4(x1, x2, x3, x4)  =  IF_SUM_3_IN_2_GGA1(x4)

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:

SUM_3_IN_GGA3(._22(0_0, XS), YS, ZS) -> SUM_3_IN_GGA3(XS, YS, ZS)
SUM_3_IN_GGA3(._22(s_11(N), XS), ._22(M, YS), ZS) -> SUM_3_IN_GGA3(._22(N, XS), ._22(s_11(M), YS), ZS)

The TRS R consists of the following rules:

weight_2_in_ga2(._22(N, ._22(M, XS)), X) -> if_weight_2_in_1_ga5(N, M, XS, X, sum_3_in_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS))
sum_3_in_gga3(._22(s_11(N), XS), ._22(M, YS), ZS) -> if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_in_gga3(._22(N, XS), ._22(s_11(M), YS), ZS))
sum_3_in_gga3(._22(0_0, XS), YS, ZS) -> if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_in_gga3(XS, YS, ZS))
sum_3_in_gga3([]_0, YS, YS) -> sum_3_out_gga3([]_0, YS, YS)
if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_out_gga3(XS, YS, ZS)) -> sum_3_out_gga3(._22(0_0, XS), YS, ZS)
if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_out_gga3(._22(N, XS), ._22(s_11(M), YS), ZS)) -> sum_3_out_gga3(._22(s_11(N), XS), ._22(M, YS), ZS)
if_weight_2_in_1_ga5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_in_ga2(YS, X))
weight_2_in_ga2(._22(X, []_0), X) -> weight_2_out_ga2(._22(X, []_0), X)
if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_out_ga2(YS, X)) -> weight_2_out_ga2(._22(N, ._22(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_2_in_ga2(x1, x2)  =  weight_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
s_11(x1)  =  s_11(x1)
0_0  =  0_0
[]_0  =  []_0
if_weight_2_in_1_ga5(x1, x2, x3, x4, x5)  =  if_weight_2_in_1_ga1(x5)
sum_3_in_gga3(x1, x2, x3)  =  sum_3_in_gga2(x1, x2)
if_sum_3_in_1_gga6(x1, x2, x3, x4, x5, x6)  =  if_sum_3_in_1_gga1(x6)
if_sum_3_in_2_gga4(x1, x2, x3, x4)  =  if_sum_3_in_2_gga1(x4)
sum_3_out_gga3(x1, x2, x3)  =  sum_3_out_gga1(x3)
if_weight_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_weight_2_in_2_ga1(x6)
weight_2_out_ga2(x1, x2)  =  weight_2_out_ga1(x2)
SUM_3_IN_GGA3(x1, x2, x3)  =  SUM_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:

SUM_3_IN_GGA3(._22(0_0, XS), YS, ZS) -> SUM_3_IN_GGA3(XS, YS, ZS)
SUM_3_IN_GGA3(._22(s_11(N), XS), ._22(M, YS), ZS) -> SUM_3_IN_GGA3(._22(N, XS), ._22(s_11(M), YS), ZS)

R is empty.
The argument filtering Pi contains the following mapping:
._22(x1, x2)  =  ._22(x1, x2)
s_11(x1)  =  s_11(x1)
0_0  =  0_0
SUM_3_IN_GGA3(x1, x2, x3)  =  SUM_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:

SUM_3_IN_GGA2(._22(0_0, XS), YS) -> SUM_3_IN_GGA2(XS, YS)
SUM_3_IN_GGA2(._22(s_11(N), XS), ._22(M, YS)) -> SUM_3_IN_GGA2(._22(N, XS), ._22(s_11(M), YS))

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

Order:Homeomorphic Embedding Order

AFS:
0_0  =  0_0
s_11(x1)  =  s_11(x1)
._22(x1, x2)  =  ._22(x1, x2)

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

We oriented the following set of usable rules. none


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

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

WEIGHT_2_IN_GA2(._22(N, ._22(M, XS)), X) -> IF_WEIGHT_2_IN_1_GA5(N, M, XS, X, sum_3_in_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS))
IF_WEIGHT_2_IN_1_GA5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> WEIGHT_2_IN_GA2(YS, X)

The TRS R consists of the following rules:

weight_2_in_ga2(._22(N, ._22(M, XS)), X) -> if_weight_2_in_1_ga5(N, M, XS, X, sum_3_in_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS))
sum_3_in_gga3(._22(s_11(N), XS), ._22(M, YS), ZS) -> if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_in_gga3(._22(N, XS), ._22(s_11(M), YS), ZS))
sum_3_in_gga3(._22(0_0, XS), YS, ZS) -> if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_in_gga3(XS, YS, ZS))
sum_3_in_gga3([]_0, YS, YS) -> sum_3_out_gga3([]_0, YS, YS)
if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_out_gga3(XS, YS, ZS)) -> sum_3_out_gga3(._22(0_0, XS), YS, ZS)
if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_out_gga3(._22(N, XS), ._22(s_11(M), YS), ZS)) -> sum_3_out_gga3(._22(s_11(N), XS), ._22(M, YS), ZS)
if_weight_2_in_1_ga5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_in_ga2(YS, X))
weight_2_in_ga2(._22(X, []_0), X) -> weight_2_out_ga2(._22(X, []_0), X)
if_weight_2_in_2_ga6(N, M, XS, X, YS, weight_2_out_ga2(YS, X)) -> weight_2_out_ga2(._22(N, ._22(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_2_in_ga2(x1, x2)  =  weight_2_in_ga1(x1)
._22(x1, x2)  =  ._22(x1, x2)
s_11(x1)  =  s_11(x1)
0_0  =  0_0
[]_0  =  []_0
if_weight_2_in_1_ga5(x1, x2, x3, x4, x5)  =  if_weight_2_in_1_ga1(x5)
sum_3_in_gga3(x1, x2, x3)  =  sum_3_in_gga2(x1, x2)
if_sum_3_in_1_gga6(x1, x2, x3, x4, x5, x6)  =  if_sum_3_in_1_gga1(x6)
if_sum_3_in_2_gga4(x1, x2, x3, x4)  =  if_sum_3_in_2_gga1(x4)
sum_3_out_gga3(x1, x2, x3)  =  sum_3_out_gga1(x3)
if_weight_2_in_2_ga6(x1, x2, x3, x4, x5, x6)  =  if_weight_2_in_2_ga1(x6)
weight_2_out_ga2(x1, x2)  =  weight_2_out_ga1(x2)
WEIGHT_2_IN_GA2(x1, x2)  =  WEIGHT_2_IN_GA1(x1)
IF_WEIGHT_2_IN_1_GA5(x1, x2, x3, x4, x5)  =  IF_WEIGHT_2_IN_1_GA1(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
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

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

WEIGHT_2_IN_GA2(._22(N, ._22(M, XS)), X) -> IF_WEIGHT_2_IN_1_GA5(N, M, XS, X, sum_3_in_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS))
IF_WEIGHT_2_IN_1_GA5(N, M, XS, X, sum_3_out_gga3(._22(N, ._22(M, XS)), ._22(0_0, XS), YS)) -> WEIGHT_2_IN_GA2(YS, X)

The TRS R consists of the following rules:

sum_3_in_gga3(._22(s_11(N), XS), ._22(M, YS), ZS) -> if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_in_gga3(._22(N, XS), ._22(s_11(M), YS), ZS))
sum_3_in_gga3(._22(0_0, XS), YS, ZS) -> if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_in_gga3(XS, YS, ZS))
if_sum_3_in_1_gga6(N, XS, M, YS, ZS, sum_3_out_gga3(._22(N, XS), ._22(s_11(M), YS), ZS)) -> sum_3_out_gga3(._22(s_11(N), XS), ._22(M, YS), ZS)
if_sum_3_in_2_gga4(XS, YS, ZS, sum_3_out_gga3(XS, YS, ZS)) -> sum_3_out_gga3(._22(0_0, XS), YS, ZS)
sum_3_in_gga3([]_0, YS, YS) -> sum_3_out_gga3([]_0, YS, YS)

The argument filtering Pi contains the following mapping:
._22(x1, x2)  =  ._22(x1, x2)
s_11(x1)  =  s_11(x1)
0_0  =  0_0
[]_0  =  []_0
sum_3_in_gga3(x1, x2, x3)  =  sum_3_in_gga2(x1, x2)
if_sum_3_in_1_gga6(x1, x2, x3, x4, x5, x6)  =  if_sum_3_in_1_gga1(x6)
if_sum_3_in_2_gga4(x1, x2, x3, x4)  =  if_sum_3_in_2_gga1(x4)
sum_3_out_gga3(x1, x2, x3)  =  sum_3_out_gga1(x3)
WEIGHT_2_IN_GA2(x1, x2)  =  WEIGHT_2_IN_GA1(x1)
IF_WEIGHT_2_IN_1_GA5(x1, x2, x3, x4, x5)  =  IF_WEIGHT_2_IN_1_GA1(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
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof

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

WEIGHT_2_IN_GA1(._22(N, ._22(M, XS))) -> IF_WEIGHT_2_IN_1_GA1(sum_3_in_gga2(._22(N, ._22(M, XS)), ._22(0_0, XS)))
IF_WEIGHT_2_IN_1_GA1(sum_3_out_gga1(YS)) -> WEIGHT_2_IN_GA1(YS)

The TRS R consists of the following rules:

sum_3_in_gga2(._22(s_11(N), XS), ._22(M, YS)) -> if_sum_3_in_1_gga1(sum_3_in_gga2(._22(N, XS), ._22(s_11(M), YS)))
sum_3_in_gga2(._22(0_0, XS), YS) -> if_sum_3_in_2_gga1(sum_3_in_gga2(XS, YS))
if_sum_3_in_1_gga1(sum_3_out_gga1(ZS)) -> sum_3_out_gga1(ZS)
if_sum_3_in_2_gga1(sum_3_out_gga1(ZS)) -> sum_3_out_gga1(ZS)
sum_3_in_gga2([]_0, YS) -> sum_3_out_gga1(YS)

The set Q consists of the following terms:

sum_3_in_gga2(x0, x1)
if_sum_3_in_1_gga1(x0)
if_sum_3_in_2_gga1(x0)

We have to consider all (P,Q,R)-chains.
The head symbols of this DP problem are {IF_WEIGHT_2_IN_1_GA1, WEIGHT_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(0_0) = 1   
POL(._22(x1, x2)) = 1 + x2   
POL(sum_3_out_gga1(x1)) = x1   
POL(if_sum_3_in_1_gga1(x1)) = x1   
POL(if_sum_3_in_2_gga1(x1)) = x1   
POL(sum_3_in_gga2(x1, x2)) = x2   
POL(s_11(x1)) = 0   
POL([]_0) = 0   

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

We oriented the following set of usable rules.


sum_3_in_gga2([]_0, YS) -> sum_3_out_gga1(YS)
sum_3_in_gga2(._22(s_11(N), XS), ._22(M, YS)) -> if_sum_3_in_1_gga1(sum_3_in_gga2(._22(N, XS), ._22(s_11(M), YS)))
sum_3_in_gga2(._22(0_0, XS), YS) -> if_sum_3_in_2_gga1(sum_3_in_gga2(XS, YS))
if_sum_3_in_2_gga1(sum_3_out_gga1(ZS)) -> sum_3_out_gga1(ZS)
if_sum_3_in_1_gga1(sum_3_out_gga1(ZS)) -> sum_3_out_gga1(ZS)