prodigy.analysis.lowerbounds.explicit¶
Explicit-state semantics of loop-free statements of the intermediate representation, on measures given as
dicts state tuple -> weight (exact fractions.Fraction or float), and a sparse Kleene iteration for
loops. Used to validate the generating-function calculus, to choose template parameters, and as the unrolling
baseline.
- run_state(stmt, state, w, out, variables, geo_cut=400)[source]¶
Execute
stmtfrom a single state with weightwand add the output sub-measure toout.
- apply(stmt, measure, variables, geo_cut=400)[source]¶
Forward semantics of a loop-free statement on an explicit measure.
- class Kernel(guard, body, variables, exact=False)[source]¶
Bases:
objectThe transition kernel of a loop
("loop", guard, body):step(s)is None if the guard is false insand the list of successor states with probabilities otherwise (cached).
- class Exploration(init, guard, body, variables, box=None, max_states=2000000)[source]¶
Bases:
objectSparse floating-point Kleene iteration of the occupation measure of a loop, restricted to a box.
After
run(n):occupationapproximates the occupation measure on the box (sum of the firstniterates),exitthe output measure of the runs that terminated withinniterations,remainingthe mass still inside the loop, andleakedthe mass that left the box (it is dropped).- Parameters: