(0) Obligation:

Clauses:

rem(X, Y, R) :- ','(notZero(Y), ','(sub(X, Y, Z), rem(Z, Y, R))).
rem(X, Y, X) :- ','(notZero(Y), geq(X, Y)).
sub(s(X), s(Y), Z) :- sub(X, Y, Z).
sub(X, 0, X).
notZero(s(X)).
geq(s(X), s(Y)) :- geq(X, Y).
geq(X, 0).

Queries:

rem(g,a,g).

(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:
rem_in: (b,f,b) (b,b,b)
sub_in: (b,f,f) (b,b,f)
geq_in: (b,b) (b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x2, x3, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g(x1)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x1, x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x1, x2, x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x1, x2, x3, x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x1, x2, x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
geq_out_gg(x1, x2)  =  geq_out_gg(x1, x2)
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg(x1, x2, x3)
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x1, x2, x3)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x1, x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x1, x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

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

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x2, x3, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g(x1)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x1, x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x1, x2, x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x1, x2, x3, x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x1, x2, x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
geq_out_gg(x1, x2)  =  geq_out_gg(x1, x2)
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg(x1, x2, x3)
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x1, x2, x3)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x1, x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x1, x2)

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

REM_IN_GAG(X, Y, R) → U1_GAG(X, Y, R, notZero_in_a(Y))
REM_IN_GAG(X, Y, R) → NOTZERO_IN_A(Y)
U1_GAG(X, Y, R, notZero_out_a(Y)) → U2_GAG(X, Y, R, sub_in_gaa(X, Y, Z))
U1_GAG(X, Y, R, notZero_out_a(Y)) → SUB_IN_GAA(X, Y, Z)
SUB_IN_GAA(s(X), s(Y), Z) → U6_GAA(X, Y, Z, sub_in_gaa(X, Y, Z))
SUB_IN_GAA(s(X), s(Y), Z) → SUB_IN_GAA(X, Y, Z)
U2_GAG(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_GAG(X, Y, R, rem_in_ggg(Z, Y, R))
U2_GAG(X, Y, R, sub_out_gaa(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, R) → U1_GGG(X, Y, R, notZero_in_g(Y))
REM_IN_GGG(X, Y, R) → NOTZERO_IN_G(Y)
U1_GGG(X, Y, R, notZero_out_g(Y)) → U2_GGG(X, Y, R, sub_in_gga(X, Y, Z))
U1_GGG(X, Y, R, notZero_out_g(Y)) → SUB_IN_GGA(X, Y, Z)
SUB_IN_GGA(s(X), s(Y), Z) → U6_GGA(X, Y, Z, sub_in_gga(X, Y, Z))
SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → U3_GGG(X, Y, R, rem_in_ggg(Z, Y, R))
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, X) → U4_GGG(X, Y, notZero_in_g(Y))
REM_IN_GGG(X, Y, X) → NOTZERO_IN_G(Y)
U4_GGG(X, Y, notZero_out_g(Y)) → U5_GGG(X, Y, geq_in_gg(X, Y))
U4_GGG(X, Y, notZero_out_g(Y)) → GEQ_IN_GG(X, Y)
GEQ_IN_GG(s(X), s(Y)) → U7_GG(X, Y, geq_in_gg(X, Y))
GEQ_IN_GG(s(X), s(Y)) → GEQ_IN_GG(X, Y)
REM_IN_GAG(X, Y, X) → U4_GAG(X, Y, notZero_in_a(Y))
REM_IN_GAG(X, Y, X) → NOTZERO_IN_A(Y)
U4_GAG(X, Y, notZero_out_a(Y)) → U5_GAG(X, Y, geq_in_ga(X, Y))
U4_GAG(X, Y, notZero_out_a(Y)) → GEQ_IN_GA(X, Y)
GEQ_IN_GA(s(X), s(Y)) → U7_GA(X, Y, geq_in_ga(X, Y))
GEQ_IN_GA(s(X), s(Y)) → GEQ_IN_GA(X, Y)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x2, x3, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g(x1)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x1, x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x1, x2, x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x1, x2, x3, x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x1, x2, x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
geq_out_gg(x1, x2)  =  geq_out_gg(x1, x2)
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg(x1, x2, x3)
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x1, x2, x3)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x1, x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x1, x2)
REM_IN_GAG(x1, x2, x3)  =  REM_IN_GAG(x1, x3)
U1_GAG(x1, x2, x3, x4)  =  U1_GAG(x1, x3, x4)
NOTZERO_IN_A(x1)  =  NOTZERO_IN_A
U2_GAG(x1, x2, x3, x4)  =  U2_GAG(x1, x3, x4)
SUB_IN_GAA(x1, x2, x3)  =  SUB_IN_GAA(x1)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x1, x4)
U3_GAG(x1, x2, x3, x4)  =  U3_GAG(x1, x2, x3, x4)
REM_IN_GGG(x1, x2, x3)  =  REM_IN_GGG(x1, x2, x3)
U1_GGG(x1, x2, x3, x4)  =  U1_GGG(x1, x2, x3, x4)
NOTZERO_IN_G(x1)  =  NOTZERO_IN_G(x1)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x1, x2, x3, x4)
SUB_IN_GGA(x1, x2, x3)  =  SUB_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
U3_GGG(x1, x2, x3, x4)  =  U3_GGG(x1, x2, x3, x4)
U4_GGG(x1, x2, x3)  =  U4_GGG(x1, x2, x3)
U5_GGG(x1, x2, x3)  =  U5_GGG(x1, x2, x3)
GEQ_IN_GG(x1, x2)  =  GEQ_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x1, x2, x3)
U4_GAG(x1, x2, x3)  =  U4_GAG(x1, x3)
U5_GAG(x1, x2, x3)  =  U5_GAG(x1, x3)
GEQ_IN_GA(x1, x2)  =  GEQ_IN_GA(x1)
U7_GA(x1, x2, x3)  =  U7_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:

