(0) Obligation:

Clauses:

s2(plus(A, plus(B, C)), D) :- s2(plus(plus(A, B), C), D).
s2(plus(A, B), C) :- s2(plus(B, A), C).
s2(plus(X, 0), X).
s2(plus(X, Y), Z) :- ','(s2(X, A), ','(s2(Y, B), s2(plus(A, B), Z))).
s2(plus(A, B), C) :- ','(isNat(A), ','(isNat(B), add(A, B, C))).
isNat(s(X)) :- isNat(X).
isNat(0).
add(s(X), Y, s(Z)) :- add(X, Y, Z).
add(0, X, X).

Queries:

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

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

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

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)

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

S2_IN_GA(plus(A, plus(B, C)), D) → U1_GA(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
S2_IN_GA(plus(A, B), C) → U2_GA(A, B, C, s2_in_ga(plus(B, A), C))
S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
S2_IN_GA(plus(A, B), C) → U6_GA(A, B, C, isNat_in_g(A))
S2_IN_GA(plus(A, B), C) → ISNAT_IN_G(A)
ISNAT_IN_G(s(X)) → U9_G(X, isNat_in_g(X))
ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)
U6_GA(A, B, C, isNat_out_g(A)) → U7_GA(A, B, C, isNat_in_g(B))
U6_GA(A, B, C, isNat_out_g(A)) → ISNAT_IN_G(B)
U7_GA(A, B, C, isNat_out_g(B)) → U8_GA(A, B, C, add_in_gga(A, B, C))
U7_GA(A, B, C, isNat_out_g(B)) → ADD_IN_GGA(A, B, C)
ADD_IN_GGA(s(X), Y, s(Z)) → U10_GGA(X, Y, Z, add_in_gga(X, Y, Z))
ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → U5_GA(X, Y, Z, s2_in_ga(plus(A, B), Z))
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x5)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x2, x4)
U6_GA(x1, x2, x3, x4)  =  U6_GA(x1, x2, x4)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)
U9_G(x1, x2)  =  U9_G(x2)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x1, x2, x4)
U8_GA(x1, x2, x3, x4)  =  U8_GA(x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U10_GGA(x1, x2, x3, x4)  =  U10_GGA(x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x4, x5)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x4)

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

(4) Obligation:

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

S2_IN_GA(plus(A, plus(B, C)), D) → U1_GA(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
S2_IN_GA(plus(A, B), C) → U2_GA(A, B, C, s2_in_ga(plus(B, A), C))
S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
S2_IN_GA(plus(A, B), C) → U6_GA(A, B, C, isNat_in_g(A))
S2_IN_GA(plus(A, B), C) → ISNAT_IN_G(A)
ISNAT_IN_G(s(X)) → U9_G(X, isNat_in_g(X))
ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)
U6_GA(A, B, C, isNat_out_g(A)) → U7_GA(A, B, C, isNat_in_g(B))
U6_GA(A, B, C, isNat_out_g(A)) → ISNAT_IN_G(B)
U7_GA(A, B, C, isNat_out_g(B)) → U8_GA(A, B, C, add_in_gga(A, B, C))
U7_GA(A, B, C, isNat_out_g(B)) → ADD_IN_GGA(A, B, C)
ADD_IN_GGA(s(X), Y, s(Z)) → U10_GGA(X, Y, Z, add_in_gga(X, Y, Z))
ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → U5_GA(X, Y, Z, s2_in_ga(plus(A, B), Z))
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x5)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x2, x4)
U6_GA(x1, x2, x3, x4)  =  U6_GA(x1, x2, x4)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)
U9_G(x1, x2)  =  U9_G(x2)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x1, x2, x4)
U8_GA(x1, x2, x3, x4)  =  U8_GA(x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U10_GGA(x1, x2, x3, x4)  =  U10_GGA(x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x4, x5)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x4)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

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

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)

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

(8) UsableRulesProof (EQUIVALENT transformation)

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

(9) Obligation:

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

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

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

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

(10) PiDPToQDPProof (SOUND transformation)

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

(11) Obligation:

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

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

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

(12) QDPSizeChangeProof (EQUIVALENT transformation)

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

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

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

(13) TRUE

(14) Obligation:

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

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)

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:

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

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:

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

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:

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

(20) TRUE

(21) Obligation:

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

S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x2, x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x4, x5)

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

(22) PiDPToQDPProof (SOUND transformation)

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

