(0) Obligation:

Clauses:

mergesort([], []).
mergesort(.(X, []), .(X, [])).
mergesort(.(X, .(Y, Xs)), Ys) :- ','(split(.(X, .(Y, Xs)), X1s, X2s), ','(mergesort(X1s, Y1s), ','(mergesort(X2s, Y2s), merge(Y1s, Y2s, Ys)))).
split([], [], []).
split(.(X, Xs), .(X, Ys), Zs) :- split(Xs, Zs, Ys).
merge([], Xs, Xs).
merge(Xs, [], Xs).
merge(.(X, Xs), .(Y, Ys), .(X, Zs)) :- ','(le(X, Y), merge(Xs, .(Y, Ys), Zs)).
merge(.(X, Xs), .(Y, Ys), .(Y, Zs)) :- ','(gt(X, Y), merge(.(X, Xs), Ys, Zs)).
gt(s(X), s(Y)) :- gt(X, Y).
gt(s(X), 0).
le(s(X), s(Y)) :- le(X, Y).
le(0, s(Y)).
le(0, 0).

Queries:

mergesort(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:
mergesort_in: (b,f)
split_in: (b,f,f)
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:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x3, 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:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x3, 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:

MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → U1_GA(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → SPLIT_IN_GAA(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → U5_GAA(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GA(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GA(X1s, Y1s)
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_GA(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → MERGESORT_IN_GA(X2s, Y2s)
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_GA(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → MERGE_IN_GGA(Y1s, Y2s, Ys)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_GGA(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys), Zs)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_GGA(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_GGA(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x3, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x5)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)
U5_GAA(x1, x2, x3, x4, x5)  =  U5_GAA(x1, x5)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x5, x6)
U3_GA(x1, x2, x3, x4, x5, x6)  =  U3_GA(x5, x6)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x5)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5, x6)  =  U6_GGA(x1, x2, x3, x4, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U11_GG(x1, x2, x3)  =  U11_GG(x3)
U7_GGA(x1, x2, x3, x4, x5, x6)  =  U7_GGA(x1, x6)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U10_GG(x1, x2, x3)  =  U10_GG(x3)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x3, x6)

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

(4) Obligation:

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

MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → U1_GA(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → SPLIT_IN_GAA(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → U5_GAA(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GA(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GA(X1s, Y1s)
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_GA(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → MERGESORT_IN_GA(X2s, Y2s)
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_GA(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → MERGE_IN_GGA(Y1s, Y2s, Ys)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_GGA(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys), Zs)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_GGA(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_GGA(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x3, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x5)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)
U5_GAA(x1, x2, x3, x4, x5)  =  U5_GAA(x1, x5)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x5, x6)
U3_GA(x1, x2, x3, x4, x5, x6)  =  U3_GA(x5, x6)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x5)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5, x6)  =  U6_GGA(x1, x2, x3, x4, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U11_GG(x1, x2, x3)  =  U11_GG(x3)
U7_GGA(x1, x2, x3, x4, x5, x6)  =  U7_GGA(x1, x6)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U10_GG(x1, x2, x3)  =  U10_GG(x3)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x3, x6)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 5 SCCs with 11 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:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x3, 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:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x3, 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:

U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys), Zs)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_GGA(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x3, x6)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5, x6)  =  U6_GGA(x1, x2, x3, x4, x6)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_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:

U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys), Zs)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_GGA(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_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)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5, x6)  =  U6_GGA(x1, x2, x3, x4, x6)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_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:

