Term Rewriting System R:
[x, y]
even(0) -> true
even(s(0)) -> false
even(s(s(x))) -> even(x)
half(0) -> 0
half(s(s(x))) -> s(half(x))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(x), y) -> iftimes(even(s(x)), s(x), y)
iftimes(true, s(x), y) -> plus(times(half(s(x)), y), times(half(s(x)), y))
iftimes(false, s(x), y) -> plus(y, times(x, y))

Termination of R to be shown.



   R
Overlay and local confluence Check



The TRS is overlay and locally confluent (all critical pairs are trivially joinable).Hence, we can switch to innermost.


   R
OC
       →TRS2
Dependency Pair Analysis



R contains the following Dependency Pairs:

EVEN(s(s(x))) -> EVEN(x)
HALF(s(s(x))) -> HALF(x)
PLUS(s(x), y) -> PLUS(x, y)
TIMES(s(x), y) -> IFTIMES(even(s(x)), s(x), y)
TIMES(s(x), y) -> EVEN(s(x))
IFTIMES(true, s(x), y) -> PLUS(times(half(s(x)), y), times(half(s(x)), y))
IFTIMES(true, s(x), y) -> TIMES(half(s(x)), y)
IFTIMES(true, s(x), y) -> HALF(s(x))
IFTIMES(false, s(x), y) -> PLUS(y, times(x, y))
IFTIMES(false, s(x), y) -> TIMES(x, y)

Furthermore, R contains four SCCs.


   R
OC
       →TRS2
DPs
           →DP Problem 1
Usable Rules (Innermost)
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules


Dependency Pair:

EVEN(s(s(x))) -> EVEN(x)


Rules:


even(0) -> true
even(s(0)) -> false
even(s(s(x))) -> even(x)
half(0) -> 0
half(s(s(x))) -> s(half(x))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(x), y) -> iftimes(even(s(x)), s(x), y)
iftimes(true, s(x), y) -> plus(times(half(s(x)), y), times(half(s(x)), y))
iftimes(false, s(x), y) -> plus(y, times(x, y))


Strategy:

innermost




As we are in the innermost case, we can delete all 11 non-usable-rules.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
             ...
               →DP Problem 5
Size-Change Principle
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules


Dependency Pair:

EVEN(s(s(x))) -> EVEN(x)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. EVEN(s(s(x))) -> EVEN(x)
and get the following Size-Change Graph(s):
{1} , {1}
1>1

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
Usable Rules (Innermost)
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules


Dependency Pair:

HALF(s(s(x))) -> HALF(x)


Rules:


even(0) -> true
even(s(0)) -> false
even(s(s(x))) -> even(x)
half(0) -> 0
half(s(s(x))) -> s(half(x))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(x), y) -> iftimes(even(s(x)), s(x), y)
iftimes(true, s(x), y) -> plus(times(half(s(x)), y), times(half(s(x)), y))
iftimes(false, s(x), y) -> plus(y, times(x, y))


Strategy:

innermost




As we are in the innermost case, we can delete all 11 non-usable-rules.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 6
Size-Change Principle
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules


Dependency Pair:

HALF(s(s(x))) -> HALF(x)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. HALF(s(s(x))) -> HALF(x)
and get the following Size-Change Graph(s):
{1} , {1}
1>1

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
Usable Rules (Innermost)
           →DP Problem 4
UsableRules


Dependency Pair:

PLUS(s(x), y) -> PLUS(x, y)


Rules:


even(0) -> true
even(s(0)) -> false
even(s(s(x))) -> even(x)
half(0) -> 0
half(s(s(x))) -> s(half(x))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(x), y) -> iftimes(even(s(x)), s(x), y)
iftimes(true, s(x), y) -> plus(times(half(s(x)), y), times(half(s(x)), y))
iftimes(false, s(x), y) -> plus(y, times(x, y))


Strategy:

innermost




As we are in the innermost case, we can delete all 11 non-usable-rules.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
             ...
               →DP Problem 7
Size-Change Principle
           →DP Problem 4
UsableRules


Dependency Pair:

PLUS(s(x), y) -> PLUS(x, y)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. PLUS(s(x), y) -> PLUS(x, y)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
2=2

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1
2=2

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
Usable Rules (Innermost)


Dependency Pairs:

IFTIMES(false, s(x), y) -> TIMES(x, y)
IFTIMES(true, s(x), y) -> TIMES(half(s(x)), y)
TIMES(s(x), y) -> IFTIMES(even(s(x)), s(x), y)


Rules:


even(0) -> true
even(s(0)) -> false
even(s(s(x))) -> even(x)
half(0) -> 0
half(s(s(x))) -> s(half(x))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(x), y) -> iftimes(even(s(x)), s(x), y)
iftimes(true, s(x), y) -> plus(times(half(s(x)), y), times(half(s(x)), y))
iftimes(false, s(x), y) -> plus(y, times(x, y))


