(0) Obligation:

Clauses:

goal(A, B, C) :- ','(s2l(A, D), applast(D, B, C)).
applast(L, X, Last) :- ','(append(L, .(X, []), LX), last(Last, LX)).
last(X, .(X, [])).
last(X, .(H, T)) :- last(X, T).
append([], L, L).
append(.(H, L1), L2, .(H, L3)) :- append(L1, L2, L3).
s2l(s(X), .(Y, Xs)) :- s2l(X, Xs).
s2l(0, []).

Queries:

goal(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:
goal_in: (b,f,f)
s2l_in: (b,f)
applast_in: (b,f,f)
append_in: (b,b,f)
last_in: (f,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x1, x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x1, x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x2, x3, x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag(x2)
U5_ag(x1, x2, x3, x4)  =  U5_ag(x3, x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa(x1)
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa(x1)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

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

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x1, x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x1, x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x2, x3, x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag(x2)
U5_ag(x1, x2, x3, x4)  =  U5_ag(x3, x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa(x1)
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa(x1)

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

GOAL_IN_GAA(A, B, C) → U1_GAA(A, B, C, s2l_in_ga(A, D))
GOAL_IN_GAA(A, B, C) → S2L_IN_GA(A, D)
S2L_IN_GA(s(X), .(Y, Xs)) → U7_GA(X, Y, Xs, s2l_in_ga(X, Xs))
S2L_IN_GA(s(X), .(Y, Xs)) → S2L_IN_GA(X, Xs)
U1_GAA(A, B, C, s2l_out_ga(A, D)) → U2_GAA(A, B, C, applast_in_gaa(D, B, C))
U1_GAA(A, B, C, s2l_out_ga(A, D)) → APPLAST_IN_GAA(D, B, C)
APPLAST_IN_GAA(L, X, Last) → U3_GAA(L, X, Last, append_in_gga(L, .(X, []), LX))
APPLAST_IN_GAA(L, X, Last) → APPEND_IN_GGA(L, .(X, []), LX)
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → U6_GGA(H, L1, L2, L3, append_in_gga(L1, L2, L3))
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)
U3_GAA(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_GAA(L, X, Last, last_in_ag(Last, LX))
U3_GAA(L, X, Last, append_out_gga(L, .(X, []), LX)) → LAST_IN_AG(Last, LX)
LAST_IN_AG(X, .(H, T)) → U5_AG(X, H, T, last_in_ag(X, T))
LAST_IN_AG(X, .(H, T)) → LAST_IN_AG(X, T)

The TRS R consists of the following rules:

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x1, x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x1, x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x2, x3, x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag(x2)
U5_ag(x1, x2, x3, x4)  =  U5_ag(x3, x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa(x1)
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa(x1)
GOAL_IN_GAA(x1, x2, x3)  =  GOAL_IN_GAA(x1)
U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x1, x4)
S2L_IN_GA(x1, x2)  =  S2L_IN_GA(x1)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x1, x4)
U2_GAA(x1, x2, x3, x4)  =  U2_GAA(x1, x4)
APPLAST_IN_GAA(x1, x2, x3)  =  APPLAST_IN_GAA(x1)
U3_GAA(x1, x2, x3, x4)  =  U3_GAA(x1, x4)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x2, x3, x5)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x1, x4)
LAST_IN_AG(x1, x2)  =  LAST_IN_AG(x2)
U5_AG(x1, x2, x3, x4)  =  U5_AG(x3, x4)

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

(4) Obligation:

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

GOAL_IN_GAA(A, B, C) → U1_GAA(A, B, C, s2l_in_ga(A, D))
GOAL_IN_GAA(A, B, C) → S2L_IN_GA(A, D)
S2L_IN_GA(s(X), .(Y, Xs)) → U7_GA(X, Y, Xs, s2l_in_ga(X, Xs))
S2L_IN_GA(s(X), .(Y, Xs)) → S2L_IN_GA(X, Xs)
U1_GAA(A, B, C, s2l_out_ga(A, D)) → U2_GAA(A, B, C, applast_in_gaa(D, B, C))
U1_GAA(A, B, C, s2l_out_ga(A, D)) → APPLAST_IN_GAA(D, B, C)
APPLAST_IN_GAA(L, X, Last) → U3_GAA(L, X, Last, append_in_gga(L, .(X, []), LX))
APPLAST_IN_GAA(L, X, Last) → APPEND_IN_GGA(L, .(X, []), LX)
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → U6_GGA(H, L1, L2, L3, append_in_gga(L1, L2, L3))
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)
U3_GAA(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_GAA(L, X, Last, last_in_ag(Last, LX))
U3_GAA(L, X, Last, append_out_gga(L, .(X, []), LX)) → LAST_IN_AG(Last, LX)
LAST_IN_AG(X, .(H, T)) → U5_AG(X, H, T, last_in_ag(X, T))
LAST_IN_AG(X, .(H, T)) → LAST_IN_AG(X, T)

The TRS R consists of the following rules:

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x1, x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x1, x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x2, x3, x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag(x2)
U5_ag(x1, x2, x3, x4)  =  U5_ag(x3, x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa(x1)
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa(x1)
GOAL_IN_GAA(x1, x2, x3)  =  GOAL_IN_GAA(x1)
U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x1, x4)
S2L_IN_GA(x1, x2)  =  S2L_IN_GA(x1)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x1, x4)
U2_GAA(x1, x2, x3, x4)  =  U2_GAA(x1, x4)
APPLAST_IN_GAA(x1, x2, x3)  =  APPLAST_IN_GAA(x1)
U3_GAA(x1, x2, x3, x4)  =  U3_GAA(x1, x4)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x2, x3, x5)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x1, x4)
LAST_IN_AG(x1, x2)  =  LAST_IN_AG(x2)
U5_AG(x1, x2, x3, x4)  =  U5_AG(x3, x4)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

