The rewrite relation of the following TRS is considered.
div(x,s(y)) | → | d(x,s(y),0) | (1) |
d(x,s(y),z) | → | cond(ge(x,z),x,y,z) | (2) |
cond(true,x,y,z) | → | s(d(x,s(y),plus(s(y),z))) | (3) |
cond(false,x,y,z) | → | 0 | (4) |
ge(u,0) | → | true | (5) |
ge(0,s(v)) | → | false | (6) |
ge(s(u),s(v)) | → | ge(u,v) | (7) |
plus(n,0) | → | n | (8) |
plus(n,s(m)) | → | s(plus(n,m)) | (9) |
The TRS is overlay and locally confluent:
10Hence, it suffices to show innermost termination in the following.
div#(x,s(y)) | → | d#(x,s(y),0) | (10) |
d#(x,s(y),z) | → | cond#(ge(x,z),x,y,z) | (11) |
d#(x,s(y),z) | → | ge#(x,z) | (12) |
cond#(true,x,y,z) | → | d#(x,s(y),plus(s(y),z)) | (13) |
cond#(true,x,y,z) | → | plus#(s(y),z) | (14) |
ge#(s(u),s(v)) | → | ge#(u,v) | (15) |
plus#(n,s(m)) | → | plus#(n,m) | (16) |
The dependency pairs are split into 3 components.
cond#(true,x,y,z) | → | d#(x,s(y),plus(s(y),z)) | (13) |
d#(x,s(y),z) | → | cond#(ge(x,z),x,y,z) | (11) |
We restrict the rewrite rules to the following usable rules of the DP problem.
ge(u,0) | → | true | (5) |
ge(0,s(v)) | → | false | (6) |
ge(s(u),s(v)) | → | ge(u,v) | (7) |
plus(n,0) | → | n | (8) |
plus(n,s(m)) | → | s(plus(n,m)) | (9) |
We restrict the innermost strategy to the following left hand sides.
ge(x0,0) |
ge(0,s(x0)) |
ge(s(x0),s(x1)) |
plus(x0,0) |
plus(x0,s(x1)) |
[c] | = | -1 |
[d#(x1, x2, x3)] | = | 1 · x1 + -1 · x3 |
[cond#(x1,...,x4)] | = | -1 · x1 + 1 · x2 + -1 · x4 + -1 |
[true] | = | 0 |
[s(x1)] | = | 1 · x1 + 1 |
[plus(x1, x2)] | = | 1 · x1 + 1 · x2 |
[ge(x1, x2)] | = | 0 |
[0] | = | 0 |
[false] | = | 0 |
The pair(s)
d#(x,s(y),z) | → | cond#(ge(x,z),x,y,z) | (11) |
are strictly oriented and the pair(s)
cond#(true,x,y,z) | → | d#(x,s(y),plus(s(y),z)) | (13) |
are bounded w.r.t. the constant c.
The following constraints are generated for the pairs.
The details are shown below:
(cond#(ge(x3,x5),x3,x4,x5)→*cond#(true,x6,x7,x8)⟹cond#(true,x6,x7,x8)≥c)
which is simplified as follows.
This constraint is kept as final constraint.
This constraint is kept as final constraint.
(cond#(ge(x3,x5),x3,x4,x5)→*cond#(true,x6,x7,x8)⟹cond#(true,x6,x7,x8)≥d#(x6,s(x7),plus(s(x7),x8)))
which is simplified as follows.
This constraint is kept as final constraint.
This constraint is kept as final constraint.
(d#(x9,s(x10),plus(s(x10),x11))→*d#(x12,s(x13),x14)⟹d#(x12,s(x13),x14) > cond#(ge(x12,x14),x12,x13,x14))
which is simplified as follows.
This constraint is kept as final constraint.
We get two subproofs, in the first the strict pairs are deleted, in the second the bounded pairs are deleted.
We restrict the rewrite rules to the following usable rules of the DP problem.
plus(n,0) | → | n | (8) |
plus(n,s(m)) | → | s(plus(n,m)) | (9) |
We restrict the innermost strategy to the following left hand sides.
plus(x0,0) |
plus(x0,s(x1)) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
cond#(true,x,y,z) | → | d#(x,s(y),plus(s(y),z)) | (13) |
2 | ≥ | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
We restrict the rewrite rules to the following usable rules of the DP problem.
ge(u,0) | → | true | (5) |
ge(0,s(v)) | → | false | (6) |
ge(s(u),s(v)) | → | ge(u,v) | (7) |
We restrict the innermost strategy to the following left hand sides.
ge(x0,0) |
ge(0,s(x0)) |
ge(s(x0),s(x1)) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
d#(x,s(y),z) | → | cond#(ge(x,z),x,y,z) | (11) |
1 | ≥ | 2 | |
2 | > | 3 | |
3 | ≥ | 4 |
As there is no critical graph in the transitive closure, there are no infinite chains.
ge#(s(u),s(v)) | → | ge#(u,v) | (15) |
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
ge#(s(u),s(v)) | → | ge#(u,v) | (15) |
1 | > | 1 | |
2 | > | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.
plus#(n,s(m)) | → | plus#(n,m) | (16) |
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
plus#(n,s(m)) | → | plus#(n,m) | (16) |
1 | ≥ | 1 | |
2 | > | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.