(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) PrologToPiTRSProof (SOUND transformation)

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

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x2, x3, x4, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x1, x2, x3, x4, x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

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

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x2, x3, x4, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x1, x2, x3, x4, x6)

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

MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U1_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → LE_IN_GG(A, B)
LE_IN_GG(s(X), s(Y)) → U6_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U1_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → U2_GGA(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
U1_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U3_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → GT_IN_GG(A, B)
GT_IN_GG(s(X), s(Y)) → U5_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_GGA(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)

The TRS R consists of the following rules:

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x2, x3, x4, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x1, x2, x3, x4, x6)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5, x6)  =  U1_GGA(x1, x2, x3, x4, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U6_GG(x1, x2, x3)  =  U6_GG(x1, x2, x3)
U2_GGA(x1, x2, x3, x4, x5, x6)  =  U2_GGA(x1, x2, x3, x4, x6)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U5_GG(x1, x2, x3)  =  U5_GG(x1, x2, x3)
U4_GGA(x1, x2, x3, x4, x5, x6)  =  U4_GGA(x1, x2, x3, x4, x6)

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

(4) Obligation:

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

MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U1_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → LE_IN_GG(A, B)
LE_IN_GG(s(X), s(Y)) → U6_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U1_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → U2_GGA(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
U1_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U3_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → GT_IN_GG(A, B)
GT_IN_GG(s(X), s(Y)) → U5_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_GGA(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)

The TRS R consists of the following rules:

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x2, x3, x4, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x1, x2, x3, x4, x6)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5, x6)  =  U1_GGA(x1, x2, x3, x4, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U6_GG(x1, x2, x3)  =  U6_GG(x1, x2, x3)
U2_GGA(x1, x2, x3, x4, x5, x6)  =  U2_GGA(x1, x2, x3, x4, x6)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U5_GG(x1, x2, x3)  =  U5_GG(x1, x2, x3)
U4_GGA(x1, x2, x3, x4, x5, x6)  =  U4_GGA(x1, x2, x3, x4, x6)

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:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

The TRS R consists of the following rules:

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x2, x3, x4, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x1, x2, x3, x4, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(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:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

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:

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

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

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

The TRS R consists of the following rules:

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x2, x3, x4, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x1, x2, x3, x4, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(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:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

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:

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

  • LE_IN_GG(s(X), s(Y)) → LE_IN_GG(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_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U1_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U3_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)

The TRS R consists of the following rules:

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x2, x3, x4, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x1, x2, x3, x4, x6)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5, x6)  =  U1_GGA(x1, x2, x3, x4, x6)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)

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_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U1_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U3_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5, x6)  =  U1_GGA(x1, x2, x3, x4, x6)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)

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_GGA(A, X, B, Y, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U1_GGA(A, X, B, Y, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U3_GGA(A, X, B, Y, gt_in_gg(A, B))
U3_GGA(A, X, B, Y, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U6_gg(x0, x1, x2)
U5_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:

U3_GGA(A, X, B, Y, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y)

Strictly oriented rules of the TRS R:

gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)

Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 2·x1 + x2   
POL(MERGE_IN_GGA(x1, x2)) = 2·x1 + 2·x2   
POL(U1_GGA(x1, x2, x3, x4, x5)) = x1 + 2·x2 + 2·x3 + 2·x4 + 2·x5   
POL(U3_GGA(x1, x2, x3, x4, x5)) = 2·x1 + 2·x2 + 2·x3 + 2·x4 + x5   
POL(U5_gg(x1, x2, x3)) = 2·x1 + 2·x2 + x3   
POL(U6_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(gt_in_gg(x1, x2)) = 2·x1 + 2·x2   
POL(gt_out_gg(x1, x2)) = 1 + 2·x1 + x2   
POL(le_in_gg(x1, x2)) = x1 + x2   
POL(le_out_gg(x1, x2)) = x1 + x2   
POL(s(x1)) = 2·x1   
POL(zero) = 2   

(27) Obligation:

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

U1_GGA(A, X, B, Y, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U1_GGA(A, X, B, Y, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U3_GGA(A, X, B, Y, gt_in_gg(A, B))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U6_gg(x0, x1, x2)
U5_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 1 less node.

(29) Obligation:

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

MERGE_IN_GGA(.(A, X), .(B, Y)) → U1_GGA(A, X, B, Y, le_in_gg(A, B))
U1_GGA(A, X, B, Y, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U6_gg(x0, x1, x2)
U5_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:

MERGE_IN_GGA(.(A, X), .(B, Y)) → U1_GGA(A, X, B, Y, le_in_gg(A, B))
U1_GGA(A, X, B, Y, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U6_gg(x0, x1, x2)
U5_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].

gt_in_gg(x0, x1)
U5_gg(x0, x1, x2)

(33) Obligation:

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

MERGE_IN_GGA(.(A, X), .(B, Y)) → U1_GGA(A, X, B, Y, le_in_gg(A, B))
U1_GGA(A, X, B, Y, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))

The set Q consists of the following terms:

le_in_gg(x0, x1)
U6_gg(x0, x1, x2)

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

(34) PrologToPiTRSProof (SOUND transformation)

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

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x3, x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(35) Obligation:

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

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x3, x6)

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

MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U1_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → LE_IN_GG(A, B)
LE_IN_GG(s(X), s(Y)) → U6_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U1_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → U2_GGA(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
U1_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U3_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → GT_IN_GG(A, B)
GT_IN_GG(s(X), s(Y)) → U5_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_GGA(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)

The TRS R consists of the following rules:

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x3, x6)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5, x6)  =  U1_GGA(x1, x2, x3, x4, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U6_GG(x1, x2, x3)  =  U6_GG(x3)
U2_GGA(x1, x2, x3, x4, x5, x6)  =  U2_GGA(x1, x6)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U5_GG(x1, x2, x3)  =  U5_GG(x3)
U4_GGA(x1, x2, x3, x4, x5, x6)  =  U4_GGA(x3, x6)

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

(37) Obligation:

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

MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U1_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → LE_IN_GG(A, B)
LE_IN_GG(s(X), s(Y)) → U6_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U1_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → U2_GGA(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
U1_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U3_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → GT_IN_GG(A, B)
GT_IN_GG(s(X), s(Y)) → U5_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_GGA(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)

The TRS R consists of the following rules:

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x3, x6)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5, x6)  =  U1_GGA(x1, x2, x3, x4, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U6_GG(x1, x2, x3)  =  U6_GG(x3)
U2_GGA(x1, x2, x3, x4, x5, x6)  =  U2_GGA(x1, x6)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U5_GG(x1, x2, x3)  =  U5_GG(x3)
U4_GGA(x1, x2, x3, x4, x5, x6)  =  U4_GGA(x3, x6)

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

(38) DependencyGraphProof (EQUIVALENT transformation)

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

(39) Complex Obligation (AND)

(40) Obligation:

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

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

The TRS R consists of the following rules:

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x3, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)

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

(41) UsableRulesProof (EQUIVALENT transformation)

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

(42) Obligation:

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

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

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

(43) PiDPToQDPProof (EQUIVALENT transformation)

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

(44) Obligation:

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

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

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

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

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

(46) TRUE

(47) Obligation:

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

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

The TRS R consists of the following rules:

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x3, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)

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

(48) UsableRulesProof (EQUIVALENT transformation)

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

(49) Obligation:

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

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

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

(50) PiDPToQDPProof (EQUIVALENT transformation)

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

(51) Obligation:

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

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

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

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

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

(53) TRUE

(54) Obligation:

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

U1_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U1_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U3_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)

The TRS R consists of the following rules:

merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U1_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U2_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U3_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U4_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U4_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U2_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))