LAST_IN_AG(X, .(H, T)) → LAST_IN_AG(X, T)

The TRS R consists of the following rules:

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x1, x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x1, x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x2, x3, x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag(x2)
U5_ag(x1, x2, x3, x4)  =  U5_ag(x3, x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa(x1)
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa(x1)
LAST_IN_AG(x1, x2)  =  LAST_IN_AG(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:

LAST_IN_AG(X, .(H, T)) → LAST_IN_AG(X, T)

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

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

(10) PiDPToQDPProof (SOUND transformation)

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

(11) Obligation:

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

LAST_IN_AG(.(T)) → LAST_IN_AG(T)

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:

  • LAST_IN_AG(.(T)) → LAST_IN_AG(T)
    The graph contains the following edges 1 > 1

(13) TRUE

(14) Obligation:

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

APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)

The TRS R consists of the following rules:

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x1, x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x1, x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x2, x3, x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag(x2)
U5_ag(x1, x2, x3, x4)  =  U5_ag(x3, x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa(x1)
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa(x1)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(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:

APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)

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

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

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

APPEND_IN_GGA(.(L1), L2) → APPEND_IN_GGA(L1, L2)

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:

  • APPEND_IN_GGA(.(L1), L2) → APPEND_IN_GGA(L1, L2)
    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:

S2L_IN_GA(s(X), .(Y, Xs)) → S2L_IN_GA(X, Xs)

The TRS R consists of the following rules:

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x1, x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x1, x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x1, x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x2, x3, x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag(x2)
U5_ag(x1, x2, x3, x4)  =  U5_ag(x3, x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa(x1)
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa(x1)
S2L_IN_GA(x1, x2)  =  S2L_IN_GA(x1)

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:

S2L_IN_GA(s(X), .(Y, Xs)) → S2L_IN_GA(X, Xs)

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

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:

S2L_IN_GA(s(X)) → S2L_IN_GA(X)

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

(26) PrologToPiTRSProof (SOUND transformation)

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

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag
U5_ag(x1, x2, x3, x4)  =  U5_ag(x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(27) Obligation:

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

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag
U5_ag(x1, x2, x3, x4)  =  U5_ag(x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa

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

GOAL_IN_GAA(A, B, C) → U1_GAA(A, B, C, s2l_in_ga(A, D))
GOAL_IN_GAA(A, B, C) → S2L_IN_GA(A, D)
S2L_IN_GA(s(X), .(Y, Xs)) → U7_GA(X, Y, Xs, s2l_in_ga(X, Xs))
S2L_IN_GA(s(X), .(Y, Xs)) → S2L_IN_GA(X, Xs)
U1_GAA(A, B, C, s2l_out_ga(A, D)) → U2_GAA(A, B, C, applast_in_gaa(D, B, C))
U1_GAA(A, B, C, s2l_out_ga(A, D)) → APPLAST_IN_GAA(D, B, C)
APPLAST_IN_GAA(L, X, Last) → U3_GAA(L, X, Last, append_in_gga(L, .(X, []), LX))
APPLAST_IN_GAA(L, X, Last) → APPEND_IN_GGA(L, .(X, []), LX)
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → U6_GGA(H, L1, L2, L3, append_in_gga(L1, L2, L3))
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)
U3_GAA(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_GAA(L, X, Last, last_in_ag(Last, LX))
U3_GAA(L, X, Last, append_out_gga(L, .(X, []), LX)) → LAST_IN_AG(Last, LX)
LAST_IN_AG(X, .(H, T)) → U5_AG(X, H, T, last_in_ag(X, T))
LAST_IN_AG(X, .(H, T)) → LAST_IN_AG(X, T)

The TRS R consists of the following rules:

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag
U5_ag(x1, x2, x3, x4)  =  U5_ag(x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa
GOAL_IN_GAA(x1, x2, x3)  =  GOAL_IN_GAA(x1)
U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x4)
S2L_IN_GA(x1, x2)  =  S2L_IN_GA(x1)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x4)
U2_GAA(x1, x2, x3, x4)  =  U2_GAA(x4)
APPLAST_IN_GAA(x1, x2, x3)  =  APPLAST_IN_GAA(x1)
U3_GAA(x1, x2, x3, x4)  =  U3_GAA(x4)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x5)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x4)
LAST_IN_AG(x1, x2)  =  LAST_IN_AG(x2)
U5_AG(x1, x2, x3, x4)  =  U5_AG(x4)

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

(29) Obligation:

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

GOAL_IN_GAA(A, B, C) → U1_GAA(A, B, C, s2l_in_ga(A, D))
GOAL_IN_GAA(A, B, C) → S2L_IN_GA(A, D)
S2L_IN_GA(s(X), .(Y, Xs)) → U7_GA(X, Y, Xs, s2l_in_ga(X, Xs))
S2L_IN_GA(s(X), .(Y, Xs)) → S2L_IN_GA(X, Xs)
U1_GAA(A, B, C, s2l_out_ga(A, D)) → U2_GAA(A, B, C, applast_in_gaa(D, B, C))
U1_GAA(A, B, C, s2l_out_ga(A, D)) → APPLAST_IN_GAA(D, B, C)
APPLAST_IN_GAA(L, X, Last) → U3_GAA(L, X, Last, append_in_gga(L, .(X, []), LX))
APPLAST_IN_GAA(L, X, Last) → APPEND_IN_GGA(L, .(X, []), LX)
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → U6_GGA(H, L1, L2, L3, append_in_gga(L1, L2, L3))
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)
U3_GAA(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_GAA(L, X, Last, last_in_ag(Last, LX))
U3_GAA(L, X, Last, append_out_gga(L, .(X, []), LX)) → LAST_IN_AG(Last, LX)
LAST_IN_AG(X, .(H, T)) → U5_AG(X, H, T, last_in_ag(X, T))
LAST_IN_AG(X, .(H, T)) → LAST_IN_AG(X, T)

The TRS R consists of the following rules:

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag
U5_ag(x1, x2, x3, x4)  =  U5_ag(x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa
GOAL_IN_GAA(x1, x2, x3)  =  GOAL_IN_GAA(x1)
U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x4)
S2L_IN_GA(x1, x2)  =  S2L_IN_GA(x1)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x4)
U2_GAA(x1, x2, x3, x4)  =  U2_GAA(x4)
APPLAST_IN_GAA(x1, x2, x3)  =  APPLAST_IN_GAA(x1)
U3_GAA(x1, x2, x3, x4)  =  U3_GAA(x4)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x5)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x4)
LAST_IN_AG(x1, x2)  =  LAST_IN_AG(x2)
U5_AG(x1, x2, x3, x4)  =  U5_AG(x4)

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

