(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

double(0) → 0
double(s(x)) → s(s(double(x)))
half(0) → 0
half(s(0)) → 0
half(s(s(x))) → s(half(x))
-(x, 0) → x
-(s(x), s(y)) → -(x, y)
if(0, y, z) → y
if(s(x), y, z) → z
half(double(x)) → x

Rewrite Strategy: INNERMOST

(1) NestedDefinedSymbolProof (BOTH BOUNDS(ID, ID) transformation)

The TRS does not nest defined symbols.
Hence, the left-hand sides of the following rules are not basic-reachable and can be removed:
half(double(x)) → x

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

double(0) → 0
double(s(x)) → s(s(double(x)))
half(s(0)) → 0
half(s(s(x))) → s(half(x))
if(s(x), y, z) → z
half(0) → 0
-(s(x), s(y)) → -(x, y)
-(x, 0) → x
if(0, y, z) → y

Rewrite Strategy: INNERMOST

(3) CpxTrsMatchBoundsTAProof (EQUIVALENT transformation)

A linear upper bound on the runtime complexity of the TRS R could be shown with a Match-Bound[TAB_LEFTLINEAR,TAB_NONLEFTLINEAR] (for contructor-based start-terms) of 1.

The compatible tree automaton used to show the Match-Boundedness (for constructor-based start-terms) is represented by:
final states : [1, 2, 3, 4]
transitions:
00() → 0
s0(0) → 0
double0(0) → 1
half0(0) → 2
if0(0, 0, 0) → 3
-0(0, 0) → 4
01() → 1
double1(0) → 6
s1(6) → 5
s1(5) → 1
01() → 2
half1(0) → 7
s1(7) → 2
-1(0, 0) → 4
01() → 6
s1(5) → 6
01() → 7
s1(7) → 7
0 → 3
0 → 4

(4) BOUNDS(1, n^1)

(5) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)

Converted Cpx (relative) TRS to CDT

(6) Obligation:

Complexity Dependency Tuples Problem
Rules:

double(0) → 0
double(s(z0)) → s(s(double(z0)))
half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(0) → 0
if(s(z0), z1, z2) → z2
if(0, z0, z1) → z0
-(s(z0), s(z1)) → -(z0, z1)
-(z0, 0) → z0
Tuples:

DOUBLE(0) → c
DOUBLE(s(z0)) → c1(DOUBLE(z0))
HALF(s(0)) → c2
HALF(s(s(z0))) → c3(HALF(z0))
HALF(0) → c4
IF(s(z0), z1, z2) → c5
IF(0, z0, z1) → c6
-'(s(z0), s(z1)) → c7(-'(z0, z1))
-'(z0, 0) → c8
S tuples:

DOUBLE(0) → c
DOUBLE(s(z0)) → c1(DOUBLE(z0))
HALF(s(0)) → c2
HALF(s(s(z0))) → c3(HALF(z0))
HALF(0) → c4
IF(s(z0), z1, z2) → c5
IF(0, z0, z1) → c6
-'(s(z0), s(z1)) → c7(-'(z0, z1))
-'(z0, 0) → c8
K tuples:none
Defined Rule Symbols:

double, half, if, -

Defined Pair Symbols:

DOUBLE, HALF, IF, -'

Compound Symbols:

c, c1, c2, c3, c4, c5, c6, c7, c8

(7) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)

Removed 6 trailing nodes:

HALF(s(0)) → c2
DOUBLE(0) → c
-'(z0, 0) → c8
HALF(0) → c4
IF(s(z0), z1, z2) → c5
IF(0, z0, z1) → c6

(8) Obligation:

Complexity Dependency Tuples Problem
Rules:

double(0) → 0
double(s(z0)) → s(s(double(z0)))
half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(0) → 0
if(s(z0), z1, z2) → z2
if(0, z0, z1) → z0
-(s(z0), s(z1)) → -(z0, z1)
-(z0, 0) → z0
Tuples:

DOUBLE(s(z0)) → c1(DOUBLE(z0))
HALF(s(s(z0))) → c3(HALF(z0))
-'(s(z0), s(z1)) → c7(-'(z0, z1))
S tuples:

