Dependently-typed host languages empower users to verify a wide range of properties of embedded languages and programs written in them. Designers of such embedded languages are faced with a difficult choice between using a shallow or a deep embedding. The former is easier to use because the entire infrastructure of the host langauge is immediately available. Meanwhile, the latter gives full access to the structure of embedded programs, but is difficult to use in practice, especially when the embedded language is itself dependently typed. The main insight presented in this paper is that the choice between shallow and deep embedding can be eliminated by working in a host language with reflection capabilities: we start from a shallow embedding that can use all libraries and tools of the host language, and later use reflection to expose the deep structure of the embedded programs. Concretely, we apply this technique to embed three programming languages -- Kaleidoscope, SaC, and (a subset of) APL -- into the dependently typed theorem prover Agda, using dependent types to statically enforce several properties of interest. We then use Agda's reflection capabilities to extract the embedded programs back into the original language, so that the existing toolchain can be leveraged. In this process, statically verified properties of the host language are mapped onto runtime checks in the target language, allowing extracted programs to interact safely with existing code. Finally, we demonstrate the feasibility of our approach with the implementation and extraction of a convolutional neural network in our embedding of APL.\@


翻译:独立型主机语言使用户能够核实嵌入语言及其中写成的程式的广泛特性。 这些嵌入语言的设计者在使用浅层或深层嵌入器之间面临着艰难的选择。 前者更容易使用, 因为主机 Langaugue 的整个基础设施立即可用。 同时, 后者允许完全使用嵌入程序的结构, 但在实践中很难使用, 特别是当嵌入语言本身是依附打字型的, 特别是当嵌入语言本身被打字时。 本文的主要见解是, 浅层和深层嵌入器之间的选择可以通过具有反射能力的主机语言来消除: 我们从一个浅层嵌入器开始, 可以使用主机语言的所有图书馆和工具, 然后再使用反射器来暴露嵌入程序。 具体地说, 我们应用这一技术将三种程序嵌入嵌入嵌入嵌入程序, Kaleidooproc, SaC, 和 (一个子组) APL - 嵌入依附型型的Oraloral 证明 阿格达,, 使用依附型型型类型, 静态执行若干种感兴趣的特性。 我们然后使用 Agda 的反演算能力将内嵌内内嵌入程序带的内置的内嵌入式程序,, 将Sliversalevolevoleval 将现有工具程序升级到原始版本进行升级到最后版本的版本的版本的版本的版本的版本, 。

0
下载
关闭预览

相关内容

IFIP TC13 Conference on Human-Computer Interaction是人机交互领域的研究者和实践者展示其工作的重要平台。多年来,这些会议吸引了来自几个国家和文化的研究人员。官网链接:http://interact2019.org/
【如何做研究】How to research ,22页ppt
专知会员服务
109+阅读 · 2021年4月17日
最新《Transformers模型》教程,64页ppt
专知会员服务
319+阅读 · 2020年11月26日
专知会员服务
124+阅读 · 2020年9月8日
Fariz Darari简明《博弈论Game Theory》介绍,35页ppt
专知会员服务
111+阅读 · 2020年5月15日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
159+阅读 · 2019年10月12日
开源书:PyTorch深度学习起步
专知会员服务
51+阅读 · 2019年10月11日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
已删除
将门创投
3+阅读 · 2019年10月18日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
人工智能 | NIPS 2019等国际会议信息8条
Call4Papers
7+阅读 · 2019年3月21日
Unsupervised Learning via Meta-Learning
CreateAMind
42+阅读 · 2019年1月3日
Zero-Round Active Learning
Arxiv
0+阅读 · 2021年7月15日
Deep Learning of Conjugate Mappings
Arxiv
0+阅读 · 2021年7月13日
Learning to See Through Obstructions
Arxiv
7+阅读 · 2020年4月2日
Meta-Learning to Cluster
Arxiv
17+阅读 · 2019年10月30日
Arxiv
6+阅读 · 2019年7月11日
Learning to Importance Sample in Primary Sample Space
VIP会员
相关VIP内容
【如何做研究】How to research ,22页ppt
专知会员服务
109+阅读 · 2021年4月17日
最新《Transformers模型》教程,64页ppt
专知会员服务
319+阅读 · 2020年11月26日
专知会员服务
124+阅读 · 2020年9月8日
Fariz Darari简明《博弈论Game Theory》介绍,35页ppt
专知会员服务
111+阅读 · 2020年5月15日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
159+阅读 · 2019年10月12日
开源书:PyTorch深度学习起步
专知会员服务
51+阅读 · 2019年10月11日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
相关资讯
已删除
将门创投
3+阅读 · 2019年10月18日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
人工智能 | NIPS 2019等国际会议信息8条
Call4Papers
7+阅读 · 2019年3月21日
Unsupervised Learning via Meta-Learning
CreateAMind
42+阅读 · 2019年1月3日
相关论文
Zero-Round Active Learning
Arxiv
0+阅读 · 2021年7月15日
Deep Learning of Conjugate Mappings
Arxiv
0+阅读 · 2021年7月13日
Learning to See Through Obstructions
Arxiv
7+阅读 · 2020年4月2日
Meta-Learning to Cluster
Arxiv
17+阅读 · 2019年10月30日
Arxiv
6+阅读 · 2019年7月11日
Learning to Importance Sample in Primary Sample Space
Top
微信扫码咨询专知VIP会员