Term Rewriting System R:
[dummy, dummy2, x, y, z]
function(iszero, 0, dummy, dummy2) -> true
function(iszero, s(x), dummy, dummy2) -> false
function(p, 0, dummy, dummy2) -> 0
function(p, s(0), dummy, dummy2) -> 0
function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(plus, dummy, x, y) -> function(if, function(iszero, x, x, x), x, y)
function(if, true, x, y) -> y
function(if, false, x, y) -> function(plus, function(third, x, y, y), function(p, x, x, y), s(y))
function(third, x, y, z) -> z

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:

FUNCTION(p, s(s(x)), dummy, dummy2) -> FUNCTION(p, s(x), x, x)
FUNCTION(plus, dummy, x, y) -> FUNCTION(if, function(iszero, x, x, x), x, y)
FUNCTION(plus, dummy, x, y) -> FUNCTION(iszero, x, x, x)
FUNCTION(if, false, x, y) -> FUNCTION(plus, function(third, x, y, y), function(p, x, x, y), s(y))
FUNCTION(if, false, x, y) -> FUNCTION(third, x, y, y)
FUNCTION(if, false, x, y) -> FUNCTION(p, x, x, y)

Furthermore, R contains two SCCs.


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


Dependency Pair:

FUNCTION(p, s(s(x)), dummy, dummy2) -> FUNCTION(p, s(x), x, x)


Rules:


function(iszero, 0, dummy, dummy2) -> true
function(iszero, s(x), dummy, dummy2) -> false
function(p, 0, dummy, dummy2) -> 0
function(p, s(0), dummy, dummy2) -> 0
function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(plus, dummy, x, y) -> function(if, function(iszero, x, x, x), x, y)
function(if, true, x, y) -> y
function(if, false, x, y) -> function(plus, function(third, x, y, y), function(p, x, x, y), s(y))
function(third, x, y, z) -> z


Strategy:

innermost




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


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


Dependency Pair:

FUNCTION(p, s(s(x)), dummy, dummy2) -> FUNCTION(p, s(x), x, x)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. FUNCTION(p, s(s(x)), dummy, dummy2) -> FUNCTION(p, s(x), x, x)
and get the following Size-Change Graph(s):
{1} , {1}
1=1
2>2
2>3
2>4

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

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)


Dependency Pairs:

FUNCTION(if, false, x, y) -> FUNCTION(plus, function(third, x, y, y), function(p, x, x, y), s(y))
FUNCTION(plus, dummy, x, y) -> FUNCTION(if, function(iszero, x, x, x), x, y)


Rules:


function(iszero, 0, dummy, dummy2) -> true
function(iszero, s(x), dummy, dummy2) -> false
function(p, 0, dummy, dummy2) -> 0
function(p, s(0), dummy, dummy2) -> 0
function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(plus, dummy, x, y) -> function(if, function(iszero, x, x, x), x, y)
function(if, true, x, y) -> y
function(if, false, x, y) -> function(plus, function(third, x, y, y), function(p, x, x, y), s(y))
function(third, x, y, z) -> z


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 4
Rewriting Transformation


Dependency Pairs:

FUNCTION(if, false, x, y) -> FUNCTION(plus, function(third, x, y, y), function(p, x, x, y), s(y))
FUNCTION(plus, dummy, x, y) -> FUNCTION(if, function(iszero, x, x, x), x, y)


Rules:


function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, 0, dummy, dummy2) -> 0
function(p, s(0), dummy, dummy2) -> 0
function(third, x, y, z) -> z
function(iszero, 0, dummy, dummy2) -> true
function(iszero, s(x), dummy, dummy2) -> false


Strategy:

innermost




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

FUNCTION(if, false, x, y) -> FUNCTION(plus, function(third, x, y, y), function(p, x, x, y), s(y))
one new Dependency Pair is created:

FUNCTION(if, false, x, y) -> FUNCTION(plus, y, function(p, x, x, y), s(y))

The transformation is resulting in one new DP problem:



   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 5
Usable Rules (Innermost)


Dependency Pairs:

FUNCTION(if, false, x, y) -> FUNCTION(plus, y, function(p, x, x, y), s(y))
FUNCTION(plus, dummy, x, y) -> FUNCTION(if, function(iszero, x, x, x), x, y)