The argument filtering Pi contains the following mapping:
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
[]  =  []
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4, x5, x6)  =  U2_gga(x1, x6)
U3_gga(x1, x2, x3, x4, x5, x6)  =  U3_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4, x5, x6)  =  U4_gga(x3, x6)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5, x6)  =  U1_GGA(x1, x2, x3, x4, x6)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)

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

(55) UsableRulesProof (EQUIVALENT transformation)

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

(56) Obligation:

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

U1_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U1_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U3_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
U3_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U6_gg(X, Y, le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg(zero, s(Y))
le_in_gg(zero, zero) → le_out_gg(zero, zero)
gt_in_gg(s(X), s(Y)) → U5_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg(s(X), zero)
U6_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
zero  =  zero
le_out_gg(x1, x2)  =  le_out_gg
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5, x6)  =  U1_GGA(x1, x2, x3, x4, x6)
U3_GGA(x1, x2, x3, x4, x5, x6)  =  U3_GGA(x1, x2, x3, x4, x6)

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_GGA(A, X, B, Y, le_out_gg) → MERGE_IN_GGA(X, .(B, Y))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U1_GGA(A, X, B, Y, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U3_GGA(A, X, B, Y, gt_in_gg(A, B))
U3_GGA(A, X, B, Y, gt_out_gg) → MERGE_IN_GGA(.(A, X), Y)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U6_gg(le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg
le_in_gg(zero, zero) → le_out_gg
gt_in_gg(s(X), s(Y)) → U5_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg
U6_gg(le_out_gg) → le_out_gg
U5_gg(gt_out_gg) → gt_out_gg

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U6_gg(x0)
U5_gg(x0)

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.


U1_GGA(A, X, B, Y, le_out_gg) → MERGE_IN_GGA(X, .(B, Y))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = x1 + x2   
POL(MERGE_IN_GGA(x1, x2)) = x1   
POL(U1_GGA(x1, x2, x3, x4, x5)) = x2 + x5   
POL(U3_GGA(x1, x2, x3, x4, x5)) = x1 + x2   
POL(U5_gg(x1)) = 0   
POL(U6_gg(x1)) = 1   
POL(gt_in_gg(x1, x2)) = 0   
POL(gt_out_gg) = 0   
POL(le_in_gg(x1, x2)) = x1   
POL(le_out_gg) = 1   
POL(s(x1)) = 1   
POL(zero) = 1   

The following usable rules [FROCOS05] were oriented:

le_in_gg(s(X), s(Y)) → U6_gg(le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg
le_in_gg(zero, zero) → le_out_gg
U6_gg(le_out_gg) → le_out_gg

(60) Obligation:

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

MERGE_IN_GGA(.(A, X), .(B, Y)) → U1_GGA(A, X, B, Y, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U3_GGA(A, X, B, Y, gt_in_gg(A, B))
U3_GGA(A, X, B, Y, gt_out_gg) → MERGE_IN_GGA(.(A, X), Y)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U6_gg(le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg
le_in_gg(zero, zero) → le_out_gg
gt_in_gg(s(X), s(Y)) → U5_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg
U6_gg(le_out_gg) → le_out_gg
U5_gg(gt_out_gg) → gt_out_gg

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U6_gg(x0)
U5_gg(x0)

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 1 less node.

(62) Obligation:

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

MERGE_IN_GGA(.(A, X), .(B, Y)) → U3_GGA(A, X, B, Y, gt_in_gg(A, B))
U3_GGA(A, X, B, Y, gt_out_gg) → MERGE_IN_GGA(.(A, X), Y)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U6_gg(le_in_gg(X, Y))
le_in_gg(zero, s(Y)) → le_out_gg
le_in_gg(zero, zero) → le_out_gg
gt_in_gg(s(X), s(Y)) → U5_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg
U6_gg(le_out_gg) → le_out_gg
U5_gg(gt_out_gg) → gt_out_gg

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U6_gg(x0)
U5_gg(x0)

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:

MERGE_IN_GGA(.(A, X), .(B, Y)) → U3_GGA(A, X, B, Y, gt_in_gg(A, B))
U3_GGA(A, X, B, Y, gt_out_gg) → MERGE_IN_GGA(.(A, X), Y)

The TRS R consists of the following rules:

gt_in_gg(s(X), s(Y)) → U5_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg
U5_gg(gt_out_gg) → gt_out_gg

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U6_gg(x0)
U5_gg(x0)

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].

le_in_gg(x0, x1)
U6_gg(x0)

(66) Obligation:

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

MERGE_IN_GGA(.(A, X), .(B, Y)) → U3_GGA(A, X, B, Y, gt_in_gg(A, B))
U3_GGA(A, X, B, Y, gt_out_gg) → MERGE_IN_GGA(.(A, X), Y)

The TRS R consists of the following rules:

gt_in_gg(s(X), s(Y)) → U5_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), zero) → gt_out_gg
U5_gg(gt_out_gg) → gt_out_gg

The set Q consists of the following terms:

gt_in_gg(x0, x1)
U5_gg(x0)

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

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

  • U3_GGA(A, X, B, Y, gt_out_gg) → MERGE_IN_GGA(.(A, X), Y)
    The graph contains the following edges 4 >= 2

  • MERGE_IN_GGA(.(A, X), .(B, Y)) → U3_GGA(A, X, B, Y, gt_in_gg(A, B))
    The graph contains the following edges 1 > 1, 1 > 2, 2 > 3, 2 > 4

(68) TRUE