U6_GGA(X, Xs, Y, Ys, le_out_gg) → MERGE_IN_GGA(Xs, .(Y, Ys))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U6_GGA(X, Xs, Y, Ys, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U8_GGA(X, Xs, Y, Ys, gt_in_gg(X, Y))
U8_GGA(X, Xs, Y, Ys, gt_out_gg) → MERGE_IN_GGA(.(X, Xs), Ys)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U11_gg(le_out_gg) → le_out_gg
U10_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)
U11_gg(x0)
U10_gg(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.


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

POL(.(x1, x2)) = x1 + x2   
POL(0) = 1   
POL(MERGE_IN_GGA(x1, x2)) = x1   
POL(U10_gg(x1)) = 0   
POL(U11_gg(x1)) = 1   
POL(U6_GGA(x1, x2, x3, x4, x5)) = x2 + x5   
POL(U8_GGA(x1, x2, x3, x4, x5)) = x1 + x2   
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   

The following usable rules [FROCOS05] were oriented:

le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg

(27) Obligation:

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

MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U6_GGA(X, Xs, Y, Ys, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U8_GGA(X, Xs, Y, Ys, gt_in_gg(X, Y))
U8_GGA(X, Xs, Y, Ys, gt_out_gg) → MERGE_IN_GGA(.(X, Xs), Ys)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U11_gg(le_out_gg) → le_out_gg
U10_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)
U11_gg(x0)
U10_gg(x0)

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(.(X, Xs), .(Y, Ys)) → U8_GGA(X, Xs, Y, Ys, gt_in_gg(X, Y))
U8_GGA(X, Xs, Y, Ys, gt_out_gg) → MERGE_IN_GGA(.(X, Xs), Ys)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U11_gg(le_out_gg) → le_out_gg
U10_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)
U11_gg(x0)
U10_gg(x0)

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(.(X, Xs), .(Y, Ys)) → U8_GGA(X, Xs, Y, Ys, gt_in_gg(X, Y))
U8_GGA(X, Xs, Y, Ys, gt_out_gg) → MERGE_IN_GGA(.(X, Xs), Ys)

The TRS R consists of the following rules:

gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U10_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)
U11_gg(x0)
U10_gg(x0)

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

le_in_gg(x0, x1)
U11_gg(x0)

(33) Obligation:

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

MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U8_GGA(X, Xs, Y, Ys, gt_in_gg(X, Y))
U8_GGA(X, Xs, Y, Ys, gt_out_gg) → MERGE_IN_GGA(.(X, Xs), Ys)

The TRS R consists of the following rules:

gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg

The set Q consists of the following terms:

gt_in_gg(x0, x1)
U10_gg(x0)

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:

  • U8_GGA(X, Xs, Y, Ys, gt_out_gg) → MERGE_IN_GGA(.(X, Xs), Ys)
    The graph contains the following edges 4 >= 2

  • MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U8_GGA(X, Xs, Y, Ys, gt_in_gg(X, Y))
    The graph contains the following edges 1 > 1, 1 > 2, 2 > 3, 2 > 4

(35) TRUE

(36) Obligation:

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

SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x3, x6)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)

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:

SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)

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

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:

SPLIT_IN_GAA(.(X, Xs)) → SPLIT_IN_GAA(Xs)

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:

  • SPLIT_IN_GAA(.(X, Xs)) → SPLIT_IN_GAA(Xs)
    The graph contains the following edges 1 > 1

(42) TRUE

(43) Obligation:

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

U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GA(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → MERGESORT_IN_GA(X2s, Y2s)
MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → U1_GA(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GA(X1s, Y1s)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x3, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x5)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x5, x6)

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

(44) PiDPToQDPProof (SOUND transformation)

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

(45) Obligation:

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

U1_GA(split_out_gaa(X1s, X2s)) → U2_GA(X2s, mergesort_in_ga(X1s))
U2_GA(X2s, mergesort_out_ga(Y1s)) → MERGESORT_IN_GA(X2s)
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(split_in_gaa(.(X, .(Y, Xs))))
U1_GA(split_out_gaa(X1s, X2s)) → MERGESORT_IN_GA(X1s)

The TRS R consists of the following rules:

