当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Compositional theories for embedded languages
arXiv - CS - Programming Languages Pub Date : 2020-06-18 , DOI: arxiv-2006.10604
Davide Trotta and Margherita Zorzi

Embedded programming style allows to split the syntax in two parts, representing respectively a host language H and a core language C embedded in H. This formally models several situations in which a user writes code in a main language and delegates some tasks to an ad hoc domain specific language. Moreover, as showed in recent years, a particular case of the host-core approach allows a flexible management of data linearity, which is particularly useful in non-classical computational paradigms such as quantum computing. The definition of a systematised type theory to capture and standardize common properties of embedded languages is unexplored. The aim of this paper is to present a flexible fragment of such a type theory, together with its categorical semantics in terms of enriched categories, following previous investigations. We present the calculus HC0 and we use the notion of internal language of a category to relate the language to the class of its models, showing the equivalence between the category of models and the one of theories. This provides a stronger result w.r.t. standard soundness and completeness since it involves not only the models but also morphisms between models. We observe that the definition of the morphisms between models highlights further advantages of the embedded languages and we discuss some concrete instances, extensions and specializations of the syntax and the semantics.

中文翻译:

嵌入式语言的组合理论

嵌入式编程风格允许将语法分成两部分,分别表示宿主语言 H 和嵌入在 H 中的核心语言 C。这正式模拟了用户使用主语言编写代码并将某些任务委托给临时人员的几种情况领域特定语言。此外,正如近年来所显示的,主机核方法的一个特殊情况允许灵活管理数据线性,这在非经典计算范式(如量子计算)中特别有用。用于捕获和标准化嵌入式语言的公共属性的系统化类型理论的定义尚未得到探索。本文的目的是在之前的调查之后,展示这种类型理论的一个灵活片段,以及它在丰富类别方面的分类语义。我们提出了微积分 HC0,我们使用类别的内部语言的概念将语言与其模型的类别相关联,显示模型类别与理论之一之间的等价性。这提供了比标准健全性和完整性更强的结果,因为它不仅涉及模型,还涉及模型之间的态射。我们观察到模型之间态射的定义突出了嵌入式语言的进一步优势,我们讨论了语法和语义的一些具体实例、扩展和特化。标准的健全性和完备性,因为它不仅涉及模型,还涉及模型之间的态射。我们观察到模型之间态射的定义突出了嵌入式语言的进一步优势,我们讨论了语法和语义的一些具体实例、扩展和特化。标准的健全性和完备性,因为它不仅涉及模型,还涉及模型之间的态射。我们观察到模型之间态射的定义突出了嵌入式语言的进一步优势,我们讨论了语法和语义的一些具体实例、扩展和特化。
更新日期:2020-07-01
down
wechat
bug