## Calculating Sized Types (2001)

### Cached

### Download Links

- [www.comp.nus.edu.sg]
- [www.comp.nus.edu.sg]
- [www.comp.nus.edu.sg]
- [www.comp.nus.edu.sg]
- DBLP

### Other Repositories/Bibliography

Venue: | Higher-Order and Symbolic Computation |

Citations: | 59 - 10 self |

### BibTeX

@INPROCEEDINGS{Chin01calculatingsized,

author = {Wei-ngan Chin and Siau-cheng Khoo},

title = {Calculating Sized Types},

booktitle = {Higher-Order and Symbolic Computation},

year = {2001},

pages = {62--72},

publisher = {ACM}

}

### Years of Citing Articles

### OpenURL

### Abstract

Many program optimizations and analyses, such as array-bounds checking, termination analysis, etc, depend on knowing the size of a function's input and output. However, size information can be dicult to compute. Firstly, accurate size computation requires detecting a size relation between different inputs of a function. Secondly, different optimizations and analyses may require slightly different size information, and thus slightly different computation. Literature in size computation has mainly concentrated on size checking, instead of size inference. In this paper, we provide a generic framework on which di erent size variants can be expressed and computed. We also describe an effective algorithm for inferring, instead of checking, size information. Size information are expressed in terms of Presburger formulae, and our algorithm utilizes the Omega Calculator to compute as exact a size information as possible, within the linear arithmetic capability.

### Citations

1535 |
Theory of Linear and Integer Programming
- Schrijver
- 1986
(Show Context)
Citation Context ...umber of disjuncts A well-known method for combining multiple disjuncts is the convex hull computation. Computation of convex hull is described in Schrijver's Theory of Linear and Integer Programming =-=[25]-=-. While this method can sometimes be computationally expensive, and its result too general, we can reduce both its complexity and generality by an intelligent (and automatic) selection of suitable dis... |

598 | Automatic discovery of linear restraints among variables of a program
- Cousot, Halbwachs
- 1978
(Show Context)
Citation Context ... be rewritten as local functions. This aects code reuse. Research into the inference of linear constraints dates back to 1970's, with the seminal work of Cousot and Halbwachs on imperative languages [=-=7]-=-. Halbwachs has applied linear constraints to synchronization analysis of reactive systems [10, 11]. In their work, a constraint is described by a set of linear inequalities, and the technique relies ... |

474 | The Omega test: a fast and practical integer programming algorithm for data dependence analysis
- Pugh
- 1992
(Show Context)
Citation Context ...here exist ecient tools for solving these formulae. Secondly, Presburger formulae can be used to capture the size information in a wide range of practical applications. We employ the Omega Calculator =-=[24]-=- for solving and inferring suitable Presburger formulae in our size computation. The entire computation is divided into two steps: Thesrst step computes the relation hosc.tex; 7/05/2001; 14:10; p.2 3 ... |

299 | Dependent types in practical programming
- Xi, Pfenning
- 1999
(Show Context)
Citation Context ...ally-typed parameters. We leave this interesting issue as one of the future works. 5.1. The Meaning of Size The term size can have various meanings. In Xi and Pfenning's work on dependent type system =-=[30-=-], users can specify a specic meaning of size through a size annotation on the data declaration. To specify the rules for size computation, we require an understanding of what sizes mean. While our wo... |

175 | Eliminating Array Bound Checking Through Dependent Types
- Xi, Pfenning
- 1998
(Show Context)
Citation Context ...ram, or the termination of a transformation process, such as partial evaluation (eg., [9, 15]). The literature on size computation has mainly concentrated on size checking, instead of size inference (=-=[16, 29]-=-). In this paper, we aim to infer as accurate size information as possible for various optimizations and analyses. In the case of append , we can express its size (and its type) as follows: append :: ... |

