(0) Obligation:

Clauses:

normal(F, N) :- ','(rewrite(F, F1), normal(F1, N)).
normal(F, F).
rewrite(op(op(A, B), C), op(A, op(B, C))).
rewrite(op(A, op(B, C)), op(A, L)) :- rewrite(op(B, C), L).

Query: normal(g,a)

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph DT10.

(2) Obligation:

Triples:

rewriteB(X1, op(X2, X3), op(X1, X4)) :- rewriteB(X2, X3, X4).
normalA(op(op(X1, X2), X3), X4) :- normalA(op(X1, op(X2, X3)), X4).
normalA(op(X1, op(X2, X3)), X4) :- rewriteB(X2, X3, X5).
normalA(op(X1, op(X2, X3)), X4) :- ','(rewritecB(X2, X3, X5), normalA(op(X1, X5), X4)).

Clauses:

normalcA(op(op(X1, X2), X3), X4) :- normalcA(op(X1, op(X2, X3)), X4).
normalcA(op(X1, op(X2, X3)), X4) :- ','(rewritecB(X2, X3, X5), normalcA(op(X1, X5), X4)).
normalcA(X1, X1).
rewritecB(op(X1, X2), X3, op(X1, op(X2, X3))).
rewritecB(X1, op(X2, X3), op(X1, X4)) :- rewritecB(X2, X3, X4).

Afs:

normalA(x1, x2)  =  normalA(x1)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:
normalA_in: (b,f)
rewriteB_in: (b,b,f)
rewritecB_in: (b,b,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

NORMALA_IN_GA(op(op(X1, X2), X3), X4) → U2_GA(X1, X2, X3, X4, normalA_in_ga(op(X1, op(X2, X3)), X4))
NORMALA_IN_GA(op(op(X1, X2), X3), X4) → NORMALA_IN_GA(op(X1, op(X2, X3)), X4)
NORMALA_IN_GA(op(X1, op(X2, X3)), X4) → U3_GA(X1, X2, X3, X4, rewriteB_in_gga(X2, X3, X5))
NORMALA_IN_GA(op(X1, op(X2, X3)), X4) → REWRITEB_IN_GGA(X2, X3, X5)
REWRITEB_IN_GGA(X1, op(X2, X3), op(X1, X4)) → U1_GGA(X1, X2, X3, X4, rewriteB_in_gga(X2, X3, X4))
REWRITEB_IN_GGA(X1, op(X2, X3), op(X1, X4)) → REWRITEB_IN_GGA(X2, X3, X4)
NORMALA_IN_GA(op(X1, op(X2, X3)), X4) → U4_GA(X1, X2, X3, X4, rewritecB_in_gga(X2, X3, X5))
U4_GA(X1, X2, X3, X4, rewritecB_out_gga(X2, X3, X5)) → U5_GA(X1, X2, X3, X4, normalA_in_ga(op(X1, X5), X4))
U4_GA(X1, X2, X3, X4, rewritecB_out_gga(X2, X3, X5)) → NORMALA_IN_GA(op(X1, X5), X4)

The TRS R consists of the following rules:

rewritecB_in_gga(op(X1, X2), X3, op(X1, op(X2, X3))) → rewritecB_out_gga(op(X1, X2), X3, op(X1, op(X2, X3)))
rewritecB_in_gga(X1, op(X2, X3), op(X1, X4)) → U10_gga(X1, X2, X3, X4, rewritecB_in_gga(X2, X3, X4))
U10_gga(X1, X2, X3, X4, rewritecB_out_gga(X2, X3, X4)) → rewritecB_out_gga(X1, op(X2, X3), op(X1, X4))

The argument filtering Pi contains the following mapping:
normalA_in_ga(x1, x2)  =  normalA_in_ga(x1)
op(x1, x2)  =  op(x1, x2)
rewriteB_in_gga(x1, x2, x3)  =  rewriteB_in_gga(x1, x2)
rewritecB_in_gga(x1, x2, x3)  =  rewritecB_in_gga(x1, x2)
rewritecB_out_gga(x1, x2, x3)  =  rewritecB_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)
NORMALA_IN_GA(x1, x2)  =  NORMALA_IN_GA(x1)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x2, x3, x5)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x1, x2, x3, x5)
REWRITEB_IN_GGA(x1, x2, x3)  =  REWRITEB_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5)  =  U1_GGA(x1, x2, x3, x5)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x3, x5)
U5_GA(x1, x2, x3, x4, x5)  =  U5_GA(x1, x2, x3, x5)

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

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

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