REM_IN_GAG(X, Y, R) → U1_GAG(X, Y, R, notZero_in_a(Y))
REM_IN_GAG(X, Y, R) → NOTZERO_IN_A(Y)
U1_GAG(X, Y, R, notZero_out_a(Y)) → U2_GAG(X, Y, R, sub_in_gaa(X, Y, Z))
U1_GAG(X, Y, R, notZero_out_a(Y)) → SUB_IN_GAA(X, Y, Z)
SUB_IN_GAA(s(X), s(Y), Z) → U6_GAA(X, Y, Z, sub_in_gaa(X, Y, Z))
SUB_IN_GAA(s(X), s(Y), Z) → SUB_IN_GAA(X, Y, Z)
U2_GAG(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_GAG(X, Y, R, rem_in_ggg(Z, Y, R))
U2_GAG(X, Y, R, sub_out_gaa(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, R) → U1_GGG(X, Y, R, notZero_in_g(Y))
REM_IN_GGG(X, Y, R) → NOTZERO_IN_G(Y)
U1_GGG(X, Y, R, notZero_out_g(Y)) → U2_GGG(X, Y, R, sub_in_gga(X, Y, Z))
U1_GGG(X, Y, R, notZero_out_g(Y)) → SUB_IN_GGA(X, Y, Z)
SUB_IN_GGA(s(X), s(Y), Z) → U6_GGA(X, Y, Z, sub_in_gga(X, Y, Z))
SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → U3_GGG(X, Y, R, rem_in_ggg(Z, Y, R))
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, X) → U4_GGG(X, Y, notZero_in_g(Y))
REM_IN_GGG(X, Y, X) → NOTZERO_IN_G(Y)
U4_GGG(X, Y, notZero_out_g(Y)) → U5_GGG(X, Y, geq_in_gg(X, Y))
U4_GGG(X, Y, notZero_out_g(Y)) → GEQ_IN_GG(X, Y)
GEQ_IN_GG(s(X), s(Y)) → U7_GG(X, Y, geq_in_gg(X, Y))
GEQ_IN_GG(s(X), s(Y)) → GEQ_IN_GG(X, Y)
REM_IN_GAG(X, Y, X) → U4_GAG(X, Y, notZero_in_a(Y))
REM_IN_GAG(X, Y, X) → NOTZERO_IN_A(Y)
U4_GAG(X, Y, notZero_out_a(Y)) → U5_GAG(X, Y, geq_in_ga(X, Y))
U4_GAG(X, Y, notZero_out_a(Y)) → GEQ_IN_GA(X, Y)
GEQ_IN_GA(s(X), s(Y)) → U7_GA(X, Y, geq_in_ga(X, Y))
GEQ_IN_GA(s(X), s(Y)) → GEQ_IN_GA(X, Y)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x2, x3, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g(x1)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x1, x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x1, x2, x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x1, x2, x3, x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x1, x2, x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
geq_out_gg(x1, x2)  =  geq_out_gg(x1, x2)
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg(x1, x2, x3)
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x1, x2, x3)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x1, x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x1, x2)
REM_IN_GAG(x1, x2, x3)  =  REM_IN_GAG(x1, x3)
U1_GAG(x1, x2, x3, x4)  =  U1_GAG(x1, x3, x4)
NOTZERO_IN_A(x1)  =  NOTZERO_IN_A
U2_GAG(x1, x2, x3, x4)  =  U2_GAG(x1, x3, x4)
SUB_IN_GAA(x1, x2, x3)  =  SUB_IN_GAA(x1)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x1, x4)
U3_GAG(x1, x2, x3, x4)  =  U3_GAG(x1, x2, x3, x4)
REM_IN_GGG(x1, x2, x3)  =  REM_IN_GGG(x1, x2, x3)
U1_GGG(x1, x2, x3, x4)  =  U1_GGG(x1, x2, x3, x4)
NOTZERO_IN_G(x1)  =  NOTZERO_IN_G(x1)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x1, x2, x3, x4)
SUB_IN_GGA(x1, x2, x3)  =  SUB_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
U3_GGG(x1, x2, x3, x4)  =  U3_GGG(x1, x2, x3, x4)
U4_GGG(x1, x2, x3)  =  U4_GGG(x1, x2, x3)
U5_GGG(x1, x2, x3)  =  U5_GGG(x1, x2, x3)
GEQ_IN_GG(x1, x2)  =  GEQ_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x1, x2, x3)
U4_GAG(x1, x2, x3)  =  U4_GAG(x1, x3)
U5_GAG(x1, x2, x3)  =  U5_GAG(x1, x3)
GEQ_IN_GA(x1, x2)  =  GEQ_IN_GA(x1)
U7_GA(x1, x2, x3)  =  U7_GA(x1, x3)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