(30) DependencyGraphProof (EQUIVALENT transformation)

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

(31) Complex Obligation (AND)

(32) Obligation:

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

LAST_IN_AG(X, .(H, T)) → LAST_IN_AG(X, T)

The TRS R consists of the following rules:

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag
U5_ag(x1, x2, x3, x4)  =  U5_ag(x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa
LAST_IN_AG(x1, x2)  =  LAST_IN_AG(x2)

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

(33) UsableRulesProof (EQUIVALENT transformation)

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

(34) Obligation:

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

LAST_IN_AG(X, .(H, T)) → LAST_IN_AG(X, T)

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

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

(35) PiDPToQDPProof (SOUND transformation)

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

(36) Obligation:

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

LAST_IN_AG(.(T)) → LAST_IN_AG(T)

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

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

  • LAST_IN_AG(.(T)) → LAST_IN_AG(T)
    The graph contains the following edges 1 > 1

(38) TRUE

(39) Obligation:

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

APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)

The TRS R consists of the following rules:

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag
U5_ag(x1, x2, x3, x4)  =  U5_ag(x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)

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

(40) UsableRulesProof (EQUIVALENT transformation)

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

(41) Obligation:

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

APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)

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

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

(42) PiDPToQDPProof (SOUND transformation)

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

