The rewrite relation of the following TRS is considered.
minus(x,0) |
→ |
x |
(1) |
minus(s(x),s(y)) |
→ |
minus(x,y) |
(2) |
quot(0,s(y)) |
→ |
0 |
(3) |
quot(s(x),s(y)) |
→ |
s(quot(minus(x,y),s(y))) |
(4) |
plus(0,y) |
→ |
y |
(5) |
plus(s(x),y) |
→ |
s(plus(x,y)) |
(6) |
minus(minus(x,y),z) |
→ |
minus(x,plus(y,z)) |
(7) |
app(nil,k) |
→ |
k |
(8) |
app(l,nil) |
→ |
l |
(9) |
app(cons(x,l),k) |
→ |
cons(x,app(l,k)) |
(10) |
sum(cons(x,nil)) |
→ |
cons(x,nil) |
(11) |
sum(cons(x,cons(y,l))) |
→ |
sum(cons(plus(x,y),l)) |
(12) |
sum(app(l,cons(x,cons(y,k)))) |
→ |
sum(app(l,sum(cons(x,cons(y,k))))) |
(13) |
plus(s(x),s(y)) |
→ |
s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) |
(14) |
plus(s(x),x) |
→ |
plus(if(gt(x,x),id(x),id(x)),s(x)) |
(15) |
plus(zero,y) |
→ |
y |
(16) |
plus(id(x),s(y)) |
→ |
s(plus(x,if(gt(s(y),y),y,s(y)))) |
(17) |
id(x) |
→ |
x |
(18) |
if(true,x,y) |
→ |
x |
(19) |
if(false,x,y) |
→ |
y |
(20) |
not(x) |
→ |
if(x,false,true) |
(21) |
gt(s(x),zero) |
→ |
true |
(22) |
gt(zero,y) |
→ |
false |
(23) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(24) |
minus#(s(x),s(y)) |
→ |
minus#(x,y) |
(25) |
quot#(s(x),s(y)) |
→ |
minus#(x,y) |
(26) |
quot#(s(x),s(y)) |
→ |
quot#(minus(x,y),s(y)) |
(27) |
plus#(s(x),y) |
→ |
plus#(x,y) |
(28) |
minus#(minus(x,y),z) |
→ |
plus#(y,z) |
(29) |
minus#(minus(x,y),z) |
→ |
minus#(x,plus(y,z)) |
(30) |
app#(cons(x,l),k) |
→ |
app#(l,k) |
(31) |
sum#(cons(x,cons(y,l))) |
→ |
plus#(x,y) |
(32) |
sum#(cons(x,cons(y,l))) |
→ |
sum#(cons(plus(x,y),l)) |
(33) |
sum#(app(l,cons(x,cons(y,k)))) |
→ |
sum#(cons(x,cons(y,k))) |
(34) |
sum#(app(l,cons(x,cons(y,k)))) |
→ |
app#(l,sum(cons(x,cons(y,k)))) |
(35) |
sum#(app(l,cons(x,cons(y,k)))) |
→ |
sum#(app(l,sum(cons(x,cons(y,k))))) |
(36) |
plus#(s(x),s(y)) |
→ |
id#(y) |
(37) |
plus#(s(x),s(y)) |
→ |
id#(x) |
(38) |
plus#(s(x),s(y)) |
→ |
not#(gt(x,y)) |
(39) |
plus#(s(x),s(y)) |
→ |
if#(not(gt(x,y)),id(x),id(y)) |
(40) |
plus#(s(x),s(y)) |
→ |
gt#(x,y) |
(41) |
plus#(s(x),s(y)) |
→ |
if#(gt(x,y),x,y) |
(42) |
plus#(s(x),s(y)) |
→ |
plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) |
(43) |
plus#(s(x),x) |
→ |
id#(x) |
(44) |
plus#(s(x),x) |
→ |
gt#(x,x) |
(45) |
plus#(s(x),x) |
→ |
if#(gt(x,x),id(x),id(x)) |
(46) |
plus#(s(x),x) |
→ |
plus#(if(gt(x,x),id(x),id(x)),s(x)) |
(47) |
plus#(id(x),s(y)) |
→ |
gt#(s(y),y) |
(48) |
plus#(id(x),s(y)) |
→ |
if#(gt(s(y),y),y,s(y)) |
(49) |
plus#(id(x),s(y)) |
→ |
plus#(x,if(gt(s(y),y),y,s(y))) |
(50) |
not#(x) |
→ |
if#(x,false,true) |
(51) |
gt#(s(x),s(y)) |
→ |
gt#(x,y) |
(52) |
The dependency pairs are split into 7
components.
-
The
1st
component contains the
pair
quot#(s(x),s(y)) |
→ |
quot#(minus(x,y),s(y)) |
(27) |
1.1.1 Subterm Criterion Processor
We use the projection to multisets
π(quot#)
|
= |
{
1
}
|
π(minus)
|
= |
{
1
}
|
to remove the pairs:
quot#(s(x),s(y)) |
→ |
quot#(minus(x,y),s(y)) |
(27) |
1.1.1.1 P is empty
There are no pairs anymore.
-
The
2nd
component contains the
pair
minus#(minus(x,y),z) |
→ |
minus#(x,plus(y,z)) |
(30) |
minus#(s(x),s(y)) |
→ |
minus#(x,y) |
(25) |
1.1.2 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
minus#(minus(x,y),z) |
→ |
minus#(x,plus(y,z)) |
(30) |
|
1 |
> |
1 |
minus#(s(x),s(y)) |
→ |
minus#(x,y) |
(25) |
|
2 |
> |
2 |
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
3rd
component contains the
pair
sum#(app(l,cons(x,cons(y,k)))) |
→ |
sum#(app(l,sum(cons(x,cons(y,k))))) |
(36) |
1.1.3 Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[plus(x1, x2)] |
= |
3 · x1 + 0 · x2 + 0 |
[false] |
= |
2 |
[sum(x1)] |
= |
0 · x1 + 1 |
[nil] |
= |
0 |
[if(x1, x2, x3)] |
= |
2 · x1 + 2 · x2 + 0 · x3 + 0 |
[0] |
= |
0 |
[cons(x1, x2)] |
= |
0 · x1 + 1 · x2 + 1 |
[sum#(x1)] |
= |
1 · x1 + 0 |
[true] |
= |
0 |
[id(x1)] |
= |
0 · x1 + 1 |
[not(x1)] |
= |
0 · x1 + 0 |
[gt(x1, x2)] |
= |
0 · x1 + 5 · x2 + 1 |
[zero] |
= |
3 |
[app(x1, x2)] |
= |
4 · x1 + 1 · x2 + 0 |
[s(x1)] |
= |
0 · x1 + 6 |
together with the usable
rules
sum(cons(x,cons(y,l))) |
→ |
sum(cons(plus(x,y),l)) |
(12) |
sum(cons(x,nil)) |
→ |
cons(x,nil) |
(11) |
app(nil,k) |
→ |
k |
(8) |
app(l,nil) |
→ |
l |
(9) |
app(cons(x,l),k) |
→ |
cons(x,app(l,k)) |
(10) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pair
sum#(app(l,cons(x,cons(y,k)))) |
→ |
sum#(app(l,sum(cons(x,cons(y,k))))) |
(36) |
could be deleted.
1.1.3.1 P is empty
There are no pairs anymore.
-
The
4th
component contains the
pair
app#(cons(x,l),k) |
→ |
app#(l,k) |
(31) |
1.1.4 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
app#(cons(x,l),k) |
→ |
app#(l,k) |
(31) |
|
2 |
≥ |
2 |
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
5th
component contains the
pair
sum#(cons(x,cons(y,l))) |
→ |
sum#(cons(plus(x,y),l)) |
(33) |
1.1.5 Reduction Pair Processor with Usable Rules
Using the
prec(sum#) |
= |
0 |
|
stat(sum#) |
= |
lex
|
prec(false) |
= |
0 |
|
stat(false) |
= |
lex
|
prec(true) |
= |
0 |
|
stat(true) |
= |
lex
|
prec(zero) |
= |
0 |
|
stat(zero) |
= |
lex
|
prec(id) |
= |
0 |
|
stat(id) |
= |
lex
|
prec(not) |
= |
0 |
|
stat(not) |
= |
lex
|
prec(if) |
= |
0 |
|
stat(if) |
= |
lex
|
prec(gt) |
= |
0 |
|
stat(gt) |
= |
lex
|
prec(cons) |
= |
0 |
|
stat(cons) |
= |
lex
|
prec(plus) |
= |
0 |
|
stat(plus) |
= |
lex
|
prec(s) |
= |
0 |
|
stat(s) |
= |
lex
|
prec(0) |
= |
0 |
|
stat(0) |
= |
lex
|
π(sum#) |
= |
[1] |
π(false) |
= |
[] |
π(true) |
= |
[] |
π(zero) |
= |
[] |
π(id) |
= |
[] |
π(not) |
= |
1 |
π(if) |
= |
3 |
π(gt) |
= |
1 |
π(cons) |
= |
[2] |
π(plus) |
= |
2 |
π(s) |
= |
[] |
π(0) |
= |
[] |
having no usable rules (w.r.t. the implicit argument filter of the
reduction pair),
the
pair
sum#(cons(x,cons(y,l))) |
→ |
sum#(cons(plus(x,y),l)) |
(33) |
could be deleted.
1.1.5.1 P is empty
There are no pairs anymore.
-
The
6th
component contains the
pair
plus#(id(x),s(y)) |
→ |
plus#(x,if(gt(s(y),y),y,s(y))) |
(50) |
plus#(s(x),x) |
→ |
plus#(if(gt(x,x),id(x),id(x)),s(x)) |
(47) |
plus#(s(x),s(y)) |
→ |
plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) |
(43) |
plus#(s(x),y) |
→ |
plus#(x,y) |
(28) |
1.1.6 Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the arctic semiring over the integers
[plus#(x1, x2)] |
= |
0 · x1 + 0 · x2 +
-∞ |
[false] |
= |
0 |
[if(x1, x2, x3)] |
= |
-∞ · x1 + 0 · x2 + 0 · x3 +
-∞ |
[true] |
= |
0 |
[id(x1)] |
= |
0 · x1 +
-∞ |
[not(x1)] |
= |
0 · x1 + 0 |
[gt(x1, x2)] |
= |
-∞ · x1 + 0 · x2 + 0 |
[zero] |
= |
2 |
[s(x1)] |
= |
2 · x1 + 4 |
together with the usable
rules
gt(s(x),zero) |
→ |
true |
(22) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(24) |
gt(zero,y) |
→ |
false |
(23) |
if(true,x,y) |
→ |
x |
(19) |
if(false,x,y) |
→ |
y |
(20) |
id(x) |
→ |
x |
(18) |
not(x) |
→ |
if(x,false,true) |
(21) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pair
plus#(s(x),s(y)) |
→ |
plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) |
(43) |
could be deleted.
1.1.6.1 Reduction Pair Processor with Usable Rules
Using the
prec(plus#) |
= |
0 |
|
stat(plus#) |
= |
lex
|
prec(false) |
= |
0 |
|
stat(false) |
= |
lex
|
prec(true) |
= |
0 |
|
stat(true) |
= |
lex
|
prec(zero) |
= |
0 |
|
stat(zero) |
= |
lex
|
prec(id) |
= |
0 |
|
stat(id) |
= |
lex
|
prec(if) |
= |
0 |
|
stat(if) |
= |
lex
|
prec(gt) |
= |
0 |
|
stat(gt) |
= |
lex
|
prec(s) |
= |
4 |
|
stat(s) |
= |
lex
|
π(plus#) |
= |
[1] |
π(false) |
= |
[] |
π(true) |
= |
[] |
π(zero) |
= |
[] |
π(id) |
= |
1 |
π(if) |
= |
[2,3] |
π(gt) |
= |
1 |
π(s) |
= |
[1] |
together with the usable
rules
if(true,x,y) |
→ |
x |
(19) |
if(false,x,y) |
→ |
y |
(20) |
id(x) |
→ |
x |
(18) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pairs
plus#(s(x),x) |
→ |
plus#(if(gt(x,x),id(x),id(x)),s(x)) |
(47) |
plus#(s(x),y) |
→ |
plus#(x,y) |
(28) |
could be deleted.
1.1.6.1.1 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
plus#(id(x),s(y)) |
→ |
plus#(x,if(gt(s(y),y),y,s(y))) |
(50) |
|
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
7th
component contains the
pair
gt#(s(x),s(y)) |
→ |
gt#(x,y) |
(52) |
1.1.7 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
gt#(s(x),s(y)) |
→ |
gt#(x,y) |
(52) |
|
2 |
> |
2 |
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.