(0) Obligation:

Clauses:

gcd(X, Y, D) :- ','(le(X, Y), gcd_le(X, Y, D)).
gcd(X, Y, D) :- ','(gt(X, Y), gcd_le(Y, X, D)).
gcd_le(0, Y, Y).
gcd_le(s(X), Y, D) :- ','(add(s(X), Z, Y), gcd(s(X), Z, D)).
gt(s(X), s(Y)) :- gt(X, Y).
gt(s(X), 0).
le(s(X), s(Y)) :- le(X, Y).
le(0, s(Y)).
le(0, 0).
add(s(X), Y, s(Z)) :- add(X, Y, Z).
add(0, X, X).

Queries:

gcd(g,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:
gcd_in: (b,b,f)
le_in: (b,b)
gcd_le_in: (b,b,f)
add_in: (b,f,b)
gt_in: (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(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:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(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:

GCD_IN_GGA(X, Y, D) → U1_GGA(X, Y, D, le_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U8_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U1_GGA(X, Y, D, le_out_gg(X, Y)) → U2_GGA(X, Y, D, gcd_le_in_gga(X, Y, D))
U1_GGA(X, Y, D, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y, D)
GCD_LE_IN_GGA(s(X), Y, D) → U5_GGA(X, Y, D, add_in_gag(s(X), Z, Y))
GCD_LE_IN_GGA(s(X), Y, D) → ADD_IN_GAG(s(X), Z, Y)
ADD_IN_GAG(s(X), Y, s(Z)) → U9_GAG(X, Y, Z, add_in_gag(X, Y, Z))
ADD_IN_GAG(s(X), Y, s(Z)) → ADD_IN_GAG(X, Y, Z)
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_GGA(X, Y, D, gcd_in_gga(s(X), Z, D))
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z, D)
GCD_IN_GGA(X, Y, D) → U3_GGA(X, Y, D, gt_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U7_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → U4_GGA(X, Y, D, gcd_le_in_gga(Y, X, D))
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → GCD_LE_IN_GGA(Y, X, D)

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x3)
GCD_IN_GGA(x1, x2, x3)  =  GCD_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U8_GG(x1, x2, x3)  =  U8_GG(x3)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x4)
GCD_LE_IN_GGA(x1, x2, x3)  =  GCD_LE_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x4)
ADD_IN_GAG(x1, x2, x3)  =  ADD_IN_GAG(x1, x3)
U9_GAG(x1, x2, x3, x4)  =  U9_GAG(x4)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x3)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x4)

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

(4) Obligation:

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

GCD_IN_GGA(X, Y, D) → U1_GGA(X, Y, D, le_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U8_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U1_GGA(X, Y, D, le_out_gg(X, Y)) → U2_GGA(X, Y, D, gcd_le_in_gga(X, Y, D))
U1_GGA(X, Y, D, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y, D)
GCD_LE_IN_GGA(s(X), Y, D) → U5_GGA(X, Y, D, add_in_gag(s(X), Z, Y))
GCD_LE_IN_GGA(s(X), Y, D) → ADD_IN_GAG(s(X), Z, Y)
ADD_IN_GAG(s(X), Y, s(Z)) → U9_GAG(X, Y, Z, add_in_gag(X, Y, Z))
ADD_IN_GAG(s(X), Y, s(Z)) → ADD_IN_GAG(X, Y, Z)
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_GGA(X, Y, D, gcd_in_gga(s(X), Z, D))
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z, D)
GCD_IN_GGA(X, Y, D) → U3_GGA(X, Y, D, gt_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U7_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → U4_GGA(X, Y, D, gcd_le_in_gga(Y, X, D))
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → GCD_LE_IN_GGA(Y, X, D)

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x3)
GCD_IN_GGA(x1, x2, x3)  =  GCD_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U8_GG(x1, x2, x3)  =  U8_GG(x3)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x4)
GCD_LE_IN_GGA(x1, x2, x3)  =  GCD_LE_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x4)
ADD_IN_GAG(x1, x2, x3)  =  ADD_IN_GAG(x1, x3)
U9_GAG(x1, x2, x3, x4)  =  U9_GAG(x4)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x3)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x4)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x3)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)

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

(8) UsableRulesProof (EQUIVALENT transformation)

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

(9) Obligation:

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

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

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

(10) PiDPToQDPProof (EQUIVALENT transformation)

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

(11) Obligation:

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

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

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

(12) QDPSizeChangeProof (EQUIVALENT transformation)

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

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

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

(13) TRUE

(14) Obligation:

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

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

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x3)
ADD_IN_GAG(x1, x2, x3)  =  ADD_IN_GAG(x1, 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_GAG(s(X), Y, s(Z)) → ADD_IN_GAG(X, Y, Z)

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

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_GAG(s(X), s(Z)) → ADD_IN_GAG(X, Z)
    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:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x3)
LE_IN_GG(x1, x2)  =  LE_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:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

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

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

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

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

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

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

U1_GGA(X, Y, D, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y, D)
GCD_LE_IN_GGA(s(X), Y, D) → U5_GGA(X, Y, D, add_in_gag(s(X), Z, Y))
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z, D)
GCD_IN_GGA(X, Y, D) → U1_GGA(X, Y, D, le_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → U3_GGA(X, Y, D, gt_in_gg(X, Y))
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → GCD_LE_IN_GGA(Y, X, D)

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x3)
GCD_IN_GGA(x1, x2, x3)  =  GCD_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
GCD_LE_IN_GGA(x1, x2, x3)  =  GCD_LE_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, 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_GGA(X, Y, D, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y, D)
GCD_LE_IN_GGA(s(X), Y, D) → U5_GGA(X, Y, D, add_in_gag(s(X), Z, Y))
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z, D)
GCD_IN_GGA(X, Y, D) → U1_GGA(X, Y, D, le_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → U3_GGA(X, Y, D, gt_in_gg(X, Y))
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → GCD_LE_IN_GGA(Y, X, D)

The TRS R consists of the following rules:

add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
add_in_gag(0, X, X) → add_out_gag(0, X, X)

The argument filtering Pi contains the following mapping:
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x2)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
GCD_IN_GGA(x1, x2, x3)  =  GCD_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
GCD_LE_IN_GGA(x1, x2, x3)  =  GCD_LE_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, 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_GGA(X, Y, le_out_gg) → GCD_LE_IN_GGA(X, Y)
GCD_LE_IN_GGA(s(X), Y) → U5_GGA(X, add_in_gag(s(X), Y))
U5_GGA(X, add_out_gag(Z)) → GCD_IN_GGA(s(X), Z)
GCD_IN_GGA(X, Y) → U1_GGA(X, Y, le_in_gg(X, Y))
GCD_IN_GGA(X, Y) → U3_GGA(X, Y, gt_in_gg(X, Y))
U3_GGA(X, Y, gt_out_gg) → GCD_LE_IN_GGA(Y, X)

The TRS R consists of the following rules:

add_in_gag(s(X), s(Z)) → U9_gag(add_in_gag(X, Z))
le_in_gg(s(X), s(Y)) → U8_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U7_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U9_gag(add_out_gag(Y)) → add_out_gag(Y)
U8_gg(le_out_gg) → le_out_gg
U7_gg(gt_out_gg) → gt_out_gg
add_in_gag(0, X) → add_out_gag(X)

The set Q consists of the following terms:

add_in_gag(x0, x1)
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U9_gag(x0)
U8_gg(x0)
U7_gg(x0)

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.


GCD_LE_IN_GGA(s(X), Y) → U5_GGA(X, add_in_gag(s(X), Y))
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO]:

POL(U1_GGA(x1, x2, x3)) = 0 +
[1,0]
·x1 +
[1,0]
·x2 +
[0,0]
·x3

POL(le_out_gg) =
/0\
\0/

POL(GCD_LE_IN_GGA(x1, x2)) = 0 +
[1,0]
·x1 +
[1,0]
·x2

POL(s(x1)) =
/1\
\0/
+
/10\
\00/
·x1

POL(U5_GGA(x1, x2)) = 0 +
[1,0]
·x1 +
[0,1]
·x2

