3 research outputs found
Verifying Spatial Properties of Array Computations
Arrays computations are at the core of numerical modelling and computational science applications. However, low-level manipulation of array indices is a source of program error. Many practitioners are aware of the need to ensure program correctness, yet very few of the techniques from the programming research community are applied by scientists. We aim to change that by providing targetted lightweight verification techniques for scientific code. We focus on the all too common mistake of array offset errors as a generalisation of off-by-one errors. Firstly, we report on a code analysis study on eleven real-world computational science code base, identifying common idioms of array usage and their spatial properties. This provides much needed data on array programming idioms common in scientific code. From this data, we designed a lightweight declarative specification language capturing the majority of array access patterns via a small set of combinators. We detail a semantic model, and the design and implementation of a verification tool for our specification language, which both checks and infers specifications. We evaluate our tool on our corpus of scientific code and give verification case studies of bug fixes that are detected by our approach. We found roughly 80,000 targets for specification across roughly 1.4 million lines of code, showing that the vast majority of array computations read from arrays in a pattern with a simple, regular, static shape
Recommended from our members
Verifying Spatial Properties of Array Computations
Arrays computations are at the core of numerical modelling and computational science applications. However, low-level manipulation of array indices is a source of program error. Many practitioners are aware of the need to ensure program correctness, yet very few of the techniques from the programming research community are applied by scientists. We aim to change that by providing targetted lightweight veriication techniques for scientiic code. We focus on the all too common mistake of array ofset errors as a generalisation of of-by-one errors. Firstly, we report on a code analysis study on eleven real-world computational science code base, identifying common idioms of array usage and their spatial properties. This provides much needed data on array programming idioms common in scientiic code. From this data, we designed a lightweight declarative speciication language capturing the majority of array access patterns via a small set of combinators. We detail a semantic model, and the design and implementation of a veriication tool for our speciication language, which both checks and infers speciications. We evaluate our tool on our corpus of scientiic code. Using the inference mode, we found roughly 87,000 targets for speciication across roughly 1.1 million lines of code, showing that the vast majority of array computations read from arrays in a pattern with a simple, regular, static shape. We also studied the commit logs of one of our corpus packages, inding past bug ixes for which our speciication system distinguishes the change and thus could have been applied to detect such bugs.This work was supported by the EPSRC [grant number EP/M026124/1]
Recommended from our members
Research data supporting Verifying Spatial Properties of Array Computations
This dataset reproduces findings from our paper "Verifying Spatial Properties of Array Computations". It contains the code necessary to reproduce our study of array programming idioms in
scientific/numerical Fortran code (Section 2 of the paper), to demonstrate the inference, checking, and specification synthesis features of our verification tool via examples (Section 3 of the paper), and to produce statistics describing the various kinds of specifications that can be inferred over our test corpus (Section 7 of the paper)