0 CpxTRS
↳1 NestedDefinedSymbolProof (BOTH BOUNDS(ID, ID), 0 ms)
↳2 CpxTRS
↳3 TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID), 0 ms)
↳4 CpxWeightedTrs
↳5 TypeInferenceProof (BOTH BOUNDS(ID, ID), 0 ms)
↳6 CpxTypedWeightedTrs
↳7 CompletionProof (UPPER BOUND(ID), 0 ms)
↳8 CpxTypedWeightedCompleteTrs
↳9 CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID), 0 ms)
↳10 CpxRNTS
↳11 CompleteCoflocoProof (⇔, 49 ms)
↳12 BOUNDS(1, 1)
f(f(a)) → f(g(n__f(a)))
f(X) → n__f(X)
activate(n__f(X)) → f(X)
activate(X) → X
activate(n__f(X)) → f(X)
f(X) → n__f(X)
activate(X) → X
activate(n__f(X)) → f(X) [1]
f(X) → n__f(X) [1]
activate(X) → X [1]
activate(n__f(X)) → f(X) [1]
f(X) → n__f(X) [1]
activate(X) → X [1]
activate :: n__f → n__f n__f :: a → n__f f :: a → n__f |
const, const1
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
const => 0
const1 => 0
activate(z) -{ 1 }→ X :|: X >= 0, z = X
activate(z) -{ 1 }→ f(X) :|: z = 1 + X, X >= 0
f(z) -{ 1 }→ 1 + X :|: X >= 0, z = X
eq(start(V),0,[activate(V, Out)],[V >= 0]). eq(start(V),0,[f(V, Out)],[V >= 0]). eq(activate(V, Out),1,[f(X1, Ret)],[Out = Ret,V = 1 + X1,X1 >= 0]). eq(f(V, Out),1,[],[Out = 1 + X2,X2 >= 0,V = X2]). eq(activate(V, Out),1,[],[Out = X3,X3 >= 0,V = X3]). input_output_vars(activate(V,Out),[V],[Out]). input_output_vars(f(V,Out),[V],[Out]). |
CoFloCo proof output:
Preprocessing Cost Relations
=====================================
#### Computed strongly connected components
0. non_recursive : [f/2]
1. non_recursive : [activate/2]
2. non_recursive : [start/1]
#### Obtained direct recursion through partial evaluation
0. SCC is completely evaluated into other SCCs
1. SCC is partially evaluated into activate/2
2. SCC is partially evaluated into start/1
Control-Flow Refinement of Cost Relations
=====================================
### Specialization of cost equations activate/2
* CE 4 is refined into CE [6]
* CE 5 is refined into CE [7]
### Cost equations --> "Loop" of activate/2
* CEs [6,7] --> Loop 3
### Ranking functions of CR activate(V,Out)
#### Partial ranking functions of CR activate(V,Out)
### Specialization of cost equations start/1
* CE 2 is refined into CE [8]
* CE 3 is refined into CE [9]
### Cost equations --> "Loop" of start/1
* CEs [8,9] --> Loop 4
### Ranking functions of CR start(V)
#### Partial ranking functions of CR start(V)
Computing Bounds
=====================================
#### Cost of chains of activate(V,Out):
* Chain [3]: 2
with precondition: [V=Out,V>=0]
#### Cost of chains of start(V):
* Chain [4]: 2
with precondition: [V>=0]
Closed-form bounds of start(V):
-------------------------------------
* Chain [4] with precondition: [V>=0]
- Upper bound: 2
- Complexity: constant
### Maximum cost of start(V): 2
Asymptotic class: constant
* Total analysis performed in 15 ms.