(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

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:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

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

AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
AP(ap(map, f), xs) → AP(ap(if, ap(isEmpty, xs)), f)
AP(ap(map, f), xs) → AP(if, ap(isEmpty, xs))
AP(ap(map, f), xs) → AP(isEmpty, xs)
AP(ap(ap(if, null), f), xs) → AP(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
AP(ap(ap(if, null), f), xs) → AP(cons, ap(f, ap(last, xs)))
AP(ap(ap(if, null), f), xs) → AP(f, ap(last, xs))
AP(ap(ap(if, null), f), xs) → AP(last, xs)
AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(ap(if, null), f), xs) → AP(if2, f)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(ap(if2, f), xs) → AP(map, f)
AP(ap(if2, f), xs) → AP(dropLast, xs)
AP(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(last, ap(ap(cons, y), ys))
AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))
AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(dropLast, ap(ap(cons, y), ys))

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 3 SCCs with 10 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(dropLast, ap(ap(cons, y), ys))

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

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:

AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(dropLast, ap(ap(cons, y), ys))

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

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

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:

dropLast1(cons(x, cons(y, ys))) → dropLast1(cons(y, ys))

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

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
isEmpty(null)
isEmpty(cons(x0, x1))
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

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].

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
isEmpty(null)
isEmpty(cons(x0, x1))
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

(13) Obligation:

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

dropLast1(cons(x, cons(y, ys))) → dropLast1(cons(y, ys))

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:

  • dropLast1(cons(x, cons(y, ys))) → dropLast1(cons(y, ys))
    The graph contains the following edges 1 > 1

(15) TRUE

(16) Obligation:

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

AP(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(last, ap(ap(cons, y), ys))

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (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:

AP(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(last, ap(ap(cons, y), ys))

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

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

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

(19) ATransformationProof (EQUIVALENT transformation)

We have applied the A-Transformation [FROCOS05] to get from an applicative problem to a standard problem.

(20) Obligation:

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

last1(cons(x, cons(y, ys))) → last1(cons(y, ys))

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

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
isEmpty(null)
isEmpty(cons(x0, x1))
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (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].

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
isEmpty(null)
isEmpty(cons(x0, x1))
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

(22) Obligation:

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

last1(cons(x, cons(y, ys))) → last1(cons(y, ys))

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

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

  • last1(cons(x, cons(y, ys))) → last1(cons(y, ys))
    The graph contains the following edges 1 > 1

(24) TRUE

(25) Obligation:

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

AP(ap(ap(if, null), f), xs) → AP(f, ap(last, xs))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

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

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

(27) Obligation:

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

AP(ap(ap(if, null), f), xs) → AP(f, ap(last, xs))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))

The TRS R consists of the following rules:

ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

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

(28) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


AP(ap(ap(if, null), f), xs) → AP(f, ap(last, xs))
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO]:

POL(AP(x1, x2)) =
/0\
\1/
+
/01\
\00/
·x1 +
/00\
\00/
·x2

POL(ap(x1, x2)) =
/0\
\1/
+
/01\
\10/
·x1 +
/00\
\01/
·x2

POL(if) =
/0\
\1/

POL(null) =
/0\
\0/

POL(last) =
/1\
\0/

POL(map) =
/1\
\0/

POL(isEmpty) =
/1\
\1/

POL(if2) =
/1\
\0/

POL(dropLast) =
/1\
\1/

POL(true) =
/1\
\1/

POL(cons) =
/0\
\1/

The following usable rules [FROCOS05] were oriented:

ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null

(29) Obligation:

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

AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))

The TRS R consists of the following rules:

ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

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

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

(31) Obligation:

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

AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))

The TRS R consists of the following rules:

ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

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

(32) ATransformationProof (EQUIVALENT transformation)

We have applied the A-Transformation [FROCOS05] to get from an applicative problem to a standard problem.

(33) Obligation:

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

map1(f, xs) → if1(isEmpty(xs), f, xs)
if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))

The TRS R consists of the following rules:

dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))
isEmpty(null) → true
isEmpty(cons(x, xs)) → null

The set Q consists of the following terms:

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
isEmpty(null)
isEmpty(cons(x0, x1))
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

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

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

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))

(35) Obligation:

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

map1(f, xs) → if1(isEmpty(xs), f, xs)
if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))

The TRS R consists of the following rules:

dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))
isEmpty(null) → true
isEmpty(cons(x, xs)) → null

The set Q consists of the following terms:

isEmpty(null)
isEmpty(cons(x0, x1))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

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

(36) Narrowing (EQUIVALENT transformation)

By narrowing [LPAR04] the rule map1(f, xs) → if1(isEmpty(xs), f, xs) at position [0] we obtained the following new rules [LPAR04]:

map1(y0, null) → if1(true, y0, null)
map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))

(37) Obligation:

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

if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))
map1(y0, null) → if1(true, y0, null)
map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))

The TRS R consists of the following rules:

dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))
isEmpty(null) → true
isEmpty(cons(x, xs)) → null

The set Q consists of the following terms:

isEmpty(null)
isEmpty(cons(x0, x1))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

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

(38) DependencyGraphProof (EQUIVALENT transformation)

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

(39) Obligation:

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

if21(f, xs) → map1(f, dropLast(xs))
map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))
if1(null, f, xs) → if21(f, xs)

The TRS R consists of the following rules:

dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))
isEmpty(null) → true
isEmpty(cons(x, xs)) → null

The set Q consists of the following terms:

isEmpty(null)
isEmpty(cons(x0, x1))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

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

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

(41) Obligation:

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

if21(f, xs) → map1(f, dropLast(xs))
map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))
if1(null, f, xs) → if21(f, xs)

The TRS R consists of the following rules:

dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

isEmpty(null)
isEmpty(cons(x0, x1))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

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

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

isEmpty(null)
isEmpty(cons(x0, x1))

(43) Obligation:

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

if21(f, xs) → map1(f, dropLast(xs))
map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))
if1(null, f, xs) → if21(f, xs)

The TRS R consists of the following rules:

dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

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

(44) MRRProof (EQUIVALENT transformation)

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

Strictly oriented rules of the TRS R:

dropLast(cons(x, null)) → null

Used ordering: Polynomial interpretation [POLO]:

POL(cons(x1, x2)) = x1 + 2·x2   
POL(dropLast(x1)) = x1   
POL(if1(x1, x2, x3)) = x1 + x2 + 2·x3   
POL(if21(x1, x2)) = 2 + x1 + 2·x2   
POL(map1(x1, x2)) = 2 + x1 + 2·x2   
POL(null) = 2   

(45) Obligation:

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

if21(f, xs) → map1(f, dropLast(xs))
map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))
if1(null, f, xs) → if21(f, xs)

The TRS R consists of the following rules:

dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

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

(46) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO]:

POL(if21(x1, x2)) =
/0\
\1/
+
/00\
\00/
·x1 +
/01\
\01/
·x2

POL(map1(x1, x2)) =
/0\
\1/
+
/00\
\00/
·x1 +
/10\
\10/
·x2

POL(dropLast(x1)) =
/0\
\0/
+
/01\
\01/
·x1

POL(cons(x1, x2)) =
/1\
\0/
+
/00\
\00/
·x1 +
/10\
\10/
·x2

POL(if1(x1, x2, x3)) =
/0\
\1/
+
/00\
\00/
·x1 +
/00\
\00/
·x2 +
/01\
\01/
·x3

POL(null) =
/0\
\0/

The following usable rules [FROCOS05] were oriented:

dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

(47) Obligation:

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

if21(f, xs) → map1(f, dropLast(xs))
if1(null, f, xs) → if21(f, xs)

The TRS R consists of the following rules:

dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

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

(48) DependencyGraphProof (EQUIVALENT transformation)

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

(49) TRUE