Philipp G. Haselwarter, Kwing Hei Li, Alejandro Aguirre, Simon Oddershede Gregersen, Joseph Tassarotti, Lars Birkedal
{"title":"Approximate Relational Reasoning for Higher-Order Probabilistic Programs","authors":"Philipp G. Haselwarter, Kwing Hei Li, Alejandro Aguirre, Simon Oddershede Gregersen, Joseph Tassarotti, Lars Birkedal","doi":"arxiv-2407.14107","DOIUrl":null,"url":null,"abstract":"Properties such as provable security and correctness for randomized programs\nare naturally expressed relationally as approximate equivalences. As a result,\na number of relational program logics have been developed to reason about such\napproximate equivalences of probabilistic programs. However, existing\napproximate relational logics are mostly restricted to first-order programs\nwithout general state. In this paper we develop Approxis, a higher-order approximate relational\nseparation logic for reasoning about approximate equivalence of programs\nwritten in an expressive ML-like language with discrete probabilistic sampling,\nhigher-order functions, and higher-order state. The Approxis logic recasts the\nconcept of error credits in the relational setting to reason about relational\napproximation, which allows for expressive notions of modularity and\ncomposition, a range of new approximate relational rules, and an\ninternalization of a standard limiting argument for showing exact probabilistic\nequivalences by approximation. We also use Approxis to develop a logical\nrelation model that quantifies over error credits, which can be used to prove\nexact contextual equivalence. We demonstrate the flexibility of our approach on\na range of examples, including the PRP/PRF switching lemma, IND\\$-CPA security\nof an encryption scheme, and a collection of rejection samplers. All of the\nresults have been mechanized in the Coq proof assistant and the Iris separation\nlogic framework.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-07-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2407.14107","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
Properties such as provable security and correctness for randomized programs
are naturally expressed relationally as approximate equivalences. As a result,
a number of relational program logics have been developed to reason about such
approximate equivalences of probabilistic programs. However, existing
approximate relational logics are mostly restricted to first-order programs
without general state. In this paper we develop Approxis, a higher-order approximate relational
separation logic for reasoning about approximate equivalence of programs
written in an expressive ML-like language with discrete probabilistic sampling,
higher-order functions, and higher-order state. The Approxis logic recasts the
concept of error credits in the relational setting to reason about relational
approximation, which allows for expressive notions of modularity and
composition, a range of new approximate relational rules, and an
internalization of a standard limiting argument for showing exact probabilistic
equivalences by approximation. We also use Approxis to develop a logical
relation model that quantifies over error credits, which can be used to prove
exact contextual equivalence. We demonstrate the flexibility of our approach on
a range of examples, including the PRP/PRF switching lemma, IND\$-CPA security
of an encryption scheme, and a collection of rejection samplers. All of the
results have been mechanized in the Coq proof assistant and the Iris separation
logic framework.