Discovering Algorithms with Matrix Code
M.H. van Emden

TL;DR
This paper introduces Matrix Code, a program format that facilitates algorithm discovery by transforming specifications into executable code through a step-by-step matrix growth process, exemplified by generating prime numbers.
Contribution
It presents a novel program format, Matrix Code, enabling a structured discovery process from specification to code, grounded in Floyd-Hoare verification principles.
Findings
Matrix Code supports stepwise algorithm development.
The method is demonstrated with a Java prime number generator.
The approach bridges specification and implementation effectively.
Abstract
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.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTeaching and Learning Programming · Parallel Computing and Optimization Techniques · Experimental Learning in Engineering