NORMALA_IN_GA(op(op(X1, X2), X3), X4) → U2_GA(X1, X2, X3, X4, normalA_in_ga(op(X1, op(X2, X3)), X4))
NORMALA_IN_GA(op(op(X1, X2), X3), X4) → NORMALA_IN_GA(op(X1, op(X2, X3)), X4)
NORMALA_IN_GA(op(X1, op(X2, X3)), X4) → U3_GA(X1, X2, X3, X4, rewriteB_in_gga(X2, X3, X5))
NORMALA_IN_GA(op(X1, op(X2, X3)), X4) → REWRITEB_IN_GGA(X2, X3, X5)
REWRITEB_IN_GGA(X1, op(X2, X3), op(X1, X4)) → U1_GGA(X1, X2, X3, X4, rewriteB_in_gga(X2, X3, X4))
REWRITEB_IN_GGA(X1, op(X2, X3), op(X1, X4)) → REWRITEB_IN_GGA(X2, X3, X4)
NORMALA_IN_GA(op(X1, op(X2, X3)), X4) → U4_GA(X1, X2, X3, X4, rewritecB_in_gga(X2, X3, X5))
U4_GA(X1, X2, X3, X4, rewritecB_out_gga(X2, X3, X5)) → U5_GA(X1, X2, X3, X4, normalA_in_ga(op(X1, X5), X4))
U4_GA(X1, X2, X3, X4, rewritecB_out_gga(X2, X3, X5)) → NORMALA_IN_GA(op(X1, X5), X4)

The TRS R consists of the following rules:

rewritecB_in_gga(op(X1, X2), X3, op(X1, op(X2, X3))) → rewritecB_out_gga(op(X1, X2), X3, op(X1, op(X2, X3)))
rewritecB_in_gga(X1, op(X2, X3), op(X1, X4)) → U10_gga(X1, X2, X3, X4, rewritecB_in_gga(X2, X3, X4))
U10_gga(X1, X2, X3, X4, rewritecB_out_gga(X2, X3, X4)) → rewritecB_out_gga(X1, op(X2, X3), op(X1, X4))

The argument filtering Pi contains the following mapping:
normalA_in_ga(x1, x2)  =  normalA_in_ga(x1)
op(x1, x2)  =  op(x1, x2)
rewriteB_in_gga(x1, x2, x3)  =  rewriteB_in_gga(x1, x2)
rewritecB_in_gga(x1, x2, x3)  =  rewritecB_in_gga(x1, x2)
rewritecB_out_gga(x1, x2, x3)  =  rewritecB_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)
NORMALA_IN_GA(x1, x2)  =  NORMALA_IN_GA(x1)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x2, x3, x5)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x1, x2, x3, x5)
REWRITEB_IN_GGA(x1, x2, x3)  =  REWRITEB_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5)  =  U1_GGA(x1, x2, x3, x5)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x3, x5)
U5_GA(x1, x2, x3, x4, x5)  =  U5_GA(x1, x2, x3, x5)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 5 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

REWRITEB_IN_GGA(X1, op(X2, X3), op(X1, X4)) → REWRITEB_IN_GGA(X2, X3, X4)

The TRS R consists of the following rules:

rewritecB_in_gga(op(X1, X2), X3, op(X1, op(X2, X3))) → rewritecB_out_gga(op(X1, X2), X3, op(X1, op(X2, X3)))
rewritecB_in_gga(X1, op(X2, X3), op(X1, X4)) → U10_gga(X1, X2, X3, X4, rewritecB_in_gga(X2, X3, X4))
U10_gga(X1, X2, X3, X4, rewritecB_out_gga(X2, X3, X4)) → rewritecB_out_gga(X1, op(X2, X3), op(X1, X4))

The argument filtering Pi contains the following mapping:
op(x1, x2)  =  op(x1, x2)
rewritecB_in_gga(x1, x2, x3)  =  rewritecB_in_gga(x1, x2)
rewritecB_out_gga(x1, x2, x3)  =  rewritecB_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)
REWRITEB_IN_GGA(x1, x2, x3)  =  REWRITEB_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:

REWRITEB_IN_GGA(X1, op(X2, X3), op(X1, X4)) → REWRITEB_IN_GGA(X2, X3, X4)

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

REWRITEB_IN_GGA(X1, op(X2, X3)) → REWRITEB_IN_GGA(X2, X3)

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:

  • REWRITEB_IN_GGA(X1, op(X2, X3)) → REWRITEB_IN_GGA(X2, X3)
    The graph contains the following edges 2 > 1, 2 > 2

(13) YES

(14) Obligation:

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

NORMALA_IN_GA(op(X1, op(X2, X3)), X4) → U4_GA(X1, X2, X3, X4, rewritecB_in_gga(X2, X3, X5))
U4_GA(X1, X2, X3, X4, rewritecB_out_gga(X2, X3, X5)) → NORMALA_IN_GA(op(X1, X5), X4)
NORMALA_IN_GA(op(op(X1, X2), X3), X4) → NORMALA_IN_GA(op(X1, op(X2, X3)), X4)

The TRS R consists of the following rules:

rewritecB_in_gga(op(X1, X2), X3, op(X1, op(X2, X3))) → rewritecB_out_gga(op(X1, X2), X3, op(X1, op(X2, X3)))
rewritecB_in_gga(X1, op(X2, X3), op(X1, X4)) → U10_gga(X1, X2, X3, X4, rewritecB_in_gga(X2, X3, X4))
U10_gga(X1, X2, X3, X4, rewritecB_out_gga(X2, X3, X4)) → rewritecB_out_gga(X1, op(X2, X3), op(X1, X4))

