当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
A Comparison of Big-step Semantics Definition Styles
arXiv - CS - Programming Languages Pub Date : 2020-11-20 , DOI: arxiv-2011.10373
Péter Bereczky, Dániel Horpácsi, Simon Thompson

Formal semantics provides rigorous, mathematically precise definitions of programming languages, with which we can argue about program behaviour and program equivalence by formal means; in particular, we can describe and verify our arguments with a proof assistant. There are various approaches to giving formal semantics to programming languages, at different abstraction levels and applying different mathematical machinery: the reason for using the semantics determines which approach to choose. In this paper we investigate some of the approaches that share their roots with traditional relational big-step semantics, such as (a) functional big-step semantics (or, equivalently, a definitional interpreter), (b) pretty-big-step semantics and (c) traditional natural semantics. We compare these approaches with respect to the following criteria: executability of the semantics definition, proof complexity for typical properties (e.g. determinism) and the conciseness of expression equivalence proofs in that approach. We also briefly discuss the complexity of these definitions and the coinductive big-step semantics, which enables reasoning about divergence. To enable the comparison in practice, we present an example language for comparing the semantics: a sequential subset of Core Erlang, a functional programming language, which is used in the intermediate steps of the Erlang/OTP compiler. We have already defined a relational big-step semantics for this language that includes treatment of exceptions and side effects. The aim of this current work is to compare our big-step definition for this language with a variety of other equivalent semantics in different styles from the point of view of testing and verifying code refactorings.

中文翻译:

大型语义定义样式的比较

形式语义为编程语言提供了严格的,数学上精确的定义,我们可以通过形式化的方法来论证程序行为和程序等效性。特别是,我们可以使用证明助手来描述和验证我们的论点。在不同的抽象级别和应用不同的数学机制时,有多种方法可以为编程语言提供形式语义:使用语义的原因决定了选择哪种方法。在本文中,我们研究了一些与传统的关系型大步语义共享其根源的方法,例如(a)功能大步语义(或等效地,一个定义解释器),(b)相当大步语义(c)传统的自然语义。我们根据以下标准比较这些方法:语义定义的可执行性,典型属性的证明复杂性(例如确定性)以及该方法中表达对等证明的简洁性。我们还简要地讨论了这些定义的复杂性以及协合的大步语义,这使得能够对差异进行推理。为了在实践中进行比较,我们提供了一种用于比较语义的示例语言:Core Erlang的顺序子集,一种功能编程语言,在Erlang / OTP编译器的中间步骤中使用。我们已经为这种语言定义了一个关系重大的语义,其中包括对异常和副作用的处理。
更新日期:2020-11-23
down
wechat
bug