|
ABSTRACT
We describe an automated analysis of Haskell 98 programs to check statically that, despite the possible use of partial (or non-exhaustive) pattern matching, no pattern-match failure can occur. Our method is an iterative backward analysis using a novel form of pattern-constraint to represent sets of data values. The analysis is defined for a core first-order language to which Haskell 98 programs are reduced. Our analysis tool has been successfully applied to a range of programs, and our techniques seem to scale well. Throughout the paper, methods are represented much as we have implemented them in practice, again in Haskell.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
Stephen Adams. Efficient sets - a balancing act. JFP, 3 (4): 553--561, 1993.
|
 |
2
|
|
| |
3
|
John Horton Conway. Regular Algebra and Finite Machines. London Chapman and Hall, 1971.
|
| |
4
|
|
| |
5
|
Dimitry Golubovsky, Neil Mitchell, and Matthew Naylor. Yhc.Core - from Haskell to Core. The Monad.Reader, 1 (7): 45--61, April 2007.
|
| |
6
|
S. C. Johnson. Lint, a C program checker. Technical Report 65, Bell Laboratories, 1978.
|
| |
7
|
C. Lee. Representation of switching circuits by binary decision diagrams. Bell System Technical Journal, 38: 985--999, 1959.
|
| |
8
|
Tobias Lindahl and Konstantinos Sagonas. Detecting software defects in telecom applications through lightweight static analysis: A war story. In Proc. APLAS '04, LNCS 3302, pages 91--106. Springer, November 2004.
|
| |
9
|
Luc Maranget. Warnings for pattern matching. JFP, 17 (3): 1--35, May 2007.
|
| |
10
|
|
| |
11
|
Neil Mitchell. Transformation and Analysis of Functional Programs. PhD thesis, University of York, 2008.
|
| |
12
|
Neil Mitchell and Colin Runciman. A static checker for safe pattern matching in Haskell. In Trends in Functional Programming (2005 Symposium), volume 6, pages 15--30. Intellect, 2007.
|
| |
13
|
|
| |
14
|
|
| |
15
|
Simon Peyton Jones. Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, 2003.
|
 |
16
|
Simon Peyton Jones , Dimitrios Vytiniotis , Stephanie Weirich , Geoffrey Washburn, Simple unification-based type inference for GADTs, Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming, September 16-21, 2006, Portland, Oregon, USA
[doi> 10.1145/1159803.1159811]
|
 |
17
|
|
 |
18
|
|
 |
19
|
|
 |
20
|
|
| |
21
|
The GHC Team. The GHC compiler, version 6.8.2. http://www.haskell.org/ghc/, December 2007.
|
| |
22
|
Andrew Tolmach. An External Representation for the GHC Core Language. http://www.haskell.org/ghc/docs/papers/core.ps.gz, September 2001.
|
 |
23
|
|
| |
24
|
David Turner. Total Functional Programming. Journal of Universal Computer Science, 10 (7): 751--768, July 2004.
|
| |
25
|
|
 |
26
|
|
 |
27
|
|
| |
28
|
Dana N. Xu, Simon Peyton Jones, and Koen Claessen. Static contract checking for Haskell. In Proc. IFL 2007, pages 382--399, 2007.
|
|