The argument filtering Pi contains the following mapping:
op(x1, x2)  =  op(x1, x2)
rewritecB_in_gga(x1, x2, x3)  =  rewritecB_in_gga(x1, x2)
rewritecB_out_gga(x1, x2, x3)  =  rewritecB_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)
NORMALA_IN_GA(x1, x2)  =  NORMALA_IN_GA(x1)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x3, x5)

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

(15) PiDPToQDPProof (SOUND transformation)

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

(16) Obligation:

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

NORMALA_IN_GA(op(X1, op(X2, X3))) → U4_GA(X1, X2, X3, rewritecB_in_gga(X2, X3))
U4_GA(X1, X2, X3, rewritecB_out_gga(X2, X3, X5)) → NORMALA_IN_GA(op(X1, X5))
NORMALA_IN_GA(op(op(X1, X2), X3)) → NORMALA_IN_GA(op(X1, op(X2, X3)))

The TRS R consists of the following rules:

rewritecB_in_gga(op(X1, X2), X3) → rewritecB_out_gga(op(X1, X2), X3, op(X1, op(X2, X3)))
rewritecB_in_gga(X1, op(X2, X3)) → U10_gga(X1, X2, X3, rewritecB_in_gga(X2, X3))
U10_gga(X1, X2, X3, rewritecB_out_gga(X2, X3, X4)) → rewritecB_out_gga(X1, op(X2, X3), op(X1, X4))

The set Q consists of the following terms:

rewritecB_in_gga(x0, x1)
U10_gga(x0, x1, x2, x3)

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

(17) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


NORMALA_IN_GA(op(op(X1, X2), X3)) → NORMALA_IN_GA(op(X1, op(X2, X3)))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(NORMALA_IN_GA(x1)) = x1   
POL(U10_gga(x1, x2, x3, x4)) = 0   
POL(U4_GA(x1, x2, x3, x4)) = 1 + x1   
POL(op(x1, x2)) = 1 + x1   
POL(rewritecB_in_gga(x1, x2)) = 0   
POL(rewritecB_out_gga(x1, x2, x3)) = 0   

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
none

(18) Obligation:

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

NORMALA_IN_GA(op(X1, op(X2, X3))) → U4_GA(X1, X2, X3, rewritecB_in_gga(X2, X3))
U4_GA(X1, X2, X3, rewritecB_out_gga(X2, X3, X5)) → NORMALA_IN_GA(op(X1, X5))

The TRS R consists of the following rules:

rewritecB_in_gga(op(X1, X2), X3) → rewritecB_out_gga(op(X1, X2), X3, op(X1, op(X2, X3)))
rewritecB_in_gga(X1, op(X2, X3)) → U10_gga(X1, X2, X3, rewritecB_in_gga(X2, X3))
U10_gga(X1, X2, X3, rewritecB_out_gga(X2, X3, X4)) → rewritecB_out_gga(X1, op(X2, X3), op(X1, X4))

The set Q consists of the following terms:

rewritecB_in_gga(x0, x1)
U10_gga(x0, x1, x2, x3)

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

(19) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


NORMALA_IN_GA(op(X1, op(X2, X3))) → U4_GA(X1, X2, X3, rewritecB_in_gga(X2, X3))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation:

POL( U4_GA(x1, ..., x4) ) = 2x1 + x4


POL( rewritecB_in_gga(x1, x2) ) = 2x1 + x2


POL( op(x1, x2) ) = 2x1 + x2 + 1


POL( rewritecB_out_gga(x1, ..., x3) ) = x3


POL( U10_gga(x1, ..., x4) ) = 2x1 + x4 + 1


POL( NORMALA_IN_GA(x1) ) = max{0, x1 - 1}



The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

rewritecB_in_gga(op(X1, X2), X3) → rewritecB_out_gga(op(X1, X2), X3, op(X1, op(X2, X3)))
rewritecB_in_gga(X1, op(X2, X3)) → U10_gga(X1, X2, X3, rewritecB_in_gga(X2, X3))
U10_gga(X1, X2, X3, rewritecB_out_gga(X2, X3, X4)) → rewritecB_out_gga(X1, op(X2, X3), op(X1, X4))

(20) Obligation:

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

U4_GA(X1, X2, X3, rewritecB_out_gga(X2, X3, X5)) → NORMALA_IN_GA(op(X1, X5))

The TRS R consists of the following rules:

rewritecB_in_gga(op(X1, X2), X3) → rewritecB_out_gga(op(X1, X2), X3, op(X1, op(X2, X3)))
rewritecB_in_gga(X1, op(X2, X3)) → U10_gga(X1, X2, X3, rewritecB_in_gga(X2, X3))
U10_gga(X1, X2, X3, rewritecB_out_gga(X2, X3, X4)) → rewritecB_out_gga(X1, op(X2, X3), op(X1, X4))

The set Q consists of the following terms:

rewritecB_in_gga(x0, x1)
U10_gga(x0, x1, x2, x3)

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

(21) DependencyGraphProof (EQUIVALENT transformation)

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

(22) TRUE