(0) Obligation:

Clauses:

p(cons(X, nil)).
p(cons(s(s(X)), cons(Y, Xs))) :- ','(p(cons(X, cons(Y, Xs))), ','(mult(X, Y, Z), p(cons(Z, Xs)))).
p(cons(0, Xs)) :- p(Xs).
sum(X, 0, X).
sum(X, s(Y), s(Z)) :- sum(X, Y, Z).
mult(X1, 0, 0).
mult(X, s(Y), Z) :- ','(mult(X, Y, W), sum(W, X, Z)).

Queries:

p(g).

(1) PrologToPiTRSProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
p_in: (b)
mult_in: (b,b,f)
sum_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

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

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

P_IN_G(cons(s(s(X)), cons(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))
P_IN_G(cons(0, Xs)) → U4_G(Xs, p_in_g(Xs))
P_IN_G(cons(0, Xs)) → P_IN_G(Xs)
U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_G(X, Y, Xs, mult_in_gga(X, Y, Z))
U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → MULT_IN_GGA(X, Y, Z)
MULT_IN_GGA(X, s(Y), Z) → U6_GGA(X, Y, Z, mult_in_gga(X, Y, W))
MULT_IN_GGA(X, s(Y), Z) → MULT_IN_GGA(X, Y, W)
U6_GGA(X, Y, Z, mult_out_gga(X, Y, W)) → U7_GGA(X, Y, Z, sum_in_gga(W, X, Z))
U6_GGA(X, Y, Z, mult_out_gga(X, Y, W)) → SUM_IN_GGA(W, X, Z)
SUM_IN_GGA(X, s(Y), s(Z)) → U5_GGA(X, Y, Z, sum_in_gga(X, Y, Z))
SUM_IN_GGA(X, s(Y), s(Z)) → SUM_IN_GGA(X, Y, Z)
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_G(X, Y, Xs, p_in_g(cons(Z, Xs)))
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → P_IN_G(cons(Z, Xs))

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
P_IN_G(x1)  =  P_IN_G(x1)
U1_G(x1, x2, x3, x4)  =  U1_G(x1, x2, x3, x4)
U4_G(x1, x2)  =  U4_G(x2)
U2_G(x1, x2, x3, x4)  =  U2_G(x3, x4)
MULT_IN_GGA(x1, x2, x3)  =  MULT_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x4)
SUM_IN_GGA(x1, x2, x3)  =  SUM_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x4)
U3_G(x1, x2, x3, x4)  =  U3_G(x4)

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

(4) Obligation:

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

P_IN_G(cons(s(s(X)), cons(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))
P_IN_G(cons(0, Xs)) → U4_G(Xs, p_in_g(Xs))
P_IN_G(cons(0, Xs)) → P_IN_G(Xs)
U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_G(X, Y, Xs, mult_in_gga(X, Y, Z))
U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → MULT_IN_GGA(X, Y, Z)
MULT_IN_GGA(X, s(Y), Z) → U6_GGA(X, Y, Z, mult_in_gga(X, Y, W))
MULT_IN_GGA(X, s(Y), Z) → MULT_IN_GGA(X, Y, W)
U6_GGA(X, Y, Z, mult_out_gga(X, Y, W)) → U7_GGA(X, Y, Z, sum_in_gga(W, X, Z))
U6_GGA(X, Y, Z, mult_out_gga(X, Y, W)) → SUM_IN_GGA(W, X, Z)
SUM_IN_GGA(X, s(Y), s(Z)) → U5_GGA(X, Y, Z, sum_in_gga(X, Y, Z))
SUM_IN_GGA(X, s(Y), s(Z)) → SUM_IN_GGA(X, Y, Z)
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_G(X, Y, Xs, p_in_g(cons(Z, Xs)))
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → P_IN_G(cons(Z, Xs))

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
P_IN_G(x1)  =  P_IN_G(x1)
U1_G(x1, x2, x3, x4)  =  U1_G(x1, x2, x3, x4)
U4_G(x1, x2)  =  U4_G(x2)
U2_G(x1, x2, x3, x4)  =  U2_G(x3, x4)
MULT_IN_GGA(x1, x2, x3)  =  MULT_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x4)
SUM_IN_GGA(x1, x2, x3)  =  SUM_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x4)
U3_G(x1, x2, x3, x4)  =  U3_G(x4)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 3 SCCs with 7 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