mergesort_in_ga([]) → mergesort_out_ga([])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []))
mergesort_in_ga(.(X, .(Y, Xs))) → U1_ga(split_in_gaa(.(X, .(Y, Xs))))
split_in_gaa([]) → split_out_gaa([], [])
split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)
U1_ga(split_out_gaa(X1s, X2s)) → U2_ga(X2s, mergesort_in_ga(X1s))
U2_ga(X2s, mergesort_out_ga(Y1s)) → U3_ga(Y1s, mergesort_in_ga(X2s))
U3_ga(Y1s, mergesort_out_ga(Y2s)) → U4_ga(merge_in_gga(Y1s, Y2s))
merge_in_gga([], Xs) → merge_out_gga(Xs)
merge_in_gga(Xs, []) → merge_out_gga(Xs)
merge_in_gga(.(X, Xs), .(Y, Ys)) → U6_gga(X, Xs, Y, Ys, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U6_gga(X, Xs, Y, Ys, le_out_gg) → U7_gga(X, merge_in_gga(Xs, .(Y, Ys)))
merge_in_gga(.(X, Xs), .(Y, Ys)) → U8_gga(X, Xs, Y, Ys, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U8_gga(X, Xs, Y, Ys, gt_out_gg) → U9_gga(Y, merge_in_gga(.(X, Xs), Ys))
U9_gga(Y, merge_out_gga(Zs)) → merge_out_gga(.(Y, Zs))
U7_gga(X, merge_out_gga(Zs)) → merge_out_gga(.(X, Zs))
U4_ga(merge_out_gga(Ys)) → mergesort_out_ga(Ys)

The set Q consists of the following terms:

mergesort_in_ga(x0)
split_in_gaa(x0)
U5_gaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)
merge_in_gga(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_gga(x0, x1, x2, x3, x4)
U9_gga(x0, x1)
U7_gga(x0, x1)
U4_ga(x0)

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

(46) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


U2_GA(X2s, mergesort_out_ga(Y1s)) → MERGESORT_IN_GA(X2s)
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO]:

POL(U1_GA(x1)) = 0 +
[0,1]
·x1

POL(split_out_gaa(x1, x2)) =
/0\
\0/
+
/01\
\11/
·x1 +
/01\
\01/
·x2

POL(U2_GA(x1, x2)) = 0 +
[0,1]
·x1 +
[1,0]
·x2

POL(mergesort_in_ga(x1)) =
/0\
\0/
+
/11\
\00/
·x1

POL(mergesort_out_ga(x1)) =
/1\
\0/
+
/00\
\00/
·x1

POL(MERGESORT_IN_GA(x1)) = 0 +
[0,1]
·x1

POL(.(x1, x2)) =
/0\
\1/
+
/00\
\00/
·x1 +
/00\
\01/
·x2

POL(split_in_gaa(x1)) =
/0\
\0/
+
/01\
\11/
·x1

POL([]) =
/1\
\0/

POL(U1_ga(x1)) =
/1\
\0/
+
/00\
\00/
·x1

POL(U5_gaa(x1, x2)) =
/1\
\1/
+
/00\
\00/
·x1 +
/10\
\10/
·x2

POL(U2_ga(x1, x2)) =
/1\
\0/
+
/00\
\00/
·x1 +
/00\
\00/
·x2

POL(U3_ga(x1, x2)) =
/1\
\0/
+
/00\
\00/
·x1 +
/00\
\00/
·x2

POL(U4_ga(x1)) =
/1\
\0/
+
/00\
\00/
·x1

POL(merge_in_gga(x1, x2)) =
/1\
\1/
+
/00\
\10/
·x1 +
/00\
\01/
·x2

POL(merge_out_gga(x1)) =
/1\
\0/
+
/10\
\00/
·x1

POL(U6_gga(x1, x2, x3, x4, x5)) =
/1\
\1/
+
/11\
\11/
·x1 +
/11\
\11/
·x2 +
/01\
\11/
·x3 +
/01\
\10/
·x4 +
/11\
\00/
·x5

POL(le_in_gg(x1, x2)) =
/0\
\0/
+
/00\
\00/
·x1 +
/00\
\00/
·x2

POL(U8_gga(x1, x2, x3, x4, x5)) =
/0\
\1/
+
/10\
\01/
·x1 +
/10\
\00/
·x2 +
/10\
\00/
·x3 +
/00\
\01/
·x4 +
/11\
\00/
·x5

POL(gt_in_gg(x1, x2)) =
/1\
\1/
+
/10\
\01/
·x1 +
/00\
\00/
·x2

POL(s(x1)) =
/1\
\1/
+
/10\
\00/
·x1

POL(U11_gg(x1)) =
/0\
\0/
+
/11\
\00/
·x1

POL(0) =
/0\
\0/

POL(le_out_gg) =
/1\
\1/

POL(U7_gga(x1, x2)) =
/1\
\0/
+
/00\
\10/
·x1 +
/00\
\00/
·x2

POL(U10_gg(x1)) =
/0\
\0/
+
/01\
\00/
·x1

POL(gt_out_gg) =
/0\
\0/

POL(U9_gga(x1, x2)) =
/0\
\0/
+
/11\
\11/
·x1 +
/00\
\00/
·x2

The following usable rules [FROCOS05] were oriented:

mergesort_in_ga([]) → mergesort_out_ga([])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []))
mergesort_in_ga(.(X, .(Y, Xs))) → U1_ga(split_in_gaa(.(X, .(Y, Xs))))
split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
U1_ga(split_out_gaa(X1s, X2s)) → U2_ga(X2s, mergesort_in_ga(X1s))
U2_ga(X2s, mergesort_out_ga(Y1s)) → U3_ga(Y1s, mergesort_in_ga(X2s))
U3_ga(Y1s, mergesort_out_ga(Y2s)) → U4_ga(merge_in_gga(Y1s, Y2s))
split_in_gaa([]) → split_out_gaa([], [])
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)
U4_ga(merge_out_gga(Ys)) → mergesort_out_ga(Ys)

