一句话:提出概率程序期望代价分析的指称语义框架 cert,并证明其与操作语义的可靠性和充分性。
程序执行代价分析是计算机科学的基础问题,但在概率编程中,代价因随机采样而不再确定,并与递归和求值策略复杂交互。本文提出 cert:一个基于 Call-By-Push-Value 的元语言,用于推理概率代价。作者定义操作代价语义以及代价语义和期望代价语义两种指称语义,证明前者相对操作语义的可靠性与充分性,并为期望代价语义建立代价充分性定理。文章还证明 CBPV 的效应模拟性质以关联两种指称语义,并基于一元概率语义证明期望代价语义是期望代价与概率的最小语义。最后通过随机算法到随机过程等案例展示 cert 的表达力及其语义对预期期望代价的刻画。
Reasoning about the cost of executing programs is one of the fundamental questions in computer science. In the context of programming with probabilities, however, the notion of cost stops being deterministic, since it depends on the probabilistic samples made throughout the execution of the program. This interaction is further complicated by the non-trivial interaction between cost, recursion and evaluation strategy. In this work we introduce cert : a Call-By-Push-Value (CBPV) metalanguage for reasoning about probabilistic cost. We equip cert with an operational cost semantics and define two denotational semantics — a cost semantics and an expected-cost semantics. We prove operational soundness and adequacy for the denotational cost semantics and a cost adequacy theorem for the expected-cost semantics. We formally relate both denotational semantics by stating and proving a novel effect simulation property for CBPV. We also prove a canonicity property of the expected-cost semantics as the minimal semantics for expected cost and probability by building on recent advances on monadic probabilistic semantics. Finally, we illustrate the expressivity of cert and the expected-cost semantics by presenting case-studies ranging from randomized algorithms to stochastic processes and show how our semantics capture their intended expected cost.