SUM_IN_GGA(X, s(Y), s(Z)) → SUM_IN_GGA(X, Y, Z)

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
SUM_IN_GGA(x1, x2, x3)  =  SUM_IN_GGA(x1, x2)

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

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

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

SUM_IN_GGA(X, s(Y), s(Z)) → SUM_IN_GGA(X, Y, Z)

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

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

(10) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

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

SUM_IN_GGA(X, s(Y)) → SUM_IN_GGA(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] 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:

  • SUM_IN_GGA(X, s(Y)) → SUM_IN_GGA(X, Y)
    The graph contains the following edges 1 >= 1, 2 > 2

(13) TRUE

(14) Obligation:

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

MULT_IN_GGA(X, s(Y), Z) → MULT_IN_GGA(X, Y, W)

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
MULT_IN_GGA(x1, x2, x3)  =  MULT_IN_GGA(x1, x2)

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

(15) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(16) Obligation:

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

MULT_IN_GGA(X, s(Y), Z) → MULT_IN_GGA(X, Y, W)

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

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

(17) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(18) Obligation:

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

MULT_IN_GGA(X, s(Y)) → MULT_IN_GGA(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] 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:

  • MULT_IN_GGA(X, s(Y)) → MULT_IN_GGA(X, Y)
    The graph contains the following edges 1 >= 1, 2 > 2

(20) TRUE

(21) Obligation:

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

U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_G(X, Y, Xs, mult_in_gga(X, Y, Z))
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → P_IN_G(cons(Z, Xs))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))
P_IN_G(cons(0, Xs)) → P_IN_G(Xs)

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
P_IN_G(x1)  =  P_IN_G(x1)
U1_G(x1, x2, x3, x4)  =  U1_G(x1, x2, x3, x4)
U2_G(x1, x2, x3, x4)  =  U2_G(x3, x4)

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

(22) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(23) Obligation:

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

U1_G(X, Y, Xs, p_out_g) → U2_G(Xs, mult_in_gga(X, Y))
U2_G(Xs, mult_out_gga(Z)) → P_IN_G(cons(Z, Xs))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))
P_IN_G(cons(0, Xs)) → P_IN_G(Xs)

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(p_in_g(Xs))
U4_g(p_out_g) → p_out_g
U1_g(X, Y, Xs, p_out_g) → U2_g(Xs, mult_in_gga(X, Y))
mult_in_gga(X1, 0) → mult_out_gga(0)
mult_in_gga(X, s(Y)) → U6_gga(X, mult_in_gga(X, Y))
U6_gga(X, mult_out_gga(W)) → U7_gga(sum_in_gga(W, X))
sum_in_gga(X, 0) → sum_out_gga(X)
sum_in_gga(X, s(Y)) → U5_gga(sum_in_gga(X, Y))
U5_gga(sum_out_gga(Z)) → sum_out_gga(s(Z))
U7_gga(sum_out_gga(Z)) → mult_out_gga(Z)
U2_g(Xs, mult_out_gga(Z)) → U3_g(p_in_g(cons(Z, Xs)))
U3_g(p_out_g) → p_out_g

The set Q consists of the following terms:

p_in_g(x0)
U4_g(x0)
U1_g(x0, x1, x2, x3)
mult_in_gga(x0, x1)
U6_gga(x0, x1)
sum_in_gga(x0, x1)
U5_gga(x0)
U7_gga(x0)
U2_g(x0, x1)
U3_g(x0)

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

(24) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