Strategy:

innermost




As we are in the innermost case, we can delete all 6 non-usable-rules.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
             ...
               →DP Problem 8
Negative Polynomial Order


Dependency Pairs:

IFTIMES(false, s(x), y) -> TIMES(x, y)
IFTIMES(true, s(x), y) -> TIMES(half(s(x)), y)
TIMES(s(x), y) -> IFTIMES(even(s(x)), s(x), y)


Rules:


half(0) -> 0
half(s(s(x))) -> s(half(x))
even(s(0)) -> false
even(s(s(x))) -> even(x)
even(0) -> true


Strategy:

innermost




The following Dependency Pair can be strictly oriented using the given order.

IFTIMES(false, s(x), y) -> TIMES(x, y)


Moreover, the following usable rules (regarding the implicit AFS) are oriented.

half(0) -> 0
half(s(s(x))) -> s(half(x))
even(s(0)) -> false
even(s(s(x))) -> even(x)
even(0) -> true


Used ordering:
Polynomial Order with Interpretation:

POL( IFTIMES(x1, ..., x3) ) = x2

POL( s(x1) ) = x1 + 1

POL( TIMES(x1, x2) ) = x1

POL( half(x1) ) = x1

POL( 0 ) = 0

POL( even(x1) ) = 0

POL( false ) = 0

POL( true ) = 0


This results in one new DP problem.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
             ...
               →DP Problem 9
Narrowing Transformation


Dependency Pairs:

IFTIMES(true, s(x), y) -> TIMES(half(s(x)), y)
TIMES(s(x), y) -> IFTIMES(even(s(x)), s(x), y)


Rules:


half(0) -> 0
half(s(s(x))) -> s(half(x))
even(s(0)) -> false
even(s(s(x))) -> even(x)
even(0) -> true


Strategy:

innermost




On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

IFTIMES(true, s(x), y) -> TIMES(half(s(x)), y)
one new Dependency Pair is created:

IFTIMES(true, s(s(x'')), y) -> TIMES(s(half(x'')), y)

The transformation is resulting in one new DP problem:



   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
             ...
               →DP Problem 10
Narrowing Transformation


Dependency Pairs:

IFTIMES(true, s(s(x'')), y) -> TIMES(s(half(x'')), y)
TIMES(s(x), y) -> IFTIMES(even(s(x)), s(x), y)


Rules:


half(0) -> 0
half(s(s(x))) -> s(half(x))
even(s(0)) -> false
even(s(s(x))) -> even(x)
even(0) -> true


Strategy:

innermost




On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

TIMES(s(x), y) -> IFTIMES(even(s(x)), s(x), y)
two new Dependency Pairs are created:

TIMES(s(0), y) -> IFTIMES(false, s(0), y)
TIMES(s(s(x'')), y) -> IFTIMES(even(x''), s(s(x'')), y)

The transformation is resulting in one new DP problem:



   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
             ...
               →DP Problem 11
Negative Polynomial Order


Dependency Pairs:

TIMES(s(s(x'')), y) -> IFTIMES(even(x''), s(s(x'')), y)
IFTIMES(true, s(s(x'')), y) -> TIMES(s(half(x'')), y)


Rules:


half(0) -> 0
half(s(s(x))) -> s(half(x))
even(s(0)) -> false
even(s(s(x))) -> even(x)
even(0) -> true


Strategy:

innermost




The following Dependency Pair can be strictly oriented using the given order.

TIMES(s(s(x'')), y) -> IFTIMES(even(x''), s(s(x'')), y)


Moreover, the following usable rules (regarding the implicit AFS) are oriented.

even(s(0)) -> false
even(s(s(x))) -> even(x)
even(0) -> true
half(0) -> 0
half(s(s(x))) -> s(half(x))


Used ordering:
Polynomial Order with Interpretation:

POL( TIMES(x1, x2) ) = x1 + 1

POL( s(x1) ) = x1 + 1

POL( IFTIMES(x1, ..., x3) ) = x2

POL( half(x1) ) = x1

POL( even(x1) ) = 0

POL( false ) = 0

POL( true ) = 0

POL( 0 ) = 0


This results in one new DP problem.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
             ...
               →DP Problem 12
Dependency Graph


Dependency Pair:

IFTIMES(true, s(s(x'')), y) -> TIMES(s(half(x'')), y)


Rules:


half(0) -> 0
half(s(s(x))) -> s(half(x))
even(s(0)) -> false
even(s(s(x))) -> even(x)
even(0) -> true


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.

Termination of R successfully shown.
Duration:
0:07 minutes