POL(add_in_gag(x1, x2)) =
/0\
\0/
+
/00\
\01/
·x1 +
/10\
\10/
·x2

POL(add_out_gag(x1)) =
/0\
\1/
+
/10\
\10/
·x1

POL(GCD_IN_GGA(x1, x2)) = 0 +
[1,0]
·x1 +
[1,0]
·x2

POL(le_in_gg(x1, x2)) =
/0\
\0/
+
/00\
\01/
·x1 +
/00\
\00/
·x2

POL(U3_GGA(x1, x2, x3)) = 0 +
[1,0]
·x1 +
[1,0]
·x2 +
[0,0]
·x3

POL(gt_in_gg(x1, x2)) =
/0\
\0/
+
/01\
\00/
·x1 +
/00\
\00/
·x2

POL(gt_out_gg) =
/1\
\1/

POL(U9_gag(x1)) =
/0\
\1/
+
/10\
\10/
·x1

POL(U8_gg(x1)) =
/1\
\1/
+
/01\
\01/
·x1

POL(0) =
/0\
\1/

POL(U7_gg(x1)) =
/0\
\0/
+
/00\
\10/
·x1

The following usable rules [FROCOS05] were oriented:

add_in_gag(s(X), s(Z)) → U9_gag(add_in_gag(X, Z))
add_in_gag(0, X) → add_out_gag(X)
U9_gag(add_out_gag(Y)) → add_out_gag(Y)

(34) Obligation:

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

U1_GGA(X, Y, le_out_gg) → GCD_LE_IN_GGA(X, Y)
U5_GGA(X, add_out_gag(Z)) → GCD_IN_GGA(s(X), Z)
GCD_IN_GGA(X, Y) → U1_GGA(X, Y, le_in_gg(X, Y))
GCD_IN_GGA(X, Y) → U3_GGA(X, Y, gt_in_gg(X, Y))
U3_GGA(X, Y, gt_out_gg) → GCD_LE_IN_GGA(Y, X)

The TRS R consists of the following rules:

add_in_gag(s(X), s(Z)) → U9_gag(add_in_gag(X, Z))
le_in_gg(s(X), s(Y)) → U8_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U7_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U9_gag(add_out_gag(Y)) → add_out_gag(Y)
U8_gg(le_out_gg) → le_out_gg
U7_gg(gt_out_gg) → gt_out_gg
add_in_gag(0, X) → add_out_gag(X)

The set Q consists of the following terms:

add_in_gag(x0, x1)
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U9_gag(x0)
U8_gg(x0)
U7_gg(x0)

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 5 less nodes.

(36) TRUE

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

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x1, x3, x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x1, x2, 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:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x1, x3, x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x1, x2, 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:

GCD_IN_GGA(X, Y, D) → U1_GGA(X, Y, D, le_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U8_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U1_GGA(X, Y, D, le_out_gg(X, Y)) → U2_GGA(X, Y, D, gcd_le_in_gga(X, Y, D))
U1_GGA(X, Y, D, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y, D)
GCD_LE_IN_GGA(s(X), Y, D) → U5_GGA(X, Y, D, add_in_gag(s(X), Z, Y))
GCD_LE_IN_GGA(s(X), Y, D) → ADD_IN_GAG(s(X), Z, Y)
ADD_IN_GAG(s(X), Y, s(Z)) → U9_GAG(X, Y, Z, add_in_gag(X, Y, Z))
ADD_IN_GAG(s(X), Y, s(Z)) → ADD_IN_GAG(X, Y, Z)
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_GGA(X, Y, D, gcd_in_gga(s(X), Z, D))
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z, D)
GCD_IN_GGA(X, Y, D) → U3_GGA(X, Y, D, gt_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U7_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → U4_GGA(X, Y, D, gcd_le_in_gga(Y, X, D))
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → GCD_LE_IN_GGA(Y, X, D)

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x1, x3, x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x1, x2, x3)
GCD_IN_GGA(x1, x2, x3)  =  GCD_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U8_GG(x1, x2, x3)  =  U8_GG(x1, x2, x3)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
GCD_LE_IN_GGA(x1, x2, x3)  =  GCD_LE_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
ADD_IN_GAG(x1, x2, x3)  =  ADD_IN_GAG(x1, x3)
U9_GAG(x1, x2, x3, x4)  =  U9_GAG(x1, x3, x4)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x1, x2, x3)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)

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

