(0) Obligation:
Clauses:
p(0, 0).
p(s(X), X).
le(0, Y, true).
le(s(X), 0, false).
le(s(X), s(Y), B) :- le(X, Y, B).
minus(X, Y, Z) :- ','(le(X, Y, B), if(B, X, Y, Z)).
if(true, X, Y, 0).
if(false, X, Y, s(Z)) :- ','(p(X, X1), minus(X1, Y, Z)).
Queries:
minus(g,a,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:
minus_in: (b,f,f)
le_in: (b,f,f)
if_in: (b,b,f,f)
Transforming
Prolog into the following
Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x3)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
(2) Obligation:
Pi-finite rewrite system:
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x3)
(3) DependencyPairsProof (EQUIVALENT transformation)
Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:
MINUS_IN_GAA(X, Y, Z) → U2_GAA(X, Y, Z, le_in_gaa(X, Y, B))
MINUS_IN_GAA(X, Y, Z) → LE_IN_GAA(X, Y, B)
LE_IN_GAA(s(X), s(Y), B) → U1_GAA(X, Y, B, le_in_gaa(X, Y, B))
LE_IN_GAA(s(X), s(Y), B) → LE_IN_GAA(X, Y, B)
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → U3_GAA(X, Y, Z, if_in_ggaa(B, X, Y, Z))
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → IF_IN_GGAA(B, X, Y, Z)
IF_IN_GGAA(false, X, Y, s(Z)) → U4_GGAA(X, Y, Z, p_in_ga(X, X1))
IF_IN_GGAA(false, X, Y, s(Z)) → P_IN_GA(X, X1)
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → U5_GGAA(X, Y, Z, minus_in_gaa(X1, Y, Z))
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → MINUS_IN_GAA(X1, Y, Z)
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x3)
MINUS_IN_GAA(
x1,
x2,
x3) =
MINUS_IN_GAA(
x1)
U2_GAA(
x1,
x2,
x3,
x4) =
U2_GAA(
x1,
x4)
LE_IN_GAA(
x1,
x2,
x3) =
LE_IN_GAA(
x1)
U1_GAA(
x1,
x2,
x3,
x4) =
U1_GAA(
x4)
U3_GAA(
x1,
x2,
x3,
x4) =
U3_GAA(
x4)
IF_IN_GGAA(
x1,
x2,
x3,
x4) =
IF_IN_GGAA(
x1,
x2)
U4_GGAA(
x1,
x2,
x3,
x4) =
U4_GGAA(
x4)
P_IN_GA(
x1,
x2) =
P_IN_GA(
x1)
U5_GGAA(
x1,
x2,
x3,
x4) =
U5_GGAA(
x4)
We have to consider all (P,R,Pi)-chains
(4) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MINUS_IN_GAA(X, Y, Z) → U2_GAA(X, Y, Z, le_in_gaa(X, Y, B))
MINUS_IN_GAA(X, Y, Z) → LE_IN_GAA(X, Y, B)
LE_IN_GAA(s(X), s(Y), B) → U1_GAA(X, Y, B, le_in_gaa(X, Y, B))
LE_IN_GAA(s(X), s(Y), B) → LE_IN_GAA(X, Y, B)
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → U3_GAA(X, Y, Z, if_in_ggaa(B, X, Y, Z))
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → IF_IN_GGAA(B, X, Y, Z)
IF_IN_GGAA(false, X, Y, s(Z)) → U4_GGAA(X, Y, Z, p_in_ga(X, X1))
IF_IN_GGAA(false, X, Y, s(Z)) → P_IN_GA(X, X1)
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → U5_GGAA(X, Y, Z, minus_in_gaa(X1, Y, Z))
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → MINUS_IN_GAA(X1, Y, Z)
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x3)
MINUS_IN_GAA(
x1,
x2,
x3) =
MINUS_IN_GAA(
x1)
U2_GAA(
x1,
x2,
x3,
x4) =
U2_GAA(
x1,
x4)
LE_IN_GAA(
x1,
x2,
x3) =
LE_IN_GAA(
x1)
U1_GAA(
x1,
x2,
x3,
x4) =
U1_GAA(
x4)
U3_GAA(
x1,
x2,
x3,
x4) =
U3_GAA(
x4)
IF_IN_GGAA(
x1,
x2,
x3,
x4) =
IF_IN_GGAA(
x1,
x2)
U4_GGAA(
x1,
x2,
x3,
x4) =
U4_GGAA(
x4)
P_IN_GA(
x1,
x2) =
P_IN_GA(
x1)
U5_GGAA(
x1,
x2,
x3,
x4) =
U5_GGAA(
x4)
We have to consider all (P,R,Pi)-chains
(5) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 5 less nodes.
(6) Complex Obligation (AND)
(7) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
LE_IN_GAA(s(X), s(Y), B) → LE_IN_GAA(X, Y, B)
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x3)
LE_IN_GAA(
x1,
x2,
x3) =
LE_IN_GAA(
x1)
We have to consider all (P,R,Pi)-chains
(8) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(9) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
LE_IN_GAA(s(X), s(Y), B) → LE_IN_GAA(X, Y, B)
R is empty.
The argument filtering Pi contains the following mapping:
s(
x1) =
s(
x1)
LE_IN_GAA(
x1,
x2,
x3) =
LE_IN_GAA(
x1)
We have to consider all (P,R,Pi)-chains
(10) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(11) Obligation:
Q DP problem:
The TRS P consists of the following rules:
LE_IN_GAA(s(X)) → LE_IN_GAA(X)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(12) QDPSizeChangeProof (EQUIVALENT transformation)
By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.
From the DPs we obtained the following set of size-change graphs:
- LE_IN_GAA(s(X)) → LE_IN_GAA(X)
The graph contains the following edges 1 > 1
(13) TRUE
(14) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → IF_IN_GGAA(B, X, Y, Z)
IF_IN_GGAA(false, X, Y, s(Z)) → U4_GGAA(X, Y, Z, p_in_ga(X, X1))
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → MINUS_IN_GAA(X1, Y, Z)
MINUS_IN_GAA(X, Y, Z) → U2_GAA(X, Y, Z, le_in_gaa(X, Y, B))
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x3)
MINUS_IN_GAA(
x1,
x2,
x3) =
MINUS_IN_GAA(
x1)
U2_GAA(
x1,
x2,
x3,
x4) =
U2_GAA(
x1,
x4)
IF_IN_GGAA(
x1,
x2,
x3,
x4) =
IF_IN_GGAA(
x1,
x2)
U4_GGAA(
x1,
x2,
x3,
x4) =
U4_GGAA(
x4)
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:
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → IF_IN_GGAA(B, X, Y, Z)
IF_IN_GGAA(false, X, Y, s(Z)) → U4_GGAA(X, Y, Z, p_in_ga(X, X1))
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → MINUS_IN_GAA(X1, Y, Z)
MINUS_IN_GAA(X, Y, Z) → U2_GAA(X, Y, Z, le_in_gaa(X, Y, B))
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)
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
The argument filtering Pi contains the following mapping:
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x4)
true =
true
false =
false
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x2)
MINUS_IN_GAA(
x1,
x2,
x3) =
MINUS_IN_GAA(
x1)
U2_GAA(
x1,
x2,
x3,
x4) =
U2_GAA(
x1,
x4)
IF_IN_GGAA(
x1,
x2,
x3,
x4) =
IF_IN_GGAA(
x1,
x2)
U4_GGAA(
x1,
x2,
x3,
x4) =
U4_GGAA(
x4)
We have to consider all (P,R,Pi)-chains
(17) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(18) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_GAA(X, le_out_gaa(B)) → IF_IN_GGAA(B, X)
IF_IN_GGAA(false, X) → U4_GGAA(p_in_ga(X))
U4_GGAA(p_out_ga(X1)) → MINUS_IN_GAA(X1)
MINUS_IN_GAA(X) → U2_GAA(X, le_in_gaa(X))
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)
le_in_gaa(0) → le_out_gaa(true)
le_in_gaa(s(X)) → le_out_gaa(false)
le_in_gaa(s(X)) → U1_gaa(le_in_gaa(X))
U1_gaa(le_out_gaa(B)) → le_out_gaa(B)
The set Q consists of the following terms:
p_in_ga(x0)
le_in_gaa(x0)
U1_gaa(x0)
We have to consider all (P,Q,R)-chains.
(19) 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:
le_in_gaa(s(X)) → le_out_gaa(false)
le_in_gaa(s(X)) → U1_gaa(le_in_gaa(X))
p_in_ga(s(X)) → p_out_ga(X)
Used ordering: POLO with Polynomial interpretation [POLO]:
POL(0) = 0
POL(IF_IN_GGAA(x1, x2)) = x1 + x2
POL(MINUS_IN_GAA(x1)) = 2·x1
POL(U1_gaa(x1)) = 2·x1
POL(U2_GAA(x1, x2)) = x1 + x2
POL(U4_GGAA(x1)) = x1
POL(false) = 0
POL(le_in_gaa(x1)) = x1
POL(le_out_gaa(x1)) = x1
POL(p_in_ga(x1)) = x1
POL(p_out_ga(x1)) = 2·x1
POL(s(x1)) = 2·x1
POL(true) = 0
(20) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_GAA(X, le_out_gaa(B)) → IF_IN_GGAA(B, X)
IF_IN_GGAA(false, X) → U4_GGAA(p_in_ga(X))
U4_GGAA(p_out_ga(X1)) → MINUS_IN_GAA(X1)
MINUS_IN_GAA(X) → U2_GAA(X, le_in_gaa(X))
The TRS R consists of the following rules:
le_in_gaa(0) → le_out_gaa(true)
U1_gaa(le_out_gaa(B)) → le_out_gaa(B)
p_in_ga(0) → p_out_ga(0)
The set Q consists of the following terms:
p_in_ga(x0)
le_in_gaa(x0)
U1_gaa(x0)
We have to consider all (P,Q,R)-chains.
(21) 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.
(22) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_GAA(X, le_out_gaa(B)) → IF_IN_GGAA(B, X)
IF_IN_GGAA(false, X) → U4_GGAA(p_in_ga(X))
U4_GGAA(p_out_ga(X1)) → MINUS_IN_GAA(X1)
MINUS_IN_GAA(X) → U2_GAA(X, le_in_gaa(X))
The TRS R consists of the following rules:
le_in_gaa(0) → le_out_gaa(true)
p_in_ga(0) → p_out_ga(0)
The set Q consists of the following terms:
p_in_ga(x0)
le_in_gaa(x0)
U1_gaa(x0)
We have to consider all (P,Q,R)-chains.
(23) 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].
U1_gaa(x0)
(24) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_GAA(X, le_out_gaa(B)) → IF_IN_GGAA(B, X)
IF_IN_GGAA(false, X) → U4_GGAA(p_in_ga(X))
U4_GGAA(p_out_ga(X1)) → MINUS_IN_GAA(X1)
MINUS_IN_GAA(X) → U2_GAA(X, le_in_gaa(X))
The TRS R consists of the following rules:
le_in_gaa(0) → le_out_gaa(true)
p_in_ga(0) → p_out_ga(0)
The set Q consists of the following terms:
p_in_ga(x0)
le_in_gaa(x0)
We have to consider all (P,Q,R)-chains.
(25) 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.
The following dependency pairs can be deleted:
IF_IN_GGAA(false, X) → U4_GGAA(p_in_ga(X))
U4_GGAA(p_out_ga(X1)) → MINUS_IN_GAA(X1)
No rules are removed from R.
Used ordering: POLO with Polynomial interpretation [POLO]:
POL(0) = 0
POL(IF_IN_GGAA(x1, x2)) = 2 + x1 + x2
POL(MINUS_IN_GAA(x1)) = 2 + 2·x1
POL(U2_GAA(x1, x2)) = x1 + x2
POL(U4_GGAA(x1)) = 2 + x1
POL(false) = 1
POL(le_in_gaa(x1)) = 2 + x1
POL(le_out_gaa(x1)) = 2 + 2·x1
POL(p_in_ga(x1)) = 1 + x1
POL(p_out_ga(x1)) = 1 + 2·x1
POL(true) = 0
(26) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_GAA(X, le_out_gaa(B)) → IF_IN_GGAA(B, X)
MINUS_IN_GAA(X) → U2_GAA(X, le_in_gaa(X))
The TRS R consists of the following rules:
le_in_gaa(0) → le_out_gaa(true)
p_in_ga(0) → p_out_ga(0)
The set Q consists of the following terms:
p_in_ga(x0)
le_in_gaa(x0)
We have to consider all (P,Q,R)-chains.
(27) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 2 less nodes.
(28) TRUE
(29) PrologToPiTRSProof (SOUND transformation)
We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
minus_in: (b,f,f)
le_in: (b,f,f)
if_in: (b,b,f,f)
Transforming
Prolog into the following
Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x1,
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x1,
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x1,
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x1,
x2,
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x1,
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x1,
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x1,
x3)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
(30) Obligation:
Pi-finite rewrite system:
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x1,
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x1,
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x1,
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x1,
x2,
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x1,
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x1,
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x1,
x3)
(31) 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:
MINUS_IN_GAA(X, Y, Z) → U2_GAA(X, Y, Z, le_in_gaa(X, Y, B))
MINUS_IN_GAA(X, Y, Z) → LE_IN_GAA(X, Y, B)
LE_IN_GAA(s(X), s(Y), B) → U1_GAA(X, Y, B, le_in_gaa(X, Y, B))
LE_IN_GAA(s(X), s(Y), B) → LE_IN_GAA(X, Y, B)
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → U3_GAA(X, Y, Z, if_in_ggaa(B, X, Y, Z))
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → IF_IN_GGAA(B, X, Y, Z)
IF_IN_GGAA(false, X, Y, s(Z)) → U4_GGAA(X, Y, Z, p_in_ga(X, X1))
IF_IN_GGAA(false, X, Y, s(Z)) → P_IN_GA(X, X1)
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → U5_GGAA(X, Y, Z, minus_in_gaa(X1, Y, Z))
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → MINUS_IN_GAA(X1, Y, Z)
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x1,
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x1,
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x1,
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x1,
x2,
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x1,
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x1,
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x1,
x3)
MINUS_IN_GAA(
x1,
x2,
x3) =
MINUS_IN_GAA(
x1)
U2_GAA(
x1,
x2,
x3,
x4) =
U2_GAA(
x1,
x4)
LE_IN_GAA(
x1,
x2,
x3) =
LE_IN_GAA(
x1)
U1_GAA(
x1,
x2,
x3,
x4) =
U1_GAA(
x1,
x4)
U3_GAA(
x1,
x2,
x3,
x4) =
U3_GAA(
x1,
x4)
IF_IN_GGAA(
x1,
x2,
x3,
x4) =
IF_IN_GGAA(
x1,
x2)
U4_GGAA(
x1,
x2,
x3,
x4) =
U4_GGAA(
x1,
x4)
P_IN_GA(
x1,
x2) =
P_IN_GA(
x1)
U5_GGAA(
x1,
x2,
x3,
x4) =
U5_GGAA(
x1,
x4)
We have to consider all (P,R,Pi)-chains
(32) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MINUS_IN_GAA(X, Y, Z) → U2_GAA(X, Y, Z, le_in_gaa(X, Y, B))
MINUS_IN_GAA(X, Y, Z) → LE_IN_GAA(X, Y, B)
LE_IN_GAA(s(X), s(Y), B) → U1_GAA(X, Y, B, le_in_gaa(X, Y, B))
LE_IN_GAA(s(X), s(Y), B) → LE_IN_GAA(X, Y, B)
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → U3_GAA(X, Y, Z, if_in_ggaa(B, X, Y, Z))
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → IF_IN_GGAA(B, X, Y, Z)
IF_IN_GGAA(false, X, Y, s(Z)) → U4_GGAA(X, Y, Z, p_in_ga(X, X1))
IF_IN_GGAA(false, X, Y, s(Z)) → P_IN_GA(X, X1)
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → U5_GGAA(X, Y, Z, minus_in_gaa(X1, Y, Z))
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → MINUS_IN_GAA(X1, Y, Z)
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x1,
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x1,
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x1,
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x1,
x2,
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x1,
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x1,
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x1,
x3)
MINUS_IN_GAA(
x1,
x2,
x3) =
MINUS_IN_GAA(
x1)
U2_GAA(
x1,
x2,
x3,
x4) =
U2_GAA(
x1,
x4)
LE_IN_GAA(
x1,
x2,
x3) =
LE_IN_GAA(
x1)
U1_GAA(
x1,
x2,
x3,
x4) =
U1_GAA(
x1,
x4)
U3_GAA(
x1,
x2,
x3,
x4) =
U3_GAA(
x1,
x4)
IF_IN_GGAA(
x1,
x2,
x3,
x4) =
IF_IN_GGAA(
x1,
x2)
U4_GGAA(
x1,
x2,
x3,
x4) =
U4_GGAA(
x1,
x4)
P_IN_GA(
x1,
x2) =
P_IN_GA(
x1)
U5_GGAA(
x1,
x2,
x3,
x4) =
U5_GGAA(
x1,
x4)
We have to consider all (P,R,Pi)-chains
(33) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 5 less nodes.
(34) Complex Obligation (AND)
(35) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
LE_IN_GAA(s(X), s(Y), B) → LE_IN_GAA(X, Y, B)
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x1,
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x1,
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x1,
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x1,
x2,
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x1,
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x1,
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x1,
x3)
LE_IN_GAA(
x1,
x2,
x3) =
LE_IN_GAA(
x1)
We have to consider all (P,R,Pi)-chains
(36) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(37) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
LE_IN_GAA(s(X), s(Y), B) → LE_IN_GAA(X, Y, B)
R is empty.
The argument filtering Pi contains the following mapping:
s(
x1) =
s(
x1)
LE_IN_GAA(
x1,
x2,
x3) =
LE_IN_GAA(
x1)
We have to consider all (P,R,Pi)-chains
(38) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(39) Obligation:
Q DP problem:
The TRS P consists of the following rules:
LE_IN_GAA(s(X)) → LE_IN_GAA(X)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(40) QDPSizeChangeProof (EQUIVALENT transformation)
By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.
From the DPs we obtained the following set of size-change graphs:
- LE_IN_GAA(s(X)) → LE_IN_GAA(X)
The graph contains the following edges 1 > 1
(41) TRUE
(42) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → IF_IN_GGAA(B, X, Y, Z)
IF_IN_GGAA(false, X, Y, s(Z)) → U4_GGAA(X, Y, Z, p_in_ga(X, X1))
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → MINUS_IN_GAA(X1, Y, Z)
MINUS_IN_GAA(X, Y, Z) → U2_GAA(X, Y, Z, le_in_gaa(X, Y, B))
The TRS R consists of the following rules:
minus_in_gaa(X, Y, Z) → U2_gaa(X, Y, Z, le_in_gaa(X, Y, B))
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
U2_gaa(X, Y, Z, le_out_gaa(X, Y, B)) → U3_gaa(X, Y, Z, if_in_ggaa(B, X, Y, Z))
if_in_ggaa(true, X, Y, 0) → if_out_ggaa(true, X, Y, 0)
if_in_ggaa(false, X, Y, s(Z)) → U4_ggaa(X, Y, Z, p_in_ga(X, X1))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U4_ggaa(X, Y, Z, p_out_ga(X, X1)) → U5_ggaa(X, Y, Z, minus_in_gaa(X1, Y, Z))
U5_ggaa(X, Y, Z, minus_out_gaa(X1, Y, Z)) → if_out_ggaa(false, X, Y, s(Z))
U3_gaa(X, Y, Z, if_out_ggaa(B, X, Y, Z)) → minus_out_gaa(X, Y, Z)
The argument filtering Pi contains the following mapping:
minus_in_gaa(
x1,
x2,
x3) =
minus_in_gaa(
x1)
U2_gaa(
x1,
x2,
x3,
x4) =
U2_gaa(
x1,
x4)
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x1,
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x1,
x4)
U3_gaa(
x1,
x2,
x3,
x4) =
U3_gaa(
x1,
x4)
if_in_ggaa(
x1,
x2,
x3,
x4) =
if_in_ggaa(
x1,
x2)
true =
true
if_out_ggaa(
x1,
x2,
x3,
x4) =
if_out_ggaa(
x1,
x2,
x4)
false =
false
U4_ggaa(
x1,
x2,
x3,
x4) =
U4_ggaa(
x1,
x4)
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
U5_ggaa(
x1,
x2,
x3,
x4) =
U5_ggaa(
x1,
x4)
minus_out_gaa(
x1,
x2,
x3) =
minus_out_gaa(
x1,
x3)
MINUS_IN_GAA(
x1,
x2,
x3) =
MINUS_IN_GAA(
x1)
U2_GAA(
x1,
x2,
x3,
x4) =
U2_GAA(
x1,
x4)
IF_IN_GGAA(
x1,
x2,
x3,
x4) =
IF_IN_GGAA(
x1,
x2)
U4_GGAA(
x1,
x2,
x3,
x4) =
U4_GGAA(
x1,
x4)
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:
U2_GAA(X, Y, Z, le_out_gaa(X, Y, B)) → IF_IN_GGAA(B, X, Y, Z)
IF_IN_GGAA(false, X, Y, s(Z)) → U4_GGAA(X, Y, Z, p_in_ga(X, X1))
U4_GGAA(X, Y, Z, p_out_ga(X, X1)) → MINUS_IN_GAA(X1, Y, Z)
MINUS_IN_GAA(X, Y, Z) → U2_GAA(X, Y, Z, le_in_gaa(X, Y, B))
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)
le_in_gaa(0, Y, true) → le_out_gaa(0, Y, true)
le_in_gaa(s(X), 0, false) → le_out_gaa(s(X), 0, false)
le_in_gaa(s(X), s(Y), B) → U1_gaa(X, Y, B, le_in_gaa(X, Y, B))
U1_gaa(X, Y, B, le_out_gaa(X, Y, B)) → le_out_gaa(s(X), s(Y), B)
The argument filtering Pi contains the following mapping:
le_in_gaa(
x1,
x2,
x3) =
le_in_gaa(
x1)
0 =
0
le_out_gaa(
x1,
x2,
x3) =
le_out_gaa(
x1,
x3)
s(
x1) =
s(
x1)
U1_gaa(
x1,
x2,
x3,
x4) =
U1_gaa(
x1,
x4)
true =
true
false =
false
p_in_ga(
x1,
x2) =
p_in_ga(
x1)
p_out_ga(
x1,
x2) =
p_out_ga(
x1,
x2)
MINUS_IN_GAA(
x1,
x2,
x3) =
MINUS_IN_GAA(
x1)
U2_GAA(
x1,
x2,
x3,
x4) =
U2_GAA(
x1,
x4)
IF_IN_GGAA(
x1,
x2,
x3,
x4) =
IF_IN_GGAA(
x1,
x2)
U4_GGAA(
x1,
x2,
x3,
x4) =
U4_GGAA(
x1,
x4)
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:
U2_GAA(X, le_out_gaa(X, B)) → IF_IN_GGAA(B, X)
IF_IN_GGAA(false, X) → U4_GGAA(X, p_in_ga(X))
U4_GGAA(X, p_out_ga(X, X1)) → MINUS_IN_GAA(X1)
MINUS_IN_GAA(X) → U2_GAA(X, le_in_gaa(X))
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)
le_in_gaa(0) → le_out_gaa(0, true)
le_in_gaa(s(X)) → le_out_gaa(s(X), false)
le_in_gaa(s(X)) → U1_gaa(X, le_in_gaa(X))
U1_gaa(X, le_out_gaa(X, B)) → le_out_gaa(s(X), B)
The set Q consists of the following terms:
p_in_ga(x0)
le_in_gaa(x0)
U1_gaa(x0, x1)
We have to consider all (P,Q,R)-chains.