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}
}
  • H. Xi, F. Pfenning
  • Published 1 May 1998
  • Computer Science
  • Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementation
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… 

Tables from this paper

A Dependently Typed Framework for Static Analysis of Program Execution Costs

TLDR
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

TLDR
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

TLDR
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

TLDR
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

TLDR
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

TLDR
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

  • H. Xi
  • Computer Science
    First International Conference onSoftware Engineering and Formal Methods, 2003.Proceedings.
  • 2003
TLDR
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

TLDR
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

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

TLDR
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

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

TLDR
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

TLDR
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

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

TLDR
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

TLDR
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

TLDR
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

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

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

TLDR
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.