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)) |
→ |
quot#(minus(x,y),s(y)) |
(26) |
quot#(s(x),s(y)) |
→ |
minus#(x,y) |
(27) |
plus#(s(x),y) |
→ |
plus#(x,y) |
(28) |
minus#(minus(x,y),z) |
→ |
minus#(x,plus(y,z)) |
(29) |
minus#(minus(x,y),z) |
→ |
plus#(y,z) |
(30) |
app#(cons(x,l),k) |
→ |
app#(l,k) |
(31) |
sum#(cons(x,cons(y,l))) |
→ |
sum#(cons(plus(x,y),l)) |
(32) |
sum#(cons(x,cons(y,l))) |
→ |
plus#(x,y) |
(33) |
sum#(app(l,cons(x,cons(y,k)))) |
→ |
sum#(app(l,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#(cons(x,cons(y,k))) |
(36) |
plus#(s(x),s(y)) |
→ |
plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) |
(37) |
plus#(s(x),s(y)) |
→ |
if#(gt(x,y),x,y) |
(38) |
plus#(s(x),s(y)) |
→ |
gt#(x,y) |
(39) |
plus#(s(x),s(y)) |
→ |
if#(not(gt(x,y)),id(x),id(y)) |
(40) |
plus#(s(x),s(y)) |
→ |
not#(gt(x,y)) |
(41) |
plus#(s(x),s(y)) |
→ |
id#(x) |
(42) |
plus#(s(x),s(y)) |
→ |
id#(y) |
(43) |
plus#(s(x),x) |
→ |
plus#(if(gt(x,x),id(x),id(x)),s(x)) |
(44) |
plus#(s(x),x) |
→ |
if#(gt(x,x),id(x),id(x)) |
(45) |
plus#(s(x),x) |
→ |
gt#(x,x) |
(46) |
plus#(s(x),x) |
→ |
id#(x) |
(47) |
plus#(id(x),s(y)) |
→ |
plus#(x,if(gt(s(y),y),y,s(y))) |
(48) |
plus#(id(x),s(y)) |
→ |
if#(gt(s(y),y),y,s(y)) |
(49) |
plus#(id(x),s(y)) |
→ |
gt#(s(y),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)) |
(26) |
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(s) |
= |
0 |
|
weight(s) |
= |
1 |
|
|
|
in combination with the following argument filter
π(quot#) |
= |
1 |
π(s) |
= |
[1] |
π(minus) |
= |
1 |
together with the usable
rules
minus(x,0) |
→ |
x |
(1) |
minus(minus(x,y),z) |
→ |
minus(x,plus(y,z)) |
(7) |
minus(s(x),s(y)) |
→ |
minus(x,y) |
(2) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pair
quot#(s(x),s(y)) |
→ |
quot#(minus(x,y),s(y)) |
(26) |
could be deleted.
1.1.1.1 P is empty
There are no pairs anymore.
-
The
2nd
component contains the
pair
sum#(app(l,cons(x,cons(y,k)))) |
→ |
sum#(app(l,sum(cons(x,cons(y,k))))) |
(34) |
1.1.2 Reduction Pair Processor with Usable Rules
Using the Knuth Bendix order with w0 = 1 and the following precedence and weight functions
prec(app) |
= |
2 |
|
weight(app) |
= |
1 |
|
|
|
prec(cons) |
= |
1 |
|
weight(cons) |
= |
3 |
|
|
|
prec(sum) |
= |
0 |
|
weight(sum) |
= |
5 |
|
|
|
prec(nil) |
= |
3 |
|
weight(nil) |
= |
1 |
|
|
|
in combination with the following argument filter
π(sum#) |
= |
1 |
π(app) |
= |
[1,2] |
π(cons) |
= |
[2] |
π(sum) |
= |
[] |
π(nil) |
= |
[] |
together with the usable
rules
sum(cons(x,cons(y,l))) |
→ |
sum(cons(plus(x,y),l)) |
(12) |
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) |
(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))))) |
(34) |
could be deleted.
1.1.2.1 P is empty
There are no pairs anymore.
-
The
3rd
component contains the
pair
minus#(minus(x,y),z) |
→ |
minus#(x,plus(y,z)) |
(29) |
minus#(s(x),s(y)) |
→ |
minus#(x,y) |
(25) |
1.1.3 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)) |
(29) |
|
1 |
> |
1 |
minus#(s(x),s(y)) |
→ |
minus#(x,y) |
(25) |
|
1 |
> |
1 |
2 |
> |
2 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
4th
component contains the
pair
sum#(cons(x,cons(y,l))) |
→ |
sum#(cons(plus(x,y),l)) |
(32) |
1.1.4 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 |
|
|
|
in combination with the following argument filter
π(sum#) |
= |
1 |
π(cons) |
= |
[2] |
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)) |
(32) |
could be deleted.
1.1.4.1 P is empty
There are no pairs anymore.
-
The
5th
component contains the
pair
plus#(s(x),s(y)) |
→ |
plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) |
(37) |
plus#(s(x),y) |
→ |
plus#(x,y) |
(28) |
plus#(s(x),x) |
→ |
plus#(if(gt(x,x),id(x),id(x)),s(x)) |
(44) |
plus#(id(x),s(y)) |
→ |
plus#(x,if(gt(s(y),y),y,s(y))) |
(48) |
1.1.5 Reduction Pair Processor with Usable Rules
Using the matrix interpretations of dimension 1 with strict dimension 1 over the arctic semiring over the naturals
[plus#(x1, x2)] |
= |
+ · x1 + · x2
|
[s(x1)] |
= |
+ · x1
|
[if(x1, x2, x3)] |
= |
+ · x1 + · x2 + · x3
|
[gt(x1, x2)] |
= |
+ · x1 + · x2
|
[not(x1)] |
= |
+ · x1
|
[id(x1)] |
= |
+ · x1
|
[zero] |
= |
|
[true] |
= |
|
[false] |
= |
|
together with the usable
rules
gt(s(x),zero) |
→ |
true |
(22) |
gt(zero,y) |
→ |
false |
(23) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(24) |
if(true,x,y) |
→ |
x |
(19) |
if(false,x,y) |
→ |
y |
(20) |
not(x) |
→ |
if(x,false,true) |
(21) |
id(x) |
→ |
x |
(18) |
(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))) |
(37) |
could be deleted.
1.1.5.1 Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[plus#(x1, x2)] |
= |
x1 |
[if(x1, x2, x3)] |
= |
-2 + 2 · x1 + x2 + x3
|
[gt(x1, x2)] |
= |
1 |
[s(x1)] |
= |
1 + 2 · x1
|
[zero] |
= |
0 |
[true] |
= |
1 |
[false] |
= |
1 |
[id(x1)] |
= |
x1 |
together with the usable
rules
gt(s(x),zero) |
→ |
true |
(22) |
gt(zero,y) |
→ |
false |
(23) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(24) |
id(x) |
→ |
x |
(18) |
if(true,x,y) |
→ |
x |
(19) |
if(false,x,y) |
→ |
y |
(20) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pairs
plus#(s(x),y) |
→ |
plus#(x,y) |
(28) |
plus#(s(x),x) |
→ |
plus#(if(gt(x,x),id(x),id(x)),s(x)) |
(44) |
could be deleted.
1.1.5.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))) |
(48) |
|
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
6th
component contains the
pair
app#(cons(x,l),k) |
→ |
app#(l,k) |
(31) |
1.1.6 Monotonic Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[cons(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[app#(x1, x2)] |
= |
1 · x1 + 1 · x2
|
having no usable rules (w.r.t. the implicit argument filter of the
reduction pair),
the
rule
could be deleted.
1.1.6.1 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) |
|
1 |
> |
1 |
2 |
≥ |
2 |
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 Monotonic Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[s(x1)] |
= |
1 · x1
|
[gt#(x1, x2)] |
= |
1 · x1 + 1 · x2
|
having no usable rules (w.r.t. the implicit argument filter of the
reduction pair),
the
rule
could be deleted.
1.1.7.1 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) |
|
1 |
> |
1 |
2 |
> |
2 |
As there is no critical graph in the transitive closure, there are no infinite chains.