142 | Type inference with polymorphic recursion
- Henglein
- 1993
(Show Context)
Citation Context ...ry since dierent recursive calls can, and do have dierent call contexts. Introducing new size variables at each call enables capturing of these contextual constraints. It has been shown by Henglein [1=-=2]-=- that type inference algorithm for polymorphic recursion is incomplete. For our type system, our type inference algorithm is incomplete for another reason: the limitation of the Omega's transitive-clo... |

141 |
Termination of logic programs: the never-ending story
- Schreye, Decorte
- 1993
(Show Context)
Citation Context ...parison. Linear constraints have also received much attention in logic programming community, particularly in the inference of argument sizes for the purpose of termination analysis of logic programs =-=[8]-=-. One such approach is pioneered by Ullman and Van Gelder [28], which has spurred substantial development [2, 3, 23, 26, 27]. In this approach, size information is represented via a restricted form of... |

128 | Proving the correctness of reactive systems using sized types
- Hughes, Pareto, et al.
- 1996
(Show Context)
Citation Context ...ram, or the termination of a transformation process, such as partial evaluation (eg., [9, 15]). The literature on size computation has mainly concentrated on size checking, instead of size inference (=-=[16, 29]-=-). In this paper, we aim to infer as accurate size information as possible for various optimizations and analyses. In the case of append , we can express its size (and its type) as follows: append :: ... |

115 | Veri of real-time systems using linear relation analysis
- Halbwachs, Proy, et al.
- 1997
(Show Context)
Citation Context ...r constraints dates back to 1970's, with the seminal work of Cousot and Halbwachs on imperative languages [7]. Halbwachs has applied linear constraints to synchronization analysis of reactive systems =-=[10, 1-=-1]. In their work, a constraint is described by a set of linear inequalities, and the technique relies on an eective widening operation to obtainsxed point of polyhedra. Our method diers from their wo... |

96 |
Type inference with constrained types. Theory and Practice of Object Systems
- Odersky, Sulzmann, et al.
- 1999
(Show Context)
Citation Context ... t P ) and the join (denoted by u P ) operator respectively, : is the complement, and False and True are bottom and top elements, respectively. The algebra has the following cylindrication properties[21, 22]. P1. ` P 9 v: P2. ` Psimplies 9 v : ` P 9 v:sP3. 9 v : ( ^ 9 v :s) = P (9 v:) ^ (9 v: ) P4. 9 v : 9 w : = P 9 w : 9 v:. In the above, ` P denotes logical entailment. We say that entails... |

75 |
Cylindric Algebras Part
- Henkin, Monk, et al.
- 1985
(Show Context)
Citation Context ...on and formulae on both positive and negative integers. In this paper, Presburger formulae are simplied and satised via the Omega calculator[24]. We view our constraint system as a cylindric algebra[1=-=3-=-], where constraints are identied modulo logical equivalence. Cylindric algebra provides an algebraic-style reasoning about the formulae. Our cylindric algebra, P, is a boolean algebra where existenti... |

75 |
Termination Proofs for Logic Programs
- PluÌˆmer
(Show Context)
Citation Context ... the inference of argument sizes for the purpose of termination analysis of logic programs [8]. One such approach is pioneered by Ullman and Van Gelder [28], which has spurred substantial development =-=[2, 3, 23, 26, 2-=-7]. In this approach, size information is represented via a restricted form of predicate inequalities (usually without disjunction of constraints). For example, constraints of the form i 2 I p i +sp ... |

74 |
Grundlagen der Mathematik
- Hilbert, Bernays
- 1939
(Show Context)
Citation Context ...9 X : or 9 v 1 : : : v n : instead of 9 v 1 : : : : : 9 v n : . The basic Presburger algorithm that decides the validity (or satisability) of Presburger formulae is given by Hilbert and Bernays [14]. D.C. Cooper [6] extends the algorithm to include subtraction and formulae on both positive and negative integers. In this paper, Presburger formulae are simplied and satised via the Omega calculat... |

68 |
Efficient tests for top-down termination of logical rules
- Ullman
- 1988
(Show Context)
Citation Context ... in logic programming community, particularly in the inference of argument sizes for the purpose of termination analysis of logic programs [8]. One such approach is pioneered by Ullman and Van Gelder =-=[28]-=-, which has spurred substantial development [2, 3, 23, 26, 27]. In this approach, size information is represented via a restricted form of predicate inequalities (usually without disjunction of constr... |

48 | A.: Inferring Argument Size Relationships with CLP(R
- Benoy, King
- 1996
(Show Context)
Citation Context ...stly, separate size information for nested data structures is not captured. King et al. also look into the use of linear constraints in program analysis, both in computing argument-size relationships =-=[1]-=- and in timecomplexity analysis [20]. Their work is in the context of constraint logic programs. The main purpose of this analysis is to detect termination. The technique employed is the polyhedra ana... |

43 |
Finiteness analysis
- Holst
- 1991
(Show Context)
Citation Context ...ns constant in size. Such information is useful for analyzing, among other properties, the termination of the program, or the termination of a transformation process, such as partial evaluation (eg., =-=[9, 15]-=-). The literature on size computation has mainly concentrated on size checking, instead of size inference ([16, 29]). In this paper, we aim to infer as accurate size information as possible for variou... |

41 |
Termination detection in logic programs using argument sizes
- Sohn, Gelder
- 1991
(Show Context)
Citation Context ... the inference of argument sizes for the purpose of termination analysis of logic programs [8]. One such approach is pioneered by Ullman and Van Gelder [28], which has spurred substantial development =-=[2, 3, 23, 26, 2-=-7]. In this approach, size information is represented via a restricted form of predicate inequalities (usually without disjunction of constraints). For example, constraints of the form i 2 I p i +sp ... |

34 | Dynamic partitioning in analyses of numerical properties
- Jeannet, Halbwachs, et al.
- 1999
(Show Context)
Citation Context ...ion. (4) A polyhedra alone cannot be used to express disjunctive constraints. Thus, it cannot be used to describe the lexicographical ordering of input to ack function. Jeannet, Halbwachs and Raymond =-=[17]-=- recently described a way to statically partition a linear relation to improve the precision of their analysis. This new method is similar to the introduction of disjunction in a linear relation; furt... |

34 | Termination analysis for Mercury
- Speirs, Somogyi, et al.
- 1997
(Show Context)
Citation Context ... the inference of argument sizes for the purpose of termination analysis of logic programs [8]. One such approach is pioneered by Ullman and Van Gelder [28], which has spurred substantial development =-=[2, 3, 23, 26, 2-=-7]. In this approach, size information is represented via a restricted form of predicate inequalities (usually without disjunction of constraints). For example, constraints of the form i 2 I p i +sp ... |

27 |
About synchronous programming and abstract interpretation
- Halbwachs
- 1994
(Show Context)
Citation Context ...r constraints dates back to 1970's, with the seminal work of Cousot and Halbwachs on imperative languages [7]. Halbwachs has applied linear constraints to synchronization analysis of reactive systems =-=[10, 1-=-1]. In their work, a constraint is described by a set of linear inequalities, and the technique relies on an eective widening operation to obtainsxed point of polyhedra. Our method diers from their wo... |

26 |
Inference of inequality constraints in logic programs
- Brodsky, Sagiv
- 1991
(Show Context)
Citation Context |

24 | BTA algorithms to ensure termination of offline partial evaluation - Glenstrup, Jones |

24 | Transitive closure of infinite graphs and its applications - KELLY, PUGH, et al. - 1996 |

18 | Lower-bound time-complexity analysis of logic programs
- King, Shen, et al.
- 1997
(Show Context)
Citation Context ... nested data structures is not captured. King et al. also look into the use of linear constraints in program analysis, both in computing argument-size relationships [1] and in timecomplexity analysis =-=[20]-=-. Their work is in the context of constraint logic programs. The main purpose of this analysis is to detect termination. The technique employed is the polyhedra analysis proposed by Cousot and Halbwac... |

16 |
Typed norms
- Bossi, Cocco, et al.
- 1992
(Show Context)
Citation Context |

13 |
The Omega Library, Version 1.1.0 Interface Guide. omega@cs.umd.edu. http://www.cs.umd.edu/projects/omega
- Kelly, Maslov, et al.
- 1996
(Show Context)
Citation Context ... that are not known to the Omega Library. Such constraints can arise from the need to approximate during computation, such as the uses of transitive closure. We refer the readers to the related paper =-=[18]-=- for detail discussion. hosc.tex; 7/05/2001; 14:10; p.33 34 In thesrst two cases, when upper bound(closure(U)) 4 fails to produce U + , the result is a lower bound of U + (see Section 6.4 of [18]). We... |

10 |
M.: A Bounds Inference Method for Vector-Based Memoisation
- Chin, Hagiya
- 1997
(Show Context)
Citation Context ...ector-Based Memoisation Sized types can also be used to determine the sizes of the vectors needed to avoid the re-computation of repeated calls, through a technique known as dynamic-sized memoisation [4]. A simple example is the following binomial function with exponential time complexity: bin :: (Int n ; Int k ) ! Int p s.t. inv (k + ; 1 ksn) ^ (k + ; 1 n +sn) ^ (k + n + n + k + ) ^ 0 k + bi... |

9 | Deriving pre-conditions for array bound check elimination
- Chin, Khoo, et al.
- 2001
(Show Context)
Citation Context ...tic inference of sized types presents a new challenge. With the help of automatic size type inference, we have recently formulated a new approach to identifying and eliminating redundant bounds check =-=[5]-=-. Our approach is able to identify both totally-redundant and partially-redundant bound checks. In the case of partially-redundant bound checks, we make use of a program specialisation to strengthen t... |

2 |
Transitive closure of in graphs and its applications
- Kelly, Pugh, et al.
- 1994
(Show Context)
Citation Context ... approximation of thesxed point of the sized type of the recursive function. The leastsxed point of a formula is also called its transitive closure, borrowing the terminology from Kelly, Pugh, et al. =-=[1-=-9]. We shall use the terms leastsxed point and transitive closure interchangeably. Before dening transitive closure of a formula, we dene the formulacomposition operation as follows: DEFINITION 4 (For... |

2 |
Parametric polymorphic type inference in constraint form
- Nishimura
- 2000
(Show Context)
Citation Context ... t P ) and the join (denoted by u P ) operator respectively, : is the complement, and False and True are bottom and top elements, respectively. The algebra has the following cylindrication properties[21, 22]. P1. ` P 9 v: P2. ` Psimplies 9 v : ` P 9 v:sP3. 9 v : ( ^ 9 v :s) = P (9 v:) ^ (9 v: ) P4. 9 v : 9 w : = P 9 w : 9 v:. In the above, ` P denotes logical entailment. We say that entails... |

2 | De Schreye and S Decorte. Termination of logic programs: The never-ending story - unknown authors - 1994 |

2 | 13] William Pugh. The omega test: A fast practical integer programming algorithm for dependence analysis - Verlag - 1990 |

1 |
Programs for mechanical program veri
- Cooper
- 1971
(Show Context)
Citation Context ... : : v n : instead of 9 v 1 : : : : : 9 v n : . The basic Presburger algorithm that decides the validity (or satisability) of Presburger formulae is given by Hilbert and Bernays [14]. D.C. Cooper [6] extends the algorithm to include subtraction and formulae on both positive and negative integers. In this paper, Presburger formulae are simplied and satised via the Omega calculator[24]. We view o... |

1 |
BTA algorithms to ensure termination of o- line partial evaluation
- Glenstrup, Jones
- 1996
(Show Context)
Citation Context ...ns constant in size. Such information is useful for analyzing, among other properties, the termination of the program, or the termination of a transformation process, such as partial evaluation (eg., =-=[9, 15]-=-). The literature on size computation has mainly concentrated on size checking, instead of size inference ([16, 29]). In this paper, we aim to infer as accurate size information as possible for variou... |