We establish a general framework for reasoning about the relationship between call-by-value and call-by-name. In languages with side-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 side-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 these properties. 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 side-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 side-effects that imply these maps form a Galois connection. These properties hold for some side-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 side-effects including divergence and nondeterminism.


翻译:我们建立了一个通用框架,用于推理传值调用与传名调用之间的关系。在具有副作用(side-effects)的语言中,传值调用与传名调用的程序执行通常会产生不同但相关的可观察行为(observable behaviours)。例如,若一个程序可能发散(diverge)但除此之外无其他副作用,那么当其以传值调用方式终止时,以传名调用方式也将终止并得到相同结果。我们提出了一套陈述和证明这些属性的技术。关键要素是Levy的传值推送演算(call-by-push-value calculus),我们将其作为推理求值顺序的框架。我们证明,在特定副作用条件下,表达式在传值调用与传名调用下翻译为传值推送演算后,具有相关的可观察行为,这些条件已被我们识别。进而利用这一事实构造类型在传值调用与传名调用解释之间的映射,并识别出使这些映射构成Galois连接的副作用进一步属性。这些属性对某些副作用(如发散)成立,但对另一些副作用(如可变状态)则不成立。由此给出一个连接传值调用与传名调用的通用推理原理。我们将该原理应用于包括发散和非确定性在内的示例副作用。

0
下载
关闭预览

相关内容

Meta最新WWW2022《联邦计算导论》教程,附77页ppt
专知会员服务
60+阅读 · 2022年5月5日
专知会员服务
52+阅读 · 2021年8月8日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
82+阅读 · 2020年7月26日
因果图,Causal Graphs,52页ppt
专知会员服务
254+阅读 · 2020年4月19日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
94+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
105+阅读 · 2019年10月9日
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
逆强化学习-学习人先验的动机
CreateAMind
16+阅读 · 2019年1月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
国家自然科学基金
0+阅读 · 2016年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
5+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
2+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
Arxiv
29+阅读 · 2023年2月10日
Arxiv
15+阅读 · 2020年12月17日
Arxiv
113+阅读 · 2020年2月5日
VIP会员
最新内容
BES:让语言模型通过双向进化搜索自我改进
专知会员服务
1+阅读 · 5月30日
以色列-美国-伊朗战争中的无人机:关键要点
专知会员服务
3+阅读 · 5月30日
《Palantir任务保障性软件安全标准(MA-S2)》
专知会员服务
8+阅读 · 5月30日
基于声学的无人机检测技术综述
专知会员服务
5+阅读 · 5月30日
《当代混合战争分析框架:俄乌战争经验教训》
战略前沿人工智能的再思考(中文)
专知会员服务
7+阅读 · 5月29日
《量化地基防空系统间接效应的博弈论方法》
专知会员服务
5+阅读 · 5月29日
相关VIP内容
Meta最新WWW2022《联邦计算导论》教程,附77页ppt
专知会员服务
60+阅读 · 2022年5月5日
专知会员服务
52+阅读 · 2021年8月8日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
82+阅读 · 2020年7月26日
因果图,Causal Graphs,52页ppt
专知会员服务
254+阅读 · 2020年4月19日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
94+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
105+阅读 · 2019年10月9日
相关资讯
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
逆强化学习-学习人先验的动机
CreateAMind
16+阅读 · 2019年1月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
相关基金
国家自然科学基金
0+阅读 · 2016年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
5+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
2+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员