(0) Obligation:

Clauses:

add(X, 0, Y) :- ','(!, eq(X, Y)).
add(X, Y, s(Z)) :- ','(p(Y, P), add(X, P, Z)).
p(0, 0).
p(s(X), X).
eq(X, X).

Queries:

add(a,g,a).

(1) CutEliminatorProof (SOUND transformation)

Eliminated all cuts by simply ignoring them[PROLOG].

(2) Obligation:

Clauses:

add(X, 0, Y) :- eq(X, Y).
add(X, Y, s(Z)) :- ','(p(Y, P), add(X, P, Z)).
p(0, 0).
p(s(X), X).
eq(X, X).

Queries:

add(a,g,a).

(3) PrologToPiTRSProof (SOUND transformation)

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

add_in_aga(X, 0, Y) → U1_aga(X, Y, eq_in_aa(X, Y))
eq_in_aa(X, X) → eq_out_aa(X, X)
U1_aga(X, Y, eq_out_aa(X, Y)) → add_out_aga(X, 0, Y)
add_in_aga(X, Y, s(Z)) → U2_aga(X, Y, Z, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_aga(X, Y, Z, p_out_ga(Y, P)) → U3_aga(X, Y, Z, add_in_aga(X, P, Z))
U3_aga(X, Y, Z, add_out_aga(X, P, Z)) → add_out_aga(X, Y, s(Z))

The argument filtering Pi contains the following mapping:
add_in_aga(x1, x2, x3)  =  add_in_aga(x2)
0  =  0
U1_aga(x1, x2, x3)  =  U1_aga(x3)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
add_out_aga(x1, x2, x3)  =  add_out_aga
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x2)
s(x1)  =  s(x1)
U3_aga(x1, x2, x3, x4)  =  U3_aga(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

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

add_in_aga(X, 0, Y) → U1_aga(X, Y, eq_in_aa(X, Y))
eq_in_aa(X, X) → eq_out_aa(X, X)
U1_aga(X, Y, eq_out_aa(X, Y)) → add_out_aga(X, 0, Y)
add_in_aga(X, Y, s(Z)) → U2_aga(X, Y, Z, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_aga(X, Y, Z, p_out_ga(Y, P)) → U3_aga(X, Y, Z, add_in_aga(X, P, Z))
U3_aga(X, Y, Z, add_out_aga(X, P, Z)) → add_out_aga(X, Y, s(Z))

The argument filtering Pi contains the following mapping:
add_in_aga(x1, x2, x3)  =  add_in_aga(x2)
0  =  0
U1_aga(x1, x2, x3)  =  U1_aga(x3)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
add_out_aga(x1, x2, x3)  =  add_out_aga
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x2)
s(x1)  =  s(x1)
U3_aga(x1, x2, x3, x4)  =  U3_aga(x4)

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

ADD_IN_AGA(X, 0, Y) → U1_AGA(X, Y, eq_in_aa(X, Y))
ADD_IN_AGA(X, 0, Y) → EQ_IN_AA(X, Y)
ADD_IN_AGA(X, Y, s(Z)) → U2_AGA(X, Y, Z, p_in_ga(Y, P))
ADD_IN_AGA(X, Y, s(Z)) → P_IN_GA(Y, P)
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → U3_AGA(X, Y, Z, add_in_aga(X, P, Z))
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → ADD_IN_AGA(X, P, Z)

The TRS R consists of the following rules:

add_in_aga(X, 0, Y) → U1_aga(X, Y, eq_in_aa(X, Y))
eq_in_aa(X, X) → eq_out_aa(X, X)
U1_aga(X, Y, eq_out_aa(X, Y)) → add_out_aga(X, 0, Y)
add_in_aga(X, Y, s(Z)) → U2_aga(X, Y, Z, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_aga(X, Y, Z, p_out_ga(Y, P)) → U3_aga(X, Y, Z, add_in_aga(X, P, Z))
U3_aga(X, Y, Z, add_out_aga(X, P, Z)) → add_out_aga(X, Y, s(Z))

The argument filtering Pi contains the following mapping:
add_in_aga(x1, x2, x3)  =  add_in_aga(x2)
0  =  0
U1_aga(x1, x2, x3)  =  U1_aga(x3)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
add_out_aga(x1, x2, x3)  =  add_out_aga
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x2)
s(x1)  =  s(x1)
U3_aga(x1, x2, x3, x4)  =  U3_aga(x4)
ADD_IN_AGA(x1, x2, x3)  =  ADD_IN_AGA(x2)
U1_AGA(x1, x2, x3)  =  U1_AGA(x3)
EQ_IN_AA(x1, x2)  =  EQ_IN_AA
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x4)
P_IN_GA(x1, x2)  =  P_IN_GA(x1)
U3_AGA(x1, x2, x3, x4)  =  U3_AGA(x4)

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

