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.
我们给出了一类简单类型语言(如PCF语言)的语法和语义的代数刻画:我们刻画了简单类型绑定语法,通过一个普适属性,即作为某个类别的初始对象,配备了归约规则。为了这个目的,我们采用了在以前的两个工作中开发的技术:在[2]中,我们在不同类型集上对语言之间的句法翻译建模,作为一类模型中的初始态射。在[1]中,我们在一类模型中用归约规则刻画了无类型语法作为初始对象。在目前的工作中,我们表明,这些技术是模块化的,足以结合起来:因此,我们的特点是简单类型的语法与减少规则的初始对象在一个类别。泛属性产生了一个操作符,它允许在可能不同的类型集上指定语言之间的翻译-通过构造在语义上忠实。我们通过2-签名来指定一种语言,也就是说,在两个级别上的签名:语法级别指定语言的类型和术语,并将类型与每个术语相关联。语义层通过不等式指定语言术语的归约规则。对于任何给定的2-签名,我们关联一类模型。我们证明了这个范畴有一个初始对象,它集成了由2-签名自由生成的类型和项,以及由给定不等式生成的这些项的约化关系。我们称这个对象为由2-签名生成的(编程)语言。[1]Ahrens,B.:Modules over relative monads for syntax and semantics(2011),arXiv:1107.5252,to be published in Math. Struct. in Comp. Sci…