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 3
components.
-
The
1st
component contains the
pair
cond#(false,n,l) |
→ |
nthtail#(s(n),l) |
(15) |
nthtail#(n,l) |
→ |
cond#(ge(n,length(l)),n,l) |
(11) |
1.1.1.1 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
length(nil) |
→ |
0 |
(6) |
length(cons(x,l)) |
→ |
s(length(l)) |
(7) |
ge(u,0) |
→ |
true |
(8) |
ge(0,s(v)) |
→ |
false |
(9) |
ge(s(u),s(v)) |
→ |
ge(u,v) |
(10) |
1.1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
length(nil) |
length(cons(x0,x1)) |
ge(x0,0) |
ge(0,s(x0)) |
ge(s(x0),s(x1)) |
1.1.1.1.1.1 Reduction Pair Processor
We apply the generic reduction pair processor using the
linear polynomial interpretation over the naturals
[c] |
= |
-2 |
[nthtail#(x1, x2)] |
= |
-1 · x1 + 1 · x2 + -1 |
[cond#(x1, x2, x3)] |
= |
1 · x1 + -1 · x2 + 1 · x3 + -1 |
[false] |
= |
0 |
[s(x1)] |
= |
1 · x1 + 1 |
[ge(x1, x2)] |
= |
0 |
[length(x1)] |
= |
0 |
[nil] |
= |
1 |
[0] |
= |
0 |
[cons(x1, x2)] |
= |
1 · x1 + 1 · x2 + 1 |
[true] |
= |
0 |
The pair(s)
cond#(false,n,l) |
→ |
nthtail#(s(n),l) |
(15) |
are strictly oriented and the pair(s)
cond#(false,n,l) |
→ |
nthtail#(s(n),l) |
(15) |
are bounded w.r.t. the constant c.
The following constraints are generated for the pairs.
-
cond#(false,0,cons(x19,x18))≥c
- (cond#(false,x16,x21)≥c⟹cond#(false,s(x16),cons(x22,x21))≥c)
-
cond#(false,0,cons(x19,x18)) > nthtail#(s(0),cons(x19,x18))
- (cond#(false,x16,x21) > nthtail#(s(x16),x21)⟹cond#(false,s(x16),cons(x22,x21)) > nthtail#(s(s(x16)),cons(x22,x21)))
-
nthtail#(s(x6),x7)≥cond#(ge(s(x6),length(x7)),s(x6),x7)
The details are shown below:
-
For the chain
we build the initial constraint
(cond#(ge(x2,length(x3)),x2,x3)→*cond#(false,x4,x5)⟹cond#(false,x4,x5)≥c)
which is simplified as follows.
-
Applying Rule "Same Constructor" results in
(ge(x2,length(x3))→*false⟹x2→*x4⟹x3→*x5⟹cond#(false,x4,x5)≥c)
-
Applying Rule "Variable in Equation" allows to substitute
x4 by x2 which results in
(ge(x2,length(x3))→*false⟹x3→*x5⟹cond#(false,x2,x5)≥c)
-
Applying Rule "Variable in Equation" allows to substitute
x5 by x3 which results in
(ge(x2,length(x3))→*false⟹cond#(false,x2,x3)≥c)
-
Applying Rule "Introduce fresh variable" results in
(length(x3)→*x12⟹ge(x2,x12)→*false⟹cond#(false,x2,x3)≥c)
-
Applying Rule "Induction" on ge(x2,x12)→*false results in the following 3 new constraints.
- (true→*false⟹cond#(false,x13,x3)≥c)
- Applying Rule "Different Constructors" allows to drop this constraint.
- (false→*false⟹length(x3)→*s(x14)⟹cond#(false,0,x3)≥c)
-
Applying Rule "Same Constructor" results in
(length(x3)→*s(x14)⟹cond#(false,0,x3)≥c)
-
Applying Rule "Induction" on length(x3)→*s(x14) results in the following 2 new constraints.
- (0→*s(x14)⟹cond#(false,0,nil)≥c)
- Applying Rule "Different Constructors" allows to drop this constraint.
- (s(length(x18))→*s(x14)⟹∀x20
.
(length(x18)→*s(x20)⟹cond#(false,0,x18)≥c)⟹cond#(false,0,cons(x19,x18))≥c)
- (ge(x16,x15)→*false⟹length(x3)→*s(x15)⟹∀x17
.
(ge(x16,x15)→*false⟹length(x17)→*x15⟹cond#(false,x16,x17)≥c)⟹cond#(false,s(x16),x3)≥c)
-
Applying Rule "Induction" on length(x3)→*s(x15) results in the following 2 new constraints.
- (0→*s(x15)⟹cond#(false,s(x16),nil)≥c)
- Applying Rule "Different Constructors" allows to drop this constraint.
- (s(length(x21))→*s(x15)⟹ge(x16,x15)→*false⟹∀x17
.
(ge(x16,x15)→*false⟹length(x17)→*x15⟹cond#(false,x16,x17)≥c)⟹∀x23
.
∀x24
.
∀x25
.
(length(x21)→*s(x23)⟹ge(x24,x23)→*false⟹∀x25
.
(ge(x24,x23)→*false⟹length(x25)→*x23⟹cond#(false,x24,x25)≥c)⟹cond#(false,s(x24),x21)≥c)⟹cond#(false,s(x16),cons(x22,x21))≥c)
-
For the chain
we build the initial constraint
(cond#(ge(x2,length(x3)),x2,x3)→*cond#(false,x4,x5)⟹cond#(false,x4,x5) > nthtail#(s(x4),x5))
which is simplified as follows.
-
Applying Rule "Same Constructor" results in
(ge(x2,length(x3))→*false⟹x2→*x4⟹x3→*x5⟹cond#(false,x4,x5) > nthtail#(s(x4),x5))
-
Applying Rule "Variable in Equation" allows to substitute
x4 by x2 which results in
(ge(x2,length(x3))→*false⟹x3→*x5⟹cond#(false,x2,x5) > nthtail#(s(x2),x5))
-
Applying Rule "Variable in Equation" allows to substitute
x5 by x3 which results in
(ge(x2,length(x3))→*false⟹cond#(false,x2,x3) > nthtail#(s(x2),x3))
-
Applying Rule "Introduce fresh variable" results in
(length(x3)→*x12⟹ge(x2,x12)→*false⟹cond#(false,x2,x3) > nthtail#(s(x2),x3))
-
Applying Rule "Induction" on ge(x2,x12)→*false results in the following 3 new constraints.
- (true→*false⟹cond#(false,x13,x3) > nthtail#(s(x13),x3))
- Applying Rule "Different Constructors" allows to drop this constraint.
- (false→*false⟹length(x3)→*s(x14)⟹cond#(false,0,x3) > nthtail#(s(0),x3))
-
Applying Rule "Same Constructor" results in
(length(x3)→*s(x14)⟹cond#(false,0,x3) > nthtail#(s(0),x3))
-
Applying Rule "Induction" on length(x3)→*s(x14) results in the following 2 new constraints.
- (0→*s(x14)⟹cond#(false,0,nil) > nthtail#(s(0),nil))
- Applying Rule "Different Constructors" allows to drop this constraint.
- (s(length(x18))→*s(x14)⟹∀x20
.
(length(x18)→*s(x20)⟹cond#(false,0,x18) > nthtail#(s(0),x18))⟹cond#(false,0,cons(x19,x18)) > nthtail#(s(0),cons(x19,x18)))
- (ge(x16,x15)→*false⟹length(x3)→*s(x15)⟹∀x17
.
(ge(x16,x15)→*false⟹length(x17)→*x15⟹cond#(false,x16,x17) > nthtail#(s(x16),x17))⟹cond#(false,s(x16),x3) > nthtail#(s(s(x16)),x3))
-
Applying Rule "Induction" on length(x3)→*s(x15) results in the following 2 new constraints.
- (0→*s(x15)⟹cond#(false,s(x16),nil) > nthtail#(s(s(x16)),nil))
- Applying Rule "Different Constructors" allows to drop this constraint.
- (s(length(x21))→*s(x15)⟹ge(x16,x15)→*false⟹∀x17
.
(ge(x16,x15)→*false⟹length(x17)→*x15⟹cond#(false,x16,x17) > nthtail#(s(x16),x17))⟹∀x23
.
∀x24
.
∀x25
.
(length(x21)→*s(x23)⟹ge(x24,x23)→*false⟹∀x25
.
(ge(x24,x23)→*false⟹length(x25)→*x23⟹cond#(false,x24,x25) > nthtail#(s(x24),x25))⟹cond#(false,s(x24),x21) > nthtail#(s(s(x24)),x21))⟹cond#(false,s(x16),cons(x22,x21)) > nthtail#(s(s(x16)),cons(x22,x21)))
-
For the chain
we build the initial constraint
(nthtail#(s(x6),x7)→*nthtail#(x8,x9)⟹nthtail#(x8,x9)≥cond#(ge(x8,length(x9)),x8,x9))
which is simplified as follows.
We remove those pairs which are strictly decreasing and bounded.
1.1.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.
nthtail#(n,l) |
→ |
cond#(ge(n,length(l)),n,l) |
(11) |
|
1 |
≥ |
2 |
2 |
≥ |
3 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
2nd
component contains the
pair
length#(cons(x,l)) |
→ |
length#(l) |
(16) |
1.1.1.2 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
1.1.1.2.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
1.1.1.2.1.1 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
length#(cons(x,l)) |
→ |
length#(l) |
(16) |
|
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
3rd
component contains the
pair
ge#(s(u),s(v)) |
→ |
ge#(u,v) |
(17) |
1.1.1.3 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
1.1.1.3.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
1.1.1.3.1.1 Size-Change Termination
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) |
(17) |
|
1 |
> |
1 |
2 |
> |
2 |
As there is no critical graph in the transitive closure, there are no infinite chains.