(43) Obligation:

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

APPEND_IN_GGA(.(L1), L2) → APPEND_IN_GGA(L1, L2)

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

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

  • APPEND_IN_GGA(.(L1), L2) → APPEND_IN_GGA(L1, L2)
    The graph contains the following edges 1 > 1, 2 >= 2

(45) TRUE

(46) Obligation:

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

S2L_IN_GA(s(X), .(Y, Xs)) → S2L_IN_GA(X, Xs)

The TRS R consists of the following rules:

goal_in_gaa(A, B, C) → U1_gaa(A, B, C, s2l_in_ga(A, D))
s2l_in_ga(s(X), .(Y, Xs)) → U7_ga(X, Y, Xs, s2l_in_ga(X, Xs))
s2l_in_ga(0, []) → s2l_out_ga(0, [])
U7_ga(X, Y, Xs, s2l_out_ga(X, Xs)) → s2l_out_ga(s(X), .(Y, Xs))
U1_gaa(A, B, C, s2l_out_ga(A, D)) → U2_gaa(A, B, C, applast_in_gaa(D, B, C))
applast_in_gaa(L, X, Last) → U3_gaa(L, X, Last, append_in_gga(L, .(X, []), LX))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U6_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U6_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U3_gaa(L, X, Last, append_out_gga(L, .(X, []), LX)) → U4_gaa(L, X, Last, last_in_ag(Last, LX))
last_in_ag(X, .(X, [])) → last_out_ag(X, .(X, []))
last_in_ag(X, .(H, T)) → U5_ag(X, H, T, last_in_ag(X, T))
U5_ag(X, H, T, last_out_ag(X, T)) → last_out_ag(X, .(H, T))
U4_gaa(L, X, Last, last_out_ag(Last, LX)) → applast_out_gaa(L, X, Last)
U2_gaa(A, B, C, applast_out_gaa(D, B, C)) → goal_out_gaa(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in_gaa(x1, x2, x3)  =  goal_in_gaa(x1)
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
s2l_in_ga(x1, x2)  =  s2l_in_ga(x1)
s(x1)  =  s(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x4)
0  =  0
s2l_out_ga(x1, x2)  =  s2l_out_ga(x2)
.(x1, x2)  =  .(x2)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
applast_in_gaa(x1, x2, x3)  =  applast_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x5)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
last_in_ag(x1, x2)  =  last_in_ag(x2)
last_out_ag(x1, x2)  =  last_out_ag
U5_ag(x1, x2, x3, x4)  =  U5_ag(x4)
applast_out_gaa(x1, x2, x3)  =  applast_out_gaa
goal_out_gaa(x1, x2, x3)  =  goal_out_gaa
S2L_IN_GA(x1, x2)  =  S2L_IN_GA(x1)

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:

S2L_IN_GA(s(X), .(Y, Xs)) → S2L_IN_GA(X, Xs)

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

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

(49) PiDPToQDPProof (SOUND 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:

S2L_IN_GA(s(X)) → S2L_IN_GA(X)

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:

  • S2L_IN_GA(s(X)) → S2L_IN_GA(X)
    The graph contains the following edges 1 > 1

(52) TRUE