Despite extensive research both on the theoretical and practical fronts, formalising, reasoning about, and implementing languages with variable binding is still a daunting endeavour - repetitive boilerplate and the overly complicated metatheory of capture-avoiding substitution often get in the way of progressing on to the actually interesting properties of a language. Existing developments offer some relief, however at the expense of inconvenient and error-prone term encodings and lack of formal foundations. We present a mathematically-inspired language-formalisation framework implemented in Agda. The system translates the description of a syntax signature with variable-binding operators into an intrinsically-encoded, inductive data type equipped with syntactic operations such as weakening and substitution, along with their correctness properties. The generated metatheory further incorporates metavariables and their associated operation of metasubstitution, which enables second-order equational/rewriting reasoning. The underlying mathematical foundation of the framework - initial algebra semantics - derives compositional interpretations of languages into their models satisfying the semantic substitution lemma by construction.
翻译:尽管在理论和实践方面进行了广泛的研究,但正式确定、推理和实施具有可变约束性的语言仍然是一项艰巨的工作——重复的锅炉板和过于复杂的套用式避免替换的元理论往往妨碍逐步形成一种语言的实际有趣特性。现有的发展动态提供了一些缓解,但以不方便和易出错的术语编码和缺乏正式基础为代价。我们提出了一个在阿格达实施的由数学启发的语言正规化框架。该系统将具有可变约束操作员的合成符号的描述转换成一个内在编码的、感应式的数据类型,配有削弱和替换等综合操作,以及其正确性。所产生的元论还进一步纳入了可变及其相关的代代用功能,从而使第二顺序的等式/重写推理成为可能。框架的基本数学基础——初始代数语义——将语言的构成解释纳入其模型,通过建筑来满足语义替代列母体。