Abstract
Sparse matrix formats are typically implemented with low-level imperative programs. The optimized nature of these implementations hides the structural organization of the sparse format and complicates its verification. We define a variable-free functional language (LL) in which even advanced formats can be expressed naturally, as a pipeline-style composition of smaller construction steps. We translate LL programs to Isabelle/HOL and describe a proof system based on parametric predicates for tracking relationship between mathematical vectors and their concrete representations. This proof theory automatically verifies full functional correctness of many formats. We show that it is reusable and extensible to hierarchical sparse formats.
Supplemental Material
- }}J. Backus. Can programming be liberated from the von Neumann style? A functional style and its algebra of programs. Communications of the ACM (CACM), 21(8):613--641, 1978. Google Scholar
Digital Library
- }}A. J. C. Bik, P. Brinkhaus, P. M. W. Knijnenburg, and H. A. G. Wijshoff. The automatic generation of sparse primitives. ACM Transactions on Mathematical Software, 24(2):190--225, 1998. Google Scholar
Digital Library
- }}G. E. Blelloch. Programming parallel algorithms. Communications of the ACM (CACM), 39(3):85--97, 1996. Google Scholar
Digital Library
- }}M. M. T. Chakravarty, R. Leshchinskiy, S. P. Jones, G. Keller, and S. Marlow. Data Parallel Haskell: a status report. In Workshop on Declarative Aspects of Multicore Programming (DAMP), pages 10--18, New York, NY, USA, 2007. ACM. Google Scholar
Digital Library
- }}J. Duan, J. Hurd, G. Li, S. Owens, K. Slind, and J. Zhang. Functional correctness proofs of encryption algorithms. In Logic for Programming, Artificial Intelligence and Reasoning (LPAR), pages 519--533, 2005. Google Scholar
Digital Library
- }}C. Flanagan, K. R. M. Leino, M. Lillibridge, G. Nelson, J. B. Saxe, and R. Stata. Extended static checking for Java. In Programming Languages Design and Implementation, pages 234--245, 2002. Google Scholar
Digital Library
- }}E.-J. Im. Optimizing the performance of sparse matrix-vector multiplication. PhD thesis, University of California, Berkeley, 2000. Google Scholar
Digital Library
- }}V. Kotlyar and K. Pingali. Sparse code generation for imperfectly nested loops with dependences. In International Conference on Supercomputing (ICS), pages 188--195, 1997. Google Scholar
Digital Library
- }}V. Kotlyar, K. Pingali, and P. Stodghill. A relational approach to the compilation of sparse matrix programs. In Euro-Par, pages 318--327, 1997. Google Scholar
Digital Library
- }}N. Mateev, K. Pingali, P. Stodghill, and V. Kotlyar. Next-generation generic programming and its application to sparse matrix computations. In International Conference on Supercomputing (ICS), pages 88--99, 2000. Google Scholar
Digital Library
- }}T. Nipkow, L. C. Paulson, and M. Wenzel. Isabelle/HOL: A Proof Assistant for Higher-Order Logic, volume 2283 of Lecture Notes in Computer Science. Springer-Verlag, 2002. Google Scholar
Digital Library
- }}S. Obua. Flyspeck II: The Basic Linear Programs. PhD thesis, Technische Universität München, 2008.Google Scholar
- }}M. Sagiv, T. W. Reps, and R. Wilhelm. Parametric shape analysis via 3-valued logic. ACM Transactions on Programming Languages and Systems (TOPLAS), 24(3):217--298, 2002. Google Scholar
Digital Library
- }}R. W. Vuduc. Automatic performance tuning of sparse matrix kernels. PhD thesis, University of California, Berkeley, 2004. Google Scholar
Digital Library
- }}M. Wenzel. The Isabelle/Isar Implementation. Technische Universität München. http://isabelle.in.tum.de/doc/implementation.pdf.Google Scholar
- }}M. Wildmoser and T. Nipkow. Certifying machine code safety: Shallow versus deep embedding. In International Conference on Theorem Proving in Higher-Order Logics, pages 305--320, 2004.Google Scholar
Cross Ref
Index Terms
Specifying and verifying sparse matrix codes
Recommendations
Specifying and verifying sparse matrix codes
ICFP '10: Proceedings of the 15th ACM SIGPLAN international conference on Functional programmingSparse matrix formats are typically implemented with low-level imperative programs. The optimized nature of these implementations hides the structural organization of the sparse format and complicates its verification. We define a variable-free ...
Verifying Code and Its Optimizations: An Experience Report
ICSTW '11: Proceedings of the 2011 IEEE Fourth International Conference on Software Testing, Verification and Validation WorkshopsWe present our experience in formally verifying the correctness of a 200-line industrial C implementation of Cyclic Redundancy Check (CRC) and its optimizations. Our experience indicates that (a) both the specification and verification of even such ...
Specifying Languages and Verifying Programs with K
SYNASC '13: Proceedings of the 2013 15th International Symposium on Symbolic and Numeric Algorithms for Scientific ComputingK is a rewrite-based executable semantic framework for defining languages. The K framework is designed to allow implementing a variety of generic tools that can be used with any language defined in K, such as parsers, interpreters, symbolic execution ...









Comments