(23) Obligation:

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

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(X, Y)) → U3_GA(Y, s2_in_ga(X))
U3_GA(Y, s2_out_ga(A)) → U4_GA(A, s2_in_ga(Y))
U4_GA(A, s2_out_ga(B)) → S2_IN_GA(plus(A, B))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)
U3_GA(Y, s2_out_ga(A)) → S2_IN_GA(Y)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(X)
s2_in_ga(plus(X, Y)) → U3_ga(Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(isNat_in_g(X))
isNat_in_g(0) → isNat_out_g
U9_g(isNat_out_g) → isNat_out_g
U6_ga(A, B, isNat_out_g) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g) → U8_ga(add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(X)
U10_gga(add_out_gga(Z)) → add_out_gga(s(Z))
U8_ga(add_out_gga(C)) → s2_out_ga(C)
U3_ga(Y, s2_out_ga(A)) → U4_ga(A, s2_in_ga(Y))
U4_ga(A, s2_out_ga(B)) → U5_ga(s2_in_ga(plus(A, B)))
U5_ga(s2_out_ga(Z)) → s2_out_ga(Z)
U2_ga(s2_out_ga(C)) → s2_out_ga(C)
U1_ga(s2_out_ga(D)) → s2_out_ga(D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0)
U8_ga(x0)
U3_ga(x0, x1)
U4_ga(x0, x1)
U5_ga(x0)
U2_ga(x0)
U1_ga(x0)

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

(24) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


U3_GA(Y, s2_out_ga(A)) → U4_GA(A, s2_in_ga(Y))
U4_GA(A, s2_out_ga(B)) → S2_IN_GA(plus(A, B))
U3_GA(Y, s2_out_ga(A)) → S2_IN_GA(Y)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 1   
POL(S2_IN_GA(x1)) = x1   
POL(U10_gga(x1)) = x1   
POL(U1_ga(x1)) = x1   
POL(U2_ga(x1)) = x1   
POL(U3_GA(x1, x2)) = x1 + x2   
POL(U3_ga(x1, x2)) = x1 + x2   
POL(U4_GA(x1, x2)) = x1 + x2   
POL(U4_ga(x1, x2)) = x1 + x2   
POL(U5_ga(x1)) = 1 + x1   
POL(U6_ga(x1, x2, x3)) = x2 + x3   
POL(U7_ga(x1, x2, x3)) = 1 + x2   
POL(U8_ga(x1)) = 1 + x1   
POL(U9_g(x1)) = x1   
POL(add_in_gga(x1, x2)) = x2   
POL(add_out_gga(x1)) = x1   
POL(isNat_in_g(x1)) = x1   
POL(isNat_out_g) = 1   
POL(plus(x1, x2)) = x1 + x2   
POL(s(x1)) = x1   
POL(s2_in_ga(x1)) = x1   
POL(s2_out_ga(x1)) = 1 + x1   

The following usable rules [FROCOS05] were oriented:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(X)
s2_in_ga(plus(X, Y)) → U3_ga(Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
U2_ga(s2_out_ga(C)) → s2_out_ga(C)
U1_ga(s2_out_ga(D)) → s2_out_ga(D)
U3_ga(Y, s2_out_ga(A)) → U4_ga(A, s2_in_ga(Y))
U4_ga(A, s2_out_ga(B)) → U5_ga(s2_in_ga(plus(A, B)))
U5_ga(s2_out_ga(Z)) → s2_out_ga(Z)
isNat_in_g(s(X)) → U9_g(isNat_in_g(X))
isNat_in_g(0) → isNat_out_g
U6_ga(A, B, isNat_out_g) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g) → U8_ga(add_in_gga(A, B))
U9_g(isNat_out_g) → isNat_out_g
add_in_gga(s(X), Y) → U10_gga(add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(X)
U8_ga(add_out_gga(C)) → s2_out_ga(C)
U10_gga(add_out_gga(Z)) → add_out_gga(s(Z))

(25) Obligation:

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

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(X, Y)) → U3_GA(Y, s2_in_ga(X))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(X)
s2_in_ga(plus(X, Y)) → U3_ga(Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(isNat_in_g(X))
isNat_in_g(0) → isNat_out_g
U9_g(isNat_out_g) → isNat_out_g
U6_ga(A, B, isNat_out_g) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g) → U8_ga(add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(X)
U10_gga(add_out_gga(Z)) → add_out_gga(s(Z))
U8_ga(add_out_gga(C)) → s2_out_ga(C)
U3_ga(Y, s2_out_ga(A)) → U4_ga(A, s2_in_ga(Y))
U4_ga(A, s2_out_ga(B)) → U5_ga(s2_in_ga(plus(A, B)))
U5_ga(s2_out_ga(Z)) → s2_out_ga(Z)
U2_ga(s2_out_ga(C)) → s2_out_ga(C)
U1_ga(s2_out_ga(D)) → s2_out_ga(D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0)
U8_ga(x0)
U3_ga(x0, x1)
U4_ga(x0, x1)
U5_ga(x0)
U2_ga(x0)
U1_ga(x0)

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

(26) DependencyGraphProof (EQUIVALENT transformation)

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

(27) Obligation:

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

S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(X)
s2_in_ga(plus(X, Y)) → U3_ga(Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(isNat_in_g(X))
isNat_in_g(0) → isNat_out_g
U9_g(isNat_out_g) → isNat_out_g
U6_ga(A, B, isNat_out_g) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g) → U8_ga(add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(X)
U10_gga(add_out_gga(Z)) → add_out_gga(s(Z))
U8_ga(add_out_gga(C)) → s2_out_ga(C)
U3_ga(Y, s2_out_ga(A)) → U4_ga(A, s2_in_ga(Y))
U4_ga(A, s2_out_ga(B)) → U5_ga(s2_in_ga(plus(A, B)))
U5_ga(s2_out_ga(Z)) → s2_out_ga(Z)
U2_ga(s2_out_ga(C)) → s2_out_ga(C)
U1_ga(s2_out_ga(D)) → s2_out_ga(D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0)
U8_ga(x0)
U3_ga(x0, x1)
U4_ga(x0, x1)
U5_ga(x0)
U2_ga(x0)
U1_ga(x0)

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

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

(29) Obligation:

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

S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)

R is empty.
The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0)
U8_ga(x0)
U3_ga(x0, x1)
U4_ga(x0, x1)
U5_ga(x0)
U2_ga(x0)
U1_ga(x0)

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

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

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0)
U8_ga(x0)
U3_ga(x0, x1)
U4_ga(x0, x1)
U5_ga(x0)
U2_ga(x0)
U1_ga(x0)