(6) Obligation:

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

ADD_IN_AGA(X, 0, Y) → U1_AGA(X, Y, eq_in_aa(X, Y))
ADD_IN_AGA(X, 0, Y) → EQ_IN_AA(X, Y)
ADD_IN_AGA(X, Y, s(Z)) → U2_AGA(X, Y, Z, p_in_ga(Y, P))
ADD_IN_AGA(X, Y, s(Z)) → P_IN_GA(Y, P)
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → U3_AGA(X, Y, Z, add_in_aga(X, P, Z))
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → ADD_IN_AGA(X, P, Z)

The TRS R consists of the following rules:

add_in_aga(X, 0, Y) → U1_aga(X, Y, eq_in_aa(X, Y))
eq_in_aa(X, X) → eq_out_aa(X, X)
U1_aga(X, Y, eq_out_aa(X, Y)) → add_out_aga(X, 0, Y)
add_in_aga(X, Y, s(Z)) → U2_aga(X, Y, Z, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_aga(X, Y, Z, p_out_ga(Y, P)) → U3_aga(X, Y, Z, add_in_aga(X, P, Z))
U3_aga(X, Y, Z, add_out_aga(X, P, Z)) → add_out_aga(X, Y, s(Z))

The argument filtering Pi contains the following mapping:
add_in_aga(x1, x2, x3)  =  add_in_aga(x2)
0  =  0
U1_aga(x1, x2, x3)  =  U1_aga(x3)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
add_out_aga(x1, x2, x3)  =  add_out_aga
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x2)
s(x1)  =  s(x1)
U3_aga(x1, x2, x3, x4)  =  U3_aga(x4)
ADD_IN_AGA(x1, x2, x3)  =  ADD_IN_AGA(x2)
U1_AGA(x1, x2, x3)  =  U1_AGA(x3)
EQ_IN_AA(x1, x2)  =  EQ_IN_AA
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x4)
P_IN_GA(x1, x2)  =  P_IN_GA(x1)
U3_AGA(x1, x2, x3, x4)  =  U3_AGA(x4)

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

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 4 less nodes.

(8) Obligation:

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

ADD_IN_AGA(X, Y, s(Z)) → U2_AGA(X, Y, Z, p_in_ga(Y, P))
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → ADD_IN_AGA(X, P, Z)

The TRS R consists of the following rules:

add_in_aga(X, 0, Y) → U1_aga(X, Y, eq_in_aa(X, Y))
eq_in_aa(X, X) → eq_out_aa(X, X)
U1_aga(X, Y, eq_out_aa(X, Y)) → add_out_aga(X, 0, Y)
add_in_aga(X, Y, s(Z)) → U2_aga(X, Y, Z, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_aga(X, Y, Z, p_out_ga(Y, P)) → U3_aga(X, Y, Z, add_in_aga(X, P, Z))
U3_aga(X, Y, Z, add_out_aga(X, P, Z)) → add_out_aga(X, Y, s(Z))

The argument filtering Pi contains the following mapping:
add_in_aga(x1, x2, x3)  =  add_in_aga(x2)
0  =  0
U1_aga(x1, x2, x3)  =  U1_aga(x3)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
add_out_aga(x1, x2, x3)  =  add_out_aga
U2_aga(x1, x2, x3, x4)  =  U2_aga(x4)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x2)
s(x1)  =  s(x1)
U3_aga(x1, x2, x3, x4)  =  U3_aga(x4)
ADD_IN_AGA(x1, x2, x3)  =  ADD_IN_AGA(x2)
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x4)

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

