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), 2 ms)
↳10 CpxRNTS
↳11 CompleteCoflocoProof (⇔, 98 ms)
↳12 BOUNDS(1, 1)
b(x, y) → c(a(c(y), a(0, x)))
a(y, x) → y
a(y, c(b(a(0, x), 0))) → b(a(c(b(0, y)), x), 0)
a(y, x) → y
b(x, y) → c(a(c(y), a(0, x)))
a(y, x) → y [1]
b(x, y) → c(a(c(y), a(0, x))) [1]
a(y, x) → y [1]
b(x, y) → c(a(c(y), a(0, x))) [1]
a :: c:0 → c:0 → c:0 b :: c:0 → c:0 → c:0 c :: c:0 → c:0 0 :: c:0 |
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
0 => 0
a(z, z') -{ 1 }→ y :|: z' = x, y >= 0, x >= 0, z = y
b(z, z') -{ 1 }→ 1 + a(1 + y, a(0, x)) :|: x >= 0, y >= 0, z = x, z' = y
eq(start(V, V1),0,[a(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1),0,[b(V, V1, Out)],[V >= 0,V1 >= 0]). eq(a(V, V1, Out),1,[],[Out = V2,V1 = V3,V2 >= 0,V3 >= 0,V = V2]). eq(b(V, V1, Out),1,[a(0, V5, Ret11),a(1 + V4, Ret11, Ret1)],[Out = 1 + Ret1,V5 >= 0,V4 >= 0,V = V5,V1 = V4]). input_output_vars(a(V,V1,Out),[V,V1],[Out]). input_output_vars(b(V,V1,Out),[V,V1],[Out]). |
CoFloCo proof output:
Preprocessing Cost Relations
=====================================
#### Computed strongly connected components
0. non_recursive : [a/3]
1. non_recursive : [b/3]
2. non_recursive : [start/2]
#### Obtained direct recursion through partial evaluation
0. SCC is completely evaluated into other SCCs
1. SCC is partially evaluated into b/3
2. SCC is partially evaluated into start/2
Control-Flow Refinement of Cost Relations
=====================================
### Specialization of cost equations b/3
* CE 4 is refined into CE [5]
### Cost equations --> "Loop" of b/3
* CEs [5] --> Loop 3
### Ranking functions of CR b(V,V1,Out)
#### Partial ranking functions of CR b(V,V1,Out)
### Specialization of cost equations start/2
* CE 2 is refined into CE [6]
* CE 3 is refined into CE [7]
### Cost equations --> "Loop" of start/2
* CEs [6,7] --> Loop 4
### Ranking functions of CR start(V,V1)
#### Partial ranking functions of CR start(V,V1)
Computing Bounds
=====================================
#### Cost of chains of b(V,V1,Out):
* Chain [3]: 3
with precondition: [V1+2=Out,V>=0,V1>=0]
#### Cost of chains of start(V,V1):
* Chain [4]: 3
with precondition: [V>=0,V1>=0]
Closed-form bounds of start(V,V1):
-------------------------------------
* Chain [4] with precondition: [V>=0,V1>=0]
- Upper bound: 3
- Complexity: constant
### Maximum cost of start(V,V1): 3
Asymptotic class: constant
* Total analysis performed in 21 ms.