arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1107.4751cs.LOcs.PL
收藏

类型化抽象类的扩展初始化

Extended Initiality for Typed Abstract Syntax

Benedikt Ahrens

摘要:

初始语义学的目标是将与签名相关联的语法解释为某类“模型”的初始对象,为抽象语法产生归纳和递归原则。Zavió证明了一个简单类型语法的初始性结果:给定一个签名S,与S相关联的抽象语法构成了单子中S的模型范畴中的初始对象。然而,她的定理提供的迭代原则只考虑了在一组固定的对象类型上的两种语言之间的翻译。我们推广Zavió的模型概念,使对象类型可以变化,产生一个更大的类别,同时保持其中语法的初始性。因此,我们得到了一个扩展的初始性定理的类型化抽象语法,在不同类型的条款之间的翻译可以指定通过相关的范畴理论的迭代算子作为一个初始态射。我们的定义确保通过初始化指定的翻译是类型安全的,即在明显的意义上与源语言和目标语言中的类型兼容。我们的主要例子是通过命题作为类型的范例:我们指定命题和推理规则的经典和直觉命题逻辑通过各自的类型签名。然后,我们使用范畴论的迭代算子指定一个双重否定翻译从前者到后者。第二个例子是PCF的签名。对于这种特殊情况,我们在证明助手Coq中将定理形式化。然后,我们指定,通过范畴理论的迭代运算符,从PCF的无类型的λ演算的翻译。

英文摘要:

Initial Semantics aims at interpreting the syntax associated to a signature as the initial object of some category of 'models', yielding induction and recursion principles for abstract syntax. Zsidó proves an initiality result for simply-typed syntax: given a signature S, the abstract syntax associated to S constitutes the initial object in a category of models of S in monads. However, the iteration principle her theorem provides only accounts for translations between two languages over a fixed set of object types. We generalize Zsidó's notion of model such that object types may vary, yielding a larger category, while preserving initiality of the syntax therein. Thus we obtain an extended initiality theorem for typed abstract syntax, in which translations between terms over different types can be specified via the associated category-theoretic iteration operator as an initial morphism. Our definitions ensure that translations specified via initiality are type-safe, i.e. compatible with the typing in the source and target language in the obvious sense. Our main example is given via the propositions-as-types paradigm: we specify propositions and inference rules of classical and intuitionistic propositional logics through their respective typed signatures. Afterwards we use the category--theoretic iteration operator to specify a double negation translation from the former to the latter. A second example is given by the signature of PCF. For this particular case, we formalize the theorem in the proof assistant Coq. Afterwards we specify, via the category-theoretic iteration operator, translations from PCF to the untyped lambda calculus.

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

↑