(0) Obligation:

Clauses:

factor(.(X, []), X).
factor(.(X, .(Y, Xs)), T) :- ','(times(X, Y, Z), factor(.(Z, Xs), T)).
times(0, X_, 0).
times(s(X), Y, Z) :- ','(times(X, Y, XY), plus(XY, Y, Z)).
plus(0, X, X).
plus(s(X), Y, s(Z)) :- plus(X, Y, Z).

Queries:

factor(g,a).

(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:
factor_in: (b,f)
times_in: (b,b,f)
plus_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x5)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

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

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x5)

(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:

FACTOR_IN_GA(.(X, .(Y, Xs)), T) → U1_GA(X, Y, Xs, T, times_in_gga(X, Y, Z))
FACTOR_IN_GA(.(X, .(Y, Xs)), T) → TIMES_IN_GGA(X, Y, Z)
TIMES_IN_GGA(s(X), Y, Z) → U3_GGA(X, Y, Z, times_in_gga(X, Y, XY))
TIMES_IN_GGA(s(X), Y, Z) → TIMES_IN_GGA(X, Y, XY)
U3_GGA(X, Y, Z, times_out_gga(X, Y, XY)) → U4_GGA(X, Y, Z, plus_in_gga(XY, Y, Z))
U3_GGA(X, Y, Z, times_out_gga(X, Y, XY)) → PLUS_IN_GGA(XY, Y, Z)
PLUS_IN_GGA(s(X), Y, s(Z)) → U5_GGA(X, Y, Z, plus_in_gga(X, Y, Z))
PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)
U1_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_GA(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U1_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → FACTOR_IN_GA(.(Z, Xs), T)

The TRS R consists of the following rules:

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x5)
FACTOR_IN_GA(x1, x2)  =  FACTOR_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x3, x5)
TIMES_IN_GGA(x1, x2, x3)  =  TIMES_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x4)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x4)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x5)

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

(4) Obligation:

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

FACTOR_IN_GA(.(X, .(Y, Xs)), T) → U1_GA(X, Y, Xs, T, times_in_gga(X, Y, Z))
FACTOR_IN_GA(.(X, .(Y, Xs)), T) → TIMES_IN_GGA(X, Y, Z)
TIMES_IN_GGA(s(X), Y, Z) → U3_GGA(X, Y, Z, times_in_gga(X, Y, XY))
TIMES_IN_GGA(s(X), Y, Z) → TIMES_IN_GGA(X, Y, XY)
U3_GGA(X, Y, Z, times_out_gga(X, Y, XY)) → U4_GGA(X, Y, Z, plus_in_gga(XY, Y, Z))
U3_GGA(X, Y, Z, times_out_gga(X, Y, XY)) → PLUS_IN_GGA(XY, Y, Z)
PLUS_IN_GGA(s(X), Y, s(Z)) → U5_GGA(X, Y, Z, plus_in_gga(X, Y, Z))
PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)
U1_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_GA(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U1_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → FACTOR_IN_GA(.(Z, Xs), T)

The TRS R consists of the following rules:

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x5)
FACTOR_IN_GA(x1, x2)  =  FACTOR_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x3, x5)
TIMES_IN_GGA(x1, x2, x3)  =  TIMES_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x4)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x4)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x5)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

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

The TRS R consists of the following rules:

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x5)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_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:

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

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_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:

PLUS_IN_GGA(s(X), Y) → PLUS_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:

  • PLUS_IN_GGA(s(X), Y) → PLUS_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:

TIMES_IN_GGA(s(X), Y, Z) → TIMES_IN_GGA(X, Y, XY)

The TRS R consists of the following rules:

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x5)
TIMES_IN_GGA(x1, x2, x3)  =  TIMES_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:

TIMES_IN_GGA(s(X), Y, Z) → TIMES_IN_GGA(X, Y, XY)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
TIMES_IN_GGA(x1, x2, x3)  =  TIMES_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:

TIMES_IN_GGA(s(X), Y) → TIMES_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:

  • TIMES_IN_GGA(s(X), Y) → TIMES_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_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → FACTOR_IN_GA(.(Z, Xs), T)
FACTOR_IN_GA(.(X, .(Y, Xs)), T) → U1_GA(X, Y, Xs, T, times_in_gga(X, Y, Z))