P_IN_G(cons(s(s(X)), cons(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
P_IN_G(cons(0, Xs)) → P_IN_G(Xs)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(P_IN_G(x1)) = 1 + x1   
POL(U1_G(x1, x2, x3, x4)) = 1 + x3 + x4   
POL(U1_g(x1, x2, x3, x4)) = 1   
POL(U2_G(x1, x2)) = 1 + x1 + x2   
POL(U2_g(x1, x2)) = 1   
POL(U3_g(x1)) = 1   
POL(U4_g(x1)) = 1   
POL(U5_gga(x1)) = 0   
POL(U6_gga(x1, x2)) = 1   
POL(U7_gga(x1)) = 1   
POL(cons(x1, x2)) = 1 + x2   
POL(mult_in_gga(x1, x2)) = 1   
POL(mult_out_gga(x1)) = 1   
POL(nil) = 0   
POL(p_in_g(x1)) = 1   
POL(p_out_g) = 1   
POL(s(x1)) = 0   
POL(sum_in_gga(x1, x2)) = 0   
POL(sum_out_gga(x1)) = 0   

The following usable rules [FROCOS05] were oriented:

mult_in_gga(X1, 0) → mult_out_gga(0)
mult_in_gga(X, s(Y)) → U6_gga(X, mult_in_gga(X, Y))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(p_in_g(Xs))
U4_g(p_out_g) → p_out_g
U1_g(X, Y, Xs, p_out_g) → U2_g(Xs, mult_in_gga(X, Y))
U2_g(Xs, mult_out_gga(Z)) → U3_g(p_in_g(cons(Z, Xs)))
U3_g(p_out_g) → p_out_g
U6_gga(X, mult_out_gga(W)) → U7_gga(sum_in_gga(W, X))
U7_gga(sum_out_gga(Z)) → mult_out_gga(Z)

(25) Obligation:

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

U1_G(X, Y, Xs, p_out_g) → U2_G(Xs, mult_in_gga(X, Y))
U2_G(Xs, mult_out_gga(Z)) → P_IN_G(cons(Z, Xs))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(p_in_g(Xs))
U4_g(p_out_g) → p_out_g
U1_g(X, Y, Xs, p_out_g) → U2_g(Xs, mult_in_gga(X, Y))
mult_in_gga(X1, 0) → mult_out_gga(0)
mult_in_gga(X, s(Y)) → U6_gga(X, mult_in_gga(X, Y))
U6_gga(X, mult_out_gga(W)) → U7_gga(sum_in_gga(W, X))
sum_in_gga(X, 0) → sum_out_gga(X)
sum_in_gga(X, s(Y)) → U5_gga(sum_in_gga(X, Y))
U5_gga(sum_out_gga(Z)) → sum_out_gga(s(Z))
U7_gga(sum_out_gga(Z)) → mult_out_gga(Z)
U2_g(Xs, mult_out_gga(Z)) → U3_g(p_in_g(cons(Z, Xs)))
U3_g(p_out_g) → p_out_g

The set Q consists of the following terms:

p_in_g(x0)
U4_g(x0)
U1_g(x0, x1, x2, x3)
mult_in_gga(x0, x1)
U6_gga(x0, x1)
sum_in_gga(x0, x1)
U5_gga(x0)
U7_gga(x0)
U2_g(x0, x1)
U3_g(x0)

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

(26) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 2 less nodes.

(27) Obligation:

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

P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(p_in_g(Xs))
U4_g(p_out_g) → p_out_g
U1_g(X, Y, Xs, p_out_g) → U2_g(Xs, mult_in_gga(X, Y))
mult_in_gga(X1, 0) → mult_out_gga(0)
mult_in_gga(X, s(Y)) → U6_gga(X, mult_in_gga(X, Y))
U6_gga(X, mult_out_gga(W)) → U7_gga(sum_in_gga(W, X))
sum_in_gga(X, 0) → sum_out_gga(X)
sum_in_gga(X, s(Y)) → U5_gga(sum_in_gga(X, Y))
U5_gga(sum_out_gga(Z)) → sum_out_gga(s(Z))
U7_gga(sum_out_gga(Z)) → mult_out_gga(Z)
U2_g(Xs, mult_out_gga(Z)) → U3_g(p_in_g(cons(Z, Xs)))
U3_g(p_out_g) → p_out_g

The set Q consists of the following terms:

p_in_g(x0)
U4_g(x0)
U1_g(x0, x1, x2, x3)
mult_in_gga(x0, x1)
U6_gga(x0, x1)
sum_in_gga(x0, x1)
U5_gga(x0)
U7_gga(x0)
U2_g(x0, x1)
U3_g(x0)

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

(28) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(29) Obligation:

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

P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))

R is empty.
The set Q consists of the following terms:

p_in_g(x0)
U4_g(x0)
U1_g(x0, x1, x2, x3)
mult_in_gga(x0, x1)
U6_gga(x0, x1)
sum_in_gga(x0, x1)
U5_gga(x0)
U7_gga(x0)
U2_g(x0, x1)
U3_g(x0)

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

(30) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

p_in_g(x0)
U4_g(x0)
U1_g(x0, x1, x2, x3)
mult_in_gga(x0, x1)
U6_gga(x0, x1)
sum_in_gga(x0, x1)
U5_gga(x0)
U7_gga(x0)
U2_g(x0, x1)
U3_g(x0)

(31) Obligation:

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

P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(32) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))
No rules are removed from R.

