# Eliminating array bound checking through dependent types

@article{Xi1998EliminatingAB, title={Eliminating array bound checking through dependent types}, author={Hongwei Xi and Frank Pfenning}, journal={Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementation}, year={1998} }

We present a type-based approach to eliminating array bound checking and list tag checking by conservatively extending Standard ML with a restricted form of dependent types. This enables the programmer to capture more invariants through types while type-checking remains decidable in theory and can still be performed efficiently in practice. We illustrate our approach through concrete examples and present the result of our preliminary experiments which support support the feasibility and…

## 320 Citations

### A Dependently Typed Framework for Static Analysis of Program Execution Costs

- Computer ScienceIFL
- 2005

This paper presents a dependently typed core language TT, and defines a framework within this language for representing size metrics and their properties and gives several examples of size bounded programs within this framework and shows that they can construct proofs of their size bounds within TT.

### Bounded refinement types

- Computer ScienceICFP
- 2015

A notion of bounded quantification for refinement types is presented and shown how it expands the expressiveness of refinement typing by using it to develop typed combinators for relational algebra and safe database access and to implement a refined IO monad that tracks capabilities and resource usage.

### Deriving Pre-Conditions for Array Bound Check Elimination

- Computer ScienceAPLAS
- 2000

This approach combines a forward analysis to infer precise contextual constraint at designated program points, and a backward method for deriving a safety precondition for each bound check, resulting in an accurate and fully automatable optimization of array bound check optimization.

### An expressive, scalable type theory for certified code

- Computer ScienceICFP '02
- 2002

The type theory LTT is presented, intended to form a basis for typed target languages, providing an internal notion of logical proposition and proof, and allowing for re-use of typechecking software by casting a variety of type systems within a single language.

### On-Demand Refinement of Dependent Types

- Computer ScienceFLOPS
- 2008

A novel approach to applications of dependent types to practical programming languages is proposed, which mine the output specification of a dependent function from the function's call sites, and then propagate that specification backward to infer the input specification.

### Imperative objects with dependent types

- Computer ScienceFTfJP@ECOOP
- 2015

This work proposes to incorporate a system of index refinements in a small, class-based, imperative, object-oriented language, and designed and implemented an expressive and decidable type system.

### Facilitating program verification with dependent types

- Computer ScienceFirst International Conference onSoftware Engineering and Formal Methods, 2003.Proceedings.
- 2003

It is shown that the use of restricted form of dependent types can enable us to capture many more program invariants such as memory safety while retaining practical type-checking.

### An Introduction to Dependent Type Theory

- BiologyAPPSEM
- 2000

This chapter presents precise theorems, that should hopefully help the reader to understand to which extent statements like "introducing dependent types in a programming language implies that type checking is undecidable", are justified.

### A Type-based Framework for Automatic Debugging

- Computer Science
- 2001

We present a system for automatic debugging in typed functional languages. The system checks program properties specified by a user and finds bugs as well as conditions necessary to avoid them. It…

### Lightweight verification of array indexing

- Computer ScienceISSTA
- 2018

A lightweight type system that certifies, at compile time, that array accesses in the program are in-bounds, specialized to the domain of array bounds-checking is presented.

## References

SHOWING 1-10 OF 30 REFERENCES

### Dependent types in practical programming

- Computer SciencePOPL '99
- 1999

We present an approach to enriching the type system of ML with a restricted form of dependent types, where type index objects are drawn from a constraint domain C, leading to the DML(C) language…

### Shape Checking of Array Programs

- Computer Science
- 1996

A simply-typed lambda-calculus is constructed that supports a vector type constructor, whose iteration yields types of arrays, and is expressive enough to construct all of the usual linear algebra operations.

### Optimizing array bound checks using flow analysis

- Computer ScienceLOPL
- 1993

Experimental results indicate that the number of bound checks performed during the execution of a program is greatly reduced using compile-time optimizations.

### PVS: Combining Specification, Proof Checking, and Model Checking

- Computer ScienceFMCAD
- 1996

We claim that no single technique such as rewriting, BDDs, or model checking is effective for all aspects of hardware verification. Many examples need the careful integration of these techniques. We…

### Refinement types for ML

- Computer SciencePLDI '91
- 1991

A type system called refinement types is described, which is an example of a new way to make this tradeoff, as well as a potentially useful system in itself.

### Singleton, Union and Intersection Types for Program Extraction

- Computer ScienceInf. Comput.
- 1991

It will be shown how singleton, union and intersection types serve for development of programs without unnecessary codes via a variant of the Curry-Howard isomorphism.

### Implementation of an array bound checker

- Computer SciencePOPL
- 1977

This paper describes a system which checks correctness of array accesses automatically without any inductive assertions or human interaction and creates logical assertions immediately before array elements such that these assertions must be true whenever the control passes the assertion in order for the access to be valid.

### The design and implementation of a certifying compiler

- Computer SciencePLDI
- 1998

This paper presents the design and implementation of a compiler that translates programs written in a type-safe subset of the C programming language into highly optimized DEC Alpha assembly language…

### Pvs: Combining Speciication, Proof Checking, and Model Checking ? 1 Combining Theorem Proving and Typechecking

- Computer Science
- 1996

PVS (Prototype Veriication System) is an environment for constructing clear and precise speciications and for developing readable proofs that have been mechanically veriied. It is designed to exploit…

### Experiences with Constraint-based Array Dependence Analysis

- Computer SciencePPCP
- 1994

This paper explores the use of exact constraint analysis, based on Fourier's method, for array data dependence analysis and finds these techniques can be used without a great impact on total compile time.