The TRS R consists of the following rules:

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x5)
FACTOR_IN_GA(x1, x2)  =  FACTOR_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x3, x5)

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

(22) UsableRulesProof (EQUIVALENT transformation)

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

(23) Obligation:

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

U1_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → FACTOR_IN_GA(.(Z, Xs), T)
FACTOR_IN_GA(.(X, .(Y, Xs)), T) → U1_GA(X, Y, Xs, T, times_in_gga(X, Y, Z))

The TRS R consists of the following rules:

times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
FACTOR_IN_GA(x1, x2)  =  FACTOR_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x3, x5)

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

(24) PiDPToQDPProof (SOUND transformation)

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

(25) Obligation:

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

U1_GA(Xs, times_out_gga(Z)) → FACTOR_IN_GA(.(Z, Xs))
FACTOR_IN_GA(.(X, .(Y, Xs))) → U1_GA(Xs, times_in_gga(X, Y))

The TRS R consists of the following rules:

times_in_gga(0, X_) → times_out_gga(0)
times_in_gga(s(X), Y) → U3_gga(Y, times_in_gga(X, Y))
U3_gga(Y, times_out_gga(XY)) → U4_gga(plus_in_gga(XY, Y))
U4_gga(plus_out_gga(Z)) → times_out_gga(Z)
plus_in_gga(0, X) → plus_out_gga(X)
plus_in_gga(s(X), Y) → U5_gga(plus_in_gga(X, Y))
U5_gga(plus_out_gga(Z)) → plus_out_gga(s(Z))

The set Q consists of the following terms:

times_in_gga(x0, x1)
U3_gga(x0, x1)
U4_gga(x0)
plus_in_gga(x0, x1)
U5_gga(x0)

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

(26) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


FACTOR_IN_GA(.(X, .(Y, Xs))) → U1_GA(Xs, times_in_gga(X, Y))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 1 + x2   
POL(0) = 0   
POL(FACTOR_IN_GA(x1)) = x1   
POL(U1_GA(x1, x2)) = 1 + x1   
POL(U3_gga(x1, x2)) = 0   
POL(U4_gga(x1)) = 0   
POL(U5_gga(x1)) = 0   
POL(plus_in_gga(x1, x2)) = 0   
POL(plus_out_gga(x1)) = 0   
POL(s(x1)) = 0   
POL(times_in_gga(x1, x2)) = 0   
POL(times_out_gga(x1)) = 0   

The following usable rules [FROCOS05] were oriented: none

(27) Obligation:

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

U1_GA(Xs, times_out_gga(Z)) → FACTOR_IN_GA(.(Z, Xs))

The TRS R consists of the following rules:

times_in_gga(0, X_) → times_out_gga(0)
times_in_gga(s(X), Y) → U3_gga(Y, times_in_gga(X, Y))
U3_gga(Y, times_out_gga(XY)) → U4_gga(plus_in_gga(XY, Y))
U4_gga(plus_out_gga(Z)) → times_out_gga(Z)
plus_in_gga(0, X) → plus_out_gga(X)
plus_in_gga(s(X), Y) → U5_gga(plus_in_gga(X, Y))
U5_gga(plus_out_gga(Z)) → plus_out_gga(s(Z))

The set Q consists of the following terms:

times_in_gga(x0, x1)
U3_gga(x0, x1)
U4_gga(x0)
plus_in_gga(x0, x1)
U5_gga(x0)

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

(28) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(29) TRUE

(30) PrologToPiTRSProof (SOUND transformation)

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

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x2, x3, x5)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(31) Obligation:

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

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x2, x3, x5)

(32) 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:

FACTOR_IN_GA(.(X, .(Y, Xs)), T) → U1_GA(X, Y, Xs, T, times_in_gga(X, Y, Z))
FACTOR_IN_GA(.(X, .(Y, Xs)), T) → TIMES_IN_GGA(X, Y, Z)
TIMES_IN_GGA(s(X), Y, Z) → U3_GGA(X, Y, Z, times_in_gga(X, Y, XY))
TIMES_IN_GGA(s(X), Y, Z) → TIMES_IN_GGA(X, Y, XY)
U3_GGA(X, Y, Z, times_out_gga(X, Y, XY)) → U4_GGA(X, Y, Z, plus_in_gga(XY, Y, Z))
U3_GGA(X, Y, Z, times_out_gga(X, Y, XY)) → PLUS_IN_GGA(XY, Y, Z)
PLUS_IN_GGA(s(X), Y, s(Z)) → U5_GGA(X, Y, Z, plus_in_gga(X, Y, Z))
PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)
U1_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_GA(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U1_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → FACTOR_IN_GA(.(Z, Xs), T)

The TRS R consists of the following rules:

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x2, x3, x5)
FACTOR_IN_GA(x1, x2)  =  FACTOR_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
TIMES_IN_GGA(x1, x2, x3)  =  TIMES_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x2, x3, x5)

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

(33) Obligation:

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

FACTOR_IN_GA(.(X, .(Y, Xs)), T) → U1_GA(X, Y, Xs, T, times_in_gga(X, Y, Z))
FACTOR_IN_GA(.(X, .(Y, Xs)), T) → TIMES_IN_GGA(X, Y, Z)
TIMES_IN_GGA(s(X), Y, Z) → U3_GGA(X, Y, Z, times_in_gga(X, Y, XY))
TIMES_IN_GGA(s(X), Y, Z) → TIMES_IN_GGA(X, Y, XY)
U3_GGA(X, Y, Z, times_out_gga(X, Y, XY)) → U4_GGA(X, Y, Z, plus_in_gga(XY, Y, Z))
U3_GGA(X, Y, Z, times_out_gga(X, Y, XY)) → PLUS_IN_GGA(XY, Y, Z)
PLUS_IN_GGA(s(X), Y, s(Z)) → U5_GGA(X, Y, Z, plus_in_gga(X, Y, Z))
PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)
U1_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_GA(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U1_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → FACTOR_IN_GA(.(Z, Xs), T)

The TRS R consists of the following rules:

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x2, x3, x5)
FACTOR_IN_GA(x1, x2)  =  FACTOR_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
TIMES_IN_GGA(x1, x2, x3)  =  TIMES_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x2, x3, x5)

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

(34) DependencyGraphProof (EQUIVALENT transformation)

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

(35) Complex Obligation (AND)

(36) Obligation:

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

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

The TRS R consists of the following rules:

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x2, x3, x5)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)

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

(37) UsableRulesProof (EQUIVALENT transformation)

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

(38) Obligation:

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

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

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

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

(39) PiDPToQDPProof (SOUND transformation)

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

(40) Obligation:

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

PLUS_IN_GGA(s(X), Y) → PLUS_IN_GGA(X, Y)

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

(41) 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:

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

(42) TRUE

(43) Obligation:

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

TIMES_IN_GGA(s(X), Y, Z) → TIMES_IN_GGA(X, Y, XY)

The TRS R consists of the following rules:

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x2, x3, x5)
TIMES_IN_GGA(x1, x2, x3)  =  TIMES_IN_GGA(x1, x2)

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

(44) UsableRulesProof (EQUIVALENT transformation)

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

(45) Obligation:

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

TIMES_IN_GGA(s(X), Y, Z) → TIMES_IN_GGA(X, Y, XY)

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

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

(46) PiDPToQDPProof (SOUND transformation)

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

(47) Obligation:

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

TIMES_IN_GGA(s(X), Y) → TIMES_IN_GGA(X, Y)

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

(48) 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:

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

(49) TRUE

(50) Obligation:

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

U1_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → FACTOR_IN_GA(.(Z, Xs), T)
FACTOR_IN_GA(.(X, .(Y, Xs)), T) → U1_GA(X, Y, Xs, T, times_in_gga(X, Y, Z))

The TRS R consists of the following rules:

factor_in_ga(.(X, []), X) → factor_out_ga(.(X, []), X)
factor_in_ga(.(X, .(Y, Xs)), T) → U1_ga(X, Y, Xs, T, times_in_gga(X, Y, Z))
times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
U1_ga(X, Y, Xs, T, times_out_gga(X, Y, Z)) → U2_ga(X, Y, Xs, T, factor_in_ga(.(Z, Xs), T))
U2_ga(X, Y, Xs, T, factor_out_ga(.(Z, Xs), T)) → factor_out_ga(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in_ga(x1, x2)  =  factor_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
factor_out_ga(x1, x2)  =  factor_out_ga(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x2, x3, x5)
FACTOR_IN_GA(x1, x2)  =  FACTOR_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)

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

