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