arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1203.2296cs.PL
收藏

矩阵码发现算法

Discovering Algorithms with Matrix Code

M. H. van Emden

摘要:

在第一年的编程课程中,通常很难向学生展示如何发现算法。在本文中,我们提出了一个程序格式,支持从规范到代码的发展,在小而明显的步骤,即发现过程。该格式,称为矩阵码,可以解释为一个证明,根据弗洛里-霍尔程序验证方法。该过程包括将函数体的规范表示为初始代码矩阵,然后通过添加行和列来增长矩阵,直到完成的矩阵以常规方式转换为可编译代码。作为工作示例,我们开发了一个Java程序,生成前N个素数的表。

英文摘要:

In first-year programming courses it is often difficult to show students how an algorithm can be discovered. In this paper we present a program format that supports the development from specification to code in small and obvious steps; that is, a discovery process. The format, called Matrix Code, can be interpreted as a proof according to the Floyd-Hoare program verification method. The process consists of expressing the specification of a function body as an initial code matrix and then growing the matrix by adding rows and columns until the completed matrix is translated in a routine fashion to compilable code. As worked example we develop a Java program that generates the table of the first N prime numbers.

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

↑