(31) Obligation:

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

S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)

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

(32) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)


Used ordering: Polynomial interpretation [POLO]:

POL(S2_IN_GA(x1)) = 2·x1   
POL(plus(x1, x2)) = 1 + x1 + x2   

(33) Obligation:

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

S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))

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

(34) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

s = S2_IN_GA(plus(A, B)) evaluates to t =S2_IN_GA(plus(B, A))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
  • Matcher: [A / B, B / A]
  • Semiunifier: [ ]




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from S2_IN_GA(plus(A, B)) to S2_IN_GA(plus(B, A)).



(35) FALSE

(36) PrologToPiTRSProof (SOUND transformation)

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

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(37) Obligation:

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

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)

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

S2_IN_GA(plus(A, plus(B, C)), D) → U1_GA(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
S2_IN_GA(plus(A, B), C) → U2_GA(A, B, C, s2_in_ga(plus(B, A), C))
S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
S2_IN_GA(plus(A, B), C) → U6_GA(A, B, C, isNat_in_g(A))
S2_IN_GA(plus(A, B), C) → ISNAT_IN_G(A)
ISNAT_IN_G(s(X)) → U9_G(X, isNat_in_g(X))
ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)
U6_GA(A, B, C, isNat_out_g(A)) → U7_GA(A, B, C, isNat_in_g(B))
U6_GA(A, B, C, isNat_out_g(A)) → ISNAT_IN_G(B)
U7_GA(A, B, C, isNat_out_g(B)) → U8_GA(A, B, C, add_in_gga(A, B, C))
U7_GA(A, B, C, isNat_out_g(B)) → ADD_IN_GGA(A, B, C)
ADD_IN_GGA(s(X), Y, s(Z)) → U10_GGA(X, Y, Z, add_in_gga(X, Y, Z))
ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → U5_GA(X, Y, Z, s2_in_ga(plus(A, B), Z))
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x1, x2, x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x2, x4)
U6_GA(x1, x2, x3, x4)  =  U6_GA(x1, x2, x4)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)
U9_G(x1, x2)  =  U9_G(x1, x2)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x1, x2, x4)
U8_GA(x1, x2, x3, x4)  =  U8_GA(x1, x2, x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U10_GGA(x1, x2, x3, x4)  =  U10_GGA(x1, x2, x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x4, x5)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x1, x2, x4)

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

