Search papers, labs, and topics across Lattice.
This paper introduces a novel compositional cost analysis method for probabilistic programs that utilize nonlinear operations like $\max$ and $\min$, which are challenging for traditional moment-based analyses. By employing a hierarchical cost expression and solving local recurrence equations, the authors compute the mean and higher moments of cost distributions while maintaining sound error bounds. The method, implemented in a tool named DICKENS, demonstrates effectiveness across various applications, including quantum repeater waiting times and RFID collision resolution.
Nonlinear cost structures in probabilistic programs can be analyzed for moments with a new method that balances accuracy and computational efficiency.
This paper studies how to compute the moments -- mean, variance, and beyond -- of the cost (e.g., running time) of certain probabilistic programs, in which local costs combine not only additively but also via the extremal operations $\max$ and $\min$. Such costs arise naturally -- for instance, the number of rounds of a contention-resolution protocol, the waiting time of a quantum repeater, and the completion time of a fork-join computation -- but fall outside the scope of moment-based analyses developed for additive costs. The difficulty is that $\max$ and $\min$ are nonlinear: the moments of $\max(X, Y)$ are not determined by those of $X$ and $Y$, so propagating moments alone fails. In contrast, propagating full distributions would suffice, but is computationally intractable. We present a compositional cost analysis for a family of probabilistic programs whose cost structure can be represented as a hierarchical cost expression. The analysis proceeds bottom-up through the hierarchical structure, solving local recurrence equations at each node and summarizing each subproblem with a surrogate distribution. Each surrogate consists of an exact short-time prefix and a compact parametric tail. Our approach computes the mean of the cost distribution with a sound error bound, and systematically lifts to second and higher moments. In addition, precision can be increased by refining the surrogate representation, trading additional computation for tighter bounds. We implemented our method in a tool, called DICKENS, and evaluated its capabilities on three problems: quantum repeater waiting times, RFID collision resolution, and completion times of fork-join computations.