Hostname: page-component-8448b6f56d-m8qmq Total loading time: 0 Render date: 2024-04-16T05:40:39.443Z Has data issue: false hasContentIssue false

Proof-directed debugging

Published online by Cambridge University Press:  01 July 1999

ROBERT HARPER
Affiliation:
Carnegie Mellon University, Pittsburgh, PA 15213, USA
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.

The close relationship between writing programs and proving theorems has frequently been cited as an advantage of functional programming languages. We illustrate the interplay between programming and proving in the development of a program for regular expression matching. The presentation is inspired by Lakatos's method of proofs and refutations in which the attempt to prove a plausible conjecture leads to a revision not only of the proof, but of the theorem itself. We give a plausible implementation of a regular expression matcher that contains a flaw that is uncovered in an attempt to prove its correctness. The failure of the proof suggests a revision of the specification, rather than a change to the code. We then show that a program meeting the revised specification is nevertheless sufficient to solve the original problem.

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

Discussions

No Discussions have been published for this article.