Term Rewriting System R:
[x, y]
+(x, 0) -> x
+(x, s(y)) -> s(+(x, y))
*(x, 0) -> 0
*(x, s(y)) -> +(*(x, y), x)
ge(x, 0) -> true
ge(0, s(y)) -> false
ge(s(x), s(y)) -> ge(x, y)
-(x, 0) -> x
-(s(x), s(y)) -> -(x, y)
fact(x) -> iffact(x, ge(x, s(s(0))))
iffact(x, true) -> *(x, fact(-(x, s(0))))
iffact(x, false) -> s(0)

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:

+'(x, s(y)) -> +'(x, y)
*'(x, s(y)) -> +'(*(x, y), x)
*'(x, s(y)) -> *'(x, y)
GE(s(x), s(y)) -> GE(x, y)
-'(s(x), s(y)) -> -'(x, y)
FACT(x) -> IFFACT(x, ge(x, s(s(0))))
FACT(x) -> GE(x, s(s(0)))
IFFACT(x, true) -> *'(x, fact(-(x, s(0))))
IFFACT(x, true) -> FACT(-(x, s(0)))
IFFACT(x, true) -> -'(x, s(0))

Furthermore, R contains five SCCs.


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


Dependency Pair:

+'(x, s(y)) -> +'(x, y)


Rules:


+(x, 0) -> x
+(x, s(y)) -> s(+(x, y))
*(x, 0) -> 0
*(x, s(y)) -> +(*(x, y), x)
ge(x, 0) -> true
ge(0, s(y)) -> false
ge(s(x), s(y)) -> ge(x, y)
-(x, 0) -> x
-(s(x), s(y)) -> -(x, y)
fact(x) -> iffact(x, ge(x, s(s(0))))
iffact(x, true) -> *(x, fact(-(x, s(0))))
iffact(x, false) -> s(0)


Strategy:

innermost




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


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


Dependency Pair:

+'(x, s(y)) -> +'(x, y)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. +'(x, s(y)) -> +'(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
Usable Rules (Innermost)
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules


Dependency Pair:

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


Rules:


+(x, 0) -> x
+(x, s(y)) -> s(+(x, y))
*(x, 0) -> 0
*(x, s(y)) -> +(*(x, y), x)
ge(x, 0) -> true
ge(0, s(y)) -> false
ge(s(x), s(y)) -> ge(x, y)
-(x, 0) -> x
-(s(x), s(y)) -> -(x, y)
fact(x) -> iffact(x, ge(x, s(s(0))))
iffact(x, true) -> *(x, fact(-(x, s(0))))
iffact(x, false) -> s(0)


Strategy:

innermost




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


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


Dependency Pair:

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


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. GE(s(x), s(y)) -> GE(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
Usable Rules (Innermost)
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules


Dependency Pair:

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


Rules:


+(x, 0) -> x
+(x, s(y)) -> s(+(x, y))
*(x, 0) -> 0
*(x, s(y)) -> +(*(x, y), x)
ge(x, 0) -> true
ge(0, s(y)) -> false
ge(s(x), s(y)) -> ge(x, y)
-(x, 0) -> x
-(s(x), s(y)) -> -(x, y)
fact(x) -> iffact(x, ge(x, s(s(0))))
iffact(x, true) -> *(x, fact(-(x, s(0))))
iffact(x, false) -> s(0)


Strategy:

innermost




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


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


Dependency Pair:

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


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. -'(s(x), s(y)) -> -'(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)
           →DP Problem 5
UsableRules


Dependency Pair:

*'(x, s(y)) -> *'(x, y)


Rules:


+(x, 0) -> x
+(x, s(y)) -> s(+(x, y))
*(x, 0) -> 0
*(x, s(y)) -> +(*(x, y), x)
ge(x, 0) -> true
ge(0, s(y)) -> false
ge(s(x), s(y)) -> ge(x, y)
-(x, 0) -> x
-(s(x), s(y)) -> -(x, y)
fact(x) -> iffact(x, ge(x, s(s(0))))
iffact(x, true) -> *(x, fact(-(x, s(0))))
iffact(x, false) -> s(0)


Strategy:

innermost




As we are in the innermost case, we can delete all 12 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 9
Size-Change Principle
           →DP Problem 5
UsableRules


Dependency Pair:

*'(x, s(y)) -> *'(x, y)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. *'(x, s(y)) -> *'(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
UsableRules
           →DP Problem 5
Usable Rules (Innermost)


Dependency Pairs:

IFFACT(x, true) -> FACT(-(x, s(0)))
FACT(x) -> IFFACT(x, ge(x, s(s(0))))


Rules:


+(x, 0) -> x
+(x, s(y)) -> s(+(x, y))
*(x, 0) -> 0
*(x, s(y)) -> +(*(x, y), x)
ge(x, 0) -> true
ge(0, s(y)) -> false
ge(s(x), s(y)) -> ge(x, y)
-(x, 0) -> x
-(s(x), s(y)) -> -(x, y)
fact(x) -> iffact(x, ge(x, s(s(0))))
iffact(x, true) -> *(x, fact(-(x, s(0))))
iffact(x, false) -> s(0)


Strategy:

innermost




As we are in the innermost case, we can delete all 7 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 5
UsableRules
             ...
               →DP Problem 10
Narrowing Transformation


Dependency Pairs:

IFFACT(x, true) -> FACT(-(x, s(0)))
FACT(x) -> IFFACT(x, ge(x, s(s(0))))


Rules:


-(s(x), s(y)) -> -(x, y)
-(x, 0) -> x
ge(x, 0) -> true
ge(0, s(y)) -> false
ge(s(x), s(y)) -> ge(x, y)


Strategy:

innermost




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

FACT(x) -> IFFACT(x, ge(x, s(s(0))))
two new Dependency Pairs are created:

FACT(0) -> IFFACT(0, false)
FACT(s(x'')) -> IFFACT(s(x''), ge(x'', s(0)))

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 5
UsableRules
             ...
               →DP Problem 11
Narrowing Transformation


Dependency Pairs:

FACT(s(x'')) -> IFFACT(s(x''), ge(x'', s(0)))
IFFACT(x, true) -> FACT(-(x, s(0)))


Rules:


-(s(x), s(y)) -> -(x, y)
-(x, 0) -> x
ge(x, 0) -> true
ge(0, s(y)) -> false
ge(s(x), s(y)) -> ge(x, y)


Strategy:

innermost




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

IFFACT(x, true) -> FACT(-(x, s(0)))
one new Dependency Pair is created:

IFFACT(s(x''), true) -> FACT(-(x'', 0))

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 5
UsableRules
             ...
               →DP Problem 12
Rewriting Transformation


Dependency Pairs:

IFFACT(s(x''), true) -> FACT(-(x'', 0))
FACT(s(x'')) -> IFFACT(s(x''), ge(x'', s(0)))


Rules:


-(s(x), s(y)) -> -(x, y)
-(x, 0) -> x
ge(x, 0) -> true
ge(0, s(y)) -> false
ge(s(x), s(y)) -> ge(x, y)


Strategy:

innermost




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

IFFACT(s(x''), true) -> FACT(-(x'', 0))
one new Dependency Pair is created:

IFFACT(s(x''), true) -> FACT(x'')

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 5
UsableRules
             ...
               →DP Problem 13
Usable Rules (Innermost)


Dependency Pairs:

IFFACT(s(x''), true) -> FACT(x'')
FACT(s(x'')) -> IFFACT(s(x''), ge(x'', s(0)))


Rules:


-(s(x), s(y)) -> -(x, y)
-(x, 0) -> x
ge(x, 0) -> true
ge(0, s(y)) -> false
ge(s(x), s(y)) -> ge(x, y)


Strategy:

innermost




As we are in the innermost case, we can delete all 2 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 5
UsableRules
             ...
               →DP Problem 14
Size-Change Principle


Dependency Pairs:

IFFACT(s(x''), true) -> FACT(x'')
FACT(s(x'')) -> IFFACT(s(x''), ge(x'', s(0)))


Rules:


ge(x, 0) -> true
ge(0, s(y)) -> false
ge(s(x), s(y)) -> ge(x, y)


Strategy:

innermost




We number the DPs as follows:
  1. IFFACT(s(x''), true) -> FACT(x'')
  2. FACT(s(x'')) -> IFFACT(s(x''), ge(x'', s(0)))
and get the following Size-Change Graph(s):
{1} , {1}
1>1
{2} , {2}
1=1

which lead(s) to this/these maximal multigraph(s):
{1} , {2}
1>1
{2} , {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.

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