(0) Obligation:
Clauses:
even(0) :- !.
even(N) :- ','(p(N, P), odd(P)).
odd(s(0)) :- !.
odd(N) :- ','(p(N, P), even(P)).
p(0, 0).
p(s(X), X).
Queries:
even(g).
(1) CutEliminatorProof (SOUND transformation)
Eliminated all cuts by simply ignoring them[PROLOG].
(2) Obligation:
Clauses:
even(0) :- true.
even(N) :- ','(p(N, P), odd(P)).
odd(s(0)) :- true.
odd(N) :- ','(p(N, P), even(P)).
p(0, 0).
p(s(X), X).
Queries:
even(g).
(3) UndefinedPredicateHandlerProof (SOUND transformation)
Added facts for all undefined predicates [PROLOG].
(4) Obligation:
Clauses:
even(0) :- true.
even(N) :- ','(p(N, P), odd(P)).
odd(s(0)) :- true.
odd(N) :- ','(p(N, P), even(P)).
p(0, 0).
p(s(X), X).
true.
Queries:
even(g).
(5) PrologToPiTRSProof (SOUND transformation)
We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
even_in: (b)
odd_in: (b)
Transforming
Prolog into the following
Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
even_in_g(0) → U1_g(true_in_)
true_in_ → true_out_
U1_g(true_out_) → even_out_g(0)
even_in_g(N) → U2_g(N, p_in_ga(N, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_g(N, p_out_ga(N, P)) → U3_g(N, odd_in_g(P))
odd_in_g(s(0)) → U4_g(true_in_)
U4_g(true_out_) → odd_out_g(s(0))
odd_in_g(N) → U5_g(N, p_in_ga(N, P))
U5_g(N, p_out_ga(N, P)) → U6_g(N, even_in_g(P))
U6_g(N, even_out_g(P)) → odd_out_g(N)
U3_g(N, odd_out_g(P)) → even_out_g(N)
The argument filtering Pi contains the following mapping:
even_in_g(
x1) =
even_in_g(
x1)
0 =
0
U1_g(
x1) =
U1_g(
x1)
true_in_ =
true_in_
true_out_ =
true_out_
even_out_g(
x1) =
even_out_g(
x1)
U2_g(
x1,
x2) =
U2_g(
x1,
x2)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U3_g(
x1,
x2) =
U3_g(
x1,
x2)
odd_in_g(
x1) =
odd_in_g(
x1)
U4_g(
x1) =
U4_g(
x1)
odd_out_g(
x1) =
odd_out_g(
x1)
U5_g(
x1,
x2) =
U5_g(
x1,
x2)
U6_g(
x1,
x2) =
U6_g(
x1,
x2)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
(6) Obligation:
Pi-finite rewrite system:
The TRS R consists of the following rules:
even_in_g(0) → U1_g(true_in_)
true_in_ → true_out_
U1_g(true_out_) → even_out_g(0)
even_in_g(N) → U2_g(N, p_in_ga(N, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_g(N, p_out_ga(N, P)) → U3_g(N, odd_in_g(P))
odd_in_g(s(0)) → U4_g(true_in_)
U4_g(true_out_) → odd_out_g(s(0))
odd_in_g(N) → U5_g(N, p_in_ga(N, P))
U5_g(N, p_out_ga(N, P)) → U6_g(N, even_in_g(P))
U6_g(N, even_out_g(P)) → odd_out_g(N)
U3_g(N, odd_out_g(P)) → even_out_g(N)
The argument filtering Pi contains the following mapping:
even_in_g(
x1) =
even_in_g(
x1)
0 =
0
U1_g(
x1) =
U1_g(
x1)
true_in_ =
true_in_
true_out_ =
true_out_
even_out_g(
x1) =
even_out_g(
x1)
U2_g(
x1,
x2) =
U2_g(
x1,
x2)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U3_g(
x1,
x2) =
U3_g(
x1,
x2)
odd_in_g(
x1) =
odd_in_g(
x1)
U4_g(
x1) =
U4_g(
x1)
odd_out_g(
x1) =
odd_out_g(
x1)
U5_g(
x1,
x2) =
U5_g(
x1,
x2)
U6_g(
x1,
x2) =
U6_g(
x1,
x2)
(7) 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:
EVEN_IN_G(0) → U1_G(true_in_)
EVEN_IN_G(0) → TRUE_IN_
EVEN_IN_G(N) → U2_G(N, p_in_ga(N, P))
EVEN_IN_G(N) → P_IN_GA(N, P)
U2_G(N, p_out_ga(N, P)) → U3_G(N, odd_in_g(P))
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
ODD_IN_G(s(0)) → U4_G(true_in_)
ODD_IN_G(s(0)) → TRUE_IN_
ODD_IN_G(N) → U5_G(N, p_in_ga(N, P))
ODD_IN_G(N) → P_IN_GA(N, P)
U5_G(N, p_out_ga(N, P)) → U6_G(N, even_in_g(P))
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
The TRS R consists of the following rules:
even_in_g(0) → U1_g(true_in_)
true_in_ → true_out_
U1_g(true_out_) → even_out_g(0)
even_in_g(N) → U2_g(N, p_in_ga(N, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_g(N, p_out_ga(N, P)) → U3_g(N, odd_in_g(P))
odd_in_g(s(0)) → U4_g(true_in_)
U4_g(true_out_) → odd_out_g(s(0))
odd_in_g(N) → U5_g(N, p_in_ga(N, P))
U5_g(N, p_out_ga(N, P)) → U6_g(N, even_in_g(P))
U6_g(N, even_out_g(P)) → odd_out_g(N)
U3_g(N, odd_out_g(P)) → even_out_g(N)
The argument filtering Pi contains the following mapping:
even_in_g(
x1) =
even_in_g(
x1)
0 =
0
U1_g(
x1) =
U1_g(
x1)
true_in_ =
true_in_
true_out_ =
true_out_
even_out_g(
x1) =
even_out_g(
x1)
U2_g(
x1,
x2) =
U2_g(
x1,
x2)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U3_g(
x1,
x2) =
U3_g(
x1,
x2)
odd_in_g(
x1) =
odd_in_g(
x1)
U4_g(
x1) =
U4_g(
x1)
odd_out_g(
x1) =
odd_out_g(
x1)
U5_g(
x1,
x2) =
U5_g(
x1,
x2)
U6_g(
x1,
x2) =
U6_g(
x1,
x2)
EVEN_IN_G(
x1) =
EVEN_IN_G(
x1)
U1_G(
x1) =
U1_G(
x1)
TRUE_IN_ =
TRUE_IN_
U2_G(
x1,
x2) =
U2_G(
x1,
x2)
P_IN_GA(
x1,
x2) =
P_IN_GA(
x1)
U3_G(
x1,
x2) =
U3_G(
x1,
x2)
ODD_IN_G(
x1) =
ODD_IN_G(
x1)
U4_G(
x1) =
U4_G(
x1)
U5_G(
x1,
x2) =
U5_G(
x1,
x2)
U6_G(
x1,
x2) =
U6_G(
x1,
x2)
We have to consider all (P,R,Pi)-chains
(8) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
EVEN_IN_G(0) → U1_G(true_in_)
EVEN_IN_G(0) → TRUE_IN_
EVEN_IN_G(N) → U2_G(N, p_in_ga(N, P))
EVEN_IN_G(N) → P_IN_GA(N, P)
U2_G(N, p_out_ga(N, P)) → U3_G(N, odd_in_g(P))
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
ODD_IN_G(s(0)) → U4_G(true_in_)
ODD_IN_G(s(0)) → TRUE_IN_
ODD_IN_G(N) → U5_G(N, p_in_ga(N, P))
ODD_IN_G(N) → P_IN_GA(N, P)
U5_G(N, p_out_ga(N, P)) → U6_G(N, even_in_g(P))
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
The TRS R consists of the following rules:
even_in_g(0) → U1_g(true_in_)
true_in_ → true_out_
U1_g(true_out_) → even_out_g(0)
even_in_g(N) → U2_g(N, p_in_ga(N, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_g(N, p_out_ga(N, P)) → U3_g(N, odd_in_g(P))
odd_in_g(s(0)) → U4_g(true_in_)
U4_g(true_out_) → odd_out_g(s(0))
odd_in_g(N) → U5_g(N, p_in_ga(N, P))
U5_g(N, p_out_ga(N, P)) → U6_g(N, even_in_g(P))
U6_g(N, even_out_g(P)) → odd_out_g(N)
U3_g(N, odd_out_g(P)) → even_out_g(N)
The argument filtering Pi contains the following mapping:
even_in_g(
x1) =
even_in_g(
x1)
0 =
0
U1_g(
x1) =
U1_g(
x1)
true_in_ =
true_in_
true_out_ =
true_out_
even_out_g(
x1) =
even_out_g(
x1)
U2_g(
x1,
x2) =
U2_g(
x1,
x2)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U3_g(
x1,
x2) =
U3_g(
x1,
x2)
odd_in_g(
x1) =
odd_in_g(
x1)
U4_g(
x1) =
U4_g(
x1)
odd_out_g(
x1) =
odd_out_g(
x1)
U5_g(
x1,
x2) =
U5_g(
x1,
x2)
U6_g(
x1,
x2) =
U6_g(
x1,
x2)
EVEN_IN_G(
x1) =
EVEN_IN_G(
x1)
U1_G(
x1) =
U1_G(
x1)
TRUE_IN_ =
TRUE_IN_
U2_G(
x1,
x2) =
U2_G(
x1,
x2)
P_IN_GA(
x1,
x2) =
P_IN_GA(
x1)
U3_G(
x1,
x2) =
U3_G(
x1,
x2)
ODD_IN_G(
x1) =
ODD_IN_G(
x1)
U4_G(
x1) =
U4_G(
x1)
U5_G(
x1,
x2) =
U5_G(
x1,
x2)
U6_G(
x1,
x2) =
U6_G(
x1,
x2)
We have to consider all (P,R,Pi)-chains
(9) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 8 less nodes.
(10) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
EVEN_IN_G(N) → U2_G(N, p_in_ga(N, P))
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
ODD_IN_G(N) → U5_G(N, p_in_ga(N, P))
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
The TRS R consists of the following rules:
even_in_g(0) → U1_g(true_in_)
true_in_ → true_out_
U1_g(true_out_) → even_out_g(0)
even_in_g(N) → U2_g(N, p_in_ga(N, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_g(N, p_out_ga(N, P)) → U3_g(N, odd_in_g(P))
odd_in_g(s(0)) → U4_g(true_in_)
U4_g(true_out_) → odd_out_g(s(0))
odd_in_g(N) → U5_g(N, p_in_ga(N, P))
U5_g(N, p_out_ga(N, P)) → U6_g(N, even_in_g(P))
U6_g(N, even_out_g(P)) → odd_out_g(N)
U3_g(N, odd_out_g(P)) → even_out_g(N)
The argument filtering Pi contains the following mapping:
even_in_g(
x1) =
even_in_g(
x1)
0 =
0
U1_g(
x1) =
U1_g(
x1)
true_in_ =
true_in_
true_out_ =
true_out_
even_out_g(
x1) =
even_out_g(
x1)
U2_g(
x1,
x2) =
U2_g(
x1,
x2)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U3_g(
x1,
x2) =
U3_g(
x1,
x2)
odd_in_g(
x1) =
odd_in_g(
x1)
U4_g(
x1) =
U4_g(
x1)
odd_out_g(
x1) =
odd_out_g(
x1)
U5_g(
x1,
x2) =
U5_g(
x1,
x2)
U6_g(
x1,
x2) =
U6_g(
x1,
x2)
EVEN_IN_G(
x1) =
EVEN_IN_G(
x1)
U2_G(
x1,
x2) =
U2_G(
x1,
x2)
ODD_IN_G(
x1) =
ODD_IN_G(
x1)
U5_G(
x1,
x2) =
U5_G(
x1,
x2)
We have to consider all (P,R,Pi)-chains
(11) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(12) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
EVEN_IN_G(N) → U2_G(N, p_in_ga(N, P))
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
ODD_IN_G(N) → U5_G(N, p_in_ga(N, P))
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
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)
EVEN_IN_G(
x1) =
EVEN_IN_G(
x1)
U2_G(
x1,
x2) =
U2_G(
x1,
x2)
ODD_IN_G(
x1) =
ODD_IN_G(
x1)
U5_G(
x1,
x2) =
U5_G(
x1,
x2)
We have to consider all (P,R,Pi)-chains
(13) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(14) Obligation:
Q DP problem:
The TRS P consists of the following rules:
EVEN_IN_G(N) → U2_G(N, p_in_ga(N))
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
ODD_IN_G(N) → U5_G(N, p_in_ga(N))
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(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.
(15) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
EVEN_IN_G(
N) →
U2_G(
N,
p_in_ga(
N)) at position [1] we obtained the following new rules [LPAR04]:
EVEN_IN_G(0) → U2_G(0, p_out_ga(0, 0))
EVEN_IN_G(s(x0)) → U2_G(s(x0), p_out_ga(s(x0), x0))
(16) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
ODD_IN_G(N) → U5_G(N, p_in_ga(N))
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
EVEN_IN_G(0) → U2_G(0, p_out_ga(0, 0))
EVEN_IN_G(s(x0)) → U2_G(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.
(17) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
ODD_IN_G(
N) →
U5_G(
N,
p_in_ga(
N)) at position [1] we obtained the following new rules [LPAR04]:
ODD_IN_G(0) → U5_G(0, p_out_ga(0, 0))
ODD_IN_G(s(x0)) → U5_G(s(x0), p_out_ga(s(x0), x0))
(18) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
EVEN_IN_G(0) → U2_G(0, p_out_ga(0, 0))
EVEN_IN_G(s(x0)) → U2_G(s(x0), p_out_ga(s(x0), x0))
ODD_IN_G(0) → U5_G(0, p_out_ga(0, 0))
ODD_IN_G(s(x0)) → U5_G(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.
(19) 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.
(20) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
EVEN_IN_G(0) → U2_G(0, p_out_ga(0, 0))
EVEN_IN_G(s(x0)) → U2_G(s(x0), p_out_ga(s(x0), x0))
ODD_IN_G(0) → U5_G(0, p_out_ga(0, 0))
ODD_IN_G(s(x0)) → U5_G(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.
(21) 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)
(22) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
EVEN_IN_G(0) → U2_G(0, p_out_ga(0, 0))
EVEN_IN_G(s(x0)) → U2_G(s(x0), p_out_ga(s(x0), x0))
ODD_IN_G(0) → U5_G(0, p_out_ga(0, 0))
ODD_IN_G(s(x0)) → U5_G(s(x0), p_out_ga(s(x0), x0))
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(23) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U2_G(
N,
p_out_ga(
N,
P)) →
ODD_IN_G(
P) we obtained the following new rules [LPAR04]:
U2_G(0, p_out_ga(0, 0)) → ODD_IN_G(0)
U2_G(s(z0), p_out_ga(s(z0), z0)) → ODD_IN_G(z0)
(24) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
EVEN_IN_G(0) → U2_G(0, p_out_ga(0, 0))
EVEN_IN_G(s(x0)) → U2_G(s(x0), p_out_ga(s(x0), x0))
ODD_IN_G(0) → U5_G(0, p_out_ga(0, 0))
ODD_IN_G(s(x0)) → U5_G(s(x0), p_out_ga(s(x0), x0))
U2_G(0, p_out_ga(0, 0)) → ODD_IN_G(0)
U2_G(s(z0), p_out_ga(s(z0), z0)) → ODD_IN_G(z0)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(25) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U5_G(
N,
p_out_ga(
N,
P)) →
EVEN_IN_G(
P) we obtained the following new rules [LPAR04]:
U5_G(0, p_out_ga(0, 0)) → EVEN_IN_G(0)
U5_G(s(z0), p_out_ga(s(z0), z0)) → EVEN_IN_G(z0)
(26) Obligation:
Q DP problem:
The TRS P consists of the following rules:
EVEN_IN_G(0) → U2_G(0, p_out_ga(0, 0))
EVEN_IN_G(s(x0)) → U2_G(s(x0), p_out_ga(s(x0), x0))
ODD_IN_G(0) → U5_G(0, p_out_ga(0, 0))
ODD_IN_G(s(x0)) → U5_G(s(x0), p_out_ga(s(x0), x0))
U2_G(0, p_out_ga(0, 0)) → ODD_IN_G(0)
U2_G(s(z0), p_out_ga(s(z0), z0)) → ODD_IN_G(z0)
U5_G(0, p_out_ga(0, 0)) → EVEN_IN_G(0)
U5_G(s(z0), p_out_ga(s(z0), z0)) → EVEN_IN_G(z0)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(27) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 2 SCCs.
(28) Complex Obligation (AND)
(29) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_G(0, p_out_ga(0, 0)) → ODD_IN_G(0)
ODD_IN_G(0) → U5_G(0, p_out_ga(0, 0))
U5_G(0, p_out_ga(0, 0)) → EVEN_IN_G(0)
EVEN_IN_G(0) → U2_G(0, p_out_ga(0, 0))
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(30) 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 =
ODD_IN_G(
0) evaluates to t =
ODD_IN_G(
0)
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Semiunifier: [ ]
- Matcher: [ ]
Rewriting sequenceODD_IN_G(0) →
U5_G(
0,
p_out_ga(
0,
0))
with rule
ODD_IN_G(
0) →
U5_G(
0,
p_out_ga(
0,
0)) at position [] and matcher [ ]
U5_G(0, p_out_ga(0, 0)) →
EVEN_IN_G(
0)
with rule
U5_G(
0,
p_out_ga(
0,
0)) →
EVEN_IN_G(
0) at position [] and matcher [ ]
EVEN_IN_G(0) →
U2_G(
0,
p_out_ga(
0,
0))
with rule
EVEN_IN_G(
0) →
U2_G(
0,
p_out_ga(
0,
0)) at position [] and matcher [ ]
U2_G(0, p_out_ga(0, 0)) →
ODD_IN_G(
0)
with rule
U2_G(
0,
p_out_ga(
0,
0)) →
ODD_IN_G(
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.
(31) FALSE
(32) Obligation:
Q DP problem:
The TRS P consists of the following rules:
ODD_IN_G(s(x0)) → U5_G(s(x0), p_out_ga(s(x0), x0))
U5_G(s(z0), p_out_ga(s(z0), z0)) → EVEN_IN_G(z0)
EVEN_IN_G(s(x0)) → U2_G(s(x0), p_out_ga(s(x0), x0))
U2_G(s(z0), p_out_ga(s(z0), z0)) → ODD_IN_G(z0)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(33) 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:
- U5_G(s(z0), p_out_ga(s(z0), z0)) → EVEN_IN_G(z0)
The graph contains the following edges 1 > 1, 2 > 1
- U2_G(s(z0), p_out_ga(s(z0), z0)) → ODD_IN_G(z0)
The graph contains the following edges 1 > 1, 2 > 1
- EVEN_IN_G(s(x0)) → U2_G(s(x0), p_out_ga(s(x0), x0))
The graph contains the following edges 1 >= 1
- ODD_IN_G(s(x0)) → U5_G(s(x0), p_out_ga(s(x0), x0))
The graph contains the following edges 1 >= 1
(34) TRUE
(35) PrologToPiTRSProof (SOUND transformation)
We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
even_in: (b)
odd_in: (b)
Transforming
Prolog into the following
Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
even_in_g(0) → U1_g(true_in_)
true_in_ → true_out_
U1_g(true_out_) → even_out_g(0)
even_in_g(N) → U2_g(N, p_in_ga(N, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_g(N, p_out_ga(N, P)) → U3_g(N, odd_in_g(P))
odd_in_g(s(0)) → U4_g(true_in_)
U4_g(true_out_) → odd_out_g(s(0))
odd_in_g(N) → U5_g(N, p_in_ga(N, P))
U5_g(N, p_out_ga(N, P)) → U6_g(N, even_in_g(P))
U6_g(N, even_out_g(P)) → odd_out_g(N)
U3_g(N, odd_out_g(P)) → even_out_g(N)
The argument filtering Pi contains the following mapping:
even_in_g(
x1) =
even_in_g(
x1)
0 =
0
U1_g(
x1) =
U1_g(
x1)
true_in_ =
true_in_
true_out_ =
true_out_
even_out_g(
x1) =
even_out_g
U2_g(
x1,
x2) =
U2_g(
x2)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
s(
x1) =
s(
x1)
U3_g(
x1,
x2) =
U3_g(
x2)
odd_in_g(
x1) =
odd_in_g(
x1)
U4_g(
x1) =
U4_g(
x1)
odd_out_g(
x1) =
odd_out_g
U5_g(
x1,
x2) =
U5_g(
x2)
U6_g(
x1,
x2) =
U6_g(
x2)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
(36) Obligation:
Pi-finite rewrite system:
The TRS R consists of the following rules:
even_in_g(0) → U1_g(true_in_)
true_in_ → true_out_
U1_g(true_out_) → even_out_g(0)
even_in_g(N) → U2_g(N, p_in_ga(N, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_g(N, p_out_ga(N, P)) → U3_g(N, odd_in_g(P))
odd_in_g(s(0)) → U4_g(true_in_)
U4_g(true_out_) → odd_out_g(s(0))
odd_in_g(N) → U5_g(N, p_in_ga(N, P))
U5_g(N, p_out_ga(N, P)) → U6_g(N, even_in_g(P))
U6_g(N, even_out_g(P)) → odd_out_g(N)
U3_g(N, odd_out_g(P)) → even_out_g(N)
The argument filtering Pi contains the following mapping:
even_in_g(
x1) =
even_in_g(
x1)
0 =
0
U1_g(
x1) =
U1_g(
x1)
true_in_ =
true_in_
true_out_ =
true_out_
even_out_g(
x1) =
even_out_g
U2_g(
x1,
x2) =
U2_g(
x2)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
s(
x1) =
s(
x1)
U3_g(
x1,
x2) =
U3_g(
x2)
odd_in_g(
x1) =
odd_in_g(
x1)
U4_g(
x1) =
U4_g(
x1)
odd_out_g(
x1) =
odd_out_g
U5_g(
x1,
x2) =
U5_g(
x2)
U6_g(
x1,
x2) =
U6_g(
x2)
(37) 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:
EVEN_IN_G(0) → U1_G(true_in_)
EVEN_IN_G(0) → TRUE_IN_
EVEN_IN_G(N) → U2_G(N, p_in_ga(N, P))
EVEN_IN_G(N) → P_IN_GA(N, P)
U2_G(N, p_out_ga(N, P)) → U3_G(N, odd_in_g(P))
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
ODD_IN_G(s(0)) → U4_G(true_in_)
ODD_IN_G(s(0)) → TRUE_IN_
ODD_IN_G(N) → U5_G(N, p_in_ga(N, P))
ODD_IN_G(N) → P_IN_GA(N, P)
U5_G(N, p_out_ga(N, P)) → U6_G(N, even_in_g(P))
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
The TRS R consists of the following rules:
even_in_g(0) → U1_g(true_in_)
true_in_ → true_out_
U1_g(true_out_) → even_out_g(0)
even_in_g(N) → U2_g(N, p_in_ga(N, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_g(N, p_out_ga(N, P)) → U3_g(N, odd_in_g(P))
odd_in_g(s(0)) → U4_g(true_in_)
U4_g(true_out_) → odd_out_g(s(0))
odd_in_g(N) → U5_g(N, p_in_ga(N, P))
U5_g(N, p_out_ga(N, P)) → U6_g(N, even_in_g(P))
U6_g(N, even_out_g(P)) → odd_out_g(N)
U3_g(N, odd_out_g(P)) → even_out_g(N)
The argument filtering Pi contains the following mapping:
even_in_g(
x1) =
even_in_g(
x1)
0 =
0
U1_g(
x1) =
U1_g(
x1)
true_in_ =
true_in_
true_out_ =
true_out_
even_out_g(
x1) =
even_out_g
U2_g(
x1,
x2) =
U2_g(
x2)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
s(
x1) =
s(
x1)
U3_g(
x1,
x2) =
U3_g(
x2)
odd_in_g(
x1) =
odd_in_g(
x1)
U4_g(
x1) =
U4_g(
x1)
odd_out_g(
x1) =
odd_out_g
U5_g(
x1,
x2) =
U5_g(
x2)
U6_g(
x1,
x2) =
U6_g(
x2)
EVEN_IN_G(
x1) =
EVEN_IN_G(
x1)
U1_G(
x1) =
U1_G(
x1)
TRUE_IN_ =
TRUE_IN_
U2_G(
x1,
x2) =
U2_G(
x2)
P_IN_GA(
x1,
x2) =
P_IN_GA(
x1)
U3_G(
x1,
x2) =
U3_G(
x2)
ODD_IN_G(
x1) =
ODD_IN_G(
x1)
U4_G(
x1) =
U4_G(
x1)
U5_G(
x1,
x2) =
U5_G(
x2)
U6_G(
x1,
x2) =
U6_G(
x2)
We have to consider all (P,R,Pi)-chains
(38) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
EVEN_IN_G(0) → U1_G(true_in_)
EVEN_IN_G(0) → TRUE_IN_
EVEN_IN_G(N) → U2_G(N, p_in_ga(N, P))
EVEN_IN_G(N) → P_IN_GA(N, P)
U2_G(N, p_out_ga(N, P)) → U3_G(N, odd_in_g(P))
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
ODD_IN_G(s(0)) → U4_G(true_in_)
ODD_IN_G(s(0)) → TRUE_IN_
ODD_IN_G(N) → U5_G(N, p_in_ga(N, P))
ODD_IN_G(N) → P_IN_GA(N, P)
U5_G(N, p_out_ga(N, P)) → U6_G(N, even_in_g(P))
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
The TRS R consists of the following rules:
even_in_g(0) → U1_g(true_in_)
true_in_ → true_out_
U1_g(true_out_) → even_out_g(0)
even_in_g(N) → U2_g(N, p_in_ga(N, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_g(N, p_out_ga(N, P)) → U3_g(N, odd_in_g(P))
odd_in_g(s(0)) → U4_g(true_in_)
U4_g(true_out_) → odd_out_g(s(0))
odd_in_g(N) → U5_g(N, p_in_ga(N, P))
U5_g(N, p_out_ga(N, P)) → U6_g(N, even_in_g(P))
U6_g(N, even_out_g(P)) → odd_out_g(N)
U3_g(N, odd_out_g(P)) → even_out_g(N)
The argument filtering Pi contains the following mapping:
even_in_g(
x1) =
even_in_g(
x1)
0 =
0
U1_g(
x1) =
U1_g(
x1)
true_in_ =
true_in_
true_out_ =
true_out_
even_out_g(
x1) =
even_out_g
U2_g(
x1,
x2) =
U2_g(
x2)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
s(
x1) =
s(
x1)
U3_g(
x1,
x2) =
U3_g(
x2)
odd_in_g(
x1) =
odd_in_g(
x1)
U4_g(
x1) =
U4_g(
x1)
odd_out_g(
x1) =
odd_out_g
U5_g(
x1,
x2) =
U5_g(
x2)
U6_g(
x1,
x2) =
U6_g(
x2)
EVEN_IN_G(
x1) =
EVEN_IN_G(
x1)
U1_G(
x1) =
U1_G(
x1)
TRUE_IN_ =
TRUE_IN_
U2_G(
x1,
x2) =
U2_G(
x2)
P_IN_GA(
x1,
x2) =
P_IN_GA(
x1)
U3_G(
x1,
x2) =
U3_G(
x2)
ODD_IN_G(
x1) =
ODD_IN_G(
x1)
U4_G(
x1) =
U4_G(
x1)
U5_G(
x1,
x2) =
U5_G(
x2)
U6_G(
x1,
x2) =
U6_G(
x2)
We have to consider all (P,R,Pi)-chains
(39) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 8 less nodes.
(40) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
EVEN_IN_G(N) → U2_G(N, p_in_ga(N, P))
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
ODD_IN_G(N) → U5_G(N, p_in_ga(N, P))
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
The TRS R consists of the following rules:
even_in_g(0) → U1_g(true_in_)
true_in_ → true_out_
U1_g(true_out_) → even_out_g(0)
even_in_g(N) → U2_g(N, p_in_ga(N, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U2_g(N, p_out_ga(N, P)) → U3_g(N, odd_in_g(P))
odd_in_g(s(0)) → U4_g(true_in_)
U4_g(true_out_) → odd_out_g(s(0))
odd_in_g(N) → U5_g(N, p_in_ga(N, P))
U5_g(N, p_out_ga(N, P)) → U6_g(N, even_in_g(P))
U6_g(N, even_out_g(P)) → odd_out_g(N)
U3_g(N, odd_out_g(P)) → even_out_g(N)
The argument filtering Pi contains the following mapping:
even_in_g(
x1) =
even_in_g(
x1)
0 =
0
U1_g(
x1) =
U1_g(
x1)
true_in_ =
true_in_
true_out_ =
true_out_
even_out_g(
x1) =
even_out_g
U2_g(
x1,
x2) =
U2_g(
x2)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
s(
x1) =
s(
x1)
U3_g(
x1,
x2) =
U3_g(
x2)
odd_in_g(
x1) =
odd_in_g(
x1)
U4_g(
x1) =
U4_g(
x1)
odd_out_g(
x1) =
odd_out_g
U5_g(
x1,
x2) =
U5_g(
x2)
U6_g(
x1,
x2) =
U6_g(
x2)
EVEN_IN_G(
x1) =
EVEN_IN_G(
x1)
U2_G(
x1,
x2) =
U2_G(
x2)
ODD_IN_G(
x1) =
ODD_IN_G(
x1)
U5_G(
x1,
x2) =
U5_G(
x2)
We have to consider all (P,R,Pi)-chains
(41) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(42) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
EVEN_IN_G(N) → U2_G(N, p_in_ga(N, P))
U2_G(N, p_out_ga(N, P)) → ODD_IN_G(P)
ODD_IN_G(N) → U5_G(N, p_in_ga(N, P))
U5_G(N, p_out_ga(N, P)) → EVEN_IN_G(P)
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)
EVEN_IN_G(
x1) =
EVEN_IN_G(
x1)
U2_G(
x1,
x2) =
U2_G(
x2)
ODD_IN_G(
x1) =
ODD_IN_G(
x1)
U5_G(
x1,
x2) =
U5_G(
x2)
We have to consider all (P,R,Pi)-chains
(43) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(44) Obligation:
Q DP problem:
The TRS P consists of the following rules:
EVEN_IN_G(N) → U2_G(p_in_ga(N))
U2_G(p_out_ga(P)) → ODD_IN_G(P)
ODD_IN_G(N) → U5_G(p_in_ga(N))
U5_G(p_out_ga(P)) → EVEN_IN_G(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.
(45) 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(EVEN_IN_G(x1)) = 2·x1
POL(ODD_IN_G(x1)) = 2·x1
POL(U2_G(x1)) = x1
POL(U5_G(x1)) = 2·x1
POL(p_in_ga(x1)) = x1
POL(p_out_ga(x1)) = 2·x1
POL(s(x1)) = 2·x1
(46) Obligation:
Q DP problem:
The TRS P consists of the following rules:
EVEN_IN_G(N) → U2_G(p_in_ga(N))
U2_G(p_out_ga(P)) → ODD_IN_G(P)
ODD_IN_G(N) → U5_G(p_in_ga(N))
U5_G(p_out_ga(P)) → EVEN_IN_G(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.
(47) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
EVEN_IN_G(
N) →
U2_G(
p_in_ga(
N)) at position [0] we obtained the following new rules [LPAR04]:
EVEN_IN_G(0) → U2_G(p_out_ga(0))
(48) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_G(p_out_ga(P)) → ODD_IN_G(P)
ODD_IN_G(N) → U5_G(p_in_ga(N))
U5_G(p_out_ga(P)) → EVEN_IN_G(P)
EVEN_IN_G(0) → U2_G(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.
(49) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
ODD_IN_G(
N) →
U5_G(
p_in_ga(
N)) at position [0] we obtained the following new rules [LPAR04]:
ODD_IN_G(0) → U5_G(p_out_ga(0))
(50) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_G(p_out_ga(P)) → ODD_IN_G(P)
U5_G(p_out_ga(P)) → EVEN_IN_G(P)
EVEN_IN_G(0) → U2_G(p_out_ga(0))
ODD_IN_G(0) → U5_G(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.
(51) 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.
(52) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_G(p_out_ga(P)) → ODD_IN_G(P)
U5_G(p_out_ga(P)) → EVEN_IN_G(P)
EVEN_IN_G(0) → U2_G(p_out_ga(0))
ODD_IN_G(0) → U5_G(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.
(53) 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)
(54) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_G(p_out_ga(P)) → ODD_IN_G(P)
U5_G(p_out_ga(P)) → EVEN_IN_G(P)
EVEN_IN_G(0) → U2_G(p_out_ga(0))
ODD_IN_G(0) → U5_G(p_out_ga(0))
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(55) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U2_G(
p_out_ga(
P)) →
ODD_IN_G(
P) we obtained the following new rules [LPAR04]:
U2_G(p_out_ga(0)) → ODD_IN_G(0)
(56) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U5_G(p_out_ga(P)) → EVEN_IN_G(P)
EVEN_IN_G(0) → U2_G(p_out_ga(0))
ODD_IN_G(0) → U5_G(p_out_ga(0))
U2_G(p_out_ga(0)) → ODD_IN_G(0)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(57) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U5_G(
p_out_ga(
P)) →
EVEN_IN_G(
P) we obtained the following new rules [LPAR04]:
U5_G(p_out_ga(0)) → EVEN_IN_G(0)
(58) Obligation:
Q DP problem:
The TRS P consists of the following rules:
EVEN_IN_G(0) → U2_G(p_out_ga(0))
ODD_IN_G(0) → U5_G(p_out_ga(0))
U2_G(p_out_ga(0)) → ODD_IN_G(0)
U5_G(p_out_ga(0)) → EVEN_IN_G(0)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(59) 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_G(
p_out_ga(
0)) evaluates to t =
U2_G(
p_out_ga(
0))
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Matcher: [ ]
- Semiunifier: [ ]
Rewriting sequenceU2_G(p_out_ga(0)) →
ODD_IN_G(
0)
with rule
U2_G(
p_out_ga(
0)) →
ODD_IN_G(
0) at position [] and matcher [ ]
ODD_IN_G(0) →
U5_G(
p_out_ga(
0))
with rule
ODD_IN_G(
0) →
U5_G(
p_out_ga(
0)) at position [] and matcher [ ]
U5_G(p_out_ga(0)) →
EVEN_IN_G(
0)
with rule
U5_G(
p_out_ga(
0)) →
EVEN_IN_G(
0) at position [] and matcher [ ]
EVEN_IN_G(0) →
U2_G(
p_out_ga(
0))
with rule
EVEN_IN_G(
0) →
U2_G(
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.
(60) FALSE