Results 1 - 10
of
16
Eliminating Array Bound Checking Through Dependent Types
- In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation
, 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 s ..."
Abstract
-
Cited by 162 (24 self)
- Add to MetaCart
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 effectiveness of our approach. 1 Introduction The absence of run-time array bound checks is an infamous source of fatal errors for programs in languages such as C. Nonetheless, compilers offer the option to omit array bound checks, since they can turn out to be expensive in practice (Chow 1983; Gupta 1994). In statically typed languages such as ML, one would like to provide strong guarantees about the safety of all operations, so array bound checks cannot be omitted in general. The same is true for Ja...
A Monadic Calculus for Parallel Costing of a Functional Language of Arrays
- Euro-Par'97 Parallel Processing, volume 1300 of Lecture Notes in Computer Science
, 1997
"... . Vec is a higher-order functional language of nested arrays, which includes a general folding operation. Static computation of the shape of its programs is used to support a compositional cost calculus based on a cost monad. This, in turn, is based on a cost algebra, whose operations may be customi ..."
Abstract
-
Cited by 24 (9 self)
- Add to MetaCart
. Vec is a higher-order functional language of nested arrays, which includes a general folding operation. Static computation of the shape of its programs is used to support a compositional cost calculus based on a cost monad. This, in turn, is based on a cost algebra, whose operations may be customized to handle different cost regimes, especially for parallel programming. We present examples based on sequential costing and on the PRAM model of parallel computation. The latter has been implemented in Haskell, and applied to some linear algebra examples. 1 Introduction Second-order combinators such as map, fold and zip provide programmers with a concise, abstract language for writing skeletons for implicitly parallel programs, as in [Ski94], but there is a hitch. These combinators are defined for list programs (see [BW88]), but efficient implementations (which is the point of parallelism, after all) are based on arrays. This disparity becomes acute when working with nested arrays, which...
The Functional Imperative: Shape!
- 7th European Symposium on Programming, ESOP'98 Held as part of the joint european conferences on theory and practice of software, ETAPS'98
, 1997
"... Introduction FiSh is a new programming language for array computation that compiles higher-order polymorphic programs into simple imperative programs expressed in a sub-language Turbot, which can then be translated into, say, C. Initial tests show that the resulting code is extremely fast: two orde ..."
Abstract
-
Cited by 20 (7 self)
- Add to MetaCart
Introduction FiSh is a new programming language for array computation that compiles higher-order polymorphic programs into simple imperative programs expressed in a sub-language Turbot, which can then be translated into, say, C. Initial tests show that the resulting code is extremely fast: two orders of magnitude faster than Haskell, and two to four times faster than Objective Caml, one of the fastest ML variants for array programming. Every functional program must ultimately be converted into imperative code, but the mechanism for this is often hidden. FiSh achieves this transparently, using the "equation" from which it is named: Functional = Imperative + Shape Shape here refers to the structure of data, e.g. the length of a vector, or the number of rows and columns of a matrix. The FiSh compiler reads the equation from left to right: it converts functions into procedures by using
Eekelen. Polynomial size analysis of first-order functions
, 2007
"... Abstract. We present a size-aware type system for first-order shapely function definitions. Here, a function definition is called shapely when the size of the result is determined exactly by a polynomial in the sizes of the arguments. Examples of shapely function definitions may be matrix multiplica ..."
Abstract
-
Cited by 19 (10 self)
- Add to MetaCart
Abstract. We present a size-aware type system for first-order shapely function definitions. Here, a function definition is called shapely when the size of the result is determined exactly by a polynomial in the sizes of the arguments. Examples of shapely function definitions may be matrix multiplication and the Cartesian product of two lists. The type checking problem for the type system is shown to be undecidable in general. We define a natural syntactic restriction such that the type checking becomes decidable, even though size polynomials are not necessarily linear or monotonic. Furthermore, a method that infers polynomial size dependencies for a non-trivial class of function definitions is suggested. 1
A Transformational Approach which Combines Size Inference and Program Optimization
- Semantics, Applications, and Implementation of Program Generation (SAIG’01), Lecture Notes in Computer Science 2196
, 2001
"... If functional programs are to be used for high-performance computing, efficient data representations and operations must be provided. Our contribution is a calculus for the analysis of the lengths of (nested) lists and a transformation into a form which is liberated from the chain of cons-operations ..."
Abstract
-
Cited by 6 (0 self)
- Add to MetaCart
If functional programs are to be used for high-performance computing, efficient data representations and operations must be provided. Our contribution is a calculus for the analysis of the lengths of (nested) lists and a transformation into a form which is liberated from the chain of cons-operations and which sometimes permits array implementations even if the length depends on run-time values. A major advantage of functional programs vs. imperative programs is that dependence analysis is much easier, due to the absence of reassignments. One severe disadvantage of functional programs as of yet is that efficient, machine-oriented data structures (like the array) absolutely necessary for high-performance computing play a minor role in many language implementations since they do not harmonize with functional evaluation schemata (like graph reduction), which are at a higher level of abstraction. We propose to construct programs by composition of skeletons, i.e., functi...
Compilation of a Specialized Functional Language for Massively Parallel Computers
- Journal of Functional Programming
, 2000
"... We propose a parallel specialized language that ensures portable and cost-predictable implementations on parallel computers. The language is basically a first-order, recursion-less, strict functional language equipped with a collection of higher-order functions or skeletons. These skeletons apply on ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
We propose a parallel specialized language that ensures portable and cost-predictable implementations on parallel computers. The language is basically a first-order, recursion-less, strict functional language equipped with a collection of higher-order functions or skeletons. These skeletons apply on (nested) vectors and can be grouped in four classes: computation, reorganization, communication, and mask skeletons. The compilation process is described as a series of transformations and analyses leading to spmd-like functional programs which can be directly translated into real parallel code. The language restrictions enforce a programming discipline whose benefit is to allow a static, symbolic, and accurate cost analysis. The parallel cost takes into account both load balancing and communications, and can be statically evaluated even when the actual size of vectors or the number of processors are unknown. It is used to automatically select the best data distribution among a set of standard distributions. Interestingly, this work can be seen as a cross fertilization between techniques developed within the Fortran parallelization, skeleton, and functional programming communities.
Polynomial size analysis of first-order shapely functions
- Logic in Computer Science
"... Abstract. We present a size-aware type system for first-order shapely function definitions. Here, a function definition is called shapely when the size of the result is determined exactly by a polynomial in the sizes of the arguments. Examples of shapely function definitions may be implementations o ..."
Abstract
-
Cited by 3 (3 self)
- Add to MetaCart
Abstract. We present a size-aware type system for first-order shapely function definitions. Here, a function definition is called shapely when the size of the result is determined exactly by a polynomial in the sizes of the arguments. Examples of shapely function definitions may be implementations of matrix multiplication and the Cartesian product of two lists. The type system is proved to be sound w.r.t. the operational semantics of the language. The type checking problem is shown to be undecidable in general. We define a natural syntactic restriction such that the type checking becomes decidable, even though size polynomials are not necessarily linear or monotonic. Furthermore, we have shown that the type-inference problem is at least semi-decidable (under this restriction). We have implemented a procedure that combines run-time testing and type-checking to automatically obtain size dependencies. It terminates on total typable function definitions. 2000 ACM Subject Classification: F.4.1[Mathematical logic and formal languages]: Mathematical logic – Lambda calculus and related systems, Logic and constraint programming; F.2.2 [Analysis of algorithms and
Polymorphism Over Nested Regular Arrays: Theory and Implementation in
, 1998
"... this paper we introduce a wider range of benchmarks, 4 ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
this paper we introduce a wider range of benchmarks, 4
Poly-dimensional Array Programming
- Partial Evaluation and Automatic Program Generation. International Series in Computer Science
, 1998
"... . FISh is the first language to support a poly-dimensional, data polymorphic type constructor for regular arrays. Now a fully-typed program may take a vector, matrix or higher-dimensional regular array as argument. Regularity is defined using shape theory, which was also used to guide the language d ..."
Abstract
-
Cited by 2 (2 self)
- Add to MetaCart
. FISh is the first language to support a poly-dimensional, data polymorphic type constructor for regular arrays. Now a fully-typed program may take a vector, matrix or higher-dimensional regular array as argument. Regularity is defined using shape theory, which was also used to guide the language design, e.g. by justifying the exclusion of arrays of functions. Regularity is enforced by static shape analysis which determines the shape of all arrays during compilation. As well as supporting poly-dimensional programming, it detects all shape errors, a common source of array bound errors. Further, shape analysis supports an aggressive compilation strategy, that compiles FISh programs into simple, efficient C programs. Thus FISh combines the expressive power of higher-order polymorphic programming with the speed of simple imperative programming. Version 1 is available over the internet. Key words: poly-dimensional arrays, FISh, shape analysis 1 Introduction FISh is the first language to s...
A Size-Aware Type System with Algebraic Data Types With proofs of soundness and decidability
"... Abstract. We present a size-aware type system for a first-order functional language with algebraic data types, where types are annotated with polynomials over size variables. We define how to generate typing rules for each data type, provided its user defined size function meets certain requirements ..."
Abstract
-
Cited by 2 (2 self)
- Add to MetaCart
Abstract. We present a size-aware type system for a first-order functional language with algebraic data types, where types are annotated with polynomials over size variables. We define how to generate typing rules for each data type, provided its user defined size function meets certain requirements. As an example, a program for balancing binary trees is type checked. The type system is shown to be sound with respect to the operational semantics in the class of shapely functions. Type checking is shown to be undecidable, however, decidability for a large subset of programs is guaranteed.

