(0) Obligation:

Clauses:

merge(X, [], X).
merge([], X, X).
merge(.(A, X), .(B, Y), .(A, Z)) :- ','(le(A, B), merge(X, .(B, Y), Z)).
merge(.(A, X), .(B, Y), .(B, Z)) :- ','(gt(A, B), merge(.(A, X), Y, Z)).
gt(s(X), s(Y)) :- gt(X, Y).
gt(s(X), zero).
le(s(X), s(Y)) :- le(X, Y).
le(zero, s(Y)).
le(zero, zero).

Queries:

merge(g,g,a).

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

le25(s(T45), s(T46)) :- le25(T45, T46).
gt51(s(T103), s(T104)) :- gt51(T103, T104).
merge1(.(s(T31), T18), .(s(T32), T20), .(s(T31), T22)) :- le25(T31, T32).
merge1(.(s(T31), T18), .(s(T32), T20), .(s(T31), T22)) :- ','(lec25(T31, T32), merge1(T18, .(s(T32), T20), T22)).
merge1(.(zero, T18), .(s(T64), T20), .(zero, T22)) :- merge1(T18, .(s(T64), T20), T22).
merge1(.(zero, T18), .(zero, T20), .(zero, T22)) :- merge1(T18, .(zero, T20), T22).
merge1(.(T85, T86), .(T87, T88), .(T87, T90)) :- gt51(T85, T87).
merge1(.(T85, T86), .(T87, T88), .(T87, T90)) :- ','(gtc51(T85, T87), merge1(.(T85, T86), T88, T90)).
merge1(.(s(T133), T120), .(s(T134), T122), .(s(T134), T124)) :- gt51(T133, T134).
merge1(.(s(T133), T120), .(s(T134), T122), .(s(T134), T124)) :- ','(gtc51(T133, T134), merge1(.(s(T133), T120), T122, T124)).
merge1(.(s(T145), T120), .(zero, T122), .(zero, T124)) :- merge1(.(s(T145), T120), T122, T124).

Clauses:

mergec1(T5, [], T5).
mergec1([], [], []).
mergec1([], T11, T11).
mergec1(.(s(T31), T18), .(s(T32), T20), .(s(T31), T22)) :- ','(lec25(T31, T32), mergec1(T18, .(s(T32), T20), T22)).
mergec1(.(zero, T18), .(s(T64), T20), .(zero, T22)) :- mergec1(T18, .(s(T64), T20), T22).
mergec1(.(zero, T18), .(zero, T20), .(zero, T22)) :- mergec1(T18, .(zero, T20), T22).
mergec1(.(T85, T86), .(T87, T88), .(T87, T90)) :- ','(gtc51(T85, T87), mergec1(.(T85, T86), T88, T90)).
mergec1(.(s(T133), T120), .(s(T134), T122), .(s(T134), T124)) :- ','(gtc51(T133, T134), mergec1(.(s(T133), T120), T122, T124)).
mergec1(.(s(T145), T120), .(zero, T122), .(zero, T124)) :- mergec1(.(s(T145), T120), T122, T124).
lec25(s(T45), s(T46)) :- lec25(T45, T46).
lec25(zero, s(T53)).
lec25(zero, zero).
gtc51(s(T103), s(T104)) :- gtc51(T103, T104).
gtc51(s(T109), zero).

Afs:

merge1(x1, x2, x3)  =  merge1(x1, x2)

(3) TriplesToPiDPProof (SOUND transformation)

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

MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20), .(s(T31), T22)) → U3_GGA(T31, T18, T32, T20, T22, le25_in_gg(T31, T32))
MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20), .(s(T31), T22)) → LE25_IN_GG(T31, T32)
LE25_IN_GG(s(T45), s(T46)) → U1_GG(T45, T46, le25_in_gg(T45, T46))
LE25_IN_GG(s(T45), s(T46)) → LE25_IN_GG(T45, T46)
MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20), .(s(T31), T22)) → U4_GGA(T31, T18, T32, T20, T22, lec25_in_gg(T31, T32))
U4_GGA(T31, T18, T32, T20, T22, lec25_out_gg(T31, T32)) → U5_GGA(T31, T18, T32, T20, T22, merge1_in_gga(T18, .(s(T32), T20), T22))
U4_GGA(T31, T18, T32, T20, T22, lec25_out_gg(T31, T32)) → MERGE1_IN_GGA(T18, .(s(T32), T20), T22)
MERGE1_IN_GGA(.(zero, T18), .(s(T64), T20), .(zero, T22)) → U6_GGA(T18, T64, T20, T22, merge1_in_gga(T18, .(s(T64), T20), T22))
MERGE1_IN_GGA(.(zero, T18), .(s(T64), T20), .(zero, T22)) → MERGE1_IN_GGA(T18, .(s(T64), T20), T22)
MERGE1_IN_GGA(.(zero, T18), .(zero, T20), .(zero, T22)) → U7_GGA(T18, T20, T22, merge1_in_gga(T18, .(zero, T20), T22))
MERGE1_IN_GGA(.(zero, T18), .(zero, T20), .(zero, T22)) → MERGE1_IN_GGA(T18, .(zero, T20), T22)
MERGE1_IN_GGA(.(T85, T86), .(T87, T88), .(T87, T90)) → U8_GGA(T85, T86, T87, T88, T90, gt51_in_gg(T85, T87))
MERGE1_IN_GGA(.(T85, T86), .(T87, T88), .(T87, T90)) → GT51_IN_GG(T85, T87)
GT51_IN_GG(s(T103), s(T104)) → U2_GG(T103, T104, gt51_in_gg(T103, T104))
GT51_IN_GG(s(T103), s(T104)) → GT51_IN_GG(T103, T104)
MERGE1_IN_GGA(.(T85, T86), .(T87, T88), .(T87, T90)) → U9_GGA(T85, T86, T87, T88, T90, gtc51_in_gg(T85, T87))
U9_GGA(T85, T86, T87, T88, T90, gtc51_out_gg(T85, T87)) → U10_GGA(T85, T86, T87, T88, T90, merge1_in_gga(.(T85, T86), T88, T90))
U9_GGA(T85, T86, T87, T88, T90, gtc51_out_gg(T85, T87)) → MERGE1_IN_GGA(.(T85, T86), T88, T90)
MERGE1_IN_GGA(.(s(T133), T120), .(s(T134), T122), .(s(T134), T124)) → U11_GGA(T133, T120, T134, T122, T124, gt51_in_gg(T133, T134))
MERGE1_IN_GGA(.(s(T133), T120), .(s(T134), T122), .(s(T134), T124)) → GT51_IN_GG(T133, T134)
MERGE1_IN_GGA(.(s(T133), T120), .(s(T134), T122), .(s(T134), T124)) → U12_GGA(T133, T120, T134, T122, T124, gtc51_in_gg(T133, T134))
U12_GGA(T133, T120, T134, T122, T124, gtc51_out_gg(T133, T134)) → U13_GGA(T133, T120, T134, T122, T124, merge1_in_gga(.(s(T133), T120), T122, T124))
U12_GGA(T133, T120, T134, T122, T124, gtc51_out_gg(T133, T134)) → MERGE1_IN_GGA(.(s(T133), T120), T122, T124)
MERGE1_IN_GGA(.(s(T145), T120), .(zero, T122), .(zero, T124)) → U14_GGA(T145, T120, T122, T124, merge1_in_gga(.(s(T145), T120), T122, T124))
MERGE1_IN_GGA(.(s(T145), T120), .(zero, T122), .(zero, T124)) → MERGE1_IN_GGA(.(s(T145), T120), T122, T124)

The TRS R consists of the following rules:

lec25_in_gg(s(T45), s(T46)) → U25_gg(T45, T46, lec25_in_gg(T45, T46))
lec25_in_gg(zero, s(T53)) → lec25_out_gg(zero, s(T53))
lec25_in_gg(zero, zero) → lec25_out_gg(zero, zero)
U25_gg(T45, T46, lec25_out_gg(T45, T46)) → lec25_out_gg(s(T45), s(T46))
gtc51_in_gg(s(T103), s(T104)) → U26_gg(T103, T104, gtc51_in_gg(T103, T104))
gtc51_in_gg(s(T109), zero) → gtc51_out_gg(s(T109), zero)
U26_gg(T103, T104, gtc51_out_gg(T103, T104)) → gtc51_out_gg(s(T103), s(T104))