GEQ_IN_GA(s(X), s(Y)) → GEQ_IN_GA(X, Y)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x2, x3, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g(x1)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x1, x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x1, x2, x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x1, x2, x3, x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x1, x2, x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
geq_out_gg(x1, x2)  =  geq_out_gg(x1, x2)
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg(x1, x2, x3)
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x1, x2, x3)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x1, x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x1, x2)
GEQ_IN_GA(x1, x2)  =  GEQ_IN_GA(x1)

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:

GEQ_IN_GA(s(X), s(Y)) → GEQ_IN_GA(X, Y)

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

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:

GEQ_IN_GA(s(X)) → GEQ_IN_GA(X)

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:

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

(13) TRUE

(14) Obligation:

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

GEQ_IN_GG(s(X), s(Y)) → GEQ_IN_GG(X, Y)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x2, x3, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g(x1)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x1, x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x1, x2, x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x1, x2, x3, x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x1, x2, x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
geq_out_gg(x1, x2)  =  geq_out_gg(x1, x2)
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg(x1, x2, x3)
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x1, x2, x3)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x1, x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x1, x2)
GEQ_IN_GG(x1, x2)  =  GEQ_IN_GG(x1, x2)

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

(15) UsableRulesProof (EQUIVALENT transformation)

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

(16) Obligation:

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

GEQ_IN_GG(s(X), s(Y)) → GEQ_IN_GG(X, Y)

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

(17) PiDPToQDPProof (EQUIVALENT transformation)

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

(18) Obligation:

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

GEQ_IN_GG(s(X), s(Y)) → GEQ_IN_GG(X, Y)

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

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

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

(20) TRUE

(21) Obligation:

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

SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x2, x3, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g(x1)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x1, x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x1, x2, x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x1, x2, x3, x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x1, x2, x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
geq_out_gg(x1, x2)  =  geq_out_gg(x1, x2)
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg(x1, x2, x3)
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x1, x2, x3)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x1, x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x1, x2)
SUB_IN_GGA(x1, x2, x3)  =  SUB_IN_GGA(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:

SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)

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

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

(24) PiDPToQDPProof (SOUND transformation)

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

(25) Obligation:

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

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

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

U1_GGG(X, Y, R, notZero_out_g(Y)) → U2_GGG(X, Y, R, sub_in_gga(X, Y, Z))
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, R) → U1_GGG(X, Y, R, notZero_in_g(Y))

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x2, x3, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g(x1)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x1, x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x1, x2, x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x1, x2, x3, x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x1, x2, x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
geq_out_gg(x1, x2)  =  geq_out_gg(x1, x2)
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg(x1, x2, x3)
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x1, x2, x3)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x1, x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x1, x2)
REM_IN_GGG(x1, x2, x3)  =  REM_IN_GGG(x1, x2, x3)
U1_GGG(x1, x2, x3, x4)  =  U1_GGG(x1, x2, x3, x4)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x1, x2, x3, x4)

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

