(0) Obligation:

Clauses:

less(0, s(0)).
less(s(X), s(Y)) :- less(X, Y).
less(X, s(Y)) :- less(X, Y).
add(0, 0, 0).
add(s(X), Y, s(N)) :- add(X, Y, N).
add(X, s(Y), s(N)) :- add(X, Y, N).
f(X, N) :- ','(less(s(s(0)), X), add(N, s(0), X)).
f(X, N) :- ','(less(X, s(s(s(0)))), ','(add(X, s(s(0)), S), ','(f(S, N1), f(N1, N)))).

Queries:

f(g,a).

(1) PrologToPiTRSProof (SOUND transformation)

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

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
U2_gg(x1, x2, x3)  =  U2_gg(x1, x2, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1, x2, x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x2, x3, x4)
f_out_ga(x1, x2)  =  f_out_ga(x1, x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
U9_ga(x1, x2, x3)  =  U9_ga(x1, x3)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

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

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
U2_gg(x1, x2, x3)  =  U2_gg(x1, x2, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1, x2, x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x2, x3, x4)
f_out_ga(x1, x2)  =  f_out_ga(x1, x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
U9_ga(x1, x2, x3)  =  U9_ga(x1, x3)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)

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

F_IN_GA(X, N) → U5_GA(X, N, less_in_gg(s(s(0)), X))
F_IN_GA(X, N) → LESS_IN_GG(s(s(0)), X)
LESS_IN_GG(s(X), s(Y)) → U1_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(X, s(Y)) → U2_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(X, s(Y)) → LESS_IN_GG(X, Y)
U5_GA(X, N, less_out_gg(s(s(0)), X)) → U6_GA(X, N, add_in_agg(N, s(0), X))
U5_GA(X, N, less_out_gg(s(s(0)), X)) → ADD_IN_AGG(N, s(0), X)
ADD_IN_AGG(s(X), Y, s(N)) → U3_AGG(X, Y, N, add_in_agg(X, Y, N))
ADD_IN_AGG(s(X), Y, s(N)) → ADD_IN_AGG(X, Y, N)
ADD_IN_AGG(X, s(Y), s(N)) → U4_AGG(X, Y, N, add_in_agg(X, Y, N))
ADD_IN_AGG(X, s(Y), s(N)) → ADD_IN_AGG(X, Y, N)
F_IN_GA(X, N) → U7_GA(X, N, less_in_gg(X, s(s(s(0)))))
F_IN_GA(X, N) → LESS_IN_GG(X, s(s(s(0))))
U7_GA(X, N, less_out_gg(X, s(s(s(0))))) → U8_GA(X, N, add_in_gga(X, s(s(0)), S))
U7_GA(X, N, less_out_gg(X, s(s(s(0))))) → ADD_IN_GGA(X, s(s(0)), S)
ADD_IN_GGA(s(X), Y, s(N)) → U3_GGA(X, Y, N, add_in_gga(X, Y, N))
ADD_IN_GGA(s(X), Y, s(N)) → ADD_IN_GGA(X, Y, N)
ADD_IN_GGA(X, s(Y), s(N)) → U4_GGA(X, Y, N, add_in_gga(X, Y, N))
ADD_IN_GGA(X, s(Y), s(N)) → ADD_IN_GGA(X, Y, N)
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → U9_GA(X, N, f_in_ga(S, N1))
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → F_IN_GA(S, N1)
U9_GA(X, N, f_out_ga(S, N1)) → U10_GA(X, N, f_in_ga(N1, N))
U9_GA(X, N, f_out_ga(S, N1)) → F_IN_GA(N1, N)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
U2_gg(x1, x2, x3)  =  U2_gg(x1, x2, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1, x2, x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x2, x3, x4)
f_out_ga(x1, x2)  =  f_out_ga(x1, x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
U9_ga(x1, x2, x3)  =  U9_ga(x1, x3)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
F_IN_GA(x1, x2)  =  F_IN_GA(x1)
U5_GA(x1, x2, x3)  =  U5_GA(x1, x3)
LESS_IN_GG(x1, x2)  =  LESS_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x2, x3)
U2_GG(x1, x2, x3)  =  U2_GG(x1, x2, x3)
U6_GA(x1, x2, x3)  =  U6_GA(x1, x3)
ADD_IN_AGG(x1, x2, x3)  =  ADD_IN_AGG(x2, x3)
U3_AGG(x1, x2, x3, x4)  =  U3_AGG(x2, x3, x4)
U4_AGG(x1, x2, x3, x4)  =  U4_AGG(x2, x3, x4)
U7_GA(x1, x2, x3)  =  U7_GA(x1, x3)
U8_GA(x1, x2, x3)  =  U8_GA(x1, x3)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U9_GA(x1, x2, x3)  =  U9_GA(x1, x3)
U10_GA(x1, x2, x3)  =  U10_GA(x1, x3)

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

(4) Obligation:

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

F_IN_GA(X, N) → U5_GA(X, N, less_in_gg(s(s(0)), X))
F_IN_GA(X, N) → LESS_IN_GG(s(s(0)), X)
LESS_IN_GG(s(X), s(Y)) → U1_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(X, s(Y)) → U2_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(X, s(Y)) → LESS_IN_GG(X, Y)
U5_GA(X, N, less_out_gg(s(s(0)), X)) → U6_GA(X, N, add_in_agg(N, s(0), X))
U5_GA(X, N, less_out_gg(s(s(0)), X)) → ADD_IN_AGG(N, s(0), X)
ADD_IN_AGG(s(X), Y, s(N)) → U3_AGG(X, Y, N, add_in_agg(X, Y, N))
ADD_IN_AGG(s(X), Y, s(N)) → ADD_IN_AGG(X, Y, N)
ADD_IN_AGG(X, s(Y), s(N)) → U4_AGG(X, Y, N, add_in_agg(X, Y, N))
ADD_IN_AGG(X, s(Y), s(N)) → ADD_IN_AGG(X, Y, N)
F_IN_GA(X, N) → U7_GA(X, N, less_in_gg(X, s(s(s(0)))))
F_IN_GA(X, N) → LESS_IN_GG(X, s(s(s(0))))
U7_GA(X, N, less_out_gg(X, s(s(s(0))))) → U8_GA(X, N, add_in_gga(X, s(s(0)), S))
U7_GA(X, N, less_out_gg(X, s(s(s(0))))) → ADD_IN_GGA(X, s(s(0)), S)
ADD_IN_GGA(s(X), Y, s(N)) → U3_GGA(X, Y, N, add_in_gga(X, Y, N))
ADD_IN_GGA(s(X), Y, s(N)) → ADD_IN_GGA(X, Y, N)
ADD_IN_GGA(X, s(Y), s(N)) → U4_GGA(X, Y, N, add_in_gga(X, Y, N))
ADD_IN_GGA(X, s(Y), s(N)) → ADD_IN_GGA(X, Y, N)
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → U9_GA(X, N, f_in_ga(S, N1))
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → F_IN_GA(S, N1)
U9_GA(X, N, f_out_ga(S, N1)) → U10_GA(X, N, f_in_ga(N1, N))
U9_GA(X, N, f_out_ga(S, N1)) → F_IN_GA(N1, N)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
U2_gg(x1, x2, x3)  =  U2_gg(x1, x2, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1, x2, x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x2, x3, x4)
f_out_ga(x1, x2)  =  f_out_ga(x1, x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
U9_ga(x1, x2, x3)  =  U9_ga(x1, x3)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
F_IN_GA(x1, x2)  =  F_IN_GA(x1)
U5_GA(x1, x2, x3)  =  U5_GA(x1, x3)
LESS_IN_GG(x1, x2)  =  LESS_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x2, x3)
U2_GG(x1, x2, x3)  =  U2_GG(x1, x2, x3)
U6_GA(x1, x2, x3)  =  U6_GA(x1, x3)
ADD_IN_AGG(x1, x2, x3)  =  ADD_IN_AGG(x2, x3)
U3_AGG(x1, x2, x3, x4)  =  U3_AGG(x2, x3, x4)
U4_AGG(x1, x2, x3, x4)  =  U4_AGG(x2, x3, x4)
U7_GA(x1, x2, x3)  =  U7_GA(x1, x3)
U8_GA(x1, x2, x3)  =  U8_GA(x1, x3)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U9_GA(x1, x2, x3)  =  U9_GA(x1, x3)
U10_GA(x1, x2, x3)  =  U10_GA(x1, x3)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 4 SCCs with 13 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

ADD_IN_GGA(X, s(Y), s(N)) → ADD_IN_GGA(X, Y, N)
ADD_IN_GGA(s(X), Y, s(N)) → ADD_IN_GGA(X, Y, N)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
U2_gg(x1, x2, x3)  =  U2_gg(x1, x2, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1, x2, x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x2, x3, x4)
f_out_ga(x1, x2)  =  f_out_ga(x1, x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
U9_ga(x1, x2, x3)  =  U9_ga(x1, x3)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(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:

ADD_IN_GGA(X, s(Y), s(N)) → ADD_IN_GGA(X, Y, N)
ADD_IN_GGA(s(X), Y, s(N)) → ADD_IN_GGA(X, Y, N)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, 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:

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

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

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

ADD_IN_AGG(X, s(Y), s(N)) → ADD_IN_AGG(X, Y, N)
ADD_IN_AGG(s(X), Y, s(N)) → ADD_IN_AGG(X, Y, N)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
U2_gg(x1, x2, x3)  =  U2_gg(x1, x2, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1, x2, x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x2, x3, x4)
f_out_ga(x1, x2)  =  f_out_ga(x1, x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
U9_ga(x1, x2, x3)  =  U9_ga(x1, x3)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
ADD_IN_AGG(x1, x2, x3)  =  ADD_IN_AGG(x2, x3)

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:

ADD_IN_AGG(X, s(Y), s(N)) → ADD_IN_AGG(X, Y, N)
ADD_IN_AGG(s(X), Y, s(N)) → ADD_IN_AGG(X, Y, N)

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

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:

ADD_IN_AGG(s(Y), s(N)) → ADD_IN_AGG(Y, N)
ADD_IN_AGG(Y, s(N)) → ADD_IN_AGG(Y, N)

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:

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

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

LESS_IN_GG(X, s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
U2_gg(x1, x2, x3)  =  U2_gg(x1, x2, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1, x2, x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x2, x3, x4)
f_out_ga(x1, x2)  =  f_out_ga(x1, x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
U9_ga(x1, x2, x3)  =  U9_ga(x1, x3)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
LESS_IN_GG(x1, x2)  =  LESS_IN_GG(x1, x2)

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:

LESS_IN_GG(X, s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)

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

(24) PiDPToQDPProof (EQUIVALENT 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:

LESS_IN_GG(X, s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)

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

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

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

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

(27) TRUE

(28) Obligation:

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

F_IN_GA(X, N) → U7_GA(X, N, less_in_gg(X, s(s(s(0)))))
U7_GA(X, N, less_out_gg(X, s(s(s(0))))) → U8_GA(X, N, add_in_gga(X, s(s(0)), S))
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → U9_GA(X, N, f_in_ga(S, N1))
U9_GA(X, N, f_out_ga(S, N1)) → F_IN_GA(N1, N)
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → F_IN_GA(S, N1)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
U2_gg(x1, x2, x3)  =  U2_gg(x1, x2, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1, x2, x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x2, x3, x4)
f_out_ga(x1, x2)  =  f_out_ga(x1, x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
U9_ga(x1, x2, x3)  =  U9_ga(x1, x3)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
F_IN_GA(x1, x2)  =  F_IN_GA(x1)
U7_GA(x1, x2, x3)  =  U7_GA(x1, x3)
U8_GA(x1, x2, x3)  =  U8_GA(x1, x3)
U9_GA(x1, x2, x3)  =  U9_GA(x1, x3)

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

(29) PiDPToQDPProof (SOUND transformation)

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

(30) Obligation:

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

F_IN_GA(X) → U7_GA(X, less_in_gg(X, s(s(s(0)))))
U7_GA(X, less_out_gg(X, s(s(s(0))))) → U8_GA(X, add_in_gga(X, s(s(0))))
U8_GA(X, add_out_gga(X, s(s(0)), S)) → U9_GA(X, f_in_ga(S))
U9_GA(X, f_out_ga(S, N1)) → F_IN_GA(N1)
U8_GA(X, add_out_gga(X, s(s(0)), S)) → F_IN_GA(S)

The TRS R consists of the following rules:

f_in_ga(X) → U5_ga(X, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, less_out_gg(s(s(0)), X)) → U6_ga(X, add_in_agg(s(0), X))
add_in_agg(0, 0) → add_out_agg(0, 0, 0)
add_in_agg(Y, s(N)) → U3_agg(Y, N, add_in_agg(Y, N))
add_in_agg(s(Y), s(N)) → U4_agg(Y, N, add_in_agg(Y, N))
U4_agg(Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X) → U7_ga(X, less_in_gg(X, s(s(s(0)))))
U7_ga(X, less_out_gg(X, s(s(s(0))))) → U8_ga(X, add_in_gga(X, s(s(0))))
add_in_gga(0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y) → U3_gga(X, Y, add_in_gga(X, Y))
add_in_gga(X, s(Y)) → U4_gga(X, Y, add_in_gga(X, Y))
U4_gga(X, Y, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, add_out_gga(X, s(s(0)), S)) → U9_ga(X, f_in_ga(S))
U9_ga(X, f_out_ga(S, N1)) → U10_ga(X, f_in_ga(N1))
U10_ga(X, f_out_ga(N1, N)) → f_out_ga(X, N)

The set Q consists of the following terms:

f_in_ga(x0)
less_in_gg(x0, x1)
U2_gg(x0, x1, x2)
U1_gg(x0, x1, x2)
U5_ga(x0, x1)
add_in_agg(x0, x1)
U4_agg(x0, x1, x2)
U3_agg(x0, x1, x2)
U6_ga(x0, x1)
U7_ga(x0, x1)
add_in_gga(x0, x1)
U4_gga(x0, x1, x2)
U3_gga(x0, x1, x2)
U8_ga(x0, x1)
U9_ga(x0, x1)
U10_ga(x0, x1)

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

(31) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule F_IN_GA(X) → U7_GA(X, less_in_gg(X, s(s(s(0))))) at position [1] we obtained the following new rules [LPAR04]:

F_IN_GA(s(x0)) → U7_GA(s(x0), U1_gg(x0, s(s(0)), less_in_gg(x0, s(s(0)))))
F_IN_GA(x0) → U7_GA(x0, U2_gg(x0, s(s(0)), less_in_gg(x0, s(s(0)))))

(32) Obligation:

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

U7_GA(X, less_out_gg(X, s(s(s(0))))) → U8_GA(X, add_in_gga(X, s(s(0))))
U8_GA(X, add_out_gga(X, s(s(0)), S)) → U9_GA(X, f_in_ga(S))
U9_GA(X, f_out_ga(S, N1)) → F_IN_GA(N1)
U8_GA(X, add_out_gga(X, s(s(0)), S)) → F_IN_GA(S)
F_IN_GA(s(x0)) → U7_GA(s(x0), U1_gg(x0, s(s(0)), less_in_gg(x0, s(s(0)))))
F_IN_GA(x0) → U7_GA(x0, U2_gg(x0, s(s(0)), less_in_gg(x0, s(s(0)))))

The TRS R consists of the following rules:

f_in_ga(X) → U5_ga(X, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, less_out_gg(s(s(0)), X)) → U6_ga(X, add_in_agg(s(0), X))
add_in_agg(0, 0) → add_out_agg(0, 0, 0)
add_in_agg(Y, s(N)) → U3_agg(Y, N, add_in_agg(Y, N))
add_in_agg(s(Y), s(N)) → U4_agg(Y, N, add_in_agg(Y, N))
U4_agg(Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X) → U7_ga(X, less_in_gg(X, s(s(s(0)))))
U7_ga(X, less_out_gg(X, s(s(s(0))))) → U8_ga(X, add_in_gga(X, s(s(0))))
add_in_gga(0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y) → U3_gga(X, Y, add_in_gga(X, Y))
add_in_gga(X, s(Y)) → U4_gga(X, Y, add_in_gga(X, Y))
U4_gga(X, Y, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, add_out_gga(X, s(s(0)), S)) → U9_ga(X, f_in_ga(S))
U9_ga(X, f_out_ga(S, N1)) → U10_ga(X, f_in_ga(N1))
U10_ga(X, f_out_ga(N1, N)) → f_out_ga(X, N)

The set Q consists of the following terms:

f_in_ga(x0)
less_in_gg(x0, x1)
U2_gg(x0, x1, x2)
U1_gg(x0, x1, x2)
U5_ga(x0, x1)
add_in_agg(x0, x1)
U4_agg(x0, x1, x2)
U3_agg(x0, x1, x2)
U6_ga(x0, x1)
U7_ga(x0, x1)
add_in_gga(x0, x1)
U4_gga(x0, x1, x2)
U3_gga(x0, x1, x2)
U8_ga(x0, x1)
U9_ga(x0, x1)
U10_ga(x0, x1)

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

(33) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule U7_GA(X, less_out_gg(X, s(s(s(0))))) → U8_GA(X, add_in_gga(X, s(s(0)))) at position [1] we obtained the following new rules [LPAR04]:

U7_GA(s(x0), less_out_gg(s(x0), s(s(s(0))))) → U8_GA(s(x0), U3_gga(x0, s(s(0)), add_in_gga(x0, s(s(0)))))
U7_GA(x0, less_out_gg(x0, s(s(s(0))))) → U8_GA(x0, U4_gga(x0, s(0), add_in_gga(x0, s(0))))

(34) Obligation:

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

U8_GA(X, add_out_gga(X, s(s(0)), S)) → U9_GA(X, f_in_ga(S))
U9_GA(X, f_out_ga(S, N1)) → F_IN_GA(N1)
U8_GA(X, add_out_gga(X, s(s(0)), S)) → F_IN_GA(S)
F_IN_GA(s(x0)) → U7_GA(s(x0), U1_gg(x0, s(s(0)), less_in_gg(x0, s(s(0)))))
F_IN_GA(x0) → U7_GA(x0, U2_gg(x0, s(s(0)), less_in_gg(x0, s(s(0)))))
U7_GA(s(x0), less_out_gg(s(x0), s(s(s(0))))) → U8_GA(s(x0), U3_gga(x0, s(s(0)), add_in_gga(x0, s(s(0)))))
U7_GA(x0, less_out_gg(x0, s(s(s(0))))) → U8_GA(x0, U4_gga(x0, s(0), add_in_gga(x0, s(0))))

The TRS R consists of the following rules:

f_in_ga(X) → U5_ga(X, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, less_out_gg(s(s(0)), X)) → U6_ga(X, add_in_agg(s(0), X))
add_in_agg(0, 0) → add_out_agg(0, 0, 0)
add_in_agg(Y, s(N)) → U3_agg(Y, N, add_in_agg(Y, N))
add_in_agg(s(Y), s(N)) → U4_agg(Y, N, add_in_agg(Y, N))
U4_agg(Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X) → U7_ga(X, less_in_gg(X, s(s(s(0)))))
U7_ga(X, less_out_gg(X, s(s(s(0))))) → U8_ga(X, add_in_gga(X, s(s(0))))
add_in_gga(0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y) → U3_gga(X, Y, add_in_gga(X, Y))
add_in_gga(X, s(Y)) → U4_gga(X, Y, add_in_gga(X, Y))
U4_gga(X, Y, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, add_out_gga(X, s(s(0)), S)) → U9_ga(X, f_in_ga(S))
U9_ga(X, f_out_ga(S, N1)) → U10_ga(X, f_in_ga(N1))
U10_ga(X, f_out_ga(N1, N)) → f_out_ga(X, N)

The set Q consists of the following terms:

f_in_ga(x0)
less_in_gg(x0, x1)
U2_gg(x0, x1, x2)
U1_gg(x0, x1, x2)
U5_ga(x0, x1)
add_in_agg(x0, x1)
U4_agg(x0, x1, x2)
U3_agg(x0, x1, x2)
U6_ga(x0, x1)
U7_ga(x0, x1)
add_in_gga(x0, x1)
U4_gga(x0, x1, x2)
U3_gga(x0, x1, x2)
U8_ga(x0, x1)
U9_ga(x0, x1)
U10_ga(x0, x1)

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

(35) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule U8_GA(X, add_out_gga(X, s(s(0)), S)) → U9_GA(X, f_in_ga(S)) at position [1] we obtained the following new rules [LPAR04]:

U8_GA(y0, add_out_gga(y0, s(s(0)), x0)) → U9_GA(y0, U5_ga(x0, less_in_gg(s(s(0)), x0)))
U8_GA(y0, add_out_gga(y0, s(s(0)), x0)) → U9_GA(y0, U7_ga(x0, less_in_gg(x0, s(s(s(0))))))

(36) Obligation:

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

U9_GA(X, f_out_ga(S, N1)) → F_IN_GA(N1)
U8_GA(X, add_out_gga(X, s(s(0)), S)) → F_IN_GA(S)
F_IN_GA(s(x0)) → U7_GA(s(x0), U1_gg(x0, s(s(0)), less_in_gg(x0, s(s(0)))))
F_IN_GA(x0) → U7_GA(x0, U2_gg(x0, s(s(0)), less_in_gg(x0, s(s(0)))))
U7_GA(s(x0), less_out_gg(s(x0), s(s(s(0))))) → U8_GA(s(x0), U3_gga(x0, s(s(0)), add_in_gga(x0, s(s(0)))))
U7_GA(x0, less_out_gg(x0, s(s(s(0))))) → U8_GA(x0, U4_gga(x0, s(0), add_in_gga(x0, s(0))))
U8_GA(y0, add_out_gga(y0, s(s(0)), x0)) → U9_GA(y0, U5_ga(x0, less_in_gg(s(s(0)), x0)))
U8_GA(y0, add_out_gga(y0, s(s(0)), x0)) → U9_GA(y0, U7_ga(x0, less_in_gg(x0, s(s(s(0))))))

The TRS R consists of the following rules:

f_in_ga(X) → U5_ga(X, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, less_out_gg(s(s(0)), X)) → U6_ga(X, add_in_agg(s(0), X))
add_in_agg(0, 0) → add_out_agg(0, 0, 0)
add_in_agg(Y, s(N)) → U3_agg(Y, N, add_in_agg(Y, N))
add_in_agg(s(Y), s(N)) → U4_agg(Y, N, add_in_agg(Y, N))
U4_agg(Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X) → U7_ga(X, less_in_gg(X, s(s(s(0)))))
U7_ga(X, less_out_gg(X, s(s(s(0))))) → U8_ga(X, add_in_gga(X, s(s(0))))
add_in_gga(0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y) → U3_gga(X, Y, add_in_gga(X, Y))
add_in_gga(X, s(Y)) → U4_gga(X, Y, add_in_gga(X, Y))
U4_gga(X, Y, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, add_out_gga(X, s(s(0)), S)) → U9_ga(X, f_in_ga(S))
U9_ga(X, f_out_ga(S, N1)) → U10_ga(X, f_in_ga(N1))
U10_ga(X, f_out_ga(N1, N)) → f_out_ga(X, N)

The set Q consists of the following terms:

f_in_ga(x0)
less_in_gg(x0, x1)
U2_gg(x0, x1, x2)
U1_gg(x0, x1, x2)
U5_ga(x0, x1)
add_in_agg(x0, x1)
U4_agg(x0, x1, x2)
U3_agg(x0, x1, x2)
U6_ga(x0, x1)
U7_ga(x0, x1)
add_in_gga(x0, x1)
U4_gga(x0, x1, x2)
U3_gga(x0, x1, x2)
U8_ga(x0, x1)
U9_ga(x0, x1)
U10_ga(x0, x1)

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

(37) PrologToPiTRSProof (SOUND transformation)

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

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U2_gg(x1, x2, x3)  =  U2_gg(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x4)
f_out_ga(x1, x2)  =  f_out_ga(x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U9_ga(x1, x2, x3)  =  U9_ga(x3)
U10_ga(x1, x2, x3)  =  U10_ga(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(38) Obligation:

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

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U2_gg(x1, x2, x3)  =  U2_gg(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x4)
f_out_ga(x1, x2)  =  f_out_ga(x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U9_ga(x1, x2, x3)  =  U9_ga(x3)
U10_ga(x1, x2, x3)  =  U10_ga(x3)

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

F_IN_GA(X, N) → U5_GA(X, N, less_in_gg(s(s(0)), X))
F_IN_GA(X, N) → LESS_IN_GG(s(s(0)), X)
LESS_IN_GG(s(X), s(Y)) → U1_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(X, s(Y)) → U2_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(X, s(Y)) → LESS_IN_GG(X, Y)
U5_GA(X, N, less_out_gg(s(s(0)), X)) → U6_GA(X, N, add_in_agg(N, s(0), X))
U5_GA(X, N, less_out_gg(s(s(0)), X)) → ADD_IN_AGG(N, s(0), X)
ADD_IN_AGG(s(X), Y, s(N)) → U3_AGG(X, Y, N, add_in_agg(X, Y, N))
ADD_IN_AGG(s(X), Y, s(N)) → ADD_IN_AGG(X, Y, N)
ADD_IN_AGG(X, s(Y), s(N)) → U4_AGG(X, Y, N, add_in_agg(X, Y, N))
ADD_IN_AGG(X, s(Y), s(N)) → ADD_IN_AGG(X, Y, N)
F_IN_GA(X, N) → U7_GA(X, N, less_in_gg(X, s(s(s(0)))))
F_IN_GA(X, N) → LESS_IN_GG(X, s(s(s(0))))
U7_GA(X, N, less_out_gg(X, s(s(s(0))))) → U8_GA(X, N, add_in_gga(X, s(s(0)), S))
U7_GA(X, N, less_out_gg(X, s(s(s(0))))) → ADD_IN_GGA(X, s(s(0)), S)
ADD_IN_GGA(s(X), Y, s(N)) → U3_GGA(X, Y, N, add_in_gga(X, Y, N))
ADD_IN_GGA(s(X), Y, s(N)) → ADD_IN_GGA(X, Y, N)
ADD_IN_GGA(X, s(Y), s(N)) → U4_GGA(X, Y, N, add_in_gga(X, Y, N))
ADD_IN_GGA(X, s(Y), s(N)) → ADD_IN_GGA(X, Y, N)
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → U9_GA(X, N, f_in_ga(S, N1))
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → F_IN_GA(S, N1)
U9_GA(X, N, f_out_ga(S, N1)) → U10_GA(X, N, f_in_ga(N1, N))
U9_GA(X, N, f_out_ga(S, N1)) → F_IN_GA(N1, N)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U2_gg(x1, x2, x3)  =  U2_gg(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x4)
f_out_ga(x1, x2)  =  f_out_ga(x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U9_ga(x1, x2, x3)  =  U9_ga(x3)
U10_ga(x1, x2, x3)  =  U10_ga(x3)
F_IN_GA(x1, x2)  =  F_IN_GA(x1)
U5_GA(x1, x2, x3)  =  U5_GA(x1, x3)
LESS_IN_GG(x1, x2)  =  LESS_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x3)
U2_GG(x1, x2, x3)  =  U2_GG(x3)
U6_GA(x1, x2, x3)  =  U6_GA(x3)
ADD_IN_AGG(x1, x2, x3)  =  ADD_IN_AGG(x2, x3)
U3_AGG(x1, x2, x3, x4)  =  U3_AGG(x4)
U4_AGG(x1, x2, x3, x4)  =  U4_AGG(x4)
U7_GA(x1, x2, x3)  =  U7_GA(x1, x3)
U8_GA(x1, x2, x3)  =  U8_GA(x3)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x4)
U9_GA(x1, x2, x3)  =  U9_GA(x3)
U10_GA(x1, x2, x3)  =  U10_GA(x3)

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

(40) Obligation:

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

F_IN_GA(X, N) → U5_GA(X, N, less_in_gg(s(s(0)), X))
F_IN_GA(X, N) → LESS_IN_GG(s(s(0)), X)
LESS_IN_GG(s(X), s(Y)) → U1_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(X, s(Y)) → U2_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(X, s(Y)) → LESS_IN_GG(X, Y)
U5_GA(X, N, less_out_gg(s(s(0)), X)) → U6_GA(X, N, add_in_agg(N, s(0), X))
U5_GA(X, N, less_out_gg(s(s(0)), X)) → ADD_IN_AGG(N, s(0), X)
ADD_IN_AGG(s(X), Y, s(N)) → U3_AGG(X, Y, N, add_in_agg(X, Y, N))
ADD_IN_AGG(s(X), Y, s(N)) → ADD_IN_AGG(X, Y, N)
ADD_IN_AGG(X, s(Y), s(N)) → U4_AGG(X, Y, N, add_in_agg(X, Y, N))
ADD_IN_AGG(X, s(Y), s(N)) → ADD_IN_AGG(X, Y, N)
F_IN_GA(X, N) → U7_GA(X, N, less_in_gg(X, s(s(s(0)))))
F_IN_GA(X, N) → LESS_IN_GG(X, s(s(s(0))))
U7_GA(X, N, less_out_gg(X, s(s(s(0))))) → U8_GA(X, N, add_in_gga(X, s(s(0)), S))
U7_GA(X, N, less_out_gg(X, s(s(s(0))))) → ADD_IN_GGA(X, s(s(0)), S)
ADD_IN_GGA(s(X), Y, s(N)) → U3_GGA(X, Y, N, add_in_gga(X, Y, N))
ADD_IN_GGA(s(X), Y, s(N)) → ADD_IN_GGA(X, Y, N)
ADD_IN_GGA(X, s(Y), s(N)) → U4_GGA(X, Y, N, add_in_gga(X, Y, N))
ADD_IN_GGA(X, s(Y), s(N)) → ADD_IN_GGA(X, Y, N)
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → U9_GA(X, N, f_in_ga(S, N1))
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → F_IN_GA(S, N1)
U9_GA(X, N, f_out_ga(S, N1)) → U10_GA(X, N, f_in_ga(N1, N))
U9_GA(X, N, f_out_ga(S, N1)) → F_IN_GA(N1, N)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U2_gg(x1, x2, x3)  =  U2_gg(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x4)
f_out_ga(x1, x2)  =  f_out_ga(x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U9_ga(x1, x2, x3)  =  U9_ga(x3)
U10_ga(x1, x2, x3)  =  U10_ga(x3)
F_IN_GA(x1, x2)  =  F_IN_GA(x1)
U5_GA(x1, x2, x3)  =  U5_GA(x1, x3)
LESS_IN_GG(x1, x2)  =  LESS_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x3)
U2_GG(x1, x2, x3)  =  U2_GG(x3)
U6_GA(x1, x2, x3)  =  U6_GA(x3)
ADD_IN_AGG(x1, x2, x3)  =  ADD_IN_AGG(x2, x3)
U3_AGG(x1, x2, x3, x4)  =  U3_AGG(x4)
U4_AGG(x1, x2, x3, x4)  =  U4_AGG(x4)
U7_GA(x1, x2, x3)  =  U7_GA(x1, x3)
U8_GA(x1, x2, x3)  =  U8_GA(x3)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x4)
U9_GA(x1, x2, x3)  =  U9_GA(x3)
U10_GA(x1, x2, x3)  =  U10_GA(x3)

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

(41) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 4 SCCs with 13 less nodes.

(42) Complex Obligation (AND)

(43) Obligation:

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

ADD_IN_GGA(X, s(Y), s(N)) → ADD_IN_GGA(X, Y, N)
ADD_IN_GGA(s(X), Y, s(N)) → ADD_IN_GGA(X, Y, N)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U2_gg(x1, x2, x3)  =  U2_gg(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x4)
f_out_ga(x1, x2)  =  f_out_ga(x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U9_ga(x1, x2, x3)  =  U9_ga(x3)
U10_ga(x1, x2, x3)  =  U10_ga(x3)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)

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

(44) UsableRulesProof (EQUIVALENT transformation)

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

(45) Obligation:

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

ADD_IN_GGA(X, s(Y), s(N)) → ADD_IN_GGA(X, Y, N)
ADD_IN_GGA(s(X), Y, s(N)) → ADD_IN_GGA(X, Y, N)

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

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

(46) PiDPToQDPProof (SOUND transformation)

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

(47) Obligation:

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

ADD_IN_GGA(X, s(Y)) → ADD_IN_GGA(X, Y)
ADD_IN_GGA(s(X), Y) → ADD_IN_GGA(X, Y)

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

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

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

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

(49) TRUE

(50) Obligation:

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

ADD_IN_AGG(X, s(Y), s(N)) → ADD_IN_AGG(X, Y, N)
ADD_IN_AGG(s(X), Y, s(N)) → ADD_IN_AGG(X, Y, N)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U2_gg(x1, x2, x3)  =  U2_gg(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x4)
f_out_ga(x1, x2)  =  f_out_ga(x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U9_ga(x1, x2, x3)  =  U9_ga(x3)
U10_ga(x1, x2, x3)  =  U10_ga(x3)
ADD_IN_AGG(x1, x2, x3)  =  ADD_IN_AGG(x2, x3)

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

(51) UsableRulesProof (EQUIVALENT transformation)

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

(52) Obligation:

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

ADD_IN_AGG(X, s(Y), s(N)) → ADD_IN_AGG(X, Y, N)
ADD_IN_AGG(s(X), Y, s(N)) → ADD_IN_AGG(X, Y, N)

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

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

(53) PiDPToQDPProof (SOUND transformation)

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

(54) Obligation:

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

ADD_IN_AGG(s(Y), s(N)) → ADD_IN_AGG(Y, N)
ADD_IN_AGG(Y, s(N)) → ADD_IN_AGG(Y, N)

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

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

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

  • ADD_IN_AGG(Y, s(N)) → ADD_IN_AGG(Y, N)
    The graph contains the following edges 1 >= 1, 2 > 2

(56) TRUE

(57) Obligation:

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

LESS_IN_GG(X, s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U2_gg(x1, x2, x3)  =  U2_gg(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x4)
f_out_ga(x1, x2)  =  f_out_ga(x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U9_ga(x1, x2, x3)  =  U9_ga(x3)
U10_ga(x1, x2, x3)  =  U10_ga(x3)
LESS_IN_GG(x1, x2)  =  LESS_IN_GG(x1, x2)

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

(58) UsableRulesProof (EQUIVALENT transformation)

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

(59) Obligation:

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

LESS_IN_GG(X, s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)

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

(60) PiDPToQDPProof (EQUIVALENT transformation)

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

(61) Obligation:

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

LESS_IN_GG(X, s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)

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

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

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

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

(63) TRUE

(64) Obligation:

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

F_IN_GA(X, N) → U7_GA(X, N, less_in_gg(X, s(s(s(0)))))
U7_GA(X, N, less_out_gg(X, s(s(s(0))))) → U8_GA(X, N, add_in_gga(X, s(s(0)), S))
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → U9_GA(X, N, f_in_ga(S, N1))
U9_GA(X, N, f_out_ga(S, N1)) → F_IN_GA(N1, N)
U8_GA(X, N, add_out_gga(X, s(s(0)), S)) → F_IN_GA(S, N1)

The TRS R consists of the following rules:

f_in_ga(X, N) → U5_ga(X, N, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg(0, s(0))
less_in_gg(s(X), s(Y)) → U1_gg(X, Y, less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(X, Y, less_in_gg(X, Y))
U2_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(X, s(Y))
U1_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U5_ga(X, N, less_out_gg(s(s(0)), X)) → U6_ga(X, N, add_in_agg(N, s(0), X))
add_in_agg(0, 0, 0) → add_out_agg(0, 0, 0)
add_in_agg(s(X), Y, s(N)) → U3_agg(X, Y, N, add_in_agg(X, Y, N))
add_in_agg(X, s(Y), s(N)) → U4_agg(X, Y, N, add_in_agg(X, Y, N))
U4_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(X, s(Y), s(N))
U3_agg(X, Y, N, add_out_agg(X, Y, N)) → add_out_agg(s(X), Y, s(N))
U6_ga(X, N, add_out_agg(N, s(0), X)) → f_out_ga(X, N)
f_in_ga(X, N) → U7_ga(X, N, less_in_gg(X, s(s(s(0)))))
U7_ga(X, N, less_out_gg(X, s(s(s(0))))) → U8_ga(X, N, add_in_gga(X, s(s(0)), S))
add_in_gga(0, 0, 0) → add_out_gga(0, 0, 0)
add_in_gga(s(X), Y, s(N)) → U3_gga(X, Y, N, add_in_gga(X, Y, N))
add_in_gga(X, s(Y), s(N)) → U4_gga(X, Y, N, add_in_gga(X, Y, N))
U4_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(X, s(Y), s(N))
U3_gga(X, Y, N, add_out_gga(X, Y, N)) → add_out_gga(s(X), Y, s(N))
U8_ga(X, N, add_out_gga(X, s(s(0)), S)) → U9_ga(X, N, f_in_ga(S, N1))
U9_ga(X, N, f_out_ga(S, N1)) → U10_ga(X, N, f_in_ga(N1, N))
U10_ga(X, N, f_out_ga(N1, N)) → f_out_ga(X, N)

The argument filtering Pi contains the following mapping:
f_in_ga(x1, x2)  =  f_in_ga(x1)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
less_in_gg(x1, x2)  =  less_in_gg(x1, x2)
0  =  0
s(x1)  =  s(x1)
less_out_gg(x1, x2)  =  less_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U2_gg(x1, x2, x3)  =  U2_gg(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x3)
add_in_agg(x1, x2, x3)  =  add_in_agg(x2, x3)
add_out_agg(x1, x2, x3)  =  add_out_agg(x1)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
U4_agg(x1, x2, x3, x4)  =  U4_agg(x4)
f_out_ga(x1, x2)  =  f_out_ga(x2)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U9_ga(x1, x2, x3)  =  U9_ga(x3)
U10_ga(x1, x2, x3)  =  U10_ga(x3)
F_IN_GA(x1, x2)  =  F_IN_GA(x1)
U7_GA(x1, x2, x3)  =  U7_GA(x1, x3)
U8_GA(x1, x2, x3)  =  U8_GA(x3)
U9_GA(x1, x2, x3)  =  U9_GA(x3)

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

(65) PiDPToQDPProof (SOUND transformation)

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

(66) Obligation:

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

F_IN_GA(X) → U7_GA(X, less_in_gg(X, s(s(s(0)))))
U7_GA(X, less_out_gg) → U8_GA(add_in_gga(X, s(s(0))))
U8_GA(add_out_gga(S)) → U9_GA(f_in_ga(S))
U9_GA(f_out_ga(N1)) → F_IN_GA(N1)
U8_GA(add_out_gga(S)) → F_IN_GA(S)

The TRS R consists of the following rules:

f_in_ga(X) → U5_ga(X, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg
less_in_gg(s(X), s(Y)) → U1_gg(less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(less_in_gg(X, Y))
U2_gg(less_out_gg) → less_out_gg
U1_gg(less_out_gg) → less_out_gg
U5_ga(X, less_out_gg) → U6_ga(add_in_agg(s(0), X))
add_in_agg(0, 0) → add_out_agg(0)
add_in_agg(Y, s(N)) → U3_agg(add_in_agg(Y, N))
add_in_agg(s(Y), s(N)) → U4_agg(add_in_agg(Y, N))
U4_agg(add_out_agg(X)) → add_out_agg(X)
U3_agg(add_out_agg(X)) → add_out_agg(s(X))
U6_ga(add_out_agg(N)) → f_out_ga(N)
f_in_ga(X) → U7_ga(X, less_in_gg(X, s(s(s(0)))))
U7_ga(X, less_out_gg) → U8_ga(add_in_gga(X, s(s(0))))
add_in_gga(0, 0) → add_out_gga(0)
add_in_gga(s(X), Y) → U3_gga(add_in_gga(X, Y))
add_in_gga(X, s(Y)) → U4_gga(add_in_gga(X, Y))
U4_gga(add_out_gga(N)) → add_out_gga(s(N))
U3_gga(add_out_gga(N)) → add_out_gga(s(N))
U8_ga(add_out_gga(S)) → U9_ga(f_in_ga(S))
U9_ga(f_out_ga(N1)) → U10_ga(f_in_ga(N1))
U10_ga(f_out_ga(N)) → f_out_ga(N)

The set Q consists of the following terms:

f_in_ga(x0)
less_in_gg(x0, x1)
U2_gg(x0)
U1_gg(x0)
U5_ga(x0, x1)
add_in_agg(x0, x1)
U4_agg(x0)
U3_agg(x0)
U6_ga(x0)
U7_ga(x0, x1)
add_in_gga(x0, x1)
U4_gga(x0)
U3_gga(x0)
U8_ga(x0)
U9_ga(x0)
U10_ga(x0)

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

(67) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule F_IN_GA(X) → U7_GA(X, less_in_gg(X, s(s(s(0))))) at position [1] we obtained the following new rules [LPAR04]:

F_IN_GA(s(x0)) → U7_GA(s(x0), U1_gg(less_in_gg(x0, s(s(0)))))
F_IN_GA(x0) → U7_GA(x0, U2_gg(less_in_gg(x0, s(s(0)))))

(68) Obligation:

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

U7_GA(X, less_out_gg) → U8_GA(add_in_gga(X, s(s(0))))
U8_GA(add_out_gga(S)) → U9_GA(f_in_ga(S))
U9_GA(f_out_ga(N1)) → F_IN_GA(N1)
U8_GA(add_out_gga(S)) → F_IN_GA(S)
F_IN_GA(s(x0)) → U7_GA(s(x0), U1_gg(less_in_gg(x0, s(s(0)))))
F_IN_GA(x0) → U7_GA(x0, U2_gg(less_in_gg(x0, s(s(0)))))

The TRS R consists of the following rules:

f_in_ga(X) → U5_ga(X, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg
less_in_gg(s(X), s(Y)) → U1_gg(less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(less_in_gg(X, Y))
U2_gg(less_out_gg) → less_out_gg
U1_gg(less_out_gg) → less_out_gg
U5_ga(X, less_out_gg) → U6_ga(add_in_agg(s(0), X))
add_in_agg(0, 0) → add_out_agg(0)
add_in_agg(Y, s(N)) → U3_agg(add_in_agg(Y, N))
add_in_agg(s(Y), s(N)) → U4_agg(add_in_agg(Y, N))
U4_agg(add_out_agg(X)) → add_out_agg(X)
U3_agg(add_out_agg(X)) → add_out_agg(s(X))
U6_ga(add_out_agg(N)) → f_out_ga(N)
f_in_ga(X) → U7_ga(X, less_in_gg(X, s(s(s(0)))))
U7_ga(X, less_out_gg) → U8_ga(add_in_gga(X, s(s(0))))
add_in_gga(0, 0) → add_out_gga(0)
add_in_gga(s(X), Y) → U3_gga(add_in_gga(X, Y))
add_in_gga(X, s(Y)) → U4_gga(add_in_gga(X, Y))
U4_gga(add_out_gga(N)) → add_out_gga(s(N))
U3_gga(add_out_gga(N)) → add_out_gga(s(N))
U8_ga(add_out_gga(S)) → U9_ga(f_in_ga(S))
U9_ga(f_out_ga(N1)) → U10_ga(f_in_ga(N1))
U10_ga(f_out_ga(N)) → f_out_ga(N)

The set Q consists of the following terms:

f_in_ga(x0)
less_in_gg(x0, x1)
U2_gg(x0)
U1_gg(x0)
U5_ga(x0, x1)
add_in_agg(x0, x1)
U4_agg(x0)
U3_agg(x0)
U6_ga(x0)
U7_ga(x0, x1)
add_in_gga(x0, x1)
U4_gga(x0)
U3_gga(x0)
U8_ga(x0)
U9_ga(x0)
U10_ga(x0)

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

(69) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule U7_GA(X, less_out_gg) → U8_GA(add_in_gga(X, s(s(0)))) at position [0] we obtained the following new rules [LPAR04]:

U7_GA(s(x0), less_out_gg) → U8_GA(U3_gga(add_in_gga(x0, s(s(0)))))
U7_GA(x0, less_out_gg) → U8_GA(U4_gga(add_in_gga(x0, s(0))))

(70) Obligation:

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

U8_GA(add_out_gga(S)) → U9_GA(f_in_ga(S))
U9_GA(f_out_ga(N1)) → F_IN_GA(N1)
U8_GA(add_out_gga(S)) → F_IN_GA(S)
F_IN_GA(s(x0)) → U7_GA(s(x0), U1_gg(less_in_gg(x0, s(s(0)))))
F_IN_GA(x0) → U7_GA(x0, U2_gg(less_in_gg(x0, s(s(0)))))
U7_GA(s(x0), less_out_gg) → U8_GA(U3_gga(add_in_gga(x0, s(s(0)))))
U7_GA(x0, less_out_gg) → U8_GA(U4_gga(add_in_gga(x0, s(0))))

The TRS R consists of the following rules:

f_in_ga(X) → U5_ga(X, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg
less_in_gg(s(X), s(Y)) → U1_gg(less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(less_in_gg(X, Y))
U2_gg(less_out_gg) → less_out_gg
U1_gg(less_out_gg) → less_out_gg
U5_ga(X, less_out_gg) → U6_ga(add_in_agg(s(0), X))
add_in_agg(0, 0) → add_out_agg(0)
add_in_agg(Y, s(N)) → U3_agg(add_in_agg(Y, N))
add_in_agg(s(Y), s(N)) → U4_agg(add_in_agg(Y, N))
U4_agg(add_out_agg(X)) → add_out_agg(X)
U3_agg(add_out_agg(X)) → add_out_agg(s(X))
U6_ga(add_out_agg(N)) → f_out_ga(N)
f_in_ga(X) → U7_ga(X, less_in_gg(X, s(s(s(0)))))
U7_ga(X, less_out_gg) → U8_ga(add_in_gga(X, s(s(0))))
add_in_gga(0, 0) → add_out_gga(0)
add_in_gga(s(X), Y) → U3_gga(add_in_gga(X, Y))
add_in_gga(X, s(Y)) → U4_gga(add_in_gga(X, Y))
U4_gga(add_out_gga(N)) → add_out_gga(s(N))
U3_gga(add_out_gga(N)) → add_out_gga(s(N))
U8_ga(add_out_gga(S)) → U9_ga(f_in_ga(S))
U9_ga(f_out_ga(N1)) → U10_ga(f_in_ga(N1))
U10_ga(f_out_ga(N)) → f_out_ga(N)

The set Q consists of the following terms:

f_in_ga(x0)
less_in_gg(x0, x1)
U2_gg(x0)
U1_gg(x0)
U5_ga(x0, x1)
add_in_agg(x0, x1)
U4_agg(x0)
U3_agg(x0)
U6_ga(x0)
U7_ga(x0, x1)
add_in_gga(x0, x1)
U4_gga(x0)
U3_gga(x0)
U8_ga(x0)
U9_ga(x0)
U10_ga(x0)

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

(71) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule U8_GA(add_out_gga(S)) → U9_GA(f_in_ga(S)) at position [0] we obtained the following new rules [LPAR04]:

U8_GA(add_out_gga(x0)) → U9_GA(U5_ga(x0, less_in_gg(s(s(0)), x0)))
U8_GA(add_out_gga(x0)) → U9_GA(U7_ga(x0, less_in_gg(x0, s(s(s(0))))))

(72) Obligation:

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

U9_GA(f_out_ga(N1)) → F_IN_GA(N1)
U8_GA(add_out_gga(S)) → F_IN_GA(S)
F_IN_GA(s(x0)) → U7_GA(s(x0), U1_gg(less_in_gg(x0, s(s(0)))))
F_IN_GA(x0) → U7_GA(x0, U2_gg(less_in_gg(x0, s(s(0)))))
U7_GA(s(x0), less_out_gg) → U8_GA(U3_gga(add_in_gga(x0, s(s(0)))))
U7_GA(x0, less_out_gg) → U8_GA(U4_gga(add_in_gga(x0, s(0))))
U8_GA(add_out_gga(x0)) → U9_GA(U5_ga(x0, less_in_gg(s(s(0)), x0)))
U8_GA(add_out_gga(x0)) → U9_GA(U7_ga(x0, less_in_gg(x0, s(s(s(0))))))

The TRS R consists of the following rules:

f_in_ga(X) → U5_ga(X, less_in_gg(s(s(0)), X))
less_in_gg(0, s(0)) → less_out_gg
less_in_gg(s(X), s(Y)) → U1_gg(less_in_gg(X, Y))
less_in_gg(X, s(Y)) → U2_gg(less_in_gg(X, Y))
U2_gg(less_out_gg) → less_out_gg
U1_gg(less_out_gg) → less_out_gg
U5_ga(X, less_out_gg) → U6_ga(add_in_agg(s(0), X))
add_in_agg(0, 0) → add_out_agg(0)
add_in_agg(Y, s(N)) → U3_agg(add_in_agg(Y, N))
add_in_agg(s(Y), s(N)) → U4_agg(add_in_agg(Y, N))
U4_agg(add_out_agg(X)) → add_out_agg(X)
U3_agg(add_out_agg(X)) → add_out_agg(s(X))
U6_ga(add_out_agg(N)) → f_out_ga(N)
f_in_ga(X) → U7_ga(X, less_in_gg(X, s(s(s(0)))))
U7_ga(X, less_out_gg) → U8_ga(add_in_gga(X, s(s(0))))
add_in_gga(0, 0) → add_out_gga(0)
add_in_gga(s(X), Y) → U3_gga(add_in_gga(X, Y))
add_in_gga(X, s(Y)) → U4_gga(add_in_gga(X, Y))
U4_gga(add_out_gga(N)) → add_out_gga(s(N))
U3_gga(add_out_gga(N)) → add_out_gga(s(N))
U8_ga(add_out_gga(S)) → U9_ga(f_in_ga(S))
U9_ga(f_out_ga(N1)) → U10_ga(f_in_ga(N1))
U10_ga(f_out_ga(N)) → f_out_ga(N)

The set Q consists of the following terms:

f_in_ga(x0)
less_in_gg(x0, x1)
U2_gg(x0)
U1_gg(x0)
U5_ga(x0, x1)
add_in_agg(x0, x1)
U4_agg(x0)
U3_agg(x0)
U6_ga(x0)
U7_ga(x0, x1)
add_in_gga(x0, x1)
U4_gga(x0)
U3_gga(x0)
U8_ga(x0)
U9_ga(x0)
U10_ga(x0)

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