DOUBLE(s(z0)) → c1(DOUBLE(z0))
HALF(s(s(z0))) → c3(HALF(z0))
-'(s(z0), s(z1)) → c7(-'(z0, z1))
K tuples:none
Defined Rule Symbols:

double, half, if, -

Defined Pair Symbols:

DOUBLE, HALF, -'

Compound Symbols:

c1, c3, c7

(9) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

double(0) → 0
double(s(z0)) → s(s(double(z0)))
half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(0) → 0
if(s(z0), z1, z2) → z2
if(0, z0, z1) → z0
-(s(z0), s(z1)) → -(z0, z1)
-(z0, 0) → z0

(10) Obligation:

Complexity Dependency Tuples Problem
Rules:none
Tuples:

DOUBLE(s(z0)) → c1(DOUBLE(z0))
HALF(s(s(z0))) → c3(HALF(z0))
-'(s(z0), s(z1)) → c7(-'(z0, z1))
S tuples:

DOUBLE(s(z0)) → c1(DOUBLE(z0))
HALF(s(s(z0))) → c3(HALF(z0))
-'(s(z0), s(z1)) → c7(-'(z0, z1))
K tuples:none
Defined Rule Symbols:none

Defined Pair Symbols:

DOUBLE, HALF, -'

Compound Symbols:

c1, c3, c7

(11) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

DOUBLE(s(z0)) → c1(DOUBLE(z0))
-'(s(z0), s(z1)) → c7(-'(z0, z1))
We considered the (Usable) Rules:none
And the Tuples:

DOUBLE(s(z0)) → c1(DOUBLE(z0))
HALF(s(s(z0))) → c3(HALF(z0))
-'(s(z0), s(z1)) → c7(-'(z0, z1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(-'(x1, x2)) = x1   
POL(DOUBLE(x1)) = x1   
POL(HALF(x1)) = 0   
POL(c1(x1)) = x1   
POL(c3(x1)) = x1   
POL(c7(x1)) = x1   
POL(s(x1)) = [1] + x1   

(12) Obligation:

Complexity Dependency Tuples Problem
Rules:none
Tuples:

DOUBLE(s(z0)) → c1(DOUBLE(z0))
HALF(s(s(z0))) → c3(HALF(z0))
-'(s(z0), s(z1)) → c7(-'(z0, z1))
S tuples:

HALF(s(s(z0))) → c3(HALF(z0))
K tuples:

DOUBLE(s(z0)) → c1(DOUBLE(z0))
-'(s(z0), s(z1)) → c7(-'(z0, z1))
Defined Rule Symbols:none

Defined Pair Symbols:

DOUBLE, HALF, -'

Compound Symbols:

c1, c3, c7

(13) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

HALF(s(s(z0))) → c3(HALF(z0))
We considered the (Usable) Rules:none
And the Tuples:

DOUBLE(s(z0)) → c1(DOUBLE(z0))
HALF(s(s(z0))) → c3(HALF(z0))
-'(s(z0), s(z1)) → c7(-'(z0, z1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(-'(x1, x2)) = 0   
POL(DOUBLE(x1)) = 0   
POL(HALF(x1)) = x1   
POL(c1(x1)) = x1   
POL(c3(x1)) = x1   
POL(c7(x1)) = x1   
POL(s(x1)) = [1] + x1   

(14) Obligation:

Complexity Dependency Tuples Problem
Rules:none
Tuples:

DOUBLE(s(z0)) → c1(DOUBLE(z0))
HALF(s(s(z0))) → c3(HALF(z0))
-'(s(z0), s(z1)) → c7(-'(z0, z1))
S tuples:none
K tuples:

DOUBLE(s(z0)) → c1(DOUBLE(z0))
-'(s(z0), s(z1)) → c7(-'(z0, z1))
HALF(s(s(z0))) → c3(HALF(z0))
Defined Rule Symbols:none

Defined Pair Symbols:

DOUBLE, HALF, -'

Compound Symbols:

c1, c3, c7

(15) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)

The set S is empty

(16) BOUNDS(1, 1)