(51) UsableRulesProof (EQUIVALENT transformation)

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

(52) Obligation:

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

U1_GA(X, Y, Xs, T, times_out_gga(X, Y, Z)) → FACTOR_IN_GA(.(Z, Xs), T)
FACTOR_IN_GA(.(X, .(Y, Xs)), T) → U1_GA(X, Y, Xs, T, times_in_gga(X, Y, Z))

The TRS R consists of the following rules:

times_in_gga(0, X_, 0) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y, Z) → U3_gga(X, Y, Z, times_in_gga(X, Y, XY))
U3_gga(X, Y, Z, times_out_gga(X, Y, XY)) → U4_gga(X, Y, Z, plus_in_gga(XY, Y, Z))
U4_gga(X, Y, Z, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
plus_in_gga(0, X, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U5_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U5_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
times_in_gga(x1, x2, x3)  =  times_in_gga(x1, x2)
0  =  0
times_out_gga(x1, x2, x3)  =  times_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
FACTOR_IN_GA(x1, x2)  =  FACTOR_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)

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

(53) PiDPToQDPProof (SOUND transformation)

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

(54) Obligation:

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

U1_GA(X, Y, Xs, times_out_gga(X, Y, Z)) → FACTOR_IN_GA(.(Z, Xs))
FACTOR_IN_GA(.(X, .(Y, Xs))) → U1_GA(X, Y, Xs, times_in_gga(X, Y))

The TRS R consists of the following rules:

times_in_gga(0, X_) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y) → U3_gga(X, Y, times_in_gga(X, Y))
U3_gga(X, Y, times_out_gga(X, Y, XY)) → U4_gga(X, Y, plus_in_gga(XY, Y))
U4_gga(X, Y, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
plus_in_gga(0, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y) → U5_gga(X, Y, plus_in_gga(X, Y))
U5_gga(X, Y, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))

The set Q consists of the following terms:

times_in_gga(x0, x1)
U3_gga(x0, x1, x2)
U4_gga(x0, x1, x2)
plus_in_gga(x0, x1)
U5_gga(x0, x1, x2)

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

(55) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


FACTOR_IN_GA(.(X, .(Y, Xs))) → U1_GA(X, Y, Xs, times_in_gga(X, Y))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 1 + x2   
POL(0) = 0   
POL(FACTOR_IN_GA(x1)) = x1   
POL(U1_GA(x1, x2, x3, x4)) = 1 + x3   
POL(U3_gga(x1, x2, x3)) = 0   
POL(U4_gga(x1, x2, x3)) = 0   
POL(U5_gga(x1, x2, x3)) = 1 + x1   
POL(plus_in_gga(x1, x2)) = 1 + x1 + x2   
POL(plus_out_gga(x1, x2, x3)) = 0   
POL(s(x1)) = 1 + x1   
POL(times_in_gga(x1, x2)) = 0   
POL(times_out_gga(x1, x2, x3)) = 0   

The following usable rules [FROCOS05] were oriented: none

(56) Obligation:

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

U1_GA(X, Y, Xs, times_out_gga(X, Y, Z)) → FACTOR_IN_GA(.(Z, Xs))

The TRS R consists of the following rules:

times_in_gga(0, X_) → times_out_gga(0, X_, 0)
times_in_gga(s(X), Y) → U3_gga(X, Y, times_in_gga(X, Y))
U3_gga(X, Y, times_out_gga(X, Y, XY)) → U4_gga(X, Y, plus_in_gga(XY, Y))
U4_gga(X, Y, plus_out_gga(XY, Y, Z)) → times_out_gga(s(X), Y, Z)
plus_in_gga(0, X) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y) → U5_gga(X, Y, plus_in_gga(X, Y))
U5_gga(X, Y, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))

The set Q consists of the following terms:

times_in_gga(x0, x1)
U3_gga(x0, x1, x2)
U4_gga(x0, x1, x2)
plus_in_gga(x0, x1)
U5_gga(x0, x1, x2)

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