Used ordering: POLO with Polynomial interpretation [POLO]:

POL(P_IN_G(x1)) = 2·x1   
POL(cons(x1, x2)) = 2·x1 + x2   
POL(s(x1)) = 2·x1   

(33) Obligation:

Q DP problem:
P is empty.
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(34) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(35) TRUE

(36) PrologToPiTRSProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
p_in: (b)
mult_in: (b,b,f)
sum_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g(x1)
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x1, x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x1, x2, x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x1, x2, x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x1, x2, x3, x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(37) Obligation:

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

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g(x1)
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x1, x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x1, x2, x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x1, x2, x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x1, x2, x3, x4)

(38) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

P_IN_G(cons(s(s(X)), cons(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))
P_IN_G(cons(0, Xs)) → U4_G(Xs, p_in_g(Xs))
P_IN_G(cons(0, Xs)) → P_IN_G(Xs)
U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_G(X, Y, Xs, mult_in_gga(X, Y, Z))
U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → MULT_IN_GGA(X, Y, Z)
MULT_IN_GGA(X, s(Y), Z) → U6_GGA(X, Y, Z, mult_in_gga(X, Y, W))
MULT_IN_GGA(X, s(Y), Z) → MULT_IN_GGA(X, Y, W)
U6_GGA(X, Y, Z, mult_out_gga(X, Y, W)) → U7_GGA(X, Y, Z, sum_in_gga(W, X, Z))
U6_GGA(X, Y, Z, mult_out_gga(X, Y, W)) → SUM_IN_GGA(W, X, Z)
SUM_IN_GGA(X, s(Y), s(Z)) → U5_GGA(X, Y, Z, sum_in_gga(X, Y, Z))
SUM_IN_GGA(X, s(Y), s(Z)) → SUM_IN_GGA(X, Y, Z)
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_G(X, Y, Xs, p_in_g(cons(Z, Xs)))
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → P_IN_G(cons(Z, Xs))

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g(x1)
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x1, x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x1, x2, x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x1, x2, x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x1, x2, x3, x4)
P_IN_G(x1)  =  P_IN_G(x1)
U1_G(x1, x2, x3, x4)  =  U1_G(x1, x2, x3, x4)
U4_G(x1, x2)  =  U4_G(x1, x2)
U2_G(x1, x2, x3, x4)  =  U2_G(x1, x2, x3, x4)
MULT_IN_GGA(x1, x2, x3)  =  MULT_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)
SUM_IN_GGA(x1, x2, x3)  =  SUM_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
U3_G(x1, x2, x3, x4)  =  U3_G(x1, x2, x3, x4)

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