(9) UsableRulesProof (EQUIVALENT transformation)

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

(10) Obligation:

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

ADD_IN_AGA(X, Y, s(Z)) → U2_AGA(X, Y, Z, p_in_ga(Y, P))
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → ADD_IN_AGA(X, P, Z)

The TRS R consists of the following rules:

p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)

The argument filtering Pi contains the following mapping:
0  =  0
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x2)
s(x1)  =  s(x1)
ADD_IN_AGA(x1, x2, x3)  =  ADD_IN_AGA(x2)
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x4)

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

(11) PiDPToQDPProof (SOUND transformation)

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

(12) Obligation:

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

ADD_IN_AGA(Y) → U2_AGA(p_in_ga(Y))
U2_AGA(p_out_ga(P)) → ADD_IN_AGA(P)

The TRS R consists of the following rules:

p_in_ga(0) → p_out_ga(0)
p_in_ga(s(X)) → p_out_ga(X)

The set Q consists of the following terms:

p_in_ga(x0)

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

(13) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

No dependency pairs are removed.

The following rules are removed from R:

p_in_ga(s(X)) → p_out_ga(X)
Used ordering: POLO with Polynomial interpretation [POLO]:

POL(0) = 0   
POL(ADD_IN_AGA(x1)) = x1   
POL(U2_AGA(x1)) = x1   
POL(p_in_ga(x1)) = x1   
POL(p_out_ga(x1)) = 2·x1   
POL(s(x1)) = 2·x1   

(14) Obligation:

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

ADD_IN_AGA(Y) → U2_AGA(p_in_ga(Y))
U2_AGA(p_out_ga(P)) → ADD_IN_AGA(P)

The TRS R consists of the following rules:

p_in_ga(0) → p_out_ga(0)

The set Q consists of the following terms:

p_in_ga(x0)

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

(15) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule ADD_IN_AGA(Y) → U2_AGA(p_in_ga(Y)) at position [0] we obtained the following new rules [LPAR04]:

ADD_IN_AGA(0) → U2_AGA(p_out_ga(0))

(16) Obligation:

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

U2_AGA(p_out_ga(P)) → ADD_IN_AGA(P)
ADD_IN_AGA(0) → U2_AGA(p_out_ga(0))

The TRS R consists of the following rules:

p_in_ga(0) → p_out_ga(0)

The set Q consists of the following terms:

p_in_ga(x0)

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

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

(18) Obligation:

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

U2_AGA(p_out_ga(P)) → ADD_IN_AGA(P)
ADD_IN_AGA(0) → U2_AGA(p_out_ga(0))

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

p_in_ga(x0)

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

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

p_in_ga(x0)

(20) Obligation:

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

U2_AGA(p_out_ga(P)) → ADD_IN_AGA(P)
ADD_IN_AGA(0) → U2_AGA(p_out_ga(0))

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

(21) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U2_AGA(p_out_ga(P)) → ADD_IN_AGA(P) we obtained the following new rules [LPAR04]:

U2_AGA(p_out_ga(0)) → ADD_IN_AGA(0)

(22) Obligation:

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

ADD_IN_AGA(0) → U2_AGA(p_out_ga(0))
U2_AGA(p_out_ga(0)) → ADD_IN_AGA(0)

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

(23) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

s = U2_AGA(p_out_ga(0)) evaluates to t =U2_AGA(p_out_ga(0))

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




Rewriting sequence

U2_AGA(p_out_ga(0))ADD_IN_AGA(0)
with rule U2_AGA(p_out_ga(0)) → ADD_IN_AGA(0) at position [] and matcher [ ]

ADD_IN_AGA(0)U2_AGA(p_out_ga(0))
with rule ADD_IN_AGA(0) → U2_AGA(p_out_ga(0))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.



(24) FALSE

(25) PrologToPiTRSProof (SOUND transformation)

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