(47) Obligation:

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

U1_GA(split_out_gaa(X1s, X2s)) → U2_GA(X2s, mergesort_in_ga(X1s))
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(split_in_gaa(.(X, .(Y, Xs))))
U1_GA(split_out_gaa(X1s, X2s)) → MERGESORT_IN_GA(X1s)

The TRS R consists of the following rules:

mergesort_in_ga([]) → mergesort_out_ga([])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []))
mergesort_in_ga(.(X, .(Y, Xs))) → U1_ga(split_in_gaa(.(X, .(Y, Xs))))
split_in_gaa([]) → split_out_gaa([], [])
split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)
U1_ga(split_out_gaa(X1s, X2s)) → U2_ga(X2s, mergesort_in_ga(X1s))
U2_ga(X2s, mergesort_out_ga(Y1s)) → U3_ga(Y1s, mergesort_in_ga(X2s))
U3_ga(Y1s, mergesort_out_ga(Y2s)) → U4_ga(merge_in_gga(Y1s, Y2s))
merge_in_gga([], Xs) → merge_out_gga(Xs)
merge_in_gga(Xs, []) → merge_out_gga(Xs)
merge_in_gga(.(X, Xs), .(Y, Ys)) → U6_gga(X, Xs, Y, Ys, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U6_gga(X, Xs, Y, Ys, le_out_gg) → U7_gga(X, merge_in_gga(Xs, .(Y, Ys)))
merge_in_gga(.(X, Xs), .(Y, Ys)) → U8_gga(X, Xs, Y, Ys, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U8_gga(X, Xs, Y, Ys, gt_out_gg) → U9_gga(Y, merge_in_gga(.(X, Xs), Ys))
U9_gga(Y, merge_out_gga(Zs)) → merge_out_gga(.(Y, Zs))
U7_gga(X, merge_out_gga(Zs)) → merge_out_gga(.(X, Zs))
U4_ga(merge_out_gga(Ys)) → mergesort_out_ga(Ys)

The set Q consists of the following terms:

mergesort_in_ga(x0)
split_in_gaa(x0)
U5_gaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)
merge_in_gga(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_gga(x0, x1, x2, x3, x4)
U9_gga(x0, x1)
U7_gga(x0, x1)
U4_ga(x0)

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

(48) DependencyGraphProof (EQUIVALENT transformation)

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

(49) Obligation:

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

U1_GA(split_out_gaa(X1s, X2s)) → MERGESORT_IN_GA(X1s)
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(split_in_gaa(.(X, .(Y, Xs))))

The TRS R consists of the following rules:

mergesort_in_ga([]) → mergesort_out_ga([])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []))
mergesort_in_ga(.(X, .(Y, Xs))) → U1_ga(split_in_gaa(.(X, .(Y, Xs))))
split_in_gaa([]) → split_out_gaa([], [])
split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)
U1_ga(split_out_gaa(X1s, X2s)) → U2_ga(X2s, mergesort_in_ga(X1s))
U2_ga(X2s, mergesort_out_ga(Y1s)) → U3_ga(Y1s, mergesort_in_ga(X2s))
U3_ga(Y1s, mergesort_out_ga(Y2s)) → U4_ga(merge_in_gga(Y1s, Y2s))
merge_in_gga([], Xs) → merge_out_gga(Xs)
merge_in_gga(Xs, []) → merge_out_gga(Xs)
merge_in_gga(.(X, Xs), .(Y, Ys)) → U6_gga(X, Xs, Y, Ys, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U6_gga(X, Xs, Y, Ys, le_out_gg) → U7_gga(X, merge_in_gga(Xs, .(Y, Ys)))
merge_in_gga(.(X, Xs), .(Y, Ys)) → U8_gga(X, Xs, Y, Ys, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U8_gga(X, Xs, Y, Ys, gt_out_gg) → U9_gga(Y, merge_in_gga(.(X, Xs), Ys))
U9_gga(Y, merge_out_gga(Zs)) → merge_out_gga(.(Y, Zs))
U7_gga(X, merge_out_gga(Zs)) → merge_out_gga(.(X, Zs))
U4_ga(merge_out_gga(Ys)) → mergesort_out_ga(Ys)

The set Q consists of the following terms:

mergesort_in_ga(x0)
split_in_gaa(x0)
U5_gaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)
merge_in_gga(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_gga(x0, x1, x2, x3, x4)
U9_gga(x0, x1)
U7_gga(x0, x1)
U4_ga(x0)

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

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

(51) Obligation:

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

U1_GA(split_out_gaa(X1s, X2s)) → MERGESORT_IN_GA(X1s)
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(split_in_gaa(.(X, .(Y, Xs))))

The TRS R consists of the following rules:

split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
split_in_gaa([]) → split_out_gaa([], [])
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)

The set Q consists of the following terms:

mergesort_in_ga(x0)
split_in_gaa(x0)
U5_gaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)
merge_in_gga(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_gga(x0, x1, x2, x3, x4)
U9_gga(x0, x1)
U7_gga(x0, x1)
U4_ga(x0)

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

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

mergesort_in_ga(x0)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)
merge_in_gga(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_gga(x0, x1, x2, x3, x4)
U9_gga(x0, x1)
U7_gga(x0, x1)
U4_ga(x0)

(53) Obligation:

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

U1_GA(split_out_gaa(X1s, X2s)) → MERGESORT_IN_GA(X1s)
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(split_in_gaa(.(X, .(Y, Xs))))

The TRS R consists of the following rules:

split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
split_in_gaa([]) → split_out_gaa([], [])
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)

The set Q consists of the following terms:

split_in_gaa(x0)
U5_gaa(x0, x1)

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

(54) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


U1_GA(split_out_gaa(X1s, X2s)) → MERGESORT_IN_GA(X1s)
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO]:

POL(U1_GA(x1)) = 1 +
[0,1]
·x1

POL(split_out_gaa(x1, x2)) =
/0\
\0/
+
/00\
\11/
·x1 +
/11\
\10/
·x2

POL(MERGESORT_IN_GA(x1)) = 0 +
[1,1]
·x1

POL(.(x1, x2)) =
/1\
\0/
+
/00\
\00/
·x1 +
/11\
\10/
·x2

POL(split_in_gaa(x1)) =
/0\
\0/
+
/01\
\10/
·x1

POL(U5_gaa(x1, x2)) =
/0\
\1/
+
/00\
\00/
·x1 +
/01\
\11/
·x2

POL([]) =
/0\
\0/

The following usable rules [FROCOS05] were oriented:

split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
split_in_gaa([]) → split_out_gaa([], [])
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)

(55) Obligation:

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

MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(split_in_gaa(.(X, .(Y, Xs))))

The TRS R consists of the following rules:

split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
split_in_gaa([]) → split_out_gaa([], [])
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)

The set Q consists of the following terms:

split_in_gaa(x0)
U5_gaa(x0, x1)

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

(56) DependencyGraphProof (EQUIVALENT transformation)

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

(57) TRUE

(58) PrologToPiTRSProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
mergesort_in: (b,f)
split_in: (b,f,f)
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:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x2, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x2, x3, x4, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(59) Obligation:

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

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x2, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x2, x3, x4, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)

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

MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → U1_GA(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → SPLIT_IN_GAA(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → U5_GAA(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GA(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GA(X1s, Y1s)
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_GA(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → MERGESORT_IN_GA(X2s, Y2s)
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_GA(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → MERGE_IN_GGA(Y1s, Y2s, Ys)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_GGA(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys), Zs)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_GGA(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_GGA(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x2, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x2, x3, x4, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)
U5_GAA(x1, x2, x3, x4, x5)  =  U5_GAA(x1, x2, x5)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x1, x2, x3, x5, x6)
U3_GA(x1, x2, x3, x4, x5, x6)  =  U3_GA(x1, x2, x3, x5, x6)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x3, x5)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5, x6)  =  U6_GGA(x1, x2, x3, x4, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U11_GG(x1, x2, x3)  =  U11_GG(x1, x2, x3)
U7_GGA(x1, x2, x3, x4, x5, x6)  =  U7_GGA(x1, x2, x3, x4, x6)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U10_GG(x1, x2, x3)  =  U10_GG(x1, x2, x3)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)

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

(61) Obligation:

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

MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → U1_GA(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → SPLIT_IN_GAA(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → U5_GAA(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GA(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GA(X1s, Y1s)
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_GA(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → MERGESORT_IN_GA(X2s, Y2s)
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_GA(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → MERGE_IN_GGA(Y1s, Y2s, Ys)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_GGA(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys), Zs)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_GGA(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_GGA(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x2, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x2, x3, x4, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)
U5_GAA(x1, x2, x3, x4, x5)  =  U5_GAA(x1, x2, x5)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x1, x2, x3, x5, x6)
U3_GA(x1, x2, x3, x4, x5, x6)  =  U3_GA(x1, x2, x3, x5, x6)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x3, x5)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5, x6)  =  U6_GGA(x1, x2, x3, x4, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U11_GG(x1, x2, x3)  =  U11_GG(x1, x2, x3)
U7_GGA(x1, x2, x3, x4, x5, x6)  =  U7_GGA(x1, x2, x3, x4, x6)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U10_GG(x1, x2, x3)  =  U10_GG(x1, x2, x3)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)

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

(62) DependencyGraphProof (EQUIVALENT transformation)

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

(63) Complex Obligation (AND)

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

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x2, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x2, x3, x4, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_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

(65) UsableRulesProof (EQUIVALENT transformation)

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

(66) 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

(67) PiDPToQDPProof (EQUIVALENT transformation)

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

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

(69) 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

(70) TRUE

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

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x2, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x2, x3, x4, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_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

(72) UsableRulesProof (EQUIVALENT transformation)

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

(73) 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

(74) PiDPToQDPProof (EQUIVALENT transformation)

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

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

(76) 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

(77) TRUE

(78) Obligation:

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

U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys), Zs)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_GGA(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x2, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x2, x3, x4, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5, x6)  =  U6_GGA(x1, x2, x3, x4, x6)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)

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

(79) UsableRulesProof (EQUIVALENT transformation)

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

(80) Obligation:

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

U6_GGA(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys), Zs)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_GGA(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
U8_GGA(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_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)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_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)
U6_GGA(x1, x2, x3, x4, x5, x6)  =  U6_GGA(x1, x2, x3, x4, x6)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)

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

(81) PiDPToQDPProof (SOUND transformation)

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

(82) Obligation:

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

U6_GGA(X, Xs, Y, Ys, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U6_GGA(X, Xs, Y, Ys, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U8_GGA(X, Xs, Y, Ys, gt_in_gg(X, Y))
U8_GGA(X, Xs, Y, Ys, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_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)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)

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

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

U8_GGA(X, Xs, Y, Ys, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys)

Strictly oriented rules of the TRS R:

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

Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 2·x1 + x2   
POL(0) = 2   
POL(MERGE_IN_GGA(x1, x2)) = 2·x1 + 2·x2   
POL(U10_gg(x1, x2, x3)) = 2·x1 + 2·x2 + x3   
POL(U11_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U6_GGA(x1, x2, x3, x4, x5)) = x1 + 2·x2 + 2·x3 + 2·x4 + 2·x5   
POL(U8_GGA(x1, x2, x3, x4, x5)) = 2·x1 + 2·x2 + 2·x3 + 2·x4 + x5   
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   

(84) Obligation:

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

U6_GGA(X, Xs, Y, Ys, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U6_GGA(X, Xs, Y, Ys, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U8_GGA(X, Xs, Y, Ys, gt_in_gg(X, Y))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_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)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)

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

(85) DependencyGraphProof (EQUIVALENT transformation)

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

(86) Obligation:

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

MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U6_GGA(X, Xs, Y, Ys, le_in_gg(X, Y))
U6_GGA(X, Xs, Y, Ys, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_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)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)

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

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

(88) Obligation:

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

MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U6_GGA(X, Xs, Y, Ys, le_in_gg(X, Y))
U6_GGA(X, Xs, Y, Ys, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_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)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)

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

(89) 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)
U10_gg(x0, x1, x2)

(90) Obligation:

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

MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U6_GGA(X, Xs, Y, Ys, le_in_gg(X, Y))
U6_GGA(X, Xs, Y, Ys, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_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)
U11_gg(x0, x1, x2)

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

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

  • U6_GGA(X, Xs, Y, Ys, le_out_gg(X, Y)) → MERGE_IN_GGA(Xs, .(Y, Ys))
    The graph contains the following edges 2 >= 1

  • MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U6_GGA(X, Xs, Y, Ys, le_in_gg(X, Y))
    The graph contains the following edges 1 > 1, 1 > 2, 2 > 3, 2 > 4

(92) TRUE

(93) Obligation:

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

SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x2, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x2, x3, x4, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)

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

(94) UsableRulesProof (EQUIVALENT transformation)

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

(95) Obligation:

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

SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)

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

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

(96) PiDPToQDPProof (SOUND transformation)

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

(97) Obligation:

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

SPLIT_IN_GAA(.(X, Xs)) → SPLIT_IN_GAA(Xs)

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

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

  • SPLIT_IN_GAA(.(X, Xs)) → SPLIT_IN_GAA(Xs)
    The graph contains the following edges 1 > 1

(99) TRUE

(100) Obligation:

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

U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GA(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → MERGESORT_IN_GA(X2s, Y2s)
MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → U1_GA(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GA(X1s, Y1s)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, Zs, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(Xs, .(Y, Ys), Zs))
merge_in_gga(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_gga(X, Xs, Y, Ys, Zs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, Zs, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U9_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4, x5)  =  U5_gaa(x1, x2, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5, x6)  =  U6_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x1, x2, x3, x4, x6)
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x1, x2, x3, x5, x6)

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

(101) PiDPToQDPProof (SOUND transformation)

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

(102) Obligation:

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

U1_GA(X, Y, Xs, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GA(X, Y, Xs, X2s, mergesort_in_ga(X1s))
U2_GA(X, Y, Xs, X2s, mergesort_out_ga(X1s, Y1s)) → MERGESORT_IN_GA(X2s)
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(X, Y, Xs, split_in_gaa(.(X, .(Y, Xs))))
U1_GA(X, Y, Xs, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GA(X1s)

The TRS R consists of the following rules:

mergesort_in_ga([]) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs))) → U1_ga(X, Y, Xs, split_in_gaa(.(X, .(Y, Xs))))
split_in_gaa([]) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs)) → U5_gaa(X, Xs, split_in_gaa(Xs))
U5_gaa(X, Xs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, X2s, mergesort_in_ga(X1s))
U2_ga(X, Y, Xs, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Y1s, mergesort_in_ga(X2s))
U3_ga(X, Y, Xs, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, merge_in_gga(Y1s, Y2s))
merge_in_gga([], Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, []) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys)) → U6_gga(X, Xs, Y, Ys, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_gga(X, Xs, Y, Ys, le_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, merge_in_gga(Xs, .(Y, Ys)))
merge_in_gga(.(X, Xs), .(Y, Ys)) → U8_gga(X, Xs, Y, Ys, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_gga(X, Xs, Y, Ys, gt_out_gg(X, Y)) → U9_gga(X, Xs, Y, Ys, merge_in_gga(.(X, Xs), Ys))
U9_gga(X, Xs, Y, Ys, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_gga(X, Xs, Y, Ys, merge_out_gga(Xs, .(Y, Ys), Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)

The set Q consists of the following terms:

mergesort_in_ga(x0)
split_in_gaa(x0)
U5_gaa(x0, x1, x2)
U1_ga(x0, x1, x2, x3)
U2_ga(x0, x1, x2, x3, x4)
U3_ga(x0, x1, x2, x3, x4)
merge_in_gga(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0, x1, x2)
U6_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0, x1, x2)
U8_gga(x0, x1, x2, x3, x4)
U9_gga(x0, x1, x2, x3, x4)
U7_gga(x0, x1, x2, x3, x4)
U4_ga(x0, x1, x2, x3)

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