(39) Obligation:

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

P_IN_G(cons(s(s(X)), cons(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))
P_IN_G(cons(0, Xs)) → U4_G(Xs, p_in_g(Xs))
P_IN_G(cons(0, Xs)) → P_IN_G(Xs)
U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_G(X, Y, Xs, mult_in_gga(X, Y, Z))
U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → MULT_IN_GGA(X, Y, Z)
MULT_IN_GGA(X, s(Y), Z) → U6_GGA(X, Y, Z, mult_in_gga(X, Y, W))
MULT_IN_GGA(X, s(Y), Z) → MULT_IN_GGA(X, Y, W)
U6_GGA(X, Y, Z, mult_out_gga(X, Y, W)) → U7_GGA(X, Y, Z, sum_in_gga(W, X, Z))
U6_GGA(X, Y, Z, mult_out_gga(X, Y, W)) → SUM_IN_GGA(W, X, Z)
SUM_IN_GGA(X, s(Y), s(Z)) → U5_GGA(X, Y, Z, sum_in_gga(X, Y, Z))
SUM_IN_GGA(X, s(Y), s(Z)) → SUM_IN_GGA(X, Y, Z)
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_G(X, Y, Xs, p_in_g(cons(Z, Xs)))
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → P_IN_G(cons(Z, Xs))

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g(x1)
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x1, x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x1, x2, x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x1, x2, x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x1, x2, x3, x4)
P_IN_G(x1)  =  P_IN_G(x1)
U1_G(x1, x2, x3, x4)  =  U1_G(x1, x2, x3, x4)
U4_G(x1, x2)  =  U4_G(x1, x2)
U2_G(x1, x2, x3, x4)  =  U2_G(x1, x2, x3, x4)
MULT_IN_GGA(x1, x2, x3)  =  MULT_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)
SUM_IN_GGA(x1, x2, x3)  =  SUM_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
U3_G(x1, x2, x3, x4)  =  U3_G(x1, x2, x3, x4)

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

(40) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 3 SCCs with 7 less nodes.

(41) Complex Obligation (AND)

(42) Obligation:

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

SUM_IN_GGA(X, s(Y), s(Z)) → SUM_IN_GGA(X, Y, Z)

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g(x1)
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x1, x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x1, x2, x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x1, x2, x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x1, x2, x3, x4)
SUM_IN_GGA(x1, x2, x3)  =  SUM_IN_GGA(x1, x2)

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

(43) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(44) Obligation:

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

SUM_IN_GGA(X, s(Y), s(Z)) → SUM_IN_GGA(X, Y, Z)

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

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

(45) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(46) Obligation:

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

SUM_IN_GGA(X, s(Y)) → SUM_IN_GGA(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(47) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] 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:

  • SUM_IN_GGA(X, s(Y)) → SUM_IN_GGA(X, Y)
    The graph contains the following edges 1 >= 1, 2 > 2

(48) TRUE

(49) Obligation:

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

MULT_IN_GGA(X, s(Y), Z) → MULT_IN_GGA(X, Y, W)

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g(x1)
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x1, x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x1, x2, x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x1, x2, x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x1, x2, x3, x4)
MULT_IN_GGA(x1, x2, x3)  =  MULT_IN_GGA(x1, x2)

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

(50) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(51) Obligation:

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

MULT_IN_GGA(X, s(Y), Z) → MULT_IN_GGA(X, Y, W)

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

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

(52) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(53) Obligation:

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

MULT_IN_GGA(X, s(Y)) → MULT_IN_GGA(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(54) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] 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:

  • MULT_IN_GGA(X, s(Y)) → MULT_IN_GGA(X, Y)
    The graph contains the following edges 1 >= 1, 2 > 2

(55) TRUE

(56) Obligation:

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