add_in_aga(X, 0, Y) → U1_aga(X, Y, eq_in_aa(X, Y))
eq_in_aa(X, X) → eq_out_aa(X, X)
U1_aga(X, Y, eq_out_aa(X, Y)) → add_out_aga(X, 0, Y)
add_in_aga(X, Y, s(Z)) → U2_aga(X, Y, Z, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_aga(X, Y, Z, p_out_ga(Y, P)) → U3_aga(X, Y, Z, add_in_aga(X, P, Z))
U3_aga(X, Y, Z, add_out_aga(X, P, Z)) → add_out_aga(X, Y, s(Z))

The argument filtering Pi contains the following mapping:
add_in_aga(x1, x2, x3)  =  add_in_aga(x2)
0  =  0
U1_aga(x1, x2, x3)  =  U1_aga(x3)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
add_out_aga(x1, x2, x3)  =  add_out_aga(x2)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x2, x4)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
s(x1)  =  s(x1)
U3_aga(x1, x2, x3, x4)  =  U3_aga(x2, x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(26) Obligation:

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

add_in_aga(X, 0, Y) → U1_aga(X, Y, eq_in_aa(X, Y))
eq_in_aa(X, X) → eq_out_aa(X, X)
U1_aga(X, Y, eq_out_aa(X, Y)) → add_out_aga(X, 0, Y)
add_in_aga(X, Y, s(Z)) → U2_aga(X, Y, Z, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_aga(X, Y, Z, p_out_ga(Y, P)) → U3_aga(X, Y, Z, add_in_aga(X, P, Z))
U3_aga(X, Y, Z, add_out_aga(X, P, Z)) → add_out_aga(X, Y, s(Z))

The argument filtering Pi contains the following mapping:
add_in_aga(x1, x2, x3)  =  add_in_aga(x2)
0  =  0
U1_aga(x1, x2, x3)  =  U1_aga(x3)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
add_out_aga(x1, x2, x3)  =  add_out_aga(x2)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x2, x4)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
s(x1)  =  s(x1)
U3_aga(x1, x2, x3, x4)  =  U3_aga(x2, x4)

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

ADD_IN_AGA(X, 0, Y) → U1_AGA(X, Y, eq_in_aa(X, Y))
ADD_IN_AGA(X, 0, Y) → EQ_IN_AA(X, Y)
ADD_IN_AGA(X, Y, s(Z)) → U2_AGA(X, Y, Z, p_in_ga(Y, P))
ADD_IN_AGA(X, Y, s(Z)) → P_IN_GA(Y, P)
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → U3_AGA(X, Y, Z, add_in_aga(X, P, Z))
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → ADD_IN_AGA(X, P, Z)

The TRS R consists of the following rules:

add_in_aga(X, 0, Y) → U1_aga(X, Y, eq_in_aa(X, Y))
eq_in_aa(X, X) → eq_out_aa(X, X)
U1_aga(X, Y, eq_out_aa(X, Y)) → add_out_aga(X, 0, Y)
add_in_aga(X, Y, s(Z)) → U2_aga(X, Y, Z, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_aga(X, Y, Z, p_out_ga(Y, P)) → U3_aga(X, Y, Z, add_in_aga(X, P, Z))
U3_aga(X, Y, Z, add_out_aga(X, P, Z)) → add_out_aga(X, Y, s(Z))

The argument filtering Pi contains the following mapping:
add_in_aga(x1, x2, x3)  =  add_in_aga(x2)
0  =  0
U1_aga(x1, x2, x3)  =  U1_aga(x3)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
add_out_aga(x1, x2, x3)  =  add_out_aga(x2)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x2, x4)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
s(x1)  =  s(x1)
U3_aga(x1, x2, x3, x4)  =  U3_aga(x2, x4)
ADD_IN_AGA(x1, x2, x3)  =  ADD_IN_AGA(x2)
U1_AGA(x1, x2, x3)  =  U1_AGA(x3)
EQ_IN_AA(x1, x2)  =  EQ_IN_AA
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x2, x4)
P_IN_GA(x1, x2)  =  P_IN_GA(x1)
U3_AGA(x1, x2, x3, x4)  =  U3_AGA(x2, x4)

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

(28) Obligation:

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