The argument filtering Pi contains the following mapping:
merge1_in_gga(x1, x2, x3)  =  merge1_in_gga(x1, x2)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
le25_in_gg(x1, x2)  =  le25_in_gg(x1, x2)
lec25_in_gg(x1, x2)  =  lec25_in_gg(x1, x2)
U25_gg(x1, x2, x3)  =  U25_gg(x1, x2, x3)
zero  =  zero
lec25_out_gg(x1, x2)  =  lec25_out_gg(x1, x2)
gt51_in_gg(x1, x2)  =  gt51_in_gg(x1, x2)
gtc51_in_gg(x1, x2)  =  gtc51_in_gg(x1, x2)
U26_gg(x1, x2, x3)  =  U26_gg(x1, x2, x3)
gtc51_out_gg(x1, x2)  =  gtc51_out_gg(x1, x2)
MERGE1_IN_GGA(x1, x2, x3)  =  MERGE1_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)
LE25_IN_GG(x1, x2)  =  LE25_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x2, x3)
U4_GGA(x1, x2, x3, x4, x5, x6)  =  U4_GGA(x1, x2, x3, x4, x6)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x4, x6)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x1, x2, x3, x5)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)
GT51_IN_GG(x1, x2)  =  GT51_IN_GG(x1, x2)
U2_GG(x1, x2, x3)  =  U2_GG(x1, x2, x3)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
U10_GGA(x1, x2, x3, x4, x5, x6)  =  U10_GGA(x1, x2, x3, x4, x6)
U11_GGA(x1, x2, x3, x4, x5, x6)  =  U11_GGA(x1, x2, x3, x4, x6)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x1, x2, x3, x4, x6)
U13_GGA(x1, x2, x3, x4, x5, x6)  =  U13_GGA(x1, x2, x3, x4, x6)
U14_GGA(x1, x2, x3, x4, x5)  =  U14_GGA(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:

MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20), .(s(T31), T22)) → U3_GGA(T31, T18, T32, T20, T22, le25_in_gg(T31, T32))
MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20), .(s(T31), T22)) → LE25_IN_GG(T31, T32)
LE25_IN_GG(s(T45), s(T46)) → U1_GG(T45, T46, le25_in_gg(T45, T46))
LE25_IN_GG(s(T45), s(T46)) → LE25_IN_GG(T45, T46)
MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20), .(s(T31), T22)) → U4_GGA(T31, T18, T32, T20, T22, lec25_in_gg(T31, T32))
U4_GGA(T31, T18, T32, T20, T22, lec25_out_gg(T31, T32)) → U5_GGA(T31, T18, T32, T20, T22, merge1_in_gga(T18, .(s(T32), T20), T22))
U4_GGA(T31, T18, T32, T20, T22, lec25_out_gg(T31, T32)) → MERGE1_IN_GGA(T18, .(s(T32), T20), T22)
MERGE1_IN_GGA(.(zero, T18), .(s(T64), T20), .(zero, T22)) → U6_GGA(T18, T64, T20, T22, merge1_in_gga(T18, .(s(T64), T20), T22))
MERGE1_IN_GGA(.(zero, T18), .(s(T64), T20), .(zero, T22)) → MERGE1_IN_GGA(T18, .(s(T64), T20), T22)
MERGE1_IN_GGA(.(zero, T18), .(zero, T20), .(zero, T22)) → U7_GGA(T18, T20, T22, merge1_in_gga(T18, .(zero, T20), T22))
MERGE1_IN_GGA(.(zero, T18), .(zero, T20), .(zero, T22)) → MERGE1_IN_GGA(T18, .(zero, T20), T22)
MERGE1_IN_GGA(.(T85, T86), .(T87, T88), .(T87, T90)) → U8_GGA(T85, T86, T87, T88, T90, gt51_in_gg(T85, T87))
MERGE1_IN_GGA(.(T85, T86), .(T87, T88), .(T87, T90)) → GT51_IN_GG(T85, T87)
GT51_IN_GG(s(T103), s(T104)) → U2_GG(T103, T104, gt51_in_gg(T103, T104))
GT51_IN_GG(s(T103), s(T104)) → GT51_IN_GG(T103, T104)
MERGE1_IN_GGA(.(T85, T86), .(T87, T88), .(T87, T90)) → U9_GGA(T85, T86, T87, T88, T90, gtc51_in_gg(T85, T87))
U9_GGA(T85, T86, T87, T88, T90, gtc51_out_gg(T85, T87)) → U10_GGA(T85, T86, T87, T88, T90, merge1_in_gga(.(T85, T86), T88, T90))
U9_GGA(T85, T86, T87, T88, T90, gtc51_out_gg(T85, T87)) → MERGE1_IN_GGA(.(T85, T86), T88, T90)
MERGE1_IN_GGA(.(s(T133), T120), .(s(T134), T122), .(s(T134), T124)) → U11_GGA(T133, T120, T134, T122, T124, gt51_in_gg(T133, T134))
MERGE1_IN_GGA(.(s(T133), T120), .(s(T134), T122), .(s(T134), T124)) → GT51_IN_GG(T133, T134)
MERGE1_IN_GGA(.(s(T133), T120), .(s(T134), T122), .(s(T134), T124)) → U12_GGA(T133, T120, T134, T122, T124, gtc51_in_gg(T133, T134))
U12_GGA(T133, T120, T134, T122, T124, gtc51_out_gg(T133, T134)) → U13_GGA(T133, T120, T134, T122, T124, merge1_in_gga(.(s(T133), T120), T122, T124))
U12_GGA(T133, T120, T134, T122, T124, gtc51_out_gg(T133, T134)) → MERGE1_IN_GGA(.(s(T133), T120), T122, T124)
MERGE1_IN_GGA(.(s(T145), T120), .(zero, T122), .(zero, T124)) → U14_GGA(T145, T120, T122, T124, merge1_in_gga(.(s(T145), T120), T122, T124))
MERGE1_IN_GGA(.(s(T145), T120), .(zero, T122), .(zero, T124)) → MERGE1_IN_GGA(.(s(T145), T120), T122, T124)

