prodigy.analysis.lowerbounds.problem¶
A single-loop program split into the parts used by the lower-bound modes: the loop-free prefix (which
determines the initial measure g of the loop), the loop, and the loop-free epilogue with its queries.
- class LoopProblem(variables, prefix, guard, body, epilogue, queries=list(), forced_rates=dict(), initial_state=None, init_form=None)[source]¶
Bases:
object- Parameters:
- load_problem(program)[source]¶
Split a program with exactly one top-level loop (and no nested loops) into a
LoopProblem.- Parameters:
program (
Program)- Return type:
- queries_after(program, loop)[source]¶
The
?Prand?Exqueries that directly followloopat the top level ofprogram(!Plotand!Printare skipped; any other instruction ends the list). Marginal queries?Pr[x]and queries outside the supported expressions are left out.
- problem_from_loop(loop, variables, init_expr)[source]¶
A
LoopProblemfor a loop whose input distribution is given as a generating function (used by the interactive modes of the while handler).- Parameters:
- Return type: