The rewrite relation of the following TRS is considered.
ap(ap(map,f),xs) |
→ |
ap(ap(ap(if,ap(isEmpty,xs)),f),xs) |
(1) |
ap(ap(ap(if,true),f),xs) |
→ |
nil |
(2) |
ap(ap(ap(if,false),f),xs) |
→ |
ap(ap(cons,ap(f,ap(last,xs))),ap(ap(map,f),ap(dropLast,xs))) |
(3) |
ap(isEmpty,nil) |
→ |
true |
(4) |
ap(isEmpty,ap(ap(cons,x),xs)) |
→ |
false |
(5) |
ap(last,ap(ap(cons,x),nil)) |
→ |
x |
(6) |
ap(last,ap(ap(cons,x),ap(ap(cons,y),ys))) |
→ |
ap(last,ap(ap(cons,y),ys)) |
(7) |
ap(dropLast,nil) |
→ |
nil |
(8) |
ap(dropLast,ap(ap(cons,x),nil)) |
→ |
nil |
(9) |
ap(dropLast,ap(ap(cons,x),ap(ap(cons,y),ys))) |
→ |
ap(ap(cons,x),ap(dropLast,ap(ap(cons,y),ys))) |
(10) |
Hence, it suffices to show innermost termination in the following.
The dependency pairs are split into 3
components.
-
The
1st
component contains the
pair
if3#(false,f,xs) |
→ |
ap#(f,last1(xs)) |
(33) |
ap#(map1(x0),y1) |
→ |
map2#(x0,y1) |
(39) |
map2#(f,xs) |
→ |
if3#(isEmpty1(xs),f,xs) |
(31) |
if3#(false,f,xs) |
→ |
map2#(f,dropLast1(xs)) |
(35) |
ap#(if2(x0,x1),y1) |
→ |
if3#(x0,x1,y1) |
(40) |
1.1.1.1.1 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
dropLast1(nil) |
→ |
nil |
(28) |
dropLast1(cons2(x,nil)) |
→ |
nil |
(29) |
dropLast1(cons2(x,cons2(y,ys))) |
→ |
cons2(x,dropLast1(cons2(y,ys))) |
(30) |
isEmpty1(nil) |
→ |
true |
(24) |
isEmpty1(cons2(x,xs)) |
→ |
false |
(25) |
last1(cons2(x,nil)) |
→ |
x |
(26) |
last1(cons2(x,cons2(y,ys))) |
→ |
last1(cons2(y,ys)) |
(27) |
1.1.1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
isEmpty1(nil) |
isEmpty1(cons2(x0,x1)) |
last1(cons2(x0,nil)) |
last1(cons2(x0,cons2(x1,x2))) |
dropLast1(nil) |
dropLast1(cons2(x0,nil)) |
dropLast1(cons2(x0,cons2(x1,x2))) |
1.1.1.1.1.1.1 Reduction Pair Processor with Usable Rules
Using the
prec(false) |
= |
0 |
|
stat(false) |
= |
lex
|
prec(last1) |
= |
3 |
|
stat(last1) |
= |
lex
|
prec(map1) |
= |
4 |
|
stat(map1) |
= |
lex
|
prec(isEmpty1) |
= |
5 |
|
stat(isEmpty1) |
= |
lex
|
prec(dropLast1) |
= |
1 |
|
stat(dropLast1) |
= |
lex
|
prec(if2) |
= |
6 |
|
stat(if2) |
= |
lex
|
prec(cons2) |
= |
2 |
|
stat(cons2) |
= |
lex
|
prec(nil) |
= |
7 |
|
stat(nil) |
= |
lex
|
prec(true) |
= |
7 |
|
stat(true) |
= |
lex
|
π(if3#) |
= |
2 |
π(false) |
= |
[] |
π(ap#) |
= |
1 |
π(last1) |
= |
[] |
π(map1) |
= |
[1] |
π(map2#) |
= |
1 |
π(isEmpty1) |
= |
[1] |
π(dropLast1) |
= |
[1] |
π(if2) |
= |
[2] |
π(cons2) |
= |
[] |
π(nil) |
= |
[] |
π(true) |
= |
[] |
having no usable rules (w.r.t. the implicit argument filter of the
reduction pair),
the
pairs
ap#(map1(x0),y1) |
→ |
map2#(x0,y1) |
(39) |
ap#(if2(x0,x1),y1) |
→ |
if3#(x0,x1,y1) |
(40) |
could be deleted.
1.1.1.1.1.1.1.1 Dependency Graph Processor
The dependency pairs are split into 1
component.
-
The
1st
component contains the
pair
if3#(false,f,xs) |
→ |
map2#(f,dropLast1(xs)) |
(35) |
map2#(f,xs) |
→ |
if3#(isEmpty1(xs),f,xs) |
(31) |
1.1.1.1.1.1.1.1.1 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
isEmpty1(nil) |
→ |
true |
(24) |
isEmpty1(cons2(x,xs)) |
→ |
false |
(25) |
dropLast1(nil) |
→ |
nil |
(28) |
dropLast1(cons2(x,nil)) |
→ |
nil |
(29) |
dropLast1(cons2(x,cons2(y,ys))) |
→ |
cons2(x,dropLast1(cons2(y,ys))) |
(30) |
1.1.1.1.1.1.1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
isEmpty1(nil) |
isEmpty1(cons2(x0,x1)) |
dropLast1(nil) |
dropLast1(cons2(x0,nil)) |
dropLast1(cons2(x0,cons2(x1,x2))) |
1.1.1.1.1.1.1.1.1.1.1 Narrowing Processor
We consider all narrowings of the pair
below position
1
to get the following set of pairs
map2#(y0,nil) |
→ |
if3#(true,y0,nil) |
(44) |
map2#(y0,cons2(x0,x1)) |
→ |
if3#(false,y0,cons2(x0,x1)) |
(45) |
1.1.1.1.1.1.1.1.1.1.1.1 Dependency Graph Processor
The dependency pairs are split into 1
component.
-
The
1st
component contains the
pair
map2#(y0,cons2(x0,x1)) |
→ |
if3#(false,y0,cons2(x0,x1)) |
(45) |
if3#(false,f,xs) |
→ |
map2#(f,dropLast1(xs)) |
(35) |
1.1.1.1.1.1.1.1.1.1.1.1.1 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
dropLast1(nil) |
→ |
nil |
(28) |
dropLast1(cons2(x,nil)) |
→ |
nil |
(29) |
dropLast1(cons2(x,cons2(y,ys))) |
→ |
cons2(x,dropLast1(cons2(y,ys))) |
(30) |
1.1.1.1.1.1.1.1.1.1.1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
dropLast1(nil) |
dropLast1(cons2(x0,nil)) |
dropLast1(cons2(x0,cons2(x1,x2))) |
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 Monotonic Reduction Pair Processor
Using the linear polynomial interpretation over the naturals
[dropLast1(x1)] |
= |
1 · x1
|
[nil] |
= |
1 |
[cons2(x1, x2)] |
= |
1 · x1 + 2 · x2
|
[map2#(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[if3#(x1, x2, x3)] |
= |
2 · x1 + 1 · x2 + 1 · x3
|
[false] |
= |
0 |
the
rules
map2(f,xs) |
→ |
if3(isEmpty1(xs),f,xs) |
(21) |
if3(true,f,xs) |
→ |
nil |
(22) |
if3(false,f,xs) |
→ |
cons2(ap(f,last1(xs)),map2(f,dropLast1(xs))) |
(23) |
isEmpty1(nil) |
→ |
true |
(24) |
isEmpty1(cons2(x,xs)) |
→ |
false |
(25) |
last1(cons2(x,nil)) |
→ |
x |
(26) |
last1(cons2(x,cons2(y,ys))) |
→ |
last1(cons2(y,ys)) |
(27) |
dropLast1(cons2(x,nil)) |
→ |
nil |
(29) |
ap(map,y1) |
→ |
map1(y1) |
(11) |
ap(map1(x0),y1) |
→ |
map2(x0,y1) |
(12) |
ap(if,y1) |
→ |
if1(y1) |
(13) |
ap(if1(x0),y1) |
→ |
if2(x0,y1) |
(14) |
ap(if2(x0,x1),y1) |
→ |
if3(x0,x1,y1) |
(15) |
ap(isEmpty,y1) |
→ |
isEmpty1(y1) |
(16) |
ap(cons,y1) |
→ |
cons1(y1) |
(17) |
ap(cons1(x0),y1) |
→ |
cons2(x0,y1) |
(18) |
ap(last,y1) |
→ |
last1(y1) |
(19) |
ap(dropLast,y1) |
→ |
dropLast1(y1) |
(20) |
could be deleted.
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 Reduction Pair Processor
Using the matrix interpretations of dimension 2 with strict dimension 1 over the integers
[map2#(x1, x2)] |
= |
+ · x1 + · x2
|
[cons2(x1, x2)] |
= |
+ · x1 + · x2
|
[if3#(x1, x2, x3)] |
= |
+ · x1 + · x2 + · x3
|
[false] |
= |
|
[dropLast1(x1)] |
= |
+ · x1
|
[nil] |
= |
|
the
pair
map2#(y0,cons2(x0,x1)) |
→ |
if3#(false,y0,cons2(x0,x1)) |
(45) |
could be deleted.
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
if3#(false,f,xs) |
→ |
map2#(f,dropLast1(xs)) |
(35) |
|
2 |
≥ |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
2nd
component contains the
pair
last1#(cons2(x,cons2(y,ys))) |
→ |
last1#(cons2(y,ys)) |
(37) |
1.1.1.1.2 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
1.1.1.1.2.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
1.1.1.1.2.1.1 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
last1#(cons2(x,cons2(y,ys))) |
→ |
last1#(cons2(y,ys)) |
(37) |
|
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
3rd
component contains the
pair
dropLast1#(cons2(x,cons2(y,ys))) |
→ |
dropLast1#(cons2(y,ys)) |
(38) |
1.1.1.1.3 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
1.1.1.1.3.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
1.1.1.1.3.1.1 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
dropLast1#(cons2(x,cons2(y,ys))) |
→ |
dropLast1#(cons2(y,ys)) |
(38) |
|
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.