The TRS R consists of the following rules:

lec25_in_gg(s(T45), s(T46)) → U25_gg(T45, T46, lec25_in_gg(T45, T46))
lec25_in_gg(zero, s(T53)) → lec25_out_gg(zero, s(T53))
lec25_in_gg(zero, zero) → lec25_out_gg(zero, zero)
U25_gg(T45, T46, lec25_out_gg(T45, T46)) → lec25_out_gg(s(T45), s(T46))
gtc51_in_gg(s(T103), s(T104)) → U26_gg(T103, T104, gtc51_in_gg(T103, T104))
gtc51_in_gg(s(T109), zero) → gtc51_out_gg(s(T109), zero)
U26_gg(T103, T104, gtc51_out_gg(T103, T104)) → gtc51_out_gg(s(T103), s(T104))

The argument filtering Pi contains the following mapping:
merge1_in_gga(x1, x2, x3)  =  merge1_in_gga(x1, x2)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
le25_in_gg(x1, x2)  =  le25_in_gg(x1, x2)
lec25_in_gg(x1, x2)  =  lec25_in_gg(x1, x2)
U25_gg(x1, x2, x3)  =  U25_gg(x1, x2, x3)
zero  =  zero
lec25_out_gg(x1, x2)  =  lec25_out_gg(x1, x2)
gt51_in_gg(x1, x2)  =  gt51_in_gg(x1, x2)
gtc51_in_gg(x1, x2)  =  gtc51_in_gg(x1, x2)
U26_gg(x1, x2, x3)  =  U26_gg(x1, x2, x3)
gtc51_out_gg(x1, x2)  =  gtc51_out_gg(x1, x2)
MERGE1_IN_GGA(x1, x2, x3)  =  MERGE1_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)
LE25_IN_GG(x1, x2)  =  LE25_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x2, x3)
U4_GGA(x1, x2, x3, x4, x5, x6)  =  U4_GGA(x1, x2, x3, x4, x6)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x4, x6)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x1, x2, x3, x5)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)
GT51_IN_GG(x1, x2)  =  GT51_IN_GG(x1, x2)
U2_GG(x1, x2, x3)  =  U2_GG(x1, x2, x3)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
U10_GGA(x1, x2, x3, x4, x5, x6)  =  U10_GGA(x1, x2, x3, x4, x6)
U11_GGA(x1, x2, x3, x4, x5, x6)  =  U11_GGA(x1, x2, x3, x4, x6)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x1, x2, x3, x4, x6)
U13_GGA(x1, x2, x3, x4, x5, x6)  =  U13_GGA(x1, x2, x3, x4, x6)
U14_GGA(x1, x2, x3, x4, x5)  =  U14_GGA(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 3 SCCs with 14 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

GT51_IN_GG(s(T103), s(T104)) → GT51_IN_GG(T103, T104)

The TRS R consists of the following rules:

lec25_in_gg(s(T45), s(T46)) → U25_gg(T45, T46, lec25_in_gg(T45, T46))
lec25_in_gg(zero, s(T53)) → lec25_out_gg(zero, s(T53))
lec25_in_gg(zero, zero) → lec25_out_gg(zero, zero)
U25_gg(T45, T46, lec25_out_gg(T45, T46)) → lec25_out_gg(s(T45), s(T46))
gtc51_in_gg(s(T103), s(T104)) → U26_gg(T103, T104, gtc51_in_gg(T103, T104))
gtc51_in_gg(s(T109), zero) → gtc51_out_gg(s(T109), zero)
U26_gg(T103, T104, gtc51_out_gg(T103, T104)) → gtc51_out_gg(s(T103), s(T104))

Pi is empty.
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:

GT51_IN_GG(s(T103), s(T104)) → GT51_IN_GG(T103, T104)

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

(10) PiDPToQDPProof (EQUIVALENT 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:

GT51_IN_GG(s(T103), s(T104)) → GT51_IN_GG(T103, T104)

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:

  • GT51_IN_GG(s(T103), s(T104)) → GT51_IN_GG(T103, T104)
    The graph contains the following edges 1 > 1, 2 > 2

(13) YES

(14) Obligation:

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

LE25_IN_GG(s(T45), s(T46)) → LE25_IN_GG(T45, T46)

The TRS R consists of the following rules:

lec25_in_gg(s(T45), s(T46)) → U25_gg(T45, T46, lec25_in_gg(T45, T46))
lec25_in_gg(zero, s(T53)) → lec25_out_gg(zero, s(T53))
lec25_in_gg(zero, zero) → lec25_out_gg(zero, zero)
U25_gg(T45, T46, lec25_out_gg(T45, T46)) → lec25_out_gg(s(T45), s(T46))
gtc51_in_gg(s(T103), s(T104)) → U26_gg(T103, T104, gtc51_in_gg(T103, T104))
gtc51_in_gg(s(T109), zero) → gtc51_out_gg(s(T109), zero)
U26_gg(T103, T104, gtc51_out_gg(T103, T104)) → gtc51_out_gg(s(T103), s(T104))

Pi is empty.
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:

LE25_IN_GG(s(T45), s(T46)) → LE25_IN_GG(T45, T46)

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

(17) PiDPToQDPProof (EQUIVALENT 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:

LE25_IN_GG(s(T45), s(T46)) → LE25_IN_GG(T45, T46)

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:

  • LE25_IN_GG(s(T45), s(T46)) → LE25_IN_GG(T45, T46)
    The graph contains the following edges 1 > 1, 2 > 2

(20) YES

(21) Obligation:

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

MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20), .(s(T31), T22)) → U4_GGA(T31, T18, T32, T20, T22, lec25_in_gg(T31, T32))
U4_GGA(T31, T18, T32, T20, T22, lec25_out_gg(T31, T32)) → MERGE1_IN_GGA(T18, .(s(T32), T20), T22)
MERGE1_IN_GGA(.(zero, T18), .(s(T64), T20), .(zero, T22)) → MERGE1_IN_GGA(T18, .(s(T64), T20), T22)
MERGE1_IN_GGA(.(T85, T86), .(T87, T88), .(T87, T90)) → U9_GGA(T85, T86, T87, T88, T90, gtc51_in_gg(T85, T87))
U9_GGA(T85, T86, T87, T88, T90, gtc51_out_gg(T85, T87)) → MERGE1_IN_GGA(.(T85, T86), T88, T90)
MERGE1_IN_GGA(.(zero, T18), .(zero, T20), .(zero, T22)) → MERGE1_IN_GGA(T18, .(zero, T20), T22)
MERGE1_IN_GGA(.(s(T145), T120), .(zero, T122), .(zero, T124)) → MERGE1_IN_GGA(.(s(T145), T120), T122, T124)
MERGE1_IN_GGA(.(s(T133), T120), .(s(T134), T122), .(s(T134), T124)) → U12_GGA(T133, T120, T134, T122, T124, gtc51_in_gg(T133, T134))
U12_GGA(T133, T120, T134, T122, T124, gtc51_out_gg(T133, T134)) → MERGE1_IN_GGA(.(s(T133), T120), T122, T124)

The TRS R consists of the following rules:

lec25_in_gg(s(T45), s(T46)) → U25_gg(T45, T46, lec25_in_gg(T45, T46))
lec25_in_gg(zero, s(T53)) → lec25_out_gg(zero, s(T53))
lec25_in_gg(zero, zero) → lec25_out_gg(zero, zero)
U25_gg(T45, T46, lec25_out_gg(T45, T46)) → lec25_out_gg(s(T45), s(T46))
gtc51_in_gg(s(T103), s(T104)) → U26_gg(T103, T104, gtc51_in_gg(T103, T104))
gtc51_in_gg(s(T109), zero) → gtc51_out_gg(s(T109), zero)
U26_gg(T103, T104, gtc51_out_gg(T103, T104)) → gtc51_out_gg(s(T103), s(T104))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
lec25_in_gg(x1, x2)  =  lec25_in_gg(x1, x2)
U25_gg(x1, x2, x3)  =  U25_gg(x1, x2, x3)
zero  =  zero
lec25_out_gg(x1, x2)  =  lec25_out_gg(x1, x2)
gtc51_in_gg(x1, x2)  =  gtc51_in_gg(x1, x2)
U26_gg(x1, x2, x3)  =  U26_gg(x1, x2, x3)
gtc51_out_gg(x1, x2)  =  gtc51_out_gg(x1, x2)
MERGE1_IN_GGA(x1, x2, x3)  =  MERGE1_IN_GGA(x1, x2)
U4_GGA(x1, x2, x3, x4, x5, x6)  =  U4_GGA(x1, x2, x3, x4, x6)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x1, x2, x3, x4, x6)

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:

MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20)) → U4_GGA(T31, T18, T32, T20, lec25_in_gg(T31, T32))
U4_GGA(T31, T18, T32, T20, lec25_out_gg(T31, T32)) → MERGE1_IN_GGA(T18, .(s(T32), T20))
MERGE1_IN_GGA(.(zero, T18), .(s(T64), T20)) → MERGE1_IN_GGA(T18, .(s(T64), T20))
MERGE1_IN_GGA(.(T85, T86), .(T87, T88)) → U9_GGA(T85, T86, T87, T88, gtc51_in_gg(T85, T87))
U9_GGA(T85, T86, T87, T88, gtc51_out_gg(T85, T87)) → MERGE1_IN_GGA(.(T85, T86), T88)
MERGE1_IN_GGA(.(zero, T18), .(zero, T20)) → MERGE1_IN_GGA(T18, .(zero, T20))
MERGE1_IN_GGA(.(s(T145), T120), .(zero, T122)) → MERGE1_IN_GGA(.(s(T145), T120), T122)
MERGE1_IN_GGA(.(s(T133), T120), .(s(T134), T122)) → U12_GGA(T133, T120, T134, T122, gtc51_in_gg(T133, T134))
U12_GGA(T133, T120, T134, T122, gtc51_out_gg(T133, T134)) → MERGE1_IN_GGA(.(s(T133), T120), T122)