(40) Obligation:

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

GCD_IN_GGA(X, Y, D) → U1_GGA(X, Y, D, le_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U8_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U1_GGA(X, Y, D, le_out_gg(X, Y)) → U2_GGA(X, Y, D, gcd_le_in_gga(X, Y, D))
U1_GGA(X, Y, D, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y, D)
GCD_LE_IN_GGA(s(X), Y, D) → U5_GGA(X, Y, D, add_in_gag(s(X), Z, Y))
GCD_LE_IN_GGA(s(X), Y, D) → ADD_IN_GAG(s(X), Z, Y)
ADD_IN_GAG(s(X), Y, s(Z)) → U9_GAG(X, Y, Z, add_in_gag(X, Y, Z))
ADD_IN_GAG(s(X), Y, s(Z)) → ADD_IN_GAG(X, Y, Z)
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_GGA(X, Y, D, gcd_in_gga(s(X), Z, D))
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z, D)
GCD_IN_GGA(X, Y, D) → U3_GGA(X, Y, D, gt_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U7_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → U4_GGA(X, Y, D, gcd_le_in_gga(Y, X, D))
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → GCD_LE_IN_GGA(Y, X, D)

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x1, x3, x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x1, x2, x3)
GCD_IN_GGA(x1, x2, x3)  =  GCD_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U8_GG(x1, x2, x3)  =  U8_GG(x1, x2, x3)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
GCD_LE_IN_GGA(x1, x2, x3)  =  GCD_LE_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
ADD_IN_GAG(x1, x2, x3)  =  ADD_IN_GAG(x1, x3)
U9_GAG(x1, x2, x3, x4)  =  U9_GAG(x1, x3, x4)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x1, x2, x3)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)

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

(41) DependencyGraphProof (EQUIVALENT transformation)

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

(42) Complex Obligation (AND)

(43) Obligation:

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

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x1, x3, x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x1, x2, x3)
GT_IN_GG(x1, x2)  =  GT_IN_GG(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:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

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

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

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

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

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

  • GT_IN_GG(s(X), s(Y)) → GT_IN_GG(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_GAG(s(X), Y, s(Z)) → ADD_IN_GAG(X, Y, Z)

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x1, x3, x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x1, x2, x3)
ADD_IN_GAG(x1, x2, x3)  =  ADD_IN_GAG(x1, 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_GAG(s(X), Y, s(Z)) → ADD_IN_GAG(X, Y, Z)

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

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_GAG(s(X), s(Z)) → ADD_IN_GAG(X, Z)
    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:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x1, x3, x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x1, x2, x3)
LE_IN_GG(x1, x2)  =  LE_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:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

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

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

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

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

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

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

U1_GGA(X, Y, D, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y, D)
GCD_LE_IN_GGA(s(X), Y, D) → U5_GGA(X, Y, D, add_in_gag(s(X), Z, Y))
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z, D)
GCD_IN_GGA(X, Y, D) → U1_GGA(X, Y, D, le_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → U3_GGA(X, Y, D, gt_in_gg(X, Y))
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → GCD_LE_IN_GGA(Y, X, D)

The TRS R consists of the following rules:

gcd_in_gga(X, Y, D) → U1_gga(X, Y, D, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U1_gga(X, Y, D, le_out_gg(X, Y)) → U2_gga(X, Y, D, gcd_le_in_gga(X, Y, D))
gcd_le_in_gga(0, Y, Y) → gcd_le_out_gga(0, Y, Y)
gcd_le_in_gga(s(X), Y, D) → U5_gga(X, Y, D, add_in_gag(s(X), Z, Y))
add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
add_in_gag(0, X, X) → add_out_gag(0, X, X)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U5_gga(X, Y, D, add_out_gag(s(X), Z, Y)) → U6_gga(X, Y, D, gcd_in_gga(s(X), Z, D))
gcd_in_gga(X, Y, D) → U3_gga(X, Y, D, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U3_gga(X, Y, D, gt_out_gg(X, Y)) → U4_gga(X, Y, D, gcd_le_in_gga(Y, X, D))
U4_gga(X, Y, D, gcd_le_out_gga(Y, X, D)) → gcd_out_gga(X, Y, D)
U6_gga(X, Y, D, gcd_out_gga(s(X), Z, D)) → gcd_le_out_gga(s(X), Y, D)
U2_gga(X, Y, D, gcd_le_out_gga(X, Y, D)) → gcd_out_gga(X, Y, D)

The argument filtering Pi contains the following mapping:
gcd_in_gga(x1, x2, x3)  =  gcd_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)
gcd_le_in_gga(x1, x2, x3)  =  gcd_le_in_gga(x1, x2)
gcd_le_out_gga(x1, x2, x3)  =  gcd_le_out_gga(x1, x2, x3)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x1, x2, x4)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x1, x3, x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x1, x2, x3)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x1, x2, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
gcd_out_gga(x1, x2, x3)  =  gcd_out_gga(x1, x2, x3)
GCD_IN_GGA(x1, x2, x3)  =  GCD_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
GCD_LE_IN_GGA(x1, x2, x3)  =  GCD_LE_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)

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:

U1_GGA(X, Y, D, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y, D)
GCD_LE_IN_GGA(s(X), Y, D) → U5_GGA(X, Y, D, add_in_gag(s(X), Z, Y))
U5_GGA(X, Y, D, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z, D)
GCD_IN_GGA(X, Y, D) → U1_GGA(X, Y, D, le_in_gg(X, Y))
GCD_IN_GGA(X, Y, D) → U3_GGA(X, Y, D, gt_in_gg(X, Y))
U3_GGA(X, Y, D, gt_out_gg(X, Y)) → GCD_LE_IN_GGA(Y, X, D)

The TRS R consists of the following rules:

add_in_gag(s(X), Y, s(Z)) → U9_gag(X, Y, Z, add_in_gag(X, Y, Z))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U9_gag(X, Y, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
add_in_gag(0, X, X) → add_out_gag(0, X, X)

The argument filtering Pi contains the following mapping:
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U8_gg(x1, x2, x3)  =  U8_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
add_in_gag(x1, x2, x3)  =  add_in_gag(x1, x3)
U9_gag(x1, x2, x3, x4)  =  U9_gag(x1, x3, x4)
add_out_gag(x1, x2, x3)  =  add_out_gag(x1, x2, x3)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
GCD_IN_GGA(x1, x2, x3)  =  GCD_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
GCD_LE_IN_GGA(x1, x2, x3)  =  GCD_LE_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)

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:

U1_GGA(X, Y, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y)
GCD_LE_IN_GGA(s(X), Y) → U5_GGA(X, Y, add_in_gag(s(X), Y))
U5_GGA(X, Y, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z)
GCD_IN_GGA(X, Y) → U1_GGA(X, Y, le_in_gg(X, Y))
GCD_IN_GGA(X, Y) → U3_GGA(X, Y, gt_in_gg(X, Y))
U3_GGA(X, Y, gt_out_gg(X, Y)) → GCD_LE_IN_GGA(Y, X)

The TRS R consists of the following rules:

add_in_gag(s(X), s(Z)) → U9_gag(X, Z, add_in_gag(X, Z))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U9_gag(X, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
add_in_gag(0, X) → add_out_gag(0, X, X)

The set Q consists of the following terms:

add_in_gag(x0, x1)
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U9_gag(x0, x1, x2)
U8_gg(x0, x1, x2)
U7_gg(x0, x1, x2)

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

(69) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


U3_GGA(X, Y, gt_out_gg(X, Y)) → GCD_LE_IN_GGA(Y, X)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(GCD_IN_GGA(x1, x2)) = x1   
POL(GCD_LE_IN_GGA(x1, x2)) = x1   
POL(U1_GGA(x1, x2, x3)) = x1   
POL(U3_GGA(x1, x2, x3)) = x3   
POL(U5_GGA(x1, x2, x3)) = 1 + x1   
POL(U7_gg(x1, x2, x3)) = 1 + x3   
POL(U8_gg(x1, x2, x3)) = 0   
POL(U9_gag(x1, x2, x3)) = 0   
POL(add_in_gag(x1, x2)) = 1   
POL(add_out_gag(x1, x2, x3)) = 0   
POL(gt_in_gg(x1, x2)) = x1   
POL(gt_out_gg(x1, x2)) = 1 + x2   
POL(le_in_gg(x1, x2)) = 0   
POL(le_out_gg(x1, x2)) = 0   
POL(s(x1)) = 1 + x1   

The following usable rules [FROCOS05] were oriented:

gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))