U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_G(X, Y, Xs, mult_in_gga(X, Y, Z))
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → P_IN_G(cons(Z, Xs))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))
P_IN_G(cons(0, Xs)) → P_IN_G(Xs)

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y, Z))
mult_in_gga(X1, 0, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y), Z) → U6_gga(X, Y, Z, mult_in_gga(X, Y, W))
U6_gga(X, Y, Z, mult_out_gga(X, Y, W)) → U7_gga(X, Y, Z, sum_in_gga(W, X, Z))
sum_in_gga(X, 0, X) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y), s(Z)) → U5_gga(X, Y, Z, sum_in_gga(X, Y, Z))
U5_gga(X, Y, Z, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, Z, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p_out_g(x1)  =  p_out_g(x1)
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x1, x2, x3, x4)
0  =  0
U4_g(x1, x2)  =  U4_g(x1, x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x1, x2, x3, x4)
mult_in_gga(x1, x2, x3)  =  mult_in_gga(x1, x2)
mult_out_gga(x1, x2, x3)  =  mult_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x1, x2, x4)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U3_g(x1, x2, x3, x4)  =  U3_g(x1, x2, x3, x4)
P_IN_G(x1)  =  P_IN_G(x1)
U1_G(x1, x2, x3, x4)  =  U1_G(x1, x2, x3, x4)
U2_G(x1, x2, x3, x4)  =  U2_G(x1, x2, x3, x4)

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

(57) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(58) Obligation:

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

U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_G(X, Y, Xs, mult_in_gga(X, Y))
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → P_IN_G(cons(Z, Xs))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))
P_IN_G(cons(0, Xs)) → P_IN_G(Xs)

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y))
mult_in_gga(X1, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y)) → U6_gga(X, Y, mult_in_gga(X, Y))
U6_gga(X, Y, mult_out_gga(X, Y, W)) → U7_gga(X, Y, sum_in_gga(W, X))
sum_in_gga(X, 0) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y)) → U5_gga(X, Y, sum_in_gga(X, Y))
U5_gga(X, Y, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The set Q consists of the following terms:

p_in_g(x0)
U4_g(x0, x1)
U1_g(x0, x1, x2, x3)
mult_in_gga(x0, x1)
U6_gga(x0, x1, x2)
sum_in_gga(x0, x1)
U5_gga(x0, x1, x2)
U7_gga(x0, x1, x2)
U2_g(x0, x1, x2, x3)
U3_g(x0, x1, x2, x3)

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

(59) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


P_IN_G(cons(s(s(X)), cons(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
P_IN_G(cons(0, Xs)) → P_IN_G(Xs)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(P_IN_G(x1)) = x1   
POL(U1_G(x1, x2, x3, x4)) = 1 + x3   
POL(U1_g(x1, x2, x3, x4)) = 0   
POL(U2_G(x1, x2, x3, x4)) = 1 + x3   
POL(U2_g(x1, x2, x3, x4)) = 0   
POL(U3_g(x1, x2, x3, x4)) = 0   
POL(U4_g(x1, x2)) = 0   
POL(U5_gga(x1, x2, x3)) = 0   
POL(U6_gga(x1, x2, x3)) = 0   
POL(U7_gga(x1, x2, x3)) = 0   
POL(cons(x1, x2)) = 1 + x2   
POL(mult_in_gga(x1, x2)) = 0   
POL(mult_out_gga(x1, x2, x3)) = 0   
POL(nil) = 0   
POL(p_in_g(x1)) = 0   
POL(p_out_g(x1)) = 0   
POL(s(x1)) = 0   
POL(sum_in_gga(x1, x2)) = 0   
POL(sum_out_gga(x1, x2, x3)) = 0   

The following usable rules [FROCOS05] were oriented: none

(60) Obligation:

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

U1_G(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_G(X, Y, Xs, mult_in_gga(X, Y))
U2_G(X, Y, Xs, mult_out_gga(X, Y, Z)) → P_IN_G(cons(Z, Xs))
P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y))
mult_in_gga(X1, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y)) → U6_gga(X, Y, mult_in_gga(X, Y))
U6_gga(X, Y, mult_out_gga(X, Y, W)) → U7_gga(X, Y, sum_in_gga(W, X))
sum_in_gga(X, 0) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y)) → U5_gga(X, Y, sum_in_gga(X, Y))
U5_gga(X, Y, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The set Q consists of the following terms:

p_in_g(x0)
U4_g(x0, x1)
U1_g(x0, x1, x2, x3)
mult_in_gga(x0, x1)
U6_gga(x0, x1, x2)
sum_in_gga(x0, x1)
U5_gga(x0, x1, x2)
U7_gga(x0, x1, x2)
U2_g(x0, x1, x2, x3)
U3_g(x0, x1, x2, x3)

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

(61) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 2 less nodes.

(62) Obligation:

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

P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))