(29) UsableRulesProof (EQUIVALENT transformation)

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

(30) Obligation:

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

U1_GGG(X, Y, R, notZero_out_g(Y)) → U2_GGG(X, Y, R, sub_in_gga(X, Y, Z))
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, R) → U1_GGG(X, Y, R, notZero_in_g(Y))

The TRS R consists of the following rules:

sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
notZero_in_g(s(X)) → notZero_out_g(s(X))
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g(x1)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x1, x2, x3)
REM_IN_GGG(x1, x2, x3)  =  REM_IN_GGG(x1, x2, x3)
U1_GGG(x1, x2, x3, x4)  =  U1_GGG(x1, x2, x3, x4)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x1, x2, x3, x4)

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

(31) PiDPToQDPProof (SOUND transformation)

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

(32) Obligation:

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

U1_GGG(X, Y, R, notZero_out_g(Y)) → U2_GGG(X, Y, R, sub_in_gga(X, Y))
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, R) → U1_GGG(X, Y, R, notZero_in_g(Y))

The TRS R consists of the following rules:

sub_in_gga(s(X), s(Y)) → U6_gga(X, Y, sub_in_gga(X, Y))
sub_in_gga(X, 0) → sub_out_gga(X, 0, X)
notZero_in_g(s(X)) → notZero_out_g(s(X))
U6_gga(X, Y, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)

The set Q consists of the following terms:

sub_in_gga(x0, x1)
notZero_in_g(x0)
U6_gga(x0, x1, x2)

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

(33) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


U1_GGG(X, Y, R, notZero_out_g(Y)) → U2_GGG(X, Y, R, sub_in_gga(X, Y))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(REM_IN_GGG(x1, x2, x3)) = x1 + x2   
POL(U1_GGG(x1, x2, x3, x4)) = x1 + x4   
POL(U2_GGG(x1, x2, x3, x4)) = x4   
POL(U6_gga(x1, x2, x3)) = 1 + x3   
POL(notZero_in_g(x1)) = x1   
POL(notZero_out_g(x1)) = 1   
POL(s(x1)) = 1 + x1   
POL(sub_in_gga(x1, x2)) = x1   
POL(sub_out_gga(x1, x2, x3)) = x2 + x3   

The following usable rules [FROCOS05] were oriented:

sub_in_gga(s(X), s(Y)) → U6_gga(X, Y, sub_in_gga(X, Y))
sub_in_gga(X, 0) → sub_out_gga(X, 0, X)
notZero_in_g(s(X)) → notZero_out_g(s(X))
U6_gga(X, Y, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)

(34) Obligation:

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

U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, R) → U1_GGG(X, Y, R, notZero_in_g(Y))

The TRS R consists of the following rules:

sub_in_gga(s(X), s(Y)) → U6_gga(X, Y, sub_in_gga(X, Y))
sub_in_gga(X, 0) → sub_out_gga(X, 0, X)
notZero_in_g(s(X)) → notZero_out_g(s(X))
U6_gga(X, Y, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)

The set Q consists of the following terms:

sub_in_gga(x0, x1)
notZero_in_g(x0)
U6_gga(x0, x1, x2)

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

(35) DependencyGraphProof (EQUIVALENT transformation)

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

(36) TRUE

(37) Obligation:

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

SUB_IN_GAA(s(X), s(Y), Z) → SUB_IN_GAA(X, Y, Z)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x1, x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x2, x3, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g(x1)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x1, x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x1, x2, x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x1, x2, x3, x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x1, x2, x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
geq_out_gg(x1, x2)  =  geq_out_gg(x1, x2)
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg(x1, x2, x3)
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x1, x2, x3)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x1, x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x1, x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x1, x2)
SUB_IN_GAA(x1, x2, x3)  =  SUB_IN_GAA(x1)

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

(38) UsableRulesProof (EQUIVALENT transformation)

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

(39) Obligation:

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

SUB_IN_GAA(s(X), s(Y), Z) → SUB_IN_GAA(X, Y, Z)

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

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

(40) PiDPToQDPProof (SOUND transformation)

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

(41) Obligation:

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

SUB_IN_GAA(s(X)) → SUB_IN_GAA(X)

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

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

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

(43) TRUE

