(0) Obligation:
Q restricted rewrite system:
The TRS R consists of the following rules:
a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))
Q is empty.
(1) Overlay + Local Confluence (EQUIVALENT transformation)
The TRS is overlay and locally confluent. By [NOC] we can switch to innermost.
(2) Obligation:
Q restricted rewrite system:
The TRS R consists of the following rules:
a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))
The set Q consists of the following terms:
a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))
(3) DependencyPairsProof (EQUIVALENT transformation)
Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.
(4) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A(a(divides, a(s, x)), a(s, y)) → A(a(a(div2, x), a(s, y)), y)
A(a(divides, a(s, x)), a(s, y)) → A(a(div2, x), a(s, y))
A(a(divides, a(s, x)), a(s, y)) → A(div2, x)
A(a(a(div2, x), y), 0) → A(a(divides, x), y)
A(a(a(div2, x), y), 0) → A(divides, x)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(a(a(div2, x), y), z)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(a(div2, x), y)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(div2, x)
A(a(filter, f), a(a(cons, x), xs)) → A(a(a(if, a(f, x)), x), a(a(filter, f), xs))
A(a(filter, f), a(a(cons, x), xs)) → A(a(if, a(f, x)), x)
A(a(filter, f), a(a(cons, x), xs)) → A(if, a(f, x))
A(a(filter, f), a(a(cons, x), xs)) → A(f, x)
A(a(filter, f), a(a(cons, x), xs)) → A(a(filter, f), xs)
A(a(a(if, true), x), xs) → A(a(cons, x), xs)
A(a(a(if, true), x), xs) → A(cons, x)
A(a(not, f), x) → A(not2, a(f, x))
A(a(not, f), x) → A(f, x)
A(sieve, a(a(cons, x), xs)) → A(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))
A(sieve, a(a(cons, x), xs)) → A(sieve, a(a(filter, a(not, a(divides, x))), xs))
A(sieve, a(a(cons, x), xs)) → A(a(filter, a(not, a(divides, x))), xs)
A(sieve, a(a(cons, x), xs)) → A(filter, a(not, a(divides, x)))
A(sieve, a(a(cons, x), xs)) → A(not, a(divides, x))
A(sieve, a(a(cons, x), xs)) → A(divides, x)
The TRS R consists of the following rules:
a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))
The set Q consists of the following terms:
a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))
We have to consider all minimal (P,Q,R)-chains.
(5) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 2 SCCs with 15 less nodes.
(6) Complex Obligation (AND)
(7) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A(a(a(div2, x), y), 0) → A(a(divides, x), y)
A(a(divides, a(s, x)), a(s, y)) → A(a(a(div2, x), a(s, y)), y)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(a(a(div2, x), y), z)
The TRS R consists of the following rules:
a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))
The set Q consists of the following terms:
a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))
We have to consider all minimal (P,Q,R)-chains.
(8) 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.
(9) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A(a(a(div2, x), y), 0) → A(a(divides, x), y)
A(a(divides, a(s, x)), a(s, y)) → A(a(a(div2, x), a(s, y)), y)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(a(a(div2, x), y), z)
R is empty.
The set Q consists of the following terms:
a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))
We have to consider all minimal (P,Q,R)-chains.
(10) ATransformationProof (EQUIVALENT transformation)
We have applied the A-Transformation [FROCOS05] to get from an applicative problem to a standard problem.
(11) Obligation:
Q DP problem:
The TRS P consists of the following rules:
div21(x, y, 0) → divides1(x, y)
divides1(s(x), s(y)) → div21(x, s(y), y)
div21(s(x), y, s(z)) → div21(x, y, z)
R is empty.
The set Q consists of the following terms:
divides(0, s(x0))
divides(s(x0), s(x1))
div2(x0, x1, 0)
div2(0, x0, s(x1))
div2(s(x0), x1, s(x2))
filter(x0, nil)
filter(x0, cons(x1, x2))
if(true, x0, x1)
if(false, x0, x1)
not(x0, x1)
not2(true)
not2(false)
sieve(nil)
sieve(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
(12) 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].
divides(0, s(x0))
divides(s(x0), s(x1))
div2(x0, x1, 0)
div2(0, x0, s(x1))
div2(s(x0), x1, s(x2))
filter(x0, nil)
filter(x0, cons(x1, x2))
if(true, x0, x1)
if(false, x0, x1)
not(x0, x1)
not2(true)
not2(false)
sieve(nil)
sieve(cons(x0, x1))
(13) Obligation:
Q DP problem:
The TRS P consists of the following rules:
div21(x, y, 0) → divides1(x, y)
divides1(s(x), s(y)) → div21(x, s(y), y)
div21(s(x), y, s(z)) → div21(x, y, z)
R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(14) 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:
- divides1(s(x), s(y)) → div21(x, s(y), y)
The graph contains the following edges 1 > 1, 2 >= 2, 2 > 3
- div21(s(x), y, s(z)) → div21(x, y, z)
The graph contains the following edges 1 > 1, 2 >= 2, 3 > 3
- div21(x, y, 0) → divides1(x, y)
The graph contains the following edges 1 >= 1, 2 >= 2
(15) YES
(16) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A(a(filter, f), a(a(cons, x), xs)) → A(a(filter, f), xs)
A(a(filter, f), a(a(cons, x), xs)) → A(f, x)
A(a(not, f), x) → A(f, x)
A(sieve, a(a(cons, x), xs)) → A(sieve, a(a(filter, a(not, a(divides, x))), xs))
A(sieve, a(a(cons, x), xs)) → A(a(filter, a(not, a(divides, x))), xs)
The TRS R consists of the following rules:
a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))
The set Q consists of the following terms:
a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))
We have to consider all minimal (P,Q,R)-chains.
(17) QDPApplicativeOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].First, we preprocessed all pairs by applying the argument filter which replaces every head symbol by its second argument. Then we combined the reduction pair processor [LPAR04,JAR06] with the A-transformation [FROCOS05] which results in the following intermediate Q-DP Problem.
The a-transformed P is
cons(x, xs) → xs
cons(x, xs) → x
x → x
cons(x, xs) → filter(not(divides(x)), xs)
cons(x, xs) → xs
The a-transformed usable rules are
filter(f, cons(x, xs)) → if(notProper, x, filter(f, xs))
if(true, x, xs) → cons(x, xs)
filter(f, nil) → nil
if(false, x, xs) → xs
The following pairs can be oriented strictly and are deleted.
A(a(filter, f), a(a(cons, x), xs)) → A(a(filter, f), xs)
A(a(filter, f), a(a(cons, x), xs)) → A(f, x)
A(sieve, a(a(cons, x), xs)) → A(sieve, a(a(filter, a(not, a(divides, x))), xs))
A(sieve, a(a(cons, x), xs)) → A(a(filter, a(not, a(divides, x))), xs)
The remaining pairs can at least be oriented weakly.
A(a(not, f), x) → A(f, x)
Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation:
POL( filter(x1, x2) ) = 2x2 + 1 |
POL( cons(x1, x2) ) = x1 + 2x2 + 2 |
POL( if(x1, ..., x3) ) = x2 + 2x3 + 2 |
POL( not(x1) ) = max{0, -2} |
The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(filter, f), nil) → nil
a(a(a(if, false), x), xs) → xs
(18) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A(a(not, f), x) → A(f, x)
The TRS R consists of the following rules:
a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))
The set Q consists of the following terms:
a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))
We have to consider all minimal (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:
A(a(not, f), x) → A(f, x)
R is empty.
The set Q consists of the following terms:
a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))
We have to consider all minimal (P,Q,R)-chains.
(21) 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:
- A(a(not, f), x) → A(f, x)
The graph contains the following edges 1 > 1, 2 >= 2
(22) YES