ADD_IN_AGA(X, 0, Y) → U1_AGA(X, Y, eq_in_aa(X, Y))
ADD_IN_AGA(X, 0, Y) → EQ_IN_AA(X, Y)
ADD_IN_AGA(X, Y, s(Z)) → U2_AGA(X, Y, Z, p_in_ga(Y, P))
ADD_IN_AGA(X, Y, s(Z)) → P_IN_GA(Y, P)
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → U3_AGA(X, Y, Z, add_in_aga(X, P, Z))
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → ADD_IN_AGA(X, P, Z)

The TRS R consists of the following rules:

add_in_aga(X, 0, Y) → U1_aga(X, Y, eq_in_aa(X, Y))
eq_in_aa(X, X) → eq_out_aa(X, X)
U1_aga(X, Y, eq_out_aa(X, Y)) → add_out_aga(X, 0, Y)
add_in_aga(X, Y, s(Z)) → U2_aga(X, Y, Z, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_aga(X, Y, Z, p_out_ga(Y, P)) → U3_aga(X, Y, Z, add_in_aga(X, P, Z))
U3_aga(X, Y, Z, add_out_aga(X, P, Z)) → add_out_aga(X, Y, s(Z))

The argument filtering Pi contains the following mapping:
add_in_aga(x1, x2, x3)  =  add_in_aga(x2)
0  =  0
U1_aga(x1, x2, x3)  =  U1_aga(x3)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
add_out_aga(x1, x2, x3)  =  add_out_aga(x2)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x2, x4)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
s(x1)  =  s(x1)
U3_aga(x1, x2, x3, x4)  =  U3_aga(x2, x4)
ADD_IN_AGA(x1, x2, x3)  =  ADD_IN_AGA(x2)
U1_AGA(x1, x2, x3)  =  U1_AGA(x3)
EQ_IN_AA(x1, x2)  =  EQ_IN_AA
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x2, x4)
P_IN_GA(x1, x2)  =  P_IN_GA(x1)
U3_AGA(x1, x2, x3, x4)  =  U3_AGA(x2, x4)

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

(29) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 4 less nodes.

(30) Obligation:

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

ADD_IN_AGA(X, Y, s(Z)) → U2_AGA(X, Y, Z, p_in_ga(Y, P))
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → ADD_IN_AGA(X, P, Z)

The TRS R consists of the following rules:

add_in_aga(X, 0, Y) → U1_aga(X, Y, eq_in_aa(X, Y))
eq_in_aa(X, X) → eq_out_aa(X, X)
U1_aga(X, Y, eq_out_aa(X, Y)) → add_out_aga(X, 0, Y)
add_in_aga(X, Y, s(Z)) → U2_aga(X, Y, Z, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_aga(X, Y, Z, p_out_ga(Y, P)) → U3_aga(X, Y, Z, add_in_aga(X, P, Z))
U3_aga(X, Y, Z, add_out_aga(X, P, Z)) → add_out_aga(X, Y, s(Z))

The argument filtering Pi contains the following mapping:
add_in_aga(x1, x2, x3)  =  add_in_aga(x2)
0  =  0
U1_aga(x1, x2, x3)  =  U1_aga(x3)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
add_out_aga(x1, x2, x3)  =  add_out_aga(x2)
U2_aga(x1, x2, x3, x4)  =  U2_aga(x2, x4)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
s(x1)  =  s(x1)
U3_aga(x1, x2, x3, x4)  =  U3_aga(x2, x4)
ADD_IN_AGA(x1, x2, x3)  =  ADD_IN_AGA(x2)
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x2, x4)

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

(31) UsableRulesProof (EQUIVALENT transformation)

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

(32) Obligation:

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

ADD_IN_AGA(X, Y, s(Z)) → U2_AGA(X, Y, Z, p_in_ga(Y, P))
U2_AGA(X, Y, Z, p_out_ga(Y, P)) → ADD_IN_AGA(X, P, Z)

The TRS R consists of the following rules:

p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)

The argument filtering Pi contains the following mapping:
0  =  0
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
s(x1)  =  s(x1)
ADD_IN_AGA(x1, x2, x3)  =  ADD_IN_AGA(x2)
U2_AGA(x1, x2, x3, x4)  =  U2_AGA(x2, x4)

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

(33) PiDPToQDPProof (SOUND transformation)

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

(34) Obligation:

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

