Effectful programs interact in ways that go beyond simple input-output, making compositional reasoning challenging. Existing work has shown that when such programs are ``separate'', i.e., when programs do not interfere with each other, it can be easier to reason about them. While reasoning about separated resources has been well-studied, there has been little work on reasoning about separated effects, especially for functional, higher-order programming languages. We propose two higher-order languages that can reason about sharing and separation in effectful programs. Our first language $\lambda_{\text{INI}}$ has a linear type system and probabilistic semantics, where the two product types capture independent and possibly-dependent pairs. Our second language $\lambda_{\text{INI}}^2$ is two-level, stratified language, inspired by Benton's linear-non-linear (LNL) calculus. We motivate this language with a probabilistic model, but we also provide a general categorical semantics and exhibit a range of concrete models beyond probabilistic programming. We prove soundness theorems for all of our languages; our general soundness theorem for our categorical models of $\lambda_{\text{INI}}^2$ uses a categorical gluing construction.
翻译:有效的程序互动方式超越简单的输入-输出输出, 使构成推理具有挑战性。 现有的工作已经表明, 当这种程序是“ 分离”, 也就是当程序不相互干扰时, 可以更容易地解释它们。 虽然对资源分离的推理已经进行了很好地研究, 但是对于分离效果的推理, 特别是功能性、 更高层次的编程语言, 我们建议了两种高层次的语言, 可以在有效的程序中共享和分离。 我们的第一种语言 $\lambda{ text{INI}$, 我们的第一种直线型语言有线性类型系统和概率性语义学, 两种产品类型在其中捕捉独立和可能依赖的配对。 我们的第二种语言 $\lambda}text{IN}2$( IN) 是两级的, 分级语言是分级的, 受本顿的线性、 非线性( LNL) 语义学的启发。 我们用一种概率模型来激励这种语言, 但我们也提供了一种普通的直线性语义性语言, 并展示一系列具体模型, 超出概率性程式的模型。 我们用所有的正态的模型。</s>