(39) Obligation:

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

S2_IN_GA(plus(A, plus(B, C)), D) → U1_GA(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
S2_IN_GA(plus(A, B), C) → U2_GA(A, B, C, s2_in_ga(plus(B, A), C))
S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
S2_IN_GA(plus(A, B), C) → U6_GA(A, B, C, isNat_in_g(A))
S2_IN_GA(plus(A, B), C) → ISNAT_IN_G(A)
ISNAT_IN_G(s(X)) → U9_G(X, isNat_in_g(X))
ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)
U6_GA(A, B, C, isNat_out_g(A)) → U7_GA(A, B, C, isNat_in_g(B))
U6_GA(A, B, C, isNat_out_g(A)) → ISNAT_IN_G(B)
U7_GA(A, B, C, isNat_out_g(B)) → U8_GA(A, B, C, add_in_gga(A, B, C))
U7_GA(A, B, C, isNat_out_g(B)) → ADD_IN_GGA(A, B, C)
ADD_IN_GGA(s(X), Y, s(Z)) → U10_GGA(X, Y, Z, add_in_gga(X, Y, Z))
ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → U5_GA(X, Y, Z, s2_in_ga(plus(A, B), Z))
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x1, x2, x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x2, x4)
U6_GA(x1, x2, x3, x4)  =  U6_GA(x1, x2, x4)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)
U9_G(x1, x2)  =  U9_G(x1, x2)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x1, x2, x4)
U8_GA(x1, x2, x3, x4)  =  U8_GA(x1, x2, x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U10_GGA(x1, x2, x3, x4)  =  U10_GGA(x1, x2, x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x4, x5)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x1, x2, x4)

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

(40) DependencyGraphProof (EQUIVALENT transformation)

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

(41) Complex Obligation (AND)

(42) Obligation:

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

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

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)

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

(43) UsableRulesProof (EQUIVALENT transformation)

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

(44) Obligation:

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

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

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

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

(45) PiDPToQDPProof (SOUND transformation)

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

(46) Obligation:

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

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

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

(47) QDPSizeChangeProof (EQUIVALENT transformation)

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

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

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

(48) TRUE

(49) Obligation:

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

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)

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

(50) UsableRulesProof (EQUIVALENT transformation)

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

(51) Obligation:

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

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

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

(52) PiDPToQDPProof (EQUIVALENT transformation)

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

(53) Obligation:

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

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

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

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

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

(55) TRUE

(56) Obligation:

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

S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x2, x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x4, x5)

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

(57) PiDPToQDPProof (SOUND transformation)

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