(70) Obligation:

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

U1_GGA(X, Y, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y)
GCD_LE_IN_GGA(s(X), Y) → U5_GGA(X, Y, add_in_gag(s(X), Y))
U5_GGA(X, Y, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z)
GCD_IN_GGA(X, Y) → U1_GGA(X, Y, le_in_gg(X, Y))
GCD_IN_GGA(X, Y) → U3_GGA(X, Y, gt_in_gg(X, Y))

The TRS R consists of the following rules:

add_in_gag(s(X), s(Z)) → U9_gag(X, Z, add_in_gag(X, Z))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U9_gag(X, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
add_in_gag(0, X) → add_out_gag(0, X, X)

The set Q consists of the following terms:

add_in_gag(x0, x1)
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U9_gag(x0, x1, x2)
U8_gg(x0, x1, x2)
U7_gg(x0, x1, x2)

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

(71) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.

(72) Obligation:

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

GCD_LE_IN_GGA(s(X), Y) → U5_GGA(X, Y, add_in_gag(s(X), Y))
U5_GGA(X, Y, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z)
GCD_IN_GGA(X, Y) → U1_GGA(X, Y, le_in_gg(X, Y))
U1_GGA(X, Y, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y)

The TRS R consists of the following rules:

add_in_gag(s(X), s(Z)) → U9_gag(X, Z, add_in_gag(X, Z))
le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U7_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U9_gag(X, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U7_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
add_in_gag(0, X) → add_out_gag(0, X, X)

The set Q consists of the following terms:

add_in_gag(x0, x1)
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U9_gag(x0, x1, x2)
U8_gg(x0, x1, x2)
U7_gg(x0, x1, x2)

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

(73) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(74) Obligation:

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

GCD_LE_IN_GGA(s(X), Y) → U5_GGA(X, Y, add_in_gag(s(X), Y))
U5_GGA(X, Y, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z)
GCD_IN_GGA(X, Y) → U1_GGA(X, Y, le_in_gg(X, Y))
U1_GGA(X, Y, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
add_in_gag(s(X), s(Z)) → U9_gag(X, Z, add_in_gag(X, Z))
add_in_gag(0, X) → add_out_gag(0, X, X)
U9_gag(X, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))

The set Q consists of the following terms:

add_in_gag(x0, x1)
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U9_gag(x0, x1, x2)
U8_gg(x0, x1, x2)
U7_gg(x0, x1, x2)

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

(75) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

gt_in_gg(x0, x1)
U7_gg(x0, x1, x2)

(76) Obligation:

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

GCD_LE_IN_GGA(s(X), Y) → U5_GGA(X, Y, add_in_gag(s(X), Y))
U5_GGA(X, Y, add_out_gag(s(X), Z, Y)) → GCD_IN_GGA(s(X), Z)
GCD_IN_GGA(X, Y) → U1_GGA(X, Y, le_in_gg(X, Y))
U1_GGA(X, Y, le_out_gg(X, Y)) → GCD_LE_IN_GGA(X, Y)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U8_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U8_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
add_in_gag(s(X), s(Z)) → U9_gag(X, Z, add_in_gag(X, Z))
add_in_gag(0, X) → add_out_gag(0, X, X)
U9_gag(X, Z, add_out_gag(X, Y, Z)) → add_out_gag(s(X), Y, s(Z))

The set Q consists of the following terms:

add_in_gag(x0, x1)
le_in_gg(x0, x1)
U9_gag(x0, x1, x2)
U8_gg(x0, x1, x2)

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