arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2202.08246cs.PL
收藏

连接按值调用与按名调用的伽罗瓦联络

Galois connecting call-by-value and call-by-name

Dylan McDermott, Alan Mycroft

AI总结:

本文以Levy的按推值调用演算为框架,提出一种通用推理原则,在特定计算效果条件下建立按值调用与按名调用类型解释之间的伽罗瓦联络,并应用于发散与非确定性等效果。

摘要:

我们建立了一个通用框架,用于推理按值调用与按名调用之间的关系。在具有计算效果的语言中,程序的按值调用执行与按名调用执行通常具有不同但相关的可观察行为。例如,如果一个程序可能发散但除此之外没有其他效果,那么每当它在按值调用下终止时,它在按名调用下也会以相同结果终止。我们提出了一种用于陈述和证明此类性质的技术。关键要素是Levy的按推值调用(call-by-push-value)演算,我们将其用作推理求值顺序的框架。我们证明,在我们所识别的关于计算效果的特定条件下,表达式到按推值调用的按值调用翻译和按名调用翻译具有相关的可观察行为。然后我们利用这一事实构造按值调用与按名调用类型解释之间的映射,并识别出效果的进一步性质,这些性质蕴含这些映射构成一个伽罗瓦联络。这些性质对某些计算效果(如发散)成立,但对其他效果(如可变状态)不成立。这产生了一个联系按值调用与按名调用的通用推理原则。我们将该推理原则应用于包括发散和非确定性在内的示例计算效果。

英文摘要:

We establish a general framework for reasoning about the relationship between call-by-value and call-by-name. In languages with computational effects, call-by-value and call-by-name executions of programs often have different, but related, observable behaviours. For example, if a program might diverge but otherwise has no effects, then whenever it terminates under call-by-value, it terminates with the same result under call-by-name. We propose a technique for stating and proving properties like these. The key ingredient is Levy's call-by-push-value calculus, which we use as a framework for reasoning about evaluation orders. We show that the call-by-value and call-by-name translations of expressions into call-by-push-value have related observable behaviour under certain conditions on computational effects, which we identify. We then use this fact to construct maps between the call-by-value and call-by-name interpretations of types, and identify further properties of effects that imply these maps form a Galois connection. These properties hold for some computational effects (such as divergence), but not others (such as mutable state). This gives rise to a general reasoning principle that relates call-by-value and call-by-name. We apply the reasoning principle to example computational effects including divergence and nondeterminism.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