Specifying the semantics of a programming language formally can have many benefits. However, it can also require a huge effort. The effort can be significantly reduced by translating language syntax to so-called fundamental constructs (funcons). A translation to funcons is easy to update when the language evolves, and it exposes relationships between individual language constructs. The PLanCompS project has developed an initial collection of funcons (primarily for translation of functional and imperative languages). The behaviour of each funcon is defined, once and for all, using a modular variant of structural operational semantics. The definitions are available online. This paper introduces and motivates funcons. It illustrates translation of language constructs to funcons, and how funcons are defined. It also relates funcons to notation used in previous frameworks, including monadic semantics and action semantics.
翻译:正式指定编程语言的语义可以带来许多好处。 但是, 它也可以要求做出巨大的努力。 通过将语言语法转换为所谓的基本构思( funcons), 这项工作可以大大减少。 当语言演变时, 翻译为 funcons 很容易更新, 它暴露了单个语言构造之间的关系 。 PLanCompS 项目开发了最初的有趣的集合( 主要是功能语言和必要语言的翻译 ) 。 每个 funcon 的行为都会被一劳永逸地定义, 使用结构操作语义的模块变体来定义。 这些定义可以在线查阅 。 本文介绍并激励 funcons 。 它展示语言构造的翻译为 funcons, 以及如何定义 funcons 。 它还连接了以前框架中使用的逗号, 包括修饰语和动作语义 。