The TRS R consists of the following rules:

p_in_g(cons(X, nil)) → p_out_g(cons(X, nil))
p_in_g(cons(s(s(X)), cons(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(cons(X, cons(Y, Xs))))
p_in_g(cons(0, Xs)) → U4_g(Xs, p_in_g(Xs))
U4_g(Xs, p_out_g(Xs)) → p_out_g(cons(0, Xs))
U1_g(X, Y, Xs, p_out_g(cons(X, cons(Y, Xs)))) → U2_g(X, Y, Xs, mult_in_gga(X, Y))
mult_in_gga(X1, 0) → mult_out_gga(X1, 0, 0)
mult_in_gga(X, s(Y)) → U6_gga(X, Y, mult_in_gga(X, Y))
U6_gga(X, Y, mult_out_gga(X, Y, W)) → U7_gga(X, Y, sum_in_gga(W, X))
sum_in_gga(X, 0) → sum_out_gga(X, 0, X)
sum_in_gga(X, s(Y)) → U5_gga(X, Y, sum_in_gga(X, Y))
U5_gga(X, Y, sum_out_gga(X, Y, Z)) → sum_out_gga(X, s(Y), s(Z))
U7_gga(X, Y, sum_out_gga(W, X, Z)) → mult_out_gga(X, s(Y), Z)
U2_g(X, Y, Xs, mult_out_gga(X, Y, Z)) → U3_g(X, Y, Xs, p_in_g(cons(Z, Xs)))
U3_g(X, Y, Xs, p_out_g(cons(Z, Xs))) → p_out_g(cons(s(s(X)), cons(Y, Xs)))

The set Q consists of the following terms:

p_in_g(x0)
U4_g(x0, x1)
U1_g(x0, x1, x2, x3)
mult_in_gga(x0, x1)
U6_gga(x0, x1, x2)
sum_in_gga(x0, x1)
U5_gga(x0, x1, x2)
U7_gga(x0, x1, x2)
U2_g(x0, x1, x2, x3)
U3_g(x0, x1, x2, x3)

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

(63) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(64) Obligation:

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

P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))

R is empty.
The set Q consists of the following terms:

p_in_g(x0)
U4_g(x0, x1)
U1_g(x0, x1, x2, x3)
mult_in_gga(x0, x1)
U6_gga(x0, x1, x2)
sum_in_gga(x0, x1)
U5_gga(x0, x1, x2)
U7_gga(x0, x1, x2)
U2_g(x0, x1, x2, x3)
U3_g(x0, x1, x2, x3)

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

(65) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

p_in_g(x0)
U4_g(x0, x1)
U1_g(x0, x1, x2, x3)
mult_in_gga(x0, x1)
U6_gga(x0, x1, x2)
sum_in_gga(x0, x1)
U5_gga(x0, x1, x2)
U7_gga(x0, x1, x2)
U2_g(x0, x1, x2, x3)
U3_g(x0, x1, x2, x3)

(66) Obligation:

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

P_IN_G(cons(s(s(X)), cons(Y, Xs))) → P_IN_G(cons(X, cons(Y, Xs)))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.