(58) Obligation:

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

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(X, Y)) → U3_GA(X, Y, s2_in_ga(X))
U3_GA(X, Y, s2_out_ga(X, A)) → U4_GA(X, Y, A, s2_in_ga(Y))
U4_GA(X, Y, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)
U3_GA(X, Y, s2_out_ga(X, A)) → S2_IN_GA(Y)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(A, B, C, s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(A, B, s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y)) → U3_ga(X, Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, isNat_out_g(A)) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g(B)) → U8_ga(A, B, add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(X, Y, add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(0, X, X)
U10_gga(X, Y, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, s2_out_ga(X, A)) → U4_ga(X, Y, A, s2_in_ga(Y))
U4_ga(X, Y, A, s2_out_ga(Y, B)) → U5_ga(X, Y, s2_in_ga(plus(A, B)))
U5_ga(X, Y, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0, x1)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U8_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
U4_ga(x0, x1, x2, x3)
U5_ga(x0, x1, x2)
U2_ga(x0, x1, x2)
U1_ga(x0, x1, x2, x3)

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

(59) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


U3_GA(X, Y, s2_out_ga(X, A)) → U4_GA(X, Y, A, s2_in_ga(Y))
U4_GA(X, Y, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B))
U3_GA(X, Y, s2_out_ga(X, A)) → S2_IN_GA(Y)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 1   
POL(S2_IN_GA(x1)) = x1   
POL(U10_gga(x1, x2, x3)) = x3   
POL(U1_ga(x1, x2, x3, x4)) = x4   
POL(U2_ga(x1, x2, x3)) = x3   
POL(U3_GA(x1, x2, x3)) = x2 + x3   
POL(U3_ga(x1, x2, x3)) = x2 + x3   
POL(U4_GA(x1, x2, x3, x4)) = x3 + x4   
POL(U4_ga(x1, x2, x3, x4)) = x3 + x4   
POL(U5_ga(x1, x2, x3)) = x3   
POL(U6_ga(x1, x2, x3)) = x1 + x2   
POL(U7_ga(x1, x2, x3)) = x1 + x2   
POL(U8_ga(x1, x2, x3)) = x3   
POL(U9_g(x1, x2)) = 0   
POL(add_in_gga(x1, x2)) = x1 + x2   
POL(add_out_gga(x1, x2, x3)) = 1 + x3   
POL(isNat_in_g(x1)) = 0   
POL(isNat_out_g(x1)) = 0   
POL(plus(x1, x2)) = x1 + x2   
POL(s(x1)) = x1   
POL(s2_in_ga(x1)) = x1   
POL(s2_out_ga(x1, x2)) = 1 + x2   

The following usable rules [FROCOS05] were oriented:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(A, B, C, s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(A, B, s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y)) → U3_ga(X, Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
U2_ga(A, B, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)
U3_ga(X, Y, s2_out_ga(X, A)) → U4_ga(X, Y, A, s2_in_ga(Y))
U4_ga(X, Y, A, s2_out_ga(Y, B)) → U5_ga(X, Y, s2_in_ga(plus(A, B)))
U5_ga(X, Y, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U6_ga(A, B, isNat_out_g(A)) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g(B)) → U8_ga(A, B, add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(X, Y, add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(0, X, X)
U8_ga(A, B, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U10_gga(X, Y, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))

(60) Obligation:

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

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(X, Y)) → U3_GA(X, Y, s2_in_ga(X))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(A, B, C, s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(A, B, s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y)) → U3_ga(X, Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, isNat_out_g(A)) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g(B)) → U8_ga(A, B, add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(X, Y, add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(0, X, X)
U10_gga(X, Y, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, s2_out_ga(X, A)) → U4_ga(X, Y, A, s2_in_ga(Y))
U4_ga(X, Y, A, s2_out_ga(Y, B)) → U5_ga(X, Y, s2_in_ga(plus(A, B)))
U5_ga(X, Y, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0, x1)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U8_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
U4_ga(x0, x1, x2, x3)
U5_ga(x0, x1, x2)
U2_ga(x0, x1, x2)
U1_ga(x0, x1, x2, x3)

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

(61) DependencyGraphProof (EQUIVALENT transformation)

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

(62) Obligation:

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

S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(A, B, C, s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(A, B, s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y)) → U3_ga(X, Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, isNat_out_g(A)) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g(B)) → U8_ga(A, B, add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(X, Y, add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(0, X, X)
U10_gga(X, Y, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, s2_out_ga(X, A)) → U4_ga(X, Y, A, s2_in_ga(Y))
U4_ga(X, Y, A, s2_out_ga(Y, B)) → U5_ga(X, Y, s2_in_ga(plus(A, B)))
U5_ga(X, Y, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0, x1)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U8_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
U4_ga(x0, x1, x2, x3)
U5_ga(x0, x1, x2)
U2_ga(x0, x1, x2)
U1_ga(x0, x1, x2, x3)

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

(63) 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.

(64) Obligation:

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

S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)

R is empty.
The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0, x1)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U8_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
U4_ga(x0, x1, x2, x3)
U5_ga(x0, x1, x2)
U2_ga(x0, x1, x2)
U1_ga(x0, x1, x2, x3)

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

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

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0, x1)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U8_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
U4_ga(x0, x1, x2, x3)
U5_ga(x0, x1, x2)
U2_ga(x0, x1, x2)
U1_ga(x0, x1, x2, x3)

(66) Obligation:

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

S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)

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

(67) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)


Used ordering: Polynomial interpretation [POLO]:

POL(S2_IN_GA(x1)) = x1   
POL(plus(x1, x2)) = 1 + x1 + x2   

(68) Obligation:

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

S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))

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

(69) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

s = S2_IN_GA(plus(A, B)) evaluates to t =S2_IN_GA(plus(B, A))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
  • Matcher: [A / B, B / A]
  • Semiunifier: [ ]




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from S2_IN_GA(plus(A, B)) to S2_IN_GA(plus(B, A)).



(70) FALSE