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

初始化类型化和语义

Initiality for Typed Syntax and Semantics

Benedikt Ahrens

摘要:

在这篇论文中,我们给出了简单类型语言的语法和语义的代数刻画。更确切地说,我们通过一个普遍的属性,即作为初始对象的一些类别的简单类型的绑定语法配备了约简规则的特点。我们通过2-signature(A,A)来指定一种语言,也就是说,在两个级别上的签名:语法级别A指定语言的排序和术语,并将排序与每个术语相关联。语义层A通过不等式指定语言术语的归约规则。对于任何给定的2-签名(A,A),我们关联一类(A,A)的“模型”。我们证明了这个范畴有一个初始对象,它整合了由A自由生成的项和由A在这些项上生成的归约关系。我们把这个对象称为由(A,A)生成的程序设计语言。初始化提供了一个迭代原则,允许指定语法上的翻译,可能是不同种类的语言。此外,通过迭代原则指定的翻译是通过构造类型安全的,并且在约简方面是忠实的。为了说明我们的结果,我们考虑了两个例子:首先,我们指定了一个双重否定翻译从经典的直觉命题逻辑通过范畴论迭代原则。其次,我们指定一个翻译从PCF的无类型的λ演算,这是忠实的减少在源和目标语言。在第二部分中,我们正式我们的一些初始性定理的证明助手Coq。该实现产生一个机器,当给定2-签名时,返回其相关抽象语法的实现以及经认证的替换操作,迭代运算符和由指定的归约规则生成的归约关系。

英文摘要:

In this thesis we give an algebraic characterization of the syntax and semantics of simply-typed languages. More precisely, we characterize simply-typed binding syntax equipped with reduction rules via a universal property, namely as the initial object of some category. We specify a language by a 2-signature (Σ, A), that is, a signature on two levels: the syntactic level Σ specifies the sorts and terms of the language, and associates a sort to each term. The semantic level A specifies, through inequations, reduction rules on the terms of the language. To any given 2-signature (Σ, A) we associate a category of "models" of (Σ, A). We prove that this category has an initial object, which integrates the terms freely generated by Σ and the reduction relation - on those terms - generated by A. We call this object the programming language generated by (Σ, A). Initiality provides an iteration principle which allows to specify translations on the syntax, possibly to a language over different sorts. Furthermore, translations specified via the iteration principle are by construction type-safe and faithful with respect to reduction. To illustrate our results, we consider two examples extensively: firstly, we specify a double negation translation from classical to intuitionistic propositional logic via the category-theoretic iteration principle. Secondly, we specify a translation from PCF to the untyped lambda calculus which is faithful with respect to reduction in the source and target languages. In a second part, we formalize some of our initiality theorems in the proof assistant Coq. The implementation yields a machinery which, when given a 2-signature, returns an implementation of its associated abstract syntax together with certified substitution operation, iteration operator and a reduction relation generated by the specified reduction rules.

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

↑