{"title":"Equational Logic and Categorical Semantics for Multi-Languages","authors":"Samuele Buro , Roy Crole , Isabella Mastroeni","doi":"10.1016/j.entcs.2020.09.005","DOIUrl":null,"url":null,"abstract":"<div><p>Programming language interoperability is the capability of two programming languages to interact as parts of a single system. Each language may be optimized for specific tasks, and a programmer can take advantage of this. HTML, CSS, and JavaScript yield a form of interoperability, working in conjunction to render webpages. Some object oriented languages have interoperability via a virtual machine host (.NET CLI compliant languages in the Common Language Runtime, and JVM compliant languages in the Java Virtual Machine). A high-level language can interact with a lower level one (Apple's Swift and Objective-C). While there has been some research exploring the interoperability mechanisms (Section 1) there is little development of theoretical foundations. This paper presents an approach to interoperability based around theories of equational logic, and categorical semantics.</p><p>We give ways in which two languages can be blended, and interoperability reasoned about using equations over the blended language. Formally, <em>multi-language equational logic</em> is defined within which one may deduce valid equations starting from a collection of axioms that postulate properties of the combined language. Thus we have the notion of a <em>multi-language theory</em> and much of the paper is devoted to exploring the properties of these theories. This is accomplished by way of <em>category theory</em>, giving us a very general and flexible semantics, and hence a nice collection of models. Classifying categories are constructed, and hence equational theories furnish each categorical model with an internal language; from this we can also establish soundness and completeness. A set-theoretic semantics follows as an instance, itself sound and complete. The categorical semantics is based on some pre-existing research, but we give a presentation that we feel is easier and simpler to work with, improves and mildly extends current research, and in particular is well suited to computer scientists. Throughout the paper we prove some interesting properties of the new semantic machinery. We provide a small running example throughout the paper to illustrate our ideas, and a more complex example in conclusion.</p></div>","PeriodicalId":38770,"journal":{"name":"Electronic Notes in Theoretical Computer Science","volume":"352 ","pages":"Pages 79-103"},"PeriodicalIF":0.0000,"publicationDate":"2020-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/j.entcs.2020.09.005","citationCount":"4","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Electronic Notes in Theoretical Computer Science","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S1571066120300517","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"Computer Science","Score":null,"Total":0}
引用次数: 4
Abstract
Programming language interoperability is the capability of two programming languages to interact as parts of a single system. Each language may be optimized for specific tasks, and a programmer can take advantage of this. HTML, CSS, and JavaScript yield a form of interoperability, working in conjunction to render webpages. Some object oriented languages have interoperability via a virtual machine host (.NET CLI compliant languages in the Common Language Runtime, and JVM compliant languages in the Java Virtual Machine). A high-level language can interact with a lower level one (Apple's Swift and Objective-C). While there has been some research exploring the interoperability mechanisms (Section 1) there is little development of theoretical foundations. This paper presents an approach to interoperability based around theories of equational logic, and categorical semantics.
We give ways in which two languages can be blended, and interoperability reasoned about using equations over the blended language. Formally, multi-language equational logic is defined within which one may deduce valid equations starting from a collection of axioms that postulate properties of the combined language. Thus we have the notion of a multi-language theory and much of the paper is devoted to exploring the properties of these theories. This is accomplished by way of category theory, giving us a very general and flexible semantics, and hence a nice collection of models. Classifying categories are constructed, and hence equational theories furnish each categorical model with an internal language; from this we can also establish soundness and completeness. A set-theoretic semantics follows as an instance, itself sound and complete. The categorical semantics is based on some pre-existing research, but we give a presentation that we feel is easier and simpler to work with, improves and mildly extends current research, and in particular is well suited to computer scientists. Throughout the paper we prove some interesting properties of the new semantic machinery. We provide a small running example throughout the paper to illustrate our ideas, and a more complex example in conclusion.
编程语言互操作性是两种编程语言作为单个系统的一部分进行交互的能力。每种语言都可以针对特定的任务进行优化,程序员可以利用这一点。HTML、CSS和JavaScript产生了一种互操作性的形式,它们一起工作来呈现网页。一些面向对象的语言通过虚拟机主机具有互操作性。. NET CLI兼容的公共语言运行库语言和Java虚拟机JVM兼容的语言)。高级语言可以与低级语言交互(苹果的Swift和Objective-C)。虽然已经有一些研究探索互操作性机制(第1节),但理论基础的发展很少。本文提出了一种基于等价逻辑和范畴语义理论的互操作性方法。我们给出了两种语言可以混合的方法,以及在混合语言上使用方程的互操作性。形式上,定义了多语言方程逻辑,其中可以从假定组合语言的属性的公理集合中推导出有效的方程。因此,我们有了多语言理论的概念,本文的大部分内容都致力于探索这些理论的性质。这是通过范畴论实现的,给我们一个非常一般和灵活的语义,因此是一个很好的模型集合。分类范畴被构建,因此等式理论为每个范畴模型提供了一种内部语言;由此我们也可以建立健全和完备性。集合论语义作为一个实例紧随其后,它本身是健全的和完整的。分类语义是基于一些已有的研究,但我们给出了一个我们认为更容易和更简单的演示,改进并适度扩展了当前的研究,特别适合计算机科学家。在整个论文中,我们证明了新的语义机制的一些有趣的性质。我们在本文中提供了一个小的运行示例来说明我们的想法,并在结论中提供了一个更复杂的示例。
期刊介绍:
ENTCS is a venue for the rapid electronic publication of the proceedings of conferences, of lecture notes, monographs and other similar material for which quick publication and the availability on the electronic media is appropriate. Organizers of conferences whose proceedings appear in ENTCS, and authors of other material appearing as a volume in the series are allowed to make hard copies of the relevant volume for limited distribution. For example, conference proceedings may be distributed to participants at the meeting, and lecture notes can be distributed to those taking a course based on the material in the volume.