(0) Obligation:
Clauses:
mergesort([], [], Ls).
mergesort(.(X, []), .(X, []), Ls).
mergesort(.(X, .(Y, Xs)), Ys, .(H, Ls)) :- ','(split(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)), ','(mergesort(X1s, Y1s, Ls), ','(mergesort(X2s, Y2s, Ls), merge(Y1s, Y2s, Ys, .(H, Ls))))).
split([], [], [], Ls).
split(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) :- split(Xs, Zs, Ys, Ls).
merge([], Xs, Xs, Ls).
merge(Xs, [], Xs, Ls).
merge(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) :- ','(le(X, Y), merge(Xs, .(Y, Ys), Zs, Ls)).
merge(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) :- ','(gt(X, Y), merge(.(X, Xs), Ys, Zs, Ls)).
gt(s(X), s(Y)) :- gt(X, Y).
gt(s(0), 0).
le(s(X), s(Y)) :- le(X, Y).
le(0, s(0)).
le(0, 0).
Queries:
mergesort(g,a,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,f)
split_in: (b,f,f,f)
merge_in: (b,b,f,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_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x1,
x2,
x3,
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x1,
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x2,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x1,
x2,
x3,
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x1,
x2,
x3,
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x1,
x2,
x3,
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x1,
x2,
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x2,
x3,
x4,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x1,
x2,
x3,
x4,
x8)
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_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x1,
x2,
x3,
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x1,
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x2,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x1,
x2,
x3,
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x1,
x2,
x3,
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x1,
x2,
x3,
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x1,
x2,
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x2,
x3,
x4,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x1,
x2,
x3,
x4,
x8)
(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_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → SPLIT_IN_GAAA(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_GAAA(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_GAA(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → MERGE_IN_GGAA(Y1s, Y2s, Ys, .(H, Ls))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → 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_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → 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_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
The TRS R consists of the following rules:
mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x1,
x2,
x3,
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x1,
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x2,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x1,
x2,
x3,
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x1,
x2,
x3,
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x1,
x2,
x3,
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x1,
x2,
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x2,
x3,
x4,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x1,
x2,
x3,
x4,
x8)
MERGESORT_IN_GAA(
x1,
x2,
x3) =
MERGESORT_IN_GAA(
x1)
U1_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_GAA(
x1,
x2,
x3,
x7)
SPLIT_IN_GAAA(
x1,
x2,
x3,
x4) =
SPLIT_IN_GAAA(
x1)
U5_GAAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_GAAA(
x1,
x2,
x7)
U2_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_GAA(
x1,
x2,
x3,
x7,
x8)
U3_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_GAA(
x1,
x2,
x3,
x7,
x8)
U4_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_GAA(
x1,
x2,
x3,
x7)
MERGE_IN_GGAA(
x1,
x2,
x3,
x4) =
MERGE_IN_GGAA(
x1,
x2)
U6_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_GGAA(
x1,
x2,
x3,
x4,
x8)
LE_IN_GG(
x1,
x2) =
LE_IN_GG(
x1,
x2)
U11_GG(
x1,
x2,
x3) =
U11_GG(
x1,
x2,
x3)
U7_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_GGAA(
x1,
x2,
x3,
x4,
x8)
U8_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_GGAA(
x1,
x2,
x3,
x4,
x8)
GT_IN_GG(
x1,
x2) =
GT_IN_GG(
x1,
x2)
U10_GG(
x1,
x2,
x3) =
U10_GG(
x1,
x2,
x3)
U9_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_GGAA(
x1,
x2,
x3,
x4,
x8)
We have to consider all (P,R,Pi)-chains
(4) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → SPLIT_IN_GAAA(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_GAAA(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_GAA(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → MERGE_IN_GGAA(Y1s, Y2s, Ys, .(H, Ls))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → 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_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → 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_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
The TRS R consists of the following rules:
mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x1,
x2,
x3,
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x1,
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x2,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x1,
x2,
x3,
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x1,
x2,
x3,
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x1,
x2,
x3,
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x1,
x2,
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x2,
x3,
x4,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x1,
x2,
x3,
x4,
x8)
MERGESORT_IN_GAA(
x1,
x2,
x3) =
MERGESORT_IN_GAA(
x1)
U1_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_GAA(
x1,
x2,
x3,
x7)
SPLIT_IN_GAAA(
x1,
x2,
x3,
x4) =
SPLIT_IN_GAAA(
x1)
U5_GAAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_GAAA(
x1,
x2,
x7)
U2_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_GAA(
x1,
x2,
x3,
x7,
x8)
U3_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_GAA(
x1,
x2,
x3,
x7,
x8)
U4_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_GAA(
x1,
x2,
x3,
x7)
MERGE_IN_GGAA(
x1,
x2,
x3,
x4) =
MERGE_IN_GGAA(
x1,
x2)
U6_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_GGAA(
x1,
x2,
x3,
x4,
x8)
LE_IN_GG(
x1,
x2) =
LE_IN_GG(
x1,
x2)
U11_GG(
x1,
x2,
x3) =
U11_GG(
x1,
x2,
x3)
U7_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_GGAA(
x1,
x2,
x3,
x4,
x8)
U8_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_GGAA(
x1,
x2,
x3,
x4,
x8)
GT_IN_GG(
x1,
x2) =
GT_IN_GG(
x1,
x2)
U10_GG(
x1,
x2,
x3) =
U10_GG(
x1,
x2,
x3)
U9_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_GGAA(
x1,
x2,
x3,
x4,
x8)
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_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x1,
x2,
x3,
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x1,
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x2,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x1,
x2,
x3,
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x1,
x2,
x3,
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x1,
x2,
x3,
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x1,
x2,
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x2,
x3,
x4,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x1,
x2,
x3,
x4,
x8)
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_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x1,
x2,
x3,
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x1,
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x2,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x1,
x2,
x3,
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x1,
x2,
x3,
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x1,
x2,
x3,
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x1,
x2,
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x2,
x3,
x4,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x1,
x2,
x3,
x4,
x8)
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_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
The TRS R consists of the following rules:
mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x1,
x2,
x3,
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x1,
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x2,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x1,
x2,
x3,
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x1,
x2,
x3,
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x1,
x2,
x3,
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x1,
x2,
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x2,
x3,
x4,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x1,
x2,
x3,
x4,
x8)
MERGE_IN_GGAA(
x1,
x2,
x3,
x4) =
MERGE_IN_GGAA(
x1,
x2)
U6_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_GGAA(
x1,
x2,
x3,
x4,
x8)
U8_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_GGAA(
x1,
x2,
x3,
x4,
x8)
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_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
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(0)) → le_out_gg(0, s(0))
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(0), 0) → gt_out_gg(s(0), 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_GGAA(
x1,
x2,
x3,
x4) =
MERGE_IN_GGAA(
x1,
x2)
U6_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_GGAA(
x1,
x2,
x3,
x4,
x8)
U8_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_GGAA(
x1,
x2,
x3,
x4,
x8)
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_GGAA(X, Xs, Y, Ys, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U8_GGAA(X, Xs, Y, Ys, gt_in_gg(X, Y))
U8_GGAA(X, Xs, Y, Ys, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(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(0)) → le_out_gg(0, s(0))
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(0), 0) → gt_out_gg(s(0), 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.
(26) MRRProof (EQUIVALENT transformation)
By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U8_GGAA(X, Xs, Y, Ys, gt_in_gg(X, Y))
Strictly oriented rules of the TRS R:
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
Used ordering: Polynomial interpretation [POLO]:
POL(.(x1, x2)) = 1 + 2·x1 + x2
POL(0) = 0
POL(MERGE_IN_GGAA(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_GGAA(x1, x2, x3, x4, x5)) = 2 + 2·x1 + 2·x2 + 2·x3 + 2·x4 + 2·x5
POL(U8_GGAA(x1, x2, x3, x4, x5)) = 1 + 2·x1 + 2·x2 + x3 + 2·x4 + x5
POL(gt_in_gg(x1, x2)) = 2 + 2·x1 + 2·x2
POL(gt_out_gg(x1, x2)) = 1 + 2·x1 + 2·x2
POL(le_in_gg(x1, x2)) = x1 + x2
POL(le_out_gg(x1, x2)) = x1 + x2
POL(s(x1)) = 2·x1
(27) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U6_GGAA(X, Xs, Y, Ys, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys))
U8_GGAA(X, Xs, Y, Ys, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(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(0)) → le_out_gg(0, s(0))
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.
(28) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 2 less nodes.
(29) TRUE
(30) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
The TRS R consists of the following rules:
mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x1,
x2,
x3,
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x1,
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x2,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x1,
x2,
x3,
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x1,
x2,
x3,
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x1,
x2,
x3,
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x1,
x2,
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x2,
x3,
x4,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x1,
x2,
x3,
x4,
x8)
SPLIT_IN_GAAA(
x1,
x2,
x3,
x4) =
SPLIT_IN_GAAA(
x1)
We have to consider all (P,R,Pi)-chains
(31) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(32) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
R is empty.
The argument filtering Pi contains the following mapping:
.(
x1,
x2) =
.(
x1,
x2)
SPLIT_IN_GAAA(
x1,
x2,
x3,
x4) =
SPLIT_IN_GAAA(
x1)
We have to consider all (P,R,Pi)-chains
(33) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(34) Obligation:
Q DP problem:
The TRS P consists of the following rules:
SPLIT_IN_GAAA(.(X, Xs)) → SPLIT_IN_GAAA(Xs)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(35) 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_GAAA(.(X, Xs)) → SPLIT_IN_GAAA(Xs)
The graph contains the following edges 1 > 1
(36) TRUE
(37) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)
The TRS R consists of the following rules:
mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x1,
x2,
x3,
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x1,
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x2,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x1,
x2,
x3,
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x1,
x2,
x3,
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x1,
x2,
x3,
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x1,
x2,
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x2,
x3,
x4,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x1,
x2,
x3,
x4,
x8)
MERGESORT_IN_GAA(
x1,
x2,
x3) =
MERGESORT_IN_GAA(
x1)
U1_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_GAA(
x1,
x2,
x3,
x7)
U2_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_GAA(
x1,
x2,
x3,
x7,
x8)
We have to consider all (P,R,Pi)-chains
(38) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(39) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U1_GAA(X, Y, Xs, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GAA(X, Y, Xs, X2s, mergesort_in_gaa(X1s))
U2_GAA(X, Y, Xs, X2s, mergesort_out_gaa(X1s, Y1s)) → MERGESORT_IN_GAA(X2s)
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(X, Y, Xs, split_in_gaaa(.(X, .(Y, Xs))))
U1_GAA(X, Y, Xs, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GAA(X1s)
The TRS R consists of the following rules:
mergesort_in_gaa([]) → mergesort_out_gaa([], [])
mergesort_in_gaa(.(X, [])) → mergesort_out_gaa(.(X, []), .(X, []))
mergesort_in_gaa(.(X, .(Y, Xs))) → U1_gaa(X, Y, Xs, split_in_gaaa(.(X, .(Y, Xs))))
split_in_gaaa([]) → split_out_gaaa([], [], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, Xs, split_in_gaaa(Xs))
U5_gaaa(X, Xs, split_out_gaaa(Xs, Zs, Ys)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs)
U1_gaa(X, Y, Xs, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_gaa(X, Y, Xs, X2s, mergesort_in_gaa(X1s))
U2_gaa(X, Y, Xs, X2s, mergesort_out_gaa(X1s, Y1s)) → U3_gaa(X, Y, Xs, Y1s, mergesort_in_gaa(X2s))
U3_gaa(X, Y, Xs, Y1s, mergesort_out_gaa(X2s, Y2s)) → U4_gaa(X, Y, Xs, merge_in_ggaa(Y1s, Y2s))
merge_in_ggaa([], Xs) → merge_out_ggaa([], Xs, Xs)
merge_in_ggaa(Xs, []) → merge_out_ggaa(Xs, [], Xs)
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U6_ggaa(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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, merge_in_ggaa(Xs, .(Y, Ys)))
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U8_ggaa(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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, merge_in_ggaa(.(X, Xs), Ys))
U9_ggaa(X, Xs, Y, Ys, merge_out_ggaa(.(X, Xs), Ys, Zs)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_ggaa(X, Xs, Y, Ys, merge_out_ggaa(Xs, .(Y, Ys), Zs)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_gaa(X, Y, Xs, merge_out_ggaa(Y1s, Y2s, Ys)) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys)
The set Q consists of the following terms:
mergesort_in_gaa(x0)
split_in_gaaa(x0)
U5_gaaa(x0, x1, x2)
U1_gaa(x0, x1, x2, x3)
U2_gaa(x0, x1, x2, x3, x4)
U3_gaa(x0, x1, x2, x3, x4)
merge_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0, x1, x2)
U6_ggaa(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0, x1, x2)
U8_ggaa(x0, x1, x2, x3, x4)
U9_ggaa(x0, x1, x2, x3, x4)
U7_ggaa(x0, x1, x2, x3, x4)
U4_gaa(x0, x1, x2, x3)
We have to consider all (P,Q,R)-chains.
(40) 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,f)
split_in: (b,f,f,f)
merge_in: (b,b,f,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_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x3,
x8)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
(41) Obligation:
Pi-finite rewrite system:
The TRS R consists of the following rules:
mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x3,
x8)
(42) 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_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → SPLIT_IN_GAAA(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_GAAA(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_GAA(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → MERGE_IN_GGAA(Y1s, Y2s, Ys, .(H, Ls))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → 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_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → 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_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
The TRS R consists of the following rules:
mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x3,
x8)
MERGESORT_IN_GAA(
x1,
x2,
x3) =
MERGESORT_IN_GAA(
x1)
U1_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_GAA(
x7)
SPLIT_IN_GAAA(
x1,
x2,
x3,
x4) =
SPLIT_IN_GAAA(
x1)
U5_GAAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_GAAA(
x1,
x7)
U2_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_GAA(
x7,
x8)
U3_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_GAA(
x7,
x8)
U4_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_GAA(
x7)
MERGE_IN_GGAA(
x1,
x2,
x3,
x4) =
MERGE_IN_GGAA(
x1,
x2)
U6_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_GGAA(
x1,
x2,
x3,
x4,
x8)
LE_IN_GG(
x1,
x2) =
LE_IN_GG(
x1,
x2)
U11_GG(
x1,
x2,
x3) =
U11_GG(
x3)
U7_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_GGAA(
x1,
x8)
U8_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_GGAA(
x1,
x2,
x3,
x4,
x8)
GT_IN_GG(
x1,
x2) =
GT_IN_GG(
x1,
x2)
U10_GG(
x1,
x2,
x3) =
U10_GG(
x3)
U9_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_GGAA(
x3,
x8)
We have to consider all (P,R,Pi)-chains
(43) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → SPLIT_IN_GAAA(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_GAAA(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_GAA(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → MERGE_IN_GGAA(Y1s, Y2s, Ys, .(H, Ls))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → 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_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → 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_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
The TRS R consists of the following rules:
mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x3,
x8)
MERGESORT_IN_GAA(
x1,
x2,
x3) =
MERGESORT_IN_GAA(
x1)
U1_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_GAA(
x7)
SPLIT_IN_GAAA(
x1,
x2,
x3,
x4) =
SPLIT_IN_GAAA(
x1)
U5_GAAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_GAAA(
x1,
x7)
U2_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_GAA(
x7,
x8)
U3_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_GAA(
x7,
x8)
U4_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_GAA(
x7)
MERGE_IN_GGAA(
x1,
x2,
x3,
x4) =
MERGE_IN_GGAA(
x1,
x2)
U6_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_GGAA(
x1,
x2,
x3,
x4,
x8)
LE_IN_GG(
x1,
x2) =
LE_IN_GG(
x1,
x2)
U11_GG(
x1,
x2,
x3) =
U11_GG(
x3)
U7_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_GGAA(
x1,
x8)
U8_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_GGAA(
x1,
x2,
x3,
x4,
x8)
GT_IN_GG(
x1,
x2) =
GT_IN_GG(
x1,
x2)
U10_GG(
x1,
x2,
x3) =
U10_GG(
x3)
U9_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_GGAA(
x3,
x8)
We have to consider all (P,R,Pi)-chains
(44) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 5 SCCs with 11 less nodes.
(45) Complex Obligation (AND)
(46) 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_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x3,
x8)
GT_IN_GG(
x1,
x2) =
GT_IN_GG(
x1,
x2)
We have to consider all (P,R,Pi)-chains
(47) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(48) 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
(49) PiDPToQDPProof (EQUIVALENT transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(50) 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.
(51) 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
(52) TRUE
(53) 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_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x3,
x8)
LE_IN_GG(
x1,
x2) =
LE_IN_GG(
x1,
x2)
We have to consider all (P,R,Pi)-chains
(54) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(55) 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
(56) PiDPToQDPProof (EQUIVALENT transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(57) 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.
(58) 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
(59) TRUE
(60) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
The TRS R consists of the following rules:
mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x3,
x8)
MERGE_IN_GGAA(
x1,
x2,
x3,
x4) =
MERGE_IN_GGAA(
x1,
x2)
U6_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_GGAA(
x1,
x2,
x3,
x4,
x8)
U8_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_GGAA(
x1,
x2,
x3,
x4,
x8)
We have to consider all (P,R,Pi)-chains
(61) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(62) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
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(0)) → le_out_gg(0, s(0))
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(0), 0) → gt_out_gg(s(0), 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_GGAA(
x1,
x2,
x3,
x4) =
MERGE_IN_GGAA(
x1,
x2)
U6_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_GGAA(
x1,
x2,
x3,
x4,
x8)
U8_GGAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_GGAA(
x1,
x2,
x3,
x4,
x8)
We have to consider all (P,R,Pi)-chains
(63) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(64) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U6_GGAA(X, Xs, Y, Ys, le_out_gg) → MERGE_IN_GGAA(Xs, .(Y, Ys))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U8_GGAA(X, Xs, Y, Ys, gt_in_gg(X, Y))
U8_GGAA(X, Xs, Y, Ys, gt_out_gg) → MERGE_IN_GGAA(.(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(0)) → 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(0), 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.
(65) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U8_GGAA(X, Xs, Y, Ys, gt_in_gg(X, Y))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:
POL(.(x1, x2)) = 1 + x2
POL(0) = 0
POL(MERGE_IN_GGAA(x1, x2)) = x1 + x2
POL(U10_gg(x1)) = 0
POL(U11_gg(x1)) = 0
POL(U6_GGAA(x1, x2, x3, x4, x5)) = 1 + x2 + x4
POL(U8_GGAA(x1, x2, x3, x4, x5)) = 1 + x2 + x4
POL(gt_in_gg(x1, x2)) = 0
POL(gt_out_gg) = 0
POL(le_in_gg(x1, x2)) = 1
POL(le_out_gg) = 0
POL(s(x1)) = 0
The following usable rules [FROCOS05] were oriented:
none
(66) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U6_GGAA(X, Xs, Y, Ys, le_out_gg) → MERGE_IN_GGAA(Xs, .(Y, Ys))
U8_GGAA(X, Xs, Y, Ys, gt_out_gg) → MERGE_IN_GGAA(.(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(0)) → 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(0), 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.
(67) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 2 less nodes.
(68) TRUE
(69) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
The TRS R consists of the following rules:
mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x3,
x8)
SPLIT_IN_GAAA(
x1,
x2,
x3,
x4) =
SPLIT_IN_GAAA(
x1)
We have to consider all (P,R,Pi)-chains
(70) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(71) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
R is empty.
The argument filtering Pi contains the following mapping:
.(
x1,
x2) =
.(
x1,
x2)
SPLIT_IN_GAAA(
x1,
x2,
x3,
x4) =
SPLIT_IN_GAAA(
x1)
We have to consider all (P,R,Pi)-chains
(72) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(73) Obligation:
Q DP problem:
The TRS P consists of the following rules:
SPLIT_IN_GAAA(.(X, Xs)) → SPLIT_IN_GAAA(Xs)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(74) 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_GAAA(.(X, Xs)) → SPLIT_IN_GAAA(Xs)
The graph contains the following edges 1 > 1
(75) TRUE
(76) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)
The TRS R consists of the following rules:
mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0)) → le_out_gg(0, s(0))
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_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, 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(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))
The argument filtering Pi contains the following mapping:
mergesort_in_gaa(
x1,
x2,
x3) =
mergesort_in_gaa(
x1)
[] =
[]
mergesort_out_gaa(
x1,
x2,
x3) =
mergesort_out_gaa(
x2)
.(
x1,
x2) =
.(
x1,
x2)
U1_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_gaa(
x7)
split_in_gaaa(
x1,
x2,
x3,
x4) =
split_in_gaaa(
x1)
split_out_gaaa(
x1,
x2,
x3,
x4) =
split_out_gaaa(
x2,
x3)
U5_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U5_gaaa(
x1,
x7)
U2_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_gaa(
x7,
x8)
U3_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U3_gaa(
x7,
x8)
U4_gaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U4_gaa(
x7)
merge_in_ggaa(
x1,
x2,
x3,
x4) =
merge_in_ggaa(
x1,
x2)
merge_out_ggaa(
x1,
x2,
x3,
x4) =
merge_out_ggaa(
x3)
U6_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U6_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U7_ggaa(
x1,
x8)
U8_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U8_ggaa(
x1,
x2,
x3,
x4,
x8)
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_ggaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U9_ggaa(
x3,
x8)
MERGESORT_IN_GAA(
x1,
x2,
x3) =
MERGESORT_IN_GAA(
x1)
U1_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_GAA(
x7)
U2_GAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_GAA(
x7,
x8)
We have to consider all (P,R,Pi)-chains
(77) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(78) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U1_GAA(split_out_gaaa(X1s, X2s)) → U2_GAA(X2s, mergesort_in_gaa(X1s))
U2_GAA(X2s, mergesort_out_gaa(Y1s)) → MERGESORT_IN_GAA(X2s)
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(split_in_gaaa(.(X, .(Y, Xs))))
U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)
The TRS R consists of the following rules:
mergesort_in_gaa([]) → mergesort_out_gaa([])
mergesort_in_gaa(.(X, [])) → mergesort_out_gaa(.(X, []))
mergesort_in_gaa(.(X, .(Y, Xs))) → U1_gaa(split_in_gaaa(.(X, .(Y, Xs))))
split_in_gaaa([]) → split_out_gaaa([], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)
U1_gaa(split_out_gaaa(X1s, X2s)) → U2_gaa(X2s, mergesort_in_gaa(X1s))
U2_gaa(X2s, mergesort_out_gaa(Y1s)) → U3_gaa(Y1s, mergesort_in_gaa(X2s))
U3_gaa(Y1s, mergesort_out_gaa(Y2s)) → U4_gaa(merge_in_ggaa(Y1s, Y2s))
merge_in_ggaa([], Xs) → merge_out_ggaa(Xs)
merge_in_ggaa(Xs, []) → merge_out_ggaa(Xs)
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U6_ggaa(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(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U6_ggaa(X, Xs, Y, Ys, le_out_gg) → U7_ggaa(X, merge_in_ggaa(Xs, .(Y, Ys)))
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U8_ggaa(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(0), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U8_ggaa(X, Xs, Y, Ys, gt_out_gg) → U9_ggaa(Y, merge_in_ggaa(.(X, Xs), Ys))
U9_ggaa(Y, merge_out_ggaa(Zs)) → merge_out_ggaa(.(Y, Zs))
U7_ggaa(X, merge_out_ggaa(Zs)) → merge_out_ggaa(.(X, Zs))
U4_gaa(merge_out_ggaa(Ys)) → mergesort_out_gaa(Ys)
The set Q consists of the following terms:
mergesort_in_gaa(x0)
split_in_gaaa(x0)
U5_gaaa(x0, x1)
U1_gaa(x0)
U2_gaa(x0, x1)
U3_gaa(x0, x1)
merge_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_ggaa(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_ggaa(x0, x1, x2, x3, x4)
U9_ggaa(x0, x1)
U7_ggaa(x0, x1)
U4_gaa(x0)
We have to consider all (P,Q,R)-chains.
(79) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(split_in_gaaa(.(X, .(Y, Xs))))
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO]:
POL(U1_GAA(x1)) = | 1 | + | | · | x1 |
POL(split_out_gaaa(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U2_GAA(x1, x2)) = | 1 | + | | · | x1 | + | | · | x2 |
POL(mergesort_in_gaa(x1)) = | | + | | · | x1 |
POL(mergesort_out_gaa(x1)) = | | + | | · | x1 |
POL(MERGESORT_IN_GAA(x1)) = | 1 | + | | · | x1 |
POL(.(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(split_in_gaaa(x1)) = | | + | | · | x1 |
POL(U5_gaaa(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U2_gaa(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U3_gaa(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(merge_in_ggaa(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(merge_out_ggaa(x1)) = | | + | | · | x1 |
POL(U6_ggaa(x1, x2, x3, x4, x5)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 | + | | · | x4 | + | | · | x5 |
POL(le_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U8_ggaa(x1, x2, x3, x4, x5)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 | + | | · | x4 | + | | · | x5 |
POL(gt_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U7_ggaa(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U9_ggaa(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
The following usable rules [FROCOS05] were oriented:
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
split_in_gaaa([]) → split_out_gaaa([], [])
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)
(80) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U1_GAA(split_out_gaaa(X1s, X2s)) → U2_GAA(X2s, mergesort_in_gaa(X1s))
U2_GAA(X2s, mergesort_out_gaa(Y1s)) → MERGESORT_IN_GAA(X2s)
U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)
The TRS R consists of the following rules:
mergesort_in_gaa([]) → mergesort_out_gaa([])
mergesort_in_gaa(.(X, [])) → mergesort_out_gaa(.(X, []))
mergesort_in_gaa(.(X, .(Y, Xs))) → U1_gaa(split_in_gaaa(.(X, .(Y, Xs))))
split_in_gaaa([]) → split_out_gaaa([], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)
U1_gaa(split_out_gaaa(X1s, X2s)) → U2_gaa(X2s, mergesort_in_gaa(X1s))
U2_gaa(X2s, mergesort_out_gaa(Y1s)) → U3_gaa(Y1s, mergesort_in_gaa(X2s))
U3_gaa(Y1s, mergesort_out_gaa(Y2s)) → U4_gaa(merge_in_ggaa(Y1s, Y2s))
merge_in_ggaa([], Xs) → merge_out_ggaa(Xs)
merge_in_ggaa(Xs, []) → merge_out_ggaa(Xs)
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U6_ggaa(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(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U6_ggaa(X, Xs, Y, Ys, le_out_gg) → U7_ggaa(X, merge_in_ggaa(Xs, .(Y, Ys)))
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U8_ggaa(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(0), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U8_ggaa(X, Xs, Y, Ys, gt_out_gg) → U9_ggaa(Y, merge_in_ggaa(.(X, Xs), Ys))
U9_ggaa(Y, merge_out_ggaa(Zs)) → merge_out_ggaa(.(Y, Zs))
U7_ggaa(X, merge_out_ggaa(Zs)) → merge_out_ggaa(.(X, Zs))
U4_gaa(merge_out_ggaa(Ys)) → mergesort_out_gaa(Ys)
The set Q consists of the following terms:
mergesort_in_gaa(x0)
split_in_gaaa(x0)
U5_gaaa(x0, x1)
U1_gaa(x0)
U2_gaa(x0, x1)
U3_gaa(x0, x1)
merge_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_ggaa(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_ggaa(x0, x1, x2, x3, x4)
U9_ggaa(x0, x1)
U7_ggaa(x0, x1)
U4_gaa(x0)
We have to consider all (P,Q,R)-chains.
(81) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 3 less nodes.
(82) TRUE