(44) PrologToPiTRSProof (SOUND transformation)

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

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x2, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
geq_out_gg(x1, x2)  =  geq_out_gg
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x2)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(45) Obligation:

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

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x2, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
geq_out_gg(x1, x2)  =  geq_out_gg
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x2)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x2)

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

REM_IN_GAG(X, Y, R) → U1_GAG(X, Y, R, notZero_in_a(Y))
REM_IN_GAG(X, Y, R) → NOTZERO_IN_A(Y)
U1_GAG(X, Y, R, notZero_out_a(Y)) → U2_GAG(X, Y, R, sub_in_gaa(X, Y, Z))
U1_GAG(X, Y, R, notZero_out_a(Y)) → SUB_IN_GAA(X, Y, Z)
SUB_IN_GAA(s(X), s(Y), Z) → U6_GAA(X, Y, Z, sub_in_gaa(X, Y, Z))
SUB_IN_GAA(s(X), s(Y), Z) → SUB_IN_GAA(X, Y, Z)
U2_GAG(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_GAG(X, Y, R, rem_in_ggg(Z, Y, R))
U2_GAG(X, Y, R, sub_out_gaa(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, R) → U1_GGG(X, Y, R, notZero_in_g(Y))
REM_IN_GGG(X, Y, R) → NOTZERO_IN_G(Y)
U1_GGG(X, Y, R, notZero_out_g(Y)) → U2_GGG(X, Y, R, sub_in_gga(X, Y, Z))
U1_GGG(X, Y, R, notZero_out_g(Y)) → SUB_IN_GGA(X, Y, Z)
SUB_IN_GGA(s(X), s(Y), Z) → U6_GGA(X, Y, Z, sub_in_gga(X, Y, Z))
SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → U3_GGG(X, Y, R, rem_in_ggg(Z, Y, R))
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, X) → U4_GGG(X, Y, notZero_in_g(Y))
REM_IN_GGG(X, Y, X) → NOTZERO_IN_G(Y)
U4_GGG(X, Y, notZero_out_g(Y)) → U5_GGG(X, Y, geq_in_gg(X, Y))
U4_GGG(X, Y, notZero_out_g(Y)) → GEQ_IN_GG(X, Y)
GEQ_IN_GG(s(X), s(Y)) → U7_GG(X, Y, geq_in_gg(X, Y))
GEQ_IN_GG(s(X), s(Y)) → GEQ_IN_GG(X, Y)
REM_IN_GAG(X, Y, X) → U4_GAG(X, Y, notZero_in_a(Y))
REM_IN_GAG(X, Y, X) → NOTZERO_IN_A(Y)
U4_GAG(X, Y, notZero_out_a(Y)) → U5_GAG(X, Y, geq_in_ga(X, Y))
U4_GAG(X, Y, notZero_out_a(Y)) → GEQ_IN_GA(X, Y)
GEQ_IN_GA(s(X), s(Y)) → U7_GA(X, Y, geq_in_ga(X, Y))
GEQ_IN_GA(s(X), s(Y)) → GEQ_IN_GA(X, Y)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x2, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
geq_out_gg(x1, x2)  =  geq_out_gg
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x2)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x2)
REM_IN_GAG(x1, x2, x3)  =  REM_IN_GAG(x1, x3)
U1_GAG(x1, x2, x3, x4)  =  U1_GAG(x1, x3, x4)
NOTZERO_IN_A(x1)  =  NOTZERO_IN_A
U2_GAG(x1, x2, x3, x4)  =  U2_GAG(x3, x4)
SUB_IN_GAA(x1, x2, x3)  =  SUB_IN_GAA(x1)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x4)
U3_GAG(x1, x2, x3, x4)  =  U3_GAG(x2, x4)
REM_IN_GGG(x1, x2, x3)  =  REM_IN_GGG(x1, x2, x3)
U1_GGG(x1, x2, x3, x4)  =  U1_GGG(x1, x2, x3, x4)
NOTZERO_IN_G(x1)  =  NOTZERO_IN_G(x1)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x2, x3, x4)
SUB_IN_GGA(x1, x2, x3)  =  SUB_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x4)
U3_GGG(x1, x2, x3, x4)  =  U3_GGG(x4)
U4_GGG(x1, x2, x3)  =  U4_GGG(x1, x2, x3)
U5_GGG(x1, x2, x3)  =  U5_GGG(x3)
GEQ_IN_GG(x1, x2)  =  GEQ_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x3)
U4_GAG(x1, x2, x3)  =  U4_GAG(x1, x3)
U5_GAG(x1, x2, x3)  =  U5_GAG(x3)
GEQ_IN_GA(x1, x2)  =  GEQ_IN_GA(x1)
U7_GA(x1, x2, x3)  =  U7_GA(x3)

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

