The rewrite relation of the following TRS is considered.
Hence, it suffices to show innermost termination in the following.
The dependency pairs are split into 4
components.
-
The
1st
component contains the
pair
if2#(false,l) |
→ |
prod#(cons(times(car(l),cadr(l)),cddr(l))) |
(39) |
prod#(l) |
→ |
if#(shorter(l,0),shorter(l,s(0)),l) |
(34) |
if#(false,b,l) |
→ |
if2#(b,l) |
(37) |
1.1.1.1 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
shorter(nil,y) |
→ |
true |
(16) |
shorter(cons(x,l),0) |
→ |
false |
(17) |
shorter(cons(x,l),s(y)) |
→ |
shorter(l,y) |
(18) |
car(cons(x,l)) |
→ |
x |
(1) |
cadr(cons(x,cons(y,l))) |
→ |
y |
(5) |
times(x,y) |
→ |
iftimes(isZero(x),x,y) |
(11) |
cddr(nil) |
→ |
nil |
(2) |
cddr(cons(x,nil)) |
→ |
nil |
(3) |
cddr(cons(x,cons(y,l))) |
→ |
l |
(4) |
isZero(0) |
→ |
true |
(6) |
isZero(s(x)) |
→ |
false |
(7) |
iftimes(true,x,y) |
→ |
0 |
(12) |
iftimes(false,x,y) |
→ |
plus(y,times(p(x),y)) |
(13) |
p(s(x)) |
→ |
x |
(14) |
p(0) |
→ |
0 |
(15) |
plus(x,y) |
→ |
ifplus(isZero(x),x,y) |
(8) |
ifplus(true,x,y) |
→ |
y |
(9) |
ifplus(false,x,y) |
→ |
s(plus(p(x),y)) |
(10) |
1.1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
car(cons(x0,x1)) |
cddr(nil) |
cddr(cons(x0,nil)) |
cddr(cons(x0,cons(x1,x2))) |
cadr(cons(x0,cons(x1,x2))) |
isZero(0) |
isZero(s(x0)) |
plus(x0,x1) |
ifplus(true,x0,x1) |
ifplus(false,x0,x1) |
times(x0,x1) |
iftimes(true,x0,x1) |
iftimes(false,x0,x1) |
p(s(x0)) |
p(0) |
shorter(nil,x0) |
shorter(cons(x0,x1),0) |
shorter(cons(x0,x1),s(x2)) |
1.1.1.1.1.1 Rewriting Processor
We rewrite the right hand side of the pair
resulting in
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
prod#(nil) |
→ |
if#(true,shorter(nil,s(0)),nil) |
(45) |
prod#(cons(x0,x1)) |
→ |
if#(false,shorter(cons(x0,x1),s(0)),cons(x0,x1)) |
(46) |
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
if2#(false,l) |
→ |
prod#(cons(iftimes(isZero(car(l)),car(l),cadr(l)),cddr(l))) |
(44) |
prod#(cons(x0,x1)) |
→ |
if#(false,shorter(cons(x0,x1),s(0)),cons(x0,x1)) |
(46) |
if#(false,b,l) |
→ |
if2#(b,l) |
(37) |
1.1.1.1.1.1.1.1.1 Rewriting Processor
We rewrite the right hand side of the pair
resulting in
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.
shorter(nil,y) |
→ |
true |
(16) |
shorter(cons(x,l),0) |
→ |
false |
(17) |
car(cons(x,l)) |
→ |
x |
(1) |
isZero(0) |
→ |
true |
(6) |
isZero(s(x)) |
→ |
false |
(7) |
cadr(cons(x,cons(y,l))) |
→ |
y |
(5) |
iftimes(true,x,y) |
→ |
0 |
(12) |
iftimes(false,x,y) |
→ |
plus(y,times(p(x),y)) |
(13) |
cddr(nil) |
→ |
nil |
(2) |
cddr(cons(x,nil)) |
→ |
nil |
(3) |
cddr(cons(x,cons(y,l))) |
→ |
l |
(4) |
p(s(x)) |
→ |
x |
(14) |
p(0) |
→ |
0 |
(15) |
times(x,y) |
→ |
iftimes(isZero(x),x,y) |
(11) |
plus(x,y) |
→ |
ifplus(isZero(x),x,y) |
(8) |
ifplus(true,x,y) |
→ |
y |
(9) |
ifplus(false,x,y) |
→ |
s(plus(p(x),y)) |
(10) |
1.1.1.1.1.1.1.1.1.1.1 Instantiation Processor
We instantiate the pair
to the following set of pairs
if#(false,y_0,cons(z0,z1)) |
→ |
if2#(y_0,cons(z0,z1)) |
(48) |
1.1.1.1.1.1.1.1.1.1.1.1 Instantiation Processor
We instantiate the pair
to the following set of pairs
if2#(false,cons(z1,z2)) |
→ |
prod#(cons(iftimes(isZero(car(cons(z1,z2))),car(cons(z1,z2)),cadr(cons(z1,z2))),cddr(cons(z1,z2)))) |
(49) |
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.
car(cons(x,l)) |
→ |
x |
(1) |
isZero(0) |
→ |
true |
(6) |
isZero(s(x)) |
→ |
false |
(7) |
cadr(cons(x,cons(y,l))) |
→ |
y |
(5) |
iftimes(true,x,y) |
→ |
0 |
(12) |
iftimes(false,x,y) |
→ |
plus(y,times(p(x),y)) |
(13) |
cddr(cons(x,nil)) |
→ |
nil |
(3) |
cddr(cons(x,cons(y,l))) |
→ |
l |
(4) |
p(s(x)) |
→ |
x |
(14) |
p(0) |
→ |
0 |
(15) |
times(x,y) |
→ |
iftimes(isZero(x),x,y) |
(11) |
plus(x,y) |
→ |
ifplus(isZero(x),x,y) |
(8) |
ifplus(true,x,y) |
→ |
y |
(9) |
ifplus(false,x,y) |
→ |
s(plus(p(x),y)) |
(10) |
shorter(nil,y) |
→ |
true |
(16) |
shorter(cons(x,l),0) |
→ |
false |
(17) |
1.1.1.1.1.1.1.1.1.1.1.1.1.1 Rewriting Processor
We rewrite the right hand side of the pair
resulting in
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 Rewriting Processor
We rewrite the right hand side of the pair
resulting in
1.1.1.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.
isZero(0) |
→ |
true |
(6) |
isZero(s(x)) |
→ |
false |
(7) |
cadr(cons(x,cons(y,l))) |
→ |
y |
(5) |
iftimes(true,x,y) |
→ |
0 |
(12) |
iftimes(false,x,y) |
→ |
plus(y,times(p(x),y)) |
(13) |
cddr(cons(x,nil)) |
→ |
nil |
(3) |
cddr(cons(x,cons(y,l))) |
→ |
l |
(4) |
p(s(x)) |
→ |
x |
(14) |
p(0) |
→ |
0 |
(15) |
times(x,y) |
→ |
iftimes(isZero(x),x,y) |
(11) |
plus(x,y) |
→ |
ifplus(isZero(x),x,y) |
(8) |
ifplus(true,x,y) |
→ |
y |
(9) |
ifplus(false,x,y) |
→ |
s(plus(p(x),y)) |
(10) |
shorter(nil,y) |
→ |
true |
(16) |
shorter(cons(x,l),0) |
→ |
false |
(17) |
1.1.1.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.
cddr(nil) |
cddr(cons(x0,nil)) |
cddr(cons(x0,cons(x1,x2))) |
cadr(cons(x0,cons(x1,x2))) |
isZero(0) |
isZero(s(x0)) |
plus(x0,x1) |
ifplus(true,x0,x1) |
ifplus(false,x0,x1) |
times(x0,x1) |
iftimes(true,x0,x1) |
iftimes(false,x0,x1) |
p(s(x0)) |
p(0) |
shorter(nil,x0) |
shorter(cons(x0,x1),0) |
shorter(cons(x0,x1),s(x2)) |
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 Forward Instantiation Processor
We instantiate the pair
to the following set of pairs
if#(false,false,cons(x1,x2)) |
→ |
if2#(false,cons(x1,x2)) |
(52) |
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 Narrowing Processor
We consider all narrowings of the pair
below position
2
to get the following set of pairs
prod#(cons(y0,nil)) |
→ |
if#(false,true,cons(y0,nil)) |
(53) |
prod#(cons(y0,cons(x0,x1))) |
→ |
if#(false,false,cons(y0,cons(x0,x1))) |
(54) |
1.1.1.1.1.1.1.1.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
prod#(cons(y0,cons(x0,x1))) |
→ |
if#(false,false,cons(y0,cons(x0,x1))) |
(54) |
if#(false,false,cons(x1,x2)) |
→ |
if2#(false,cons(x1,x2)) |
(52) |
if2#(false,cons(z1,z2)) |
→ |
prod#(cons(iftimes(isZero(z1),z1,cadr(cons(z1,z2))),cddr(cons(z1,z2)))) |
(51) |
1.1.1.1.1.1.1.1.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.
isZero(0) |
→ |
true |
(6) |
isZero(s(x)) |
→ |
false |
(7) |
cadr(cons(x,cons(y,l))) |
→ |
y |
(5) |
iftimes(true,x,y) |
→ |
0 |
(12) |
iftimes(false,x,y) |
→ |
plus(y,times(p(x),y)) |
(13) |
cddr(cons(x,nil)) |
→ |
nil |
(3) |
cddr(cons(x,cons(y,l))) |
→ |
l |
(4) |
p(s(x)) |
→ |
x |
(14) |
p(0) |
→ |
0 |
(15) |
times(x,y) |
→ |
iftimes(isZero(x),x,y) |
(11) |
plus(x,y) |
→ |
ifplus(isZero(x),x,y) |
(8) |
ifplus(true,x,y) |
→ |
y |
(9) |
ifplus(false,x,y) |
→ |
s(plus(p(x),y)) |
(10) |
1.1.1.1.1.1.1.1.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.
cddr(nil) |
cddr(cons(x0,nil)) |
cddr(cons(x0,cons(x1,x2))) |
cadr(cons(x0,cons(x1,x2))) |
isZero(0) |
isZero(s(x0)) |
plus(x0,x1) |
ifplus(true,x0,x1) |
ifplus(false,x0,x1) |
times(x0,x1) |
iftimes(true,x0,x1) |
iftimes(false,x0,x1) |
p(s(x0)) |
p(0) |
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 Narrowing Processor
We consider all narrowings of the pair
below position
1.2
to get the following set of pairs
if2#(false,cons(x0,nil)) |
→ |
prod#(cons(iftimes(isZero(x0),x0,cadr(cons(x0,nil))),nil)) |
(55) |
if2#(false,cons(x0,cons(x1,x2))) |
→ |
prod#(cons(iftimes(isZero(x0),x0,cadr(cons(x0,cons(x1,x2)))),x2)) |
(56) |
1.1.1.1.1.1.1.1.1.1.1.1.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
if#(false,false,cons(x1,x2)) |
→ |
if2#(false,cons(x1,x2)) |
(52) |
if2#(false,cons(x0,cons(x1,x2))) |
→ |
prod#(cons(iftimes(isZero(x0),x0,cadr(cons(x0,cons(x1,x2)))),x2)) |
(56) |
prod#(cons(y0,cons(x0,x1))) |
→ |
if#(false,false,cons(y0,cons(x0,x1))) |
(54) |
1.1.1.1.1.1.1.1.1.1.1.1.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.
isZero(0) |
→ |
true |
(6) |
isZero(s(x)) |
→ |
false |
(7) |
cadr(cons(x,cons(y,l))) |
→ |
y |
(5) |
iftimes(true,x,y) |
→ |
0 |
(12) |
iftimes(false,x,y) |
→ |
plus(y,times(p(x),y)) |
(13) |
p(s(x)) |
→ |
x |
(14) |
p(0) |
→ |
0 |
(15) |
times(x,y) |
→ |
iftimes(isZero(x),x,y) |
(11) |
plus(x,y) |
→ |
ifplus(isZero(x),x,y) |
(8) |
ifplus(true,x,y) |
→ |
y |
(9) |
ifplus(false,x,y) |
→ |
s(plus(p(x),y)) |
(10) |
1.1.1.1.1.1.1.1.1.1.1.1.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.
cadr(cons(x0,cons(x1,x2))) |
isZero(0) |
isZero(s(x0)) |
plus(x0,x1) |
ifplus(true,x0,x1) |
ifplus(false,x0,x1) |
times(x0,x1) |
iftimes(true,x0,x1) |
iftimes(false,x0,x1) |
p(s(x0)) |
p(0) |
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 Rewriting Processor
We rewrite the right hand side of the pair
resulting in
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.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.
isZero(0) |
→ |
true |
(6) |
isZero(s(x)) |
→ |
false |
(7) |
iftimes(true,x,y) |
→ |
0 |
(12) |
iftimes(false,x,y) |
→ |
plus(y,times(p(x),y)) |
(13) |
p(s(x)) |
→ |
x |
(14) |
p(0) |
→ |
0 |
(15) |
times(x,y) |
→ |
iftimes(isZero(x),x,y) |
(11) |
plus(x,y) |
→ |
ifplus(isZero(x),x,y) |
(8) |
ifplus(true,x,y) |
→ |
y |
(9) |
ifplus(false,x,y) |
→ |
s(plus(p(x),y)) |
(10) |
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.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.
isZero(0) |
isZero(s(x0)) |
plus(x0,x1) |
ifplus(true,x0,x1) |
ifplus(false,x0,x1) |
times(x0,x1) |
iftimes(true,x0,x1) |
iftimes(false,x0,x1) |
p(s(x0)) |
p(0) |
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 Instantiation Processor
We instantiate the pair
to the following set of pairs
if#(false,false,cons(z0,cons(z1,z2))) |
→ |
if2#(false,cons(z0,cons(z1,z2))) |
(58) |
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 Reduction Pair Processor with Usable Rules
Using the Knuth Bendix order with w0 = 1 and the following precedence and weight functions
prec(cons) |
= |
1 |
|
weight(cons) |
= |
1 |
|
|
|
prec(false) |
= |
0 |
|
weight(false) |
= |
2 |
|
|
|
in combination with the following argument filter
π(prod#) |
= |
1 |
π(cons) |
= |
[2] |
π(if#) |
= |
3 |
π(if2#) |
= |
2 |
π(false) |
= |
[] |
having no usable rules (w.r.t. the implicit argument filter of the
reduction pair),
the
pair
if2#(false,cons(x0,cons(x1,x2))) |
→ |
prod#(cons(iftimes(isZero(x0),x0,x1),x2)) |
(57) |
could be deleted.
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 Dependency Graph Processor
The dependency pairs are split into 0
components.
-
The
2nd
component contains the
pair
iftimes#(false,x,y) |
→ |
times#(p(x),y) |
(31) |
times#(x,y) |
→ |
iftimes#(isZero(x),x,y) |
(28) |
1.1.1.2 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
isZero(0) |
→ |
true |
(6) |
isZero(s(x)) |
→ |
false |
(7) |
p(s(x)) |
→ |
x |
(14) |
p(0) |
→ |
0 |
(15) |
1.1.1.2.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
isZero(0) |
isZero(s(x0)) |
p(s(x0)) |
p(0) |
1.1.1.2.1.1 Reduction Pair Processor
Using the linear polynomial interpretation over the rationals with delta = 1/16
[iftimes#(x1, x2, x3)] |
= |
0 + 1/4 · x1 + 1/4 · x2 + 0 · x3
|
[false] |
= |
1/4 |
[times#(x1, x2)] |
= |
0 + 1 · x1 + 0 · x2
|
[p(x1)] |
= |
0 + 1/4 · x1
|
[isZero(x1)] |
= |
0 + 1/2 · x1
|
[s(x1)] |
= |
2 + 4 · x1
|
[0] |
= |
0 |
[true] |
= |
0 |
the
pair
iftimes#(false,x,y) |
→ |
times#(p(x),y) |
(31) |
could be deleted.
1.1.1.2.1.1.1 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
isZero(0) |
→ |
true |
(6) |
isZero(s(x)) |
→ |
false |
(7) |
1.1.1.2.1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
1.1.1.2.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.
times#(x,y) |
→ |
iftimes#(isZero(x),x,y) |
(28) |
|
1 |
≥ |
2 |
2 |
≥ |
3 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
3rd
component contains the
pair
ifplus#(false,x,y) |
→ |
plus#(p(x),y) |
(26) |
plus#(x,y) |
→ |
ifplus#(isZero(x),x,y) |
(24) |
1.1.1.3 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
isZero(0) |
→ |
true |
(6) |
isZero(s(x)) |
→ |
false |
(7) |
p(s(x)) |
→ |
x |
(14) |
p(0) |
→ |
0 |
(15) |
1.1.1.3.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
isZero(0) |
isZero(s(x0)) |
p(s(x0)) |
p(0) |
1.1.1.3.1.1 Reduction Pair Processor
Using the linear polynomial interpretation over the rationals with delta = 1/16
[ifplus#(x1, x2, x3)] |
= |
0 + 1/4 · x1 + 1/4 · x2 + 0 · x3
|
[false] |
= |
1/4 |
[plus#(x1, x2)] |
= |
0 + 1 · x1 + 0 · x2
|
[p(x1)] |
= |
0 + 1/4 · x1
|
[isZero(x1)] |
= |
0 + 1/2 · x1
|
[s(x1)] |
= |
2 + 4 · x1
|
[0] |
= |
0 |
[true] |
= |
0 |
the
pair
ifplus#(false,x,y) |
→ |
plus#(p(x),y) |
(26) |
could be deleted.
1.1.1.3.1.1.1 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
isZero(0) |
→ |
true |
(6) |
isZero(s(x)) |
→ |
false |
(7) |
1.1.1.3.1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
1.1.1.3.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.
plus#(x,y) |
→ |
ifplus#(isZero(x),x,y) |
(24) |
|
1 |
≥ |
2 |
2 |
≥ |
3 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
4th
component contains the
pair
shorter#(cons(x,l),s(y)) |
→ |
shorter#(l,y) |
(33) |
1.1.1.4 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
1.1.1.4.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
1.1.1.4.1.1 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
shorter#(cons(x,l),s(y)) |
→ |
shorter#(l,y) |
(33) |
|
1 |
> |
1 |
2 |
> |
2 |
As there is no critical graph in the transitive closure, there are no infinite chains.