Inferring Expected Runtimes Using Sizes


KoAT2 Proof WORST_CASE( ?, 2 {O(1)})

Initial Complexity Problem (after preprocessing)

Start:f
Program_Vars:Arg_0
Temp_Vars:
Locations:f, g, h
Transitions:
f(Arg_0) -> g(Uniform (1, 15))
g(Arg_0) -> h(Arg_0^2)

G f f g g f->g t₀ ∈ g₀ η (Arg_0) = Uniform (1, 15) h h g->h t₁ ∈ g₁ η (Arg_0) = Arg_0^2

Timebounds:

Overall timebound:2 {O(1)}
0,0: f->g: 1 {O(1)}
1,1: g->h: 1 {O(1)}

Expected Timebounds:

Overall expected timebound: 2 {O(1)}
0: f->[1:g]: 1 {O(1)}
1: g->[1:h]: 1 {O(1)}

Costbounds:

Overall costbound: inf {Infinity}
0,0: f->g: inf {Infinity}
1,1: g->h: inf {Infinity}

Expected Costbounds:

Overall expected costbound: 2 {O(1)}
0: f->[1:g]: 1 {O(1)}
1: g->[1:h]: 1 {O(1)}

Sizebounds:

0,0: f->g, Arg_0: 15+Arg_0 {O(n)}

ExpSizeBounds:

(0: f->[1:g], g), Arg_0: 8+Arg_0 {O(n)}
(1: g->[1:h], h), Arg_0: 8+Arg_0+max([1+Arg_0, 15+Arg_0])*max([1+Arg_0, 15+Arg_0])+max([1+Arg_0, 15+Arg_0]) {O(n^2)}