ADD_IN_AGA(Y) → U2_AGA(Y, p_in_ga(Y))
U2_AGA(Y, p_out_ga(Y, P)) → ADD_IN_AGA(P)

The TRS R consists of the following rules:

p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)

The set Q consists of the following terms:

p_in_ga(x0)

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

(35) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule ADD_IN_AGA(Y) → U2_AGA(Y, p_in_ga(Y)) at position [1] we obtained the following new rules [LPAR04]:

ADD_IN_AGA(0) → U2_AGA(0, p_out_ga(0, 0))
ADD_IN_AGA(s(x0)) → U2_AGA(s(x0), p_out_ga(s(x0), x0))

(36) Obligation:

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

U2_AGA(Y, p_out_ga(Y, P)) → ADD_IN_AGA(P)
ADD_IN_AGA(0) → U2_AGA(0, p_out_ga(0, 0))
ADD_IN_AGA(s(x0)) → U2_AGA(s(x0), p_out_ga(s(x0), x0))

The TRS R consists of the following rules:

p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)

The set Q consists of the following terms:

p_in_ga(x0)

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

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

(38) Obligation:

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

U2_AGA(Y, p_out_ga(Y, P)) → ADD_IN_AGA(P)
ADD_IN_AGA(0) → U2_AGA(0, p_out_ga(0, 0))
ADD_IN_AGA(s(x0)) → U2_AGA(s(x0), p_out_ga(s(x0), x0))

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

p_in_ga(x0)

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

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

p_in_ga(x0)

(40) Obligation:

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

U2_AGA(Y, p_out_ga(Y, P)) → ADD_IN_AGA(P)
ADD_IN_AGA(0) → U2_AGA(0, p_out_ga(0, 0))
ADD_IN_AGA(s(x0)) → U2_AGA(s(x0), p_out_ga(s(x0), x0))

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

(41) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U2_AGA(Y, p_out_ga(Y, P)) → ADD_IN_AGA(P) we obtained the following new rules [LPAR04]:

U2_AGA(0, p_out_ga(0, 0)) → ADD_IN_AGA(0)
U2_AGA(s(z0), p_out_ga(s(z0), z0)) → ADD_IN_AGA(z0)

(42) Obligation:

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

ADD_IN_AGA(0) → U2_AGA(0, p_out_ga(0, 0))
ADD_IN_AGA(s(x0)) → U2_AGA(s(x0), p_out_ga(s(x0), x0))
U2_AGA(0, p_out_ga(0, 0)) → ADD_IN_AGA(0)
U2_AGA(s(z0), p_out_ga(s(z0), z0)) → ADD_IN_AGA(z0)

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

(43) DependencyGraphProof (EQUIVALENT transformation)

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

(44) Complex Obligation (AND)

(45) Obligation:

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

U2_AGA(0, p_out_ga(0, 0)) → ADD_IN_AGA(0)
ADD_IN_AGA(0) → U2_AGA(0, p_out_ga(0, 0))

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

(46) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

s = ADD_IN_AGA(0) evaluates to t =ADD_IN_AGA(0)

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




Rewriting sequence

ADD_IN_AGA(0)U2_AGA(0, p_out_ga(0, 0))
with rule ADD_IN_AGA(0) → U2_AGA(0, p_out_ga(0, 0)) at position [] and matcher [ ]

U2_AGA(0, p_out_ga(0, 0))ADD_IN_AGA(0)
with rule U2_AGA(0, p_out_ga(0, 0)) → ADD_IN_AGA(0)

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.



(47) FALSE

(48) Obligation:

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

ADD_IN_AGA(s(x0)) → U2_AGA(s(x0), p_out_ga(s(x0), x0))
U2_AGA(s(z0), p_out_ga(s(z0), z0)) → ADD_IN_AGA(z0)

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

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

  • U2_AGA(s(z0), p_out_ga(s(z0), z0)) → ADD_IN_AGA(z0)
    The graph contains the following edges 1 > 1, 2 > 1

  • ADD_IN_AGA(s(x0)) → U2_AGA(s(x0), p_out_ga(s(x0), x0))
    The graph contains the following edges 1 >= 1

(50) TRUE