YES
proof of /hpcwork/ff862203/termcomp26/benchmarks/kYuMr.pl
# AProVE Commit ID: 23a904c96b029b0a549cde0d0d17dbccf967db59 jckassing 20260626 unpublished dirty


Left Termination of the query pattern

goal(g,a,a)

w.r.t. the given Prolog program could successfully be proven:

(0) Prolog
(1) PrologToPiTRSProof [SOUND, 0 ms]
(2) PiTRS
(3) DependencyPairsProof [EQUIVALENT, 0 ms]
(4) PiDP
(5) DependencyGraphProof [EQUIVALENT, 0 ms]
(6) AND
    (7) PiDP
        (8) UsableRulesProof [EQUIVALENT, 0 ms]
        (9) PiDP
        (10) PiDPToQDPProof [SOUND, 0 ms]
        (11) QDP
        (12) QDPSizeChangeProof [EQUIVALENT, 0 ms]
        (13) YES
    (14) PiDP
        (15) UsableRulesProof [EQUIVALENT, 0 ms]
        (16) PiDP
        (17) PiDPToQDPProof [SOUND, 0 ms]
        (18) QDP
        (19) QDPSizeChangeProof [EQUIVALENT, 0 ms]
        (20) YES
    (21) PiDP
        (22) UsableRulesProof [EQUIVALENT, 0 ms]
        (23) PiDP
        (24) PiDPToQDPProof [SOUND, 0 ms]
        (25) QDP
        (26) QDPSizeChangeProof [EQUIVALENT, 0 ms]
        (27) YES


----------------------------------------

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


Query: goal(g,a,a)
----------------------------------------

(1) PrologToPiTRSProof (SOUND)
We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:

goal_in_3: (b,f,f)

s2l_in_2: (b,f)

applast_in_3: (b,f,f)

append_in_3: (b,b,f)

last_in_2: (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)
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)
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)
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)
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)
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)
YES

----------------------------------------

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

----------------------------------------

(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)
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)
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) QDPSizeChangeProof (EQUIVALENT)
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


----------------------------------------

(27)
YES
