arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2209.09471cs.PL
收藏

程序设计语言自然语义定义的描述与检验工具

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

Georgian-Vlad Saioc, Hans Hüttel

摘要:

许多大学在计算机科学的学位课程中都有围绕编译器或解释器实现的课程和项目。在这样的教学活动中,工具支持可以是非常有益的。虽然已经有几个工具可以帮助开发编译器的前端,但工具支持会逐渐减少到后端,或者需要比本科生更多的背景经验。结构操作语义是一个有用的和数学上简单的形式主义,用于指定程序的行为和规范本身很好地实现;特别是大步或自然语义往往是一个有用的和简单的方法。然而,许多学生在学习符号时遇到了困难,并且经常在定义结构操作语义时提出定义不清和无意义的尝试。一项调查显示,从事程序设计语言项目的学生认为缺乏工具支持,而且工具支持会很有用。在开发语义定义时遇到的许多问题与编程中遇到的问题相似,特别是那些本质上是类型错误导致的问题。我们提出了一个教学元语言的基础上自然语义,及其实施,试图结婚两个概念:语法类似于教科书的自然语义符号一方面,和自动验证的一些正确性属性的其他手段,一个强大的类型纪律。元语言和工具为编写和执行规范提供了便利,作为编程的一种形式。用户可以检查规范是否无意义,如果规范有意义,则执行程序。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