论文标题

描述和检查编程语言的自然语义定义的工具

A Tool for Describing and Checking Natural Semantics Definitions of Programming Languages

论文作者

Saioc, Georgian-Vlad, Hüttel, Hans

论文摘要

许多大学的课程和项目围绕编译器或指导者实施,作为其计算机科学学位课程的一部分。在这样的教学活动中,工具支持可能是非常有益的。尽管已经有几种工具可以协助开发编译器的前端,但工具支持向后端倾斜,或者需要比本科生预期更多的背景经验。 结构性操作语义是一种有用且数学上简单的形式主义,用于指定程序的行为和规范非常适合实施。特别是大型或自然语义通常是一种有用且简单的方法。但是,许多学生努力学习符号,并经常想出定义结构性操作语义的错误和毫无意义的尝试。一项调查显示,从事编程语言项目的学生认为缺乏工具支持并且将很有用。 开发语义定义时遇到的许多问题类似于编程中遇到的问题,尤其是类型错误的结果。 我们提出了一种基于自然语义及其实现的教学术语,作为试图嫁给两个概念的试图:一方面的语法类似于自然语义的教科书符号,以及通过强型纪律来自动验证某些正确性属性。金属语言和工具为编写和执行规格作为编程形式提供了设施。如果规范有意义,则用户可以检查规范是否没有意义以及执行程序。

Many universities have courses and projects revolving around compiler or interpreter implementation as part of their degree programmes in computer science. In such teaching activities, tool support can be highly beneficial. While there are already several tools for assisting with development of the front end of compilers, tool support tapers off towards the back end, or requires more background experience than is expected of undergraduate students. Structural operational semantics is a useful and mathematically simple formalism for specifying the behaviour of programs and a specification lends itself well to implementation; in particular big-step or natural semantics is often a useful and simple approach. However, many students struggle with learning the notation and often come up with ill-defined and meaningless attempts at defining a structural operational semantics. A survey shows that students working on programming language projects feel that tool support is lacking and would be useful. Many of these problems encountered when developing a semantic definition are similar to problems encountered in programming, in particular ones that are essentially the result of type errors. We present a pedagogical metalanguage based on natural semantics, and its implementation, as an attempt to marry two notions: a syntax similar to textbook notation for natural semantics on the one hand, and automatic verification of some correctness properties on the other by means of a strong type discipline. The metalanguage and the tool provide the facilities for writing and executing specifications as a form of programming. The user can check that the specification is not meaningless as well as execute programs, if the specification makes sense.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源