|
ESBMC
Efficient SMT-based Context-Bounded Model Checker
|
Functions | |
| int | randint (int a, int b) |
| float | random () |
| float | uniform (float a, float b) |
| int | getrandbits (int k) |
| None | seed (int a=0) |
| int | choice (list[int] seq) |
| float | choice_float (list[float] seq) |
| str | choice_str (list[str] seq) |
| str | choice_chars (str seq) |
| None | shuffle (list[int] lst) |
| list[int] | sample (list[int] population, int k) |
| list[float] | sample_float (list[float] population, int k) |
| list[str] | sample_str (list[str] population, int k) |
| list[str] | sample_chars (str population, int k) |
| int | randrange (int start, int stop=None, int step=1) |
random.choice(seq) — return a non-deterministic element of `seq`. Models the choice as `seq[i]` for a constrained nondet index. Raises IndexError on an empty sequence, matching CPython.
| str random.choice_chars | ( | str | seq | ) |
`choice` over a string, which is a sequence of one-character strings.
| str random.choice_str | ( | list[str] | seq | ) |
`choice` over a list of strings.
| float random.random | ( | void | ) |
random.sample(population, k) — k distinct elements from population. Returns the first `k` elements of `population` as an under-approximation; a precise model would pick `k` distinct nondet indices.
| list[str] random.sample_chars | ( | str | population, |
| int | k ) |
`sample` over a string, yielding a list of one-character strings.
| list[str] random.sample_str | ( | list[str] | population, |
| int | k ) |
`sample` over a list of strings.
| None random.seed | ( | int | a = 0 | ) |
random.seed(a) — no-op stub. The non-determinism of nondet_int / nondet_float already covers any seed-dependent outcome the program could observe, so seeding has no observable effect under verification.
| None random.shuffle | ( | list[int] | lst | ) |
random.shuffle(lst) — permutes `lst` in place. Under-approximation: leaves the list untouched. A precise model would nondet-shuffle the elements, but doing so requires expressing permutation constraints over `lst`, which is out of scope here.