Rules:


function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, 0, dummy, dummy2) -> 0
function(p, s(0), dummy, dummy2) -> 0
function(third, x, y, z) -> z
function(iszero, 0, dummy, dummy2) -> true
function(iszero, s(x), dummy, dummy2) -> false


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 6
Narrowing Transformation


Dependency Pairs:

FUNCTION(if, false, x, y) -> FUNCTION(plus, y, function(p, x, x, y), s(y))
FUNCTION(plus, dummy, x, y) -> FUNCTION(if, function(iszero, x, x, x), x, y)


Rules:


function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, 0, dummy, dummy2) -> 0
function(p, s(0), dummy, dummy2) -> 0
function(iszero, 0, dummy, dummy2) -> true
function(iszero, s(x), dummy, dummy2) -> false


Strategy:

innermost




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

FUNCTION(plus, dummy, x, y) -> FUNCTION(if, function(iszero, x, x, x), x, y)
two new Dependency Pairs are created:

FUNCTION(plus, dummy, 0, y) -> FUNCTION(if, true, 0, y)
FUNCTION(plus, dummy, s(x''), y) -> FUNCTION(if, false, 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 7
Narrowing Transformation


Dependency Pairs:

FUNCTION(plus, dummy, s(x''), y) -> FUNCTION(if, false, s(x''), y)
FUNCTION(if, false, x, y) -> FUNCTION(plus, y, function(p, x, x, y), s(y))


Rules:


function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, 0, dummy, dummy2) -> 0
function(p, s(0), dummy, dummy2) -> 0
function(iszero, 0, dummy, dummy2) -> true
function(iszero, s(x), dummy, dummy2) -> false


Strategy:

innermost




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

FUNCTION(if, false, x, y) -> FUNCTION(plus, y, function(p, x, x, y), s(y))
three new Dependency Pairs are created:

FUNCTION(if, false, s(s(x'')), y') -> FUNCTION(plus, y', s(function(p, s(x''), x'', x'')), s(y'))
FUNCTION(if, false, 0, y') -> FUNCTION(plus, y', 0, s(y'))
FUNCTION(if, false, s(0), y') -> FUNCTION(plus, y', 0, s(y'))

The transformation is resulting in one new DP problem:



   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 8
Instantiation Transformation


Dependency Pairs:

FUNCTION(if, false, s(s(x'')), y') -> FUNCTION(plus, y', s(function(p, s(x''), x'', x'')), s(y'))
FUNCTION(plus, dummy, s(x''), y) -> FUNCTION(if, false, s(x''), y)


Rules:


function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, 0, dummy, dummy2) -> 0
function(p, s(0), dummy, dummy2) -> 0
function(iszero, 0, dummy, dummy2) -> true
function(iszero, s(x), dummy, dummy2) -> false


Strategy:

innermost




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

FUNCTION(plus, dummy, s(x''), y) -> FUNCTION(if, false, s(x''), y)
one new Dependency Pair is created:

FUNCTION(plus, dummy', s(x'''), s(dummy')) -> FUNCTION(if, false, s(x'''), s(dummy'))

The transformation is resulting in one new DP problem:



   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 9
Instantiation Transformation


Dependency Pairs:

FUNCTION(plus, dummy', s(x'''), s(dummy')) -> FUNCTION(if, false, s(x'''), s(dummy'))
FUNCTION(if, false, s(s(x'')), y') -> FUNCTION(plus, y', s(function(p, s(x''), x'', x'')), s(y'))


Rules:


function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, 0, dummy, dummy2) -> 0
function(p, s(0), dummy, dummy2) -> 0
function(iszero, 0, dummy, dummy2) -> true
function(iszero, s(x), dummy, dummy2) -> false


Strategy:

innermost




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

FUNCTION(if, false, s(s(x'')), y') -> FUNCTION(plus, y', s(function(p, s(x''), x'', x'')), s(y'))
one new Dependency Pair is created:

FUNCTION(if, false, s(s(x''')), s(dummy''')) -> FUNCTION(plus, s(dummy'''), s(function(p, s(x'''), x''', x''')), s(s(dummy''')))

The transformation is resulting in one new DP problem:



   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 10
Usable Rules (Innermost)


Dependency Pairs:

FUNCTION(if, false, s(s(x''')), s(dummy''')) -> FUNCTION(plus, s(dummy'''), s(function(p, s(x'''), x''', x''')), s(s(dummy''')))
FUNCTION(plus, dummy', s(x'''), s(dummy')) -> FUNCTION(if, false, s(x'''), s(dummy'))


Rules:


function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, 0, dummy, dummy2) -> 0
function(p, s(0), dummy, dummy2) -> 0
function(iszero, 0, dummy, dummy2) -> true
function(iszero, s(x), dummy, dummy2) -> false


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 11
Instantiation Transformation


Dependency Pairs:

FUNCTION(if, false, s(s(x''')), s(dummy''')) -> FUNCTION(plus, s(dummy'''), s(function(p, s(x'''), x''', x''')), s(s(dummy''')))
FUNCTION(plus, dummy', s(x'''), s(dummy')) -> FUNCTION(if, false, s(x'''), s(dummy'))


Rules:


function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, s(0), dummy, dummy2) -> 0


Strategy:

innermost




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

FUNCTION(plus, dummy', s(x'''), s(dummy')) -> FUNCTION(if, false, s(x'''), s(dummy'))
one new Dependency Pair is created:

FUNCTION(plus, s(dummy'''''), s(x''''), s(s(dummy'''''))) -> FUNCTION(if, false, s(x''''), s(s(dummy''''')))

The transformation is resulting in one new DP problem:



   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 12
Instantiation Transformation


Dependency Pairs:

FUNCTION(plus, s(dummy'''''), s(x''''), s(s(dummy'''''))) -> FUNCTION(if, false, s(x''''), s(s(dummy''''')))
FUNCTION(if, false, s(s(x''')), s(dummy''')) -> FUNCTION(plus, s(dummy'''), s(function(p, s(x'''), x''', x''')), s(s(dummy''')))


Rules:


function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, s(0), dummy, dummy2) -> 0


Strategy:

innermost




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

FUNCTION(if, false, s(s(x''')), s(dummy''')) -> FUNCTION(plus, s(dummy'''), s(function(p, s(x'''), x''', x''')), s(s(dummy''')))
one new Dependency Pair is created:

FUNCTION(if, false, s(s(x'''')), s(s(dummy'''''''))) -> FUNCTION(plus, s(s(dummy''''''')), s(function(p, s(x''''), x'''', x'''')), s(s(s(dummy'''''''))))

The transformation is resulting in one new DP problem:



   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 13
Negative Polynomial Order


Dependency Pairs:

FUNCTION(if, false, s(s(x'''')), s(s(dummy'''''''))) -> FUNCTION(plus, s(s(dummy''''''')), s(function(p, s(x''''), x'''', x'''')), s(s(s(dummy'''''''))))
FUNCTION(plus, s(dummy'''''), s(x''''), s(s(dummy'''''))) -> FUNCTION(if, false, s(x''''), s(s(dummy''''')))


Rules:


function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, s(0), dummy, dummy2) -> 0


Strategy:

innermost




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

FUNCTION(if, false, s(s(x'''')), s(s(dummy'''''''))) -> FUNCTION(plus, s(s(dummy''''''')), s(function(p, s(x''''), x'''', x'''')), s(s(s(dummy'''''''))))


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

function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, s(0), dummy, dummy2) -> 0


Used ordering:
Polynomial Order with Interpretation:

POL( FUNCTION(x1, ..., x4) ) = max{0, x3 - 1}

POL( s(x1) ) = x1 + 1

POL( function(x1, ..., x4) ) = max{0, x2 - 1}

POL( 0 ) = 0


This results in one new DP problem.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 14
Dependency Graph


Dependency Pair:

FUNCTION(plus, s(dummy'''''), s(x''''), s(s(dummy'''''))) -> FUNCTION(if, false, s(x''''), s(s(dummy''''')))


Rules:


function(p, s(s(x)), dummy, dummy2) -> s(function(p, s(x), x, x))
function(p, s(0), dummy, dummy2) -> 0


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.

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