TY - JOUR
T1 - Tachis
T2 - Higher-Order Separation Logic with Credits for Expected Costs
AU - Haselwarter, Philipp G.
AU - Li, Kwing H.E.I.
AU - Medeiros, Markus D.E.
AU - Gregersen, Simon Oddershede
AU - Aguirre, Alejandro
AU - Tassarotti, Joseph
AU - Birkedal, Lars
N1 - Publisher Copyright:
© 2024 Copyright held by the owner/author(s)
PY - 2024/10/8
Y1 - 2024/10/8
N2 - We present Tachis, a higher-order separation logic to reason about the expected cost of probabilistic programs. Inspired by the uses of time credits for reasoning about the running time of deterministic programs, we introduce a novel notion of probabilistic cost credit. Probabilistic cost credits are a separation logic resource that can be used to pay for the cost of operations in programs, and that can be distributed across all possible branches of sampling instructions according to their weight, thus enabling us to reason about expected cost. The representation of cost credits as separation logic resources gives Tachis a great deal of flexibility and expressivity. In particular, it permits reasoning about amortized expected cost by storing excess credits as potential into data structures to pay for future operations. Tachis further supports a range of cost models, including running time and entropy usage. We showcase the versatility of this approach by applying our techniques to prove upper bounds on the expected cost of a variety of probabilistic algorithms and data structures, including randomized quicksort, hash tables, and meldable heaps. All of our results have been mechanized using Coq, Iris, and the Coquelicot real analysis library.
AB - We present Tachis, a higher-order separation logic to reason about the expected cost of probabilistic programs. Inspired by the uses of time credits for reasoning about the running time of deterministic programs, we introduce a novel notion of probabilistic cost credit. Probabilistic cost credits are a separation logic resource that can be used to pay for the cost of operations in programs, and that can be distributed across all possible branches of sampling instructions according to their weight, thus enabling us to reason about expected cost. The representation of cost credits as separation logic resources gives Tachis a great deal of flexibility and expressivity. In particular, it permits reasoning about amortized expected cost by storing excess credits as potential into data structures to pay for future operations. Tachis further supports a range of cost models, including running time and entropy usage. We showcase the versatility of this approach by applying our techniques to prove upper bounds on the expected cost of a variety of probabilistic algorithms and data structures, including randomized quicksort, hash tables, and meldable heaps. All of our results have been mechanized using Coq, Iris, and the Coquelicot real analysis library.
KW - expected time complexity
KW - probabilistic programs
KW - resource analysis
UR - http://www.scopus.com/inward/record.url?scp=85207642715&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85207642715&partnerID=8YFLogxK
U2 - 10.1145/3689753
DO - 10.1145/3689753
M3 - Article
AN - SCOPUS:85207642715
SN - 2475-1421
VL - 8
JO - Proceedings of the ACM on Programming Languages
JF - Proceedings of the ACM on Programming Languages
IS - OOPSLA2
M1 - 313
ER -