(47) Obligation:

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

REM_IN_GAG(X, Y, R) → U1_GAG(X, Y, R, notZero_in_a(Y))
REM_IN_GAG(X, Y, R) → NOTZERO_IN_A(Y)
U1_GAG(X, Y, R, notZero_out_a(Y)) → U2_GAG(X, Y, R, sub_in_gaa(X, Y, Z))
U1_GAG(X, Y, R, notZero_out_a(Y)) → SUB_IN_GAA(X, Y, Z)
SUB_IN_GAA(s(X), s(Y), Z) → U6_GAA(X, Y, Z, sub_in_gaa(X, Y, Z))
SUB_IN_GAA(s(X), s(Y), Z) → SUB_IN_GAA(X, Y, Z)
U2_GAG(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_GAG(X, Y, R, rem_in_ggg(Z, Y, R))
U2_GAG(X, Y, R, sub_out_gaa(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, R) → U1_GGG(X, Y, R, notZero_in_g(Y))
REM_IN_GGG(X, Y, R) → NOTZERO_IN_G(Y)
U1_GGG(X, Y, R, notZero_out_g(Y)) → U2_GGG(X, Y, R, sub_in_gga(X, Y, Z))
U1_GGG(X, Y, R, notZero_out_g(Y)) → SUB_IN_GGA(X, Y, Z)
SUB_IN_GGA(s(X), s(Y), Z) → U6_GGA(X, Y, Z, sub_in_gga(X, Y, Z))
SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → U3_GGG(X, Y, R, rem_in_ggg(Z, Y, R))
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, X) → U4_GGG(X, Y, notZero_in_g(Y))
REM_IN_GGG(X, Y, X) → NOTZERO_IN_G(Y)
U4_GGG(X, Y, notZero_out_g(Y)) → U5_GGG(X, Y, geq_in_gg(X, Y))
U4_GGG(X, Y, notZero_out_g(Y)) → GEQ_IN_GG(X, Y)
GEQ_IN_GG(s(X), s(Y)) → U7_GG(X, Y, geq_in_gg(X, Y))
GEQ_IN_GG(s(X), s(Y)) → GEQ_IN_GG(X, Y)
REM_IN_GAG(X, Y, X) → U4_GAG(X, Y, notZero_in_a(Y))
REM_IN_GAG(X, Y, X) → NOTZERO_IN_A(Y)
U4_GAG(X, Y, notZero_out_a(Y)) → U5_GAG(X, Y, geq_in_ga(X, Y))
U4_GAG(X, Y, notZero_out_a(Y)) → GEQ_IN_GA(X, Y)
GEQ_IN_GA(s(X), s(Y)) → U7_GA(X, Y, geq_in_ga(X, Y))
GEQ_IN_GA(s(X), s(Y)) → GEQ_IN_GA(X, Y)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x2, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
geq_out_gg(x1, x2)  =  geq_out_gg
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x2)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x2)
REM_IN_GAG(x1, x2, x3)  =  REM_IN_GAG(x1, x3)
U1_GAG(x1, x2, x3, x4)  =  U1_GAG(x1, x3, x4)
NOTZERO_IN_A(x1)  =  NOTZERO_IN_A
U2_GAG(x1, x2, x3, x4)  =  U2_GAG(x3, x4)
SUB_IN_GAA(x1, x2, x3)  =  SUB_IN_GAA(x1)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x4)
U3_GAG(x1, x2, x3, x4)  =  U3_GAG(x2, x4)
REM_IN_GGG(x1, x2, x3)  =  REM_IN_GGG(x1, x2, x3)
U1_GGG(x1, x2, x3, x4)  =  U1_GGG(x1, x2, x3, x4)
NOTZERO_IN_G(x1)  =  NOTZERO_IN_G(x1)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x2, x3, x4)
SUB_IN_GGA(x1, x2, x3)  =  SUB_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x4)
U3_GGG(x1, x2, x3, x4)  =  U3_GGG(x4)
U4_GGG(x1, x2, x3)  =  U4_GGG(x1, x2, x3)
U5_GGG(x1, x2, x3)  =  U5_GGG(x3)
GEQ_IN_GG(x1, x2)  =  GEQ_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x3)
U4_GAG(x1, x2, x3)  =  U4_GAG(x1, x3)
U5_GAG(x1, x2, x3)  =  U5_GAG(x3)
GEQ_IN_GA(x1, x2)  =  GEQ_IN_GA(x1)
U7_GA(x1, x2, x3)  =  U7_GA(x3)

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

(48) DependencyGraphProof (EQUIVALENT transformation)

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

(49) Complex Obligation (AND)

(50) Obligation:

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

GEQ_IN_GA(s(X), s(Y)) → GEQ_IN_GA(X, Y)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x2, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
geq_out_gg(x1, x2)  =  geq_out_gg
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x2)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x2)
GEQ_IN_GA(x1, x2)  =  GEQ_IN_GA(x1)

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:

GEQ_IN_GA(s(X), s(Y)) → GEQ_IN_GA(X, Y)

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

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:

GEQ_IN_GA(s(X)) → GEQ_IN_GA(X)

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:

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

(56) TRUE

(57) Obligation:

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

GEQ_IN_GG(s(X), s(Y)) → GEQ_IN_GG(X, Y)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x2, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
geq_out_gg(x1, x2)  =  geq_out_gg
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x2)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x2)
GEQ_IN_GG(x1, x2)  =  GEQ_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:

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

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

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

SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x2, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
geq_out_gg(x1, x2)  =  geq_out_gg
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x2)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x2)
SUB_IN_GGA(x1, x2, x3)  =  SUB_IN_GGA(x1, x2)

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

(65) UsableRulesProof (EQUIVALENT transformation)

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

(66) Obligation:

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

SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)

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

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

(67) PiDPToQDPProof (SOUND transformation)

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

(68) Obligation:

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

SUB_IN_GGA(s(X), s(Y)) → SUB_IN_GGA(X, Y)

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

(69) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

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

(70) TRUE

(71) Obligation:

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

U1_GGG(X, Y, R, notZero_out_g(Y)) → U2_GGG(X, Y, R, sub_in_gga(X, Y, Z))
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, R) → U1_GGG(X, Y, R, notZero_in_g(Y))

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x2, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
geq_out_gg(x1, x2)  =  geq_out_gg
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x2)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x2)
REM_IN_GGG(x1, x2, x3)  =  REM_IN_GGG(x1, x2, x3)
U1_GGG(x1, x2, x3, x4)  =  U1_GGG(x1, x2, x3, x4)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x2, x3, x4)

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

(72) UsableRulesProof (EQUIVALENT transformation)

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

(73) Obligation:

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

U1_GGG(X, Y, R, notZero_out_g(Y)) → U2_GGG(X, Y, R, sub_in_gga(X, Y, Z))
U2_GGG(X, Y, R, sub_out_gga(X, Y, Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, R) → U1_GGG(X, Y, R, notZero_in_g(Y))

The TRS R consists of the following rules:

sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
notZero_in_g(s(X)) → notZero_out_g(s(X))
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
REM_IN_GGG(x1, x2, x3)  =  REM_IN_GGG(x1, x2, x3)
U1_GGG(x1, x2, x3, x4)  =  U1_GGG(x1, x2, x3, x4)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x2, x3, x4)

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

(74) PiDPToQDPProof (SOUND transformation)

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

(75) Obligation:

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

U1_GGG(X, Y, R, notZero_out_g) → U2_GGG(Y, R, sub_in_gga(X, Y))
U2_GGG(Y, R, sub_out_gga(Z)) → REM_IN_GGG(Z, Y, R)
REM_IN_GGG(X, Y, R) → U1_GGG(X, Y, R, notZero_in_g(Y))

The TRS R consists of the following rules:

sub_in_gga(s(X), s(Y)) → U6_gga(sub_in_gga(X, Y))
sub_in_gga(X, 0) → sub_out_gga(X)
notZero_in_g(s(X)) → notZero_out_g
U6_gga(sub_out_gga(Z)) → sub_out_gga(Z)

The set Q consists of the following terms:

sub_in_gga(x0, x1)
notZero_in_g(x0)
U6_gga(x0)

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

(76) Obligation:

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

SUB_IN_GAA(s(X), s(Y), Z) → SUB_IN_GAA(X, Y, Z)

The TRS R consists of the following rules:

rem_in_gag(X, Y, R) → U1_gag(X, Y, R, notZero_in_a(Y))
notZero_in_a(s(X)) → notZero_out_a(s(X))
U1_gag(X, Y, R, notZero_out_a(Y)) → U2_gag(X, Y, R, sub_in_gaa(X, Y, Z))
sub_in_gaa(s(X), s(Y), Z) → U6_gaa(X, Y, Z, sub_in_gaa(X, Y, Z))
sub_in_gaa(X, 0, X) → sub_out_gaa(X, 0, X)
U6_gaa(X, Y, Z, sub_out_gaa(X, Y, Z)) → sub_out_gaa(s(X), s(Y), Z)
U2_gag(X, Y, R, sub_out_gaa(X, Y, Z)) → U3_gag(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, R) → U1_ggg(X, Y, R, notZero_in_g(Y))
notZero_in_g(s(X)) → notZero_out_g(s(X))
U1_ggg(X, Y, R, notZero_out_g(Y)) → U2_ggg(X, Y, R, sub_in_gga(X, Y, Z))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U2_ggg(X, Y, R, sub_out_gga(X, Y, Z)) → U3_ggg(X, Y, R, rem_in_ggg(Z, Y, R))
rem_in_ggg(X, Y, X) → U4_ggg(X, Y, notZero_in_g(Y))
U4_ggg(X, Y, notZero_out_g(Y)) → U5_ggg(X, Y, geq_in_gg(X, Y))
geq_in_gg(s(X), s(Y)) → U7_gg(X, Y, geq_in_gg(X, Y))
geq_in_gg(X, 0) → geq_out_gg(X, 0)
U7_gg(X, Y, geq_out_gg(X, Y)) → geq_out_gg(s(X), s(Y))
U5_ggg(X, Y, geq_out_gg(X, Y)) → rem_out_ggg(X, Y, X)
U3_ggg(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_ggg(X, Y, R)
U3_gag(X, Y, R, rem_out_ggg(Z, Y, R)) → rem_out_gag(X, Y, R)
rem_in_gag(X, Y, X) → U4_gag(X, Y, notZero_in_a(Y))
U4_gag(X, Y, notZero_out_a(Y)) → U5_gag(X, Y, geq_in_ga(X, Y))
geq_in_ga(s(X), s(Y)) → U7_ga(X, Y, geq_in_ga(X, Y))
geq_in_ga(X, 0) → geq_out_ga(X, 0)
U7_ga(X, Y, geq_out_ga(X, Y)) → geq_out_ga(s(X), s(Y))
U5_gag(X, Y, geq_out_ga(X, Y)) → rem_out_gag(X, Y, X)

The argument filtering Pi contains the following mapping:
rem_in_gag(x1, x2, x3)  =  rem_in_gag(x1, x3)
U1_gag(x1, x2, x3, x4)  =  U1_gag(x1, x3, x4)
notZero_in_a(x1)  =  notZero_in_a
notZero_out_a(x1)  =  notZero_out_a
U2_gag(x1, x2, x3, x4)  =  U2_gag(x3, x4)
sub_in_gaa(x1, x2, x3)  =  sub_in_gaa(x1)
s(x1)  =  s(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
sub_out_gaa(x1, x2, x3)  =  sub_out_gaa(x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x2, x4)
rem_in_ggg(x1, x2, x3)  =  rem_in_ggg(x1, x2, x3)
U1_ggg(x1, x2, x3, x4)  =  U1_ggg(x1, x2, x3, x4)
notZero_in_g(x1)  =  notZero_in_g(x1)
notZero_out_g(x1)  =  notZero_out_g
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
0  =  0
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
U4_ggg(x1, x2, x3)  =  U4_ggg(x1, x2, x3)
U5_ggg(x1, x2, x3)  =  U5_ggg(x3)
geq_in_gg(x1, x2)  =  geq_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
geq_out_gg(x1, x2)  =  geq_out_gg
rem_out_ggg(x1, x2, x3)  =  rem_out_ggg
rem_out_gag(x1, x2, x3)  =  rem_out_gag(x2)
U4_gag(x1, x2, x3)  =  U4_gag(x1, x3)
U5_gag(x1, x2, x3)  =  U5_gag(x3)
geq_in_ga(x1, x2)  =  geq_in_ga(x1)
U7_ga(x1, x2, x3)  =  U7_ga(x3)
geq_out_ga(x1, x2)  =  geq_out_ga(x2)
SUB_IN_GAA(x1, x2, x3)  =  SUB_IN_GAA(x1)

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

(77) UsableRulesProof (EQUIVALENT transformation)

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

(78) Obligation:

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

SUB_IN_GAA(s(X), s(Y), Z) → SUB_IN_GAA(X, Y, Z)

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

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