(0) Obligation:

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


The TRS R consists of the following rules:

*(i(x), x) → 1
*(1, y) → y
*(x, 0) → 0
*(*(x, y), z) → *(x, *(y, z))

Rewrite Strategy: INNERMOST

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

The following rules are not reachable from basic terms in the dependency graph and can be removed:
*(*(x, y), z) → *(x, *(y, z))

(2) Obligation:

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


The TRS R consists of the following rules:

*(i(x), x) → 1
*(x, 0) → 0
*(1, y) → y

Rewrite Strategy: INNERMOST

(3) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(4) Obligation:

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


The TRS R consists of the following rules:

*(i(x), x) → 1 [1]
*(x, 0) → 0 [1]
*(1, y) → y [1]

Rewrite Strategy: INNERMOST

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

Renamed defined symbols to avoid conflicts with arithmetic symbols:

* => times

(6) Obligation:

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


The TRS R consists of the following rules:

times(i(x), x) → 1 [1]
times(x, 0) → 0 [1]
times(1, y) → y [1]

Rewrite Strategy: INNERMOST

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

Infered types.

(8) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

times(i(x), x) → 1 [1]
times(x, 0) → 0 [1]
times(1, y) → y [1]

The TRS has the following type information:
times :: i:1:0 → i:1:0 → i:1:0
i :: i:1:0 → i:1:0
1 :: i:1:0
0 :: i:1:0

Rewrite Strategy: INNERMOST

(9) CompletionProof (UPPER BOUND(ID) transformation)

The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added:

times(v0, v1) → null_times [0]

And the following fresh constants:

null_times

(10) Obligation:

Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

times(i(x), x) → 1 [1]
times(x, 0) → 0 [1]
times(1, y) → y [1]
times(v0, v1) → null_times [0]

The TRS has the following type information:
times :: i:1:0:null_times → i:1:0:null_times → i:1:0:null_times
i :: i:1:0:null_times → i:1:0:null_times
1 :: i:1:0:null_times
0 :: i:1:0:null_times
null_times :: i:1:0:null_times

Rewrite Strategy: INNERMOST

(11) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

1 => 1
0 => 0
null_times => 0

(12) Obligation:

Complexity RNTS consisting of the following rules:

times(z, z') -{ 1 }→ y :|: z = 1, y >= 0, z' = y
times(z, z') -{ 1 }→ 1 :|: z' = x, x >= 0, z = 1 + x
times(z, z') -{ 1 }→ 0 :|: x >= 0, z = x, z' = 0
times(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1

Only complete derivations are relevant for the runtime complexity.

(13) CompleteCoflocoProof (EQUIVALENT transformation)

Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo:

eq(start(V, V1),0,[times(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(times(V, V1, Out),1,[],[Out = 1,V1 = V2,V2 >= 0,V = 1 + V2]).
eq(times(V, V1, Out),1,[],[Out = 0,V3 >= 0,V = V3,V1 = 0]).
eq(times(V, V1, Out),1,[],[Out = V4,V = 1,V4 >= 0,V1 = V4]).
eq(times(V, V1, Out),0,[],[Out = 0,V5 >= 0,V6 >= 0,V = V5,V1 = V6]).
input_output_vars(times(V,V1,Out),[V,V1],[Out]).

CoFloCo proof output:
Preprocessing Cost Relations
=====================================

#### Computed strongly connected components
0. non_recursive : [times/3]
1. non_recursive : [start/2]

#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into times/3
1. SCC is partially evaluated into start/2

Control-Flow Refinement of Cost Relations
=====================================

### Specialization of cost equations times/3
* CE 3 is refined into CE [7]
* CE 4 is refined into CE [8]
* CE 6 is refined into CE [9]
* CE 5 is refined into CE [10]


### Cost equations --> "Loop" of times/3
* CEs [7] --> Loop 5
* CEs [8,9] --> Loop 6
* CEs [10] --> Loop 7

### Ranking functions of CR times(V,V1,Out)

#### Partial ranking functions of CR times(V,V1,Out)


### Specialization of cost equations start/2
* CE 2 is refined into CE [11,12,13]


### Cost equations --> "Loop" of start/2
* CEs [13] --> Loop 8
* CEs [11,12] --> Loop 9

### Ranking functions of CR start(V,V1)

#### Partial ranking functions of CR start(V,V1)


Computing Bounds
=====================================

#### Cost of chains of times(V,V1,Out):
* Chain [7]: 1
with precondition: [V=1,V1=Out,V1>=0]

* Chain [6]: 1
with precondition: [Out=0,V>=0,V1>=0]

* Chain [5]: 1
with precondition: [Out=1,V=V1+1,V>=1]


#### Cost of chains of start(V,V1):
* Chain [9]: 1
with precondition: [V>=0,V1>=0]

* Chain [8]: 1
with precondition: [V=V1+1,V>=1]


Closed-form bounds of start(V,V1):
-------------------------------------
* Chain [9] with precondition: [V>=0,V1>=0]
- Upper bound: 1
- Complexity: constant
* Chain [8] with precondition: [V=V1+1,V>=1]
- Upper bound: 1
- Complexity: constant

### Maximum cost of start(V,V1): 1
Asymptotic class: constant
* Total analysis performed in 39 ms.

(14) BOUNDS(1, 1)