Hostname: page-component-586b7cd67f-l7hp2 Total loading time: 0 Render date: 2024-11-25T17:07:50.418Z Has data issue: false hasContentIssue false

The countdown problem

Published online by Cambridge University Press:  06 November 2002

GRAHAM HUTTON
Affiliation:
School of Computer Science and IT, University of Nottingham, Nottingham, UK
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

We systematically develop a functional program that solves the countdown problem, a numbers game in which the aim is to construct arithmetic expressions satisfying certain constraints. Starting from a formal specification of the problem, we present a simple but inefficient program that solves the problem, and prove that this program is correct. We then use program fusion to calculate an equivalent but more efficient program, which is then further improved by exploiting arithmetic properties.

Type
FUNCTIONAL PEARL
Copyright
© 2002 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.