The TRS R consists of the following rules:

lec25_in_gg(s(T45), s(T46)) → U25_gg(T45, T46, lec25_in_gg(T45, T46))
lec25_in_gg(zero, s(T53)) → lec25_out_gg(zero, s(T53))
lec25_in_gg(zero, zero) → lec25_out_gg(zero, zero)
U25_gg(T45, T46, lec25_out_gg(T45, T46)) → lec25_out_gg(s(T45), s(T46))
gtc51_in_gg(s(T103), s(T104)) → U26_gg(T103, T104, gtc51_in_gg(T103, T104))
gtc51_in_gg(s(T109), zero) → gtc51_out_gg(s(T109), zero)
U26_gg(T103, T104, gtc51_out_gg(T103, T104)) → gtc51_out_gg(s(T103), s(T104))

The set Q consists of the following terms:

lec25_in_gg(x0, x1)
U25_gg(x0, x1, x2)
gtc51_in_gg(x0, x1)
U26_gg(x0, x1, x2)

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

(24) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

MERGE1_IN_GGA(.(zero, T18), .(s(T64), T20)) → MERGE1_IN_GGA(T18, .(s(T64), T20))
MERGE1_IN_GGA(.(zero, T18), .(zero, T20)) → MERGE1_IN_GGA(T18, .(zero, T20))
MERGE1_IN_GGA(.(s(T145), T120), .(zero, T122)) → MERGE1_IN_GGA(.(s(T145), T120), T122)


Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = x1 + x2   
POL(MERGE1_IN_GGA(x1, x2)) = 2·x1 + 2·x2   
POL(U12_GGA(x1, x2, x3, x4, x5)) = 2·x1 + 2·x2 + 2·x3 + 2·x4 + 2·x5   
POL(U25_gg(x1, x2, x3)) = 2·x1 + 2·x2 + x3   
POL(U26_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U4_GGA(x1, x2, x3, x4, x5)) = x1 + 2·x2 + 2·x3 + 2·x4 + x5   
POL(U9_GGA(x1, x2, x3, x4, x5)) = x1 + 2·x2 + x3 + 2·x4 + x5   
POL(gtc51_in_gg(x1, x2)) = x1 + x2   
POL(gtc51_out_gg(x1, x2)) = x1 + x2   
POL(lec25_in_gg(x1, x2)) = 2·x1 + 2·x2   
POL(lec25_out_gg(x1, x2)) = 2·x1 + 2·x2   
POL(s(x1)) = 2·x1   
POL(zero) = 1   

(25) Obligation:

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

MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20)) → U4_GGA(T31, T18, T32, T20, lec25_in_gg(T31, T32))
U4_GGA(T31, T18, T32, T20, lec25_out_gg(T31, T32)) → MERGE1_IN_GGA(T18, .(s(T32), T20))
MERGE1_IN_GGA(.(T85, T86), .(T87, T88)) → U9_GGA(T85, T86, T87, T88, gtc51_in_gg(T85, T87))
U9_GGA(T85, T86, T87, T88, gtc51_out_gg(T85, T87)) → MERGE1_IN_GGA(.(T85, T86), T88)
MERGE1_IN_GGA(.(s(T133), T120), .(s(T134), T122)) → U12_GGA(T133, T120, T134, T122, gtc51_in_gg(T133, T134))
U12_GGA(T133, T120, T134, T122, gtc51_out_gg(T133, T134)) → MERGE1_IN_GGA(.(s(T133), T120), T122)

The TRS R consists of the following rules:

lec25_in_gg(s(T45), s(T46)) → U25_gg(T45, T46, lec25_in_gg(T45, T46))
lec25_in_gg(zero, s(T53)) → lec25_out_gg(zero, s(T53))
lec25_in_gg(zero, zero) → lec25_out_gg(zero, zero)
U25_gg(T45, T46, lec25_out_gg(T45, T46)) → lec25_out_gg(s(T45), s(T46))
gtc51_in_gg(s(T103), s(T104)) → U26_gg(T103, T104, gtc51_in_gg(T103, T104))
gtc51_in_gg(s(T109), zero) → gtc51_out_gg(s(T109), zero)
U26_gg(T103, T104, gtc51_out_gg(T103, T104)) → gtc51_out_gg(s(T103), s(T104))

The set Q consists of the following terms:

lec25_in_gg(x0, x1)
U25_gg(x0, x1, x2)
gtc51_in_gg(x0, x1)
U26_gg(x0, x1, x2)

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

(26) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

MERGE1_IN_GGA(.(T85, T86), .(T87, T88)) → U9_GGA(T85, T86, T87, T88, gtc51_in_gg(T85, T87))
U12_GGA(T133, T120, T134, T122, gtc51_out_gg(T133, T134)) → MERGE1_IN_GGA(.(s(T133), T120), T122)

Strictly oriented rules of the TRS R:

lec25_in_gg(zero, s(T53)) → lec25_out_gg(zero, s(T53))
lec25_in_gg(zero, zero) → lec25_out_gg(zero, zero)

Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 1 + 2·x1 + 2·x2   
POL(MERGE1_IN_GGA(x1, x2)) = x1 + x2   
POL(U12_GGA(x1, x2, x3, x4, x5)) = 2 + 2·x1 + 2·x2 + x3 + x4 + 2·x5   
POL(U25_gg(x1, x2, x3)) = 2·x1 + 2·x2 + x3   
POL(U26_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U4_GGA(x1, x2, x3, x4, x5)) = 1 + 2·x1 + x2 + 2·x3 + 2·x4 + x5   
POL(U9_GGA(x1, x2, x3, x4, x5)) = 1 + x1 + 2·x2 + x3 + x4 + x5   
POL(gtc51_in_gg(x1, x2)) = x1 + x2   
POL(gtc51_out_gg(x1, x2)) = x1 + x2   
POL(lec25_in_gg(x1, x2)) = 1 + 2·x1 + 2·x2   
POL(lec25_out_gg(x1, x2)) = x1 + 2·x2   
POL(s(x1)) = 2·x1   
POL(zero) = 0   

(27) Obligation:

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

MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20)) → U4_GGA(T31, T18, T32, T20, lec25_in_gg(T31, T32))
U4_GGA(T31, T18, T32, T20, lec25_out_gg(T31, T32)) → MERGE1_IN_GGA(T18, .(s(T32), T20))
U9_GGA(T85, T86, T87, T88, gtc51_out_gg(T85, T87)) → MERGE1_IN_GGA(.(T85, T86), T88)
MERGE1_IN_GGA(.(s(T133), T120), .(s(T134), T122)) → U12_GGA(T133, T120, T134, T122, gtc51_in_gg(T133, T134))

The TRS R consists of the following rules:

lec25_in_gg(s(T45), s(T46)) → U25_gg(T45, T46, lec25_in_gg(T45, T46))
U25_gg(T45, T46, lec25_out_gg(T45, T46)) → lec25_out_gg(s(T45), s(T46))
gtc51_in_gg(s(T103), s(T104)) → U26_gg(T103, T104, gtc51_in_gg(T103, T104))
gtc51_in_gg(s(T109), zero) → gtc51_out_gg(s(T109), zero)
U26_gg(T103, T104, gtc51_out_gg(T103, T104)) → gtc51_out_gg(s(T103), s(T104))

The set Q consists of the following terms:

lec25_in_gg(x0, x1)
U25_gg(x0, x1, x2)
gtc51_in_gg(x0, x1)
U26_gg(x0, x1, x2)

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

(28) DependencyGraphProof (EQUIVALENT transformation)

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

(29) Obligation:

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

U4_GGA(T31, T18, T32, T20, lec25_out_gg(T31, T32)) → MERGE1_IN_GGA(T18, .(s(T32), T20))
MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20)) → U4_GGA(T31, T18, T32, T20, lec25_in_gg(T31, T32))

The TRS R consists of the following rules:

lec25_in_gg(s(T45), s(T46)) → U25_gg(T45, T46, lec25_in_gg(T45, T46))
U25_gg(T45, T46, lec25_out_gg(T45, T46)) → lec25_out_gg(s(T45), s(T46))
gtc51_in_gg(s(T103), s(T104)) → U26_gg(T103, T104, gtc51_in_gg(T103, T104))
gtc51_in_gg(s(T109), zero) → gtc51_out_gg(s(T109), zero)
U26_gg(T103, T104, gtc51_out_gg(T103, T104)) → gtc51_out_gg(s(T103), s(T104))

The set Q consists of the following terms:

lec25_in_gg(x0, x1)
U25_gg(x0, x1, x2)
gtc51_in_gg(x0, x1)
U26_gg(x0, x1, x2)

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

(30) 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.

(31) Obligation:

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

U4_GGA(T31, T18, T32, T20, lec25_out_gg(T31, T32)) → MERGE1_IN_GGA(T18, .(s(T32), T20))
MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20)) → U4_GGA(T31, T18, T32, T20, lec25_in_gg(T31, T32))

The TRS R consists of the following rules:

lec25_in_gg(s(T45), s(T46)) → U25_gg(T45, T46, lec25_in_gg(T45, T46))
U25_gg(T45, T46, lec25_out_gg(T45, T46)) → lec25_out_gg(s(T45), s(T46))

The set Q consists of the following terms:

lec25_in_gg(x0, x1)
U25_gg(x0, x1, x2)
gtc51_in_gg(x0, x1)
U26_gg(x0, x1, x2)

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

(32) 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].

gtc51_in_gg(x0, x1)
U26_gg(x0, x1, x2)

(33) Obligation:

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

U4_GGA(T31, T18, T32, T20, lec25_out_gg(T31, T32)) → MERGE1_IN_GGA(T18, .(s(T32), T20))
MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20)) → U4_GGA(T31, T18, T32, T20, lec25_in_gg(T31, T32))

The TRS R consists of the following rules:

lec25_in_gg(s(T45), s(T46)) → U25_gg(T45, T46, lec25_in_gg(T45, T46))
U25_gg(T45, T46, lec25_out_gg(T45, T46)) → lec25_out_gg(s(T45), s(T46))

The set Q consists of the following terms:

lec25_in_gg(x0, x1)
U25_gg(x0, x1, x2)

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

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

  • MERGE1_IN_GGA(.(s(T31), T18), .(s(T32), T20)) → U4_GGA(T31, T18, T32, T20, lec25_in_gg(T31, T32))
    The graph contains the following edges 1 > 1, 1 > 2, 2 > 3, 2 > 4

  • U4_GGA(T31, T18, T32, T20, lec25_out_gg(T31, T32)) → MERGE1_IN_GGA(T18, .(s(T32), T20))
    The graph contains the following edges 2 >= 1

(35) YES