ABSTRACT
We present a purely functional array programming language that offers safe, purely functional and crash-free in-place array transformations. The language supports high-level abstractions for pure and efficient array computations that fully support equational reasoning. We show how to execute selected parts of these computations safely in-place, with the compiler guaranteeing that in-place execution does not change the computation’s result. Correctness is ensured by using an off-the-shelf-theorem prover to discharge safety conditions. Our main contribution is the idea of virtual copies for expressing re-use of arrays, and techniques for verifying their safety, which allow a pure language to include in-place transformations without weakening its transparency or reasoning power.
- Heinrich Apfelmus. 2010. The Operational monad tutorial. The Monad. Reader 15 (2010), 37-55.Google Scholar
- Markus Aronsson and Mary Sheeran. 2017. Hardware software codesign in Haskell. In Haskell Symposium, Vol. 52. ACM, 162-173. Google ScholarDigital Library
- Emil Axelsson. 2016. Benchmarking FFT in Feldspar. http://fun-discoveries.blogspot.com/2016/11/benchmarking-fft-in-feldspar.htmlGoogle Scholar
- Emil Axelsson. 2016. Compilation as a Typed EDSL-to-EDSL Transformation. http://fun-discoveries.blogspot.se/2016/03/.Google Scholar
- Emil Axelsson. 2019. A version of Operational suitable for extensible EDSLs. http://hackage.haskell.org/package/operational-alacarte.Google Scholar
- Emil Axelsson, Koen Claessen, Mary Sheeran, Josef Svenningsson, David Engdal, and Anders Persson. 2010. The design and implementation of Feldspar. In Symposium on Implementation and Application of Functional Languages. Springer, 121-136. Google ScholarDigital Library
- Emil Axelsson and Mary Sheeran. 2011. Feldspar: Application and implementation. In Central European Functional Programming School. Springer, 402-439. Google ScholarDigital Library
- John Gilbert Presslie Barnes. 2003. High integrity software: the Spark approach to safety and security. Pearson Education. Google ScholarDigital Library
- Jean-Philippe Bernardy, Mathieu Boespflug, Ryan R Newton, Simon Peyton Jones, and Arnaud Spiwack. 2017. Linear Haskell: Practical linearity in a higher-order polymorphic language. Proceedings of the ACM on Programming Languages 2, POPL (2017), 5. Google ScholarDigital Library
- Gavin M Bierman, Andrew D Gordon, Catalin Hritcu, and David Langworthy. 2010. Semantic subtyping with an SMT solver. Journal of Functional Programming 45, 9, 105-116. Google ScholarDigital Library
- James W Cooley and John W Tukey. 1965. An algorithm for the machine calculation of complex Fourier series. Mathematics of computation 19, 90 (1965), 297-301.Google Scholar
- Leonardo De Moura and Nikolaj Bjørner. 2008. Z3: An efficient SMT solver. In International conference on Tools and Algorithms for the Construction and Analysis of Systems. Springer, 337-340. Google ScholarDigital Library
- Pierre Duhamel and Martin Vetterli. 1990. Fast Fourier transforms: a tutorial review and a state of the art. Signal processing 19, 4 (1990), 259-299. Google ScholarDigital Library
- Trevor Elliott, Lee Pike, Simon Winwood, Pat Hickey, James Bielman, Jamey Sharp, Eric Seidel, and John Launchbury. 2015. Guilt free ivory. In ACM SIGPLAN Notices, Vol. 50. ACM, 189-200. Google ScholarDigital Library
- Cormac Flanagan and Shaz Qadeer. 2002. Predicate abstraction for software verification, Vol. 37. ACM, POPL '02 Proceedings of the 29th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, 191-202. Google ScholarDigital Library
- Matteo Frigo and Steven G Johnson. 2005. The design and implementation of FFTW3. Proc. IEEE 93, 2 (2005), 216-231.Google ScholarCross Ref
- Troels Henriksen, Niels GW Serup, Martin Elsman, Fritz Henglein, and Cosmin E Oancea. 2017. Futhark: purely functional GPU-programming with nested parallelism and in-place array updates. ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017) 52, 6 (2017), 556-571. Google ScholarDigital Library
- Trevor Jim, J Gregory Morrisett, Dan Grossman, Michael W Hicks, James Cheney, and Yanling Wang. 2002. Cyclone: A Safe Dialect of C. In USENIX Annual Technical Conference, General Track. 275-288. Google ScholarDigital Library
- Nicholas D Matsakis and Felix S Klock II. 2014. The rust language. In ACM SIGAda Ada Letters, Vol. 34. ACM, 103-104. Google ScholarDigital Library
- Patrick M Rondon, Ming Kawaguci, and Ranjit Jhala. 2008. Liquid types. In ACM SIGPLAN Notices, Vol. 43. ACM, 159-169. Google ScholarDigital Library
- Nikhil Swamy, Juan Chen, Cédric Fournet, Pierre-Yves Strub, Karthikeyan Bhargavan, and Jean Yang. 2011. Secure distributed programming with value-dependent types. In ACM SIGPLAN Notices, Vol. 46. ACM, 266-278. Google ScholarDigital Library
- Wouter Swierstra. 2008. Data types à la carte. Journal of Functional Programming 18, 4 (2008), 423-436. Google ScholarDigital Library
- Philip Wadler. 1990. Linear types can change the world. In IFIP TC, Vol. 2. 347-359.Google Scholar
Index Terms
- Safety at speed: in-place array algorithms from pure functional programs by safely re-using storage
Recommendations
Verifying higher-order functional programs with pattern-matching algebraic data types
POPL '11Type-based model checking algorithms for higher-order recursion schemes have recently emerged as a promising approach to the verification of functional programs. We introduce pattern-matching recursion schemes (PMRS) as an accurate model of computation ...
Verifying higher-order functional programs with pattern-matching algebraic data types
POPL '11: Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesType-based model checking algorithms for higher-order recursion schemes have recently emerged as a promising approach to the verification of functional programs. We introduce pattern-matching recursion schemes (PMRS) as an accurate model of computation ...
Compiling and verifying SC-SystemJ programs for safety-critical reactive systems
Most of today's embedded systems are very complex. These systems, controlled by computer programs, continuously interact with their physical environments through network of sensory input and output devices. Consequently, the operations of such embedded ...
Comments