## Soft typing with conditional types (1994)

### Cached

### Download Links

- [www.cs.cmu.edu]
- [www-2.cs.cmu.edu]
- [www.cs.berkeley.edu]
- DBLP

### Other Repositories/Bibliography

Venue: | In Twenty-First Annual ACM Symposium on Principles of Programming Languages |

Citations: | 187 - 14 self |

### BibTeX

@INPROCEEDINGS{Aiken94softtyping,

author = {Er Aiken},

title = {Soft typing with conditional types},

booktitle = {In Twenty-First Annual ACM Symposium on Principles of Programming Languages},

year = {1994},

pages = {163--173}

}

### Years of Citing Articles

### OpenURL

### Abstract

We present a simple and powerful type inference method for dynamically typed languages where no type information is supplied by the user. Type inference is reduced to the problem of solvability of a system of type inclusion constraints over a type language that includes function types, constructor types, union, intersection, and recursive types, and conditional types. Conditional types enable us to analyze control flow using type inference, thus facilitating computation of accurate types. We demonstrate the power and practicrdity of the method with examples and performance results from an implementation. 1

### Citations

936 | A theory of type polymorphism in progra.mming
- Milner
- 1978
(Show Context)
Citation Context ... the following two lemmas show that the set is very large. Lemma 4.5 A lambda term is a program without constructors or case. Every lambda term is well-typed. The Hindley/Milner type inference system =-=[16]-=- is used in most functional languages. We write `HM e : oe if e has type oe in the Hindley/Milner system. Lemma 4.6 shows that all programs well-typed in the Hindley/Milner system are also well-typed ... |

440 |
Can programming be liberated from the von neumann style? A functional style and its algebra of programs
- Backus
- 1978
(Show Context)
Citation Context ... 8 Implementation There are two implementations of the type inference algorithm presented here: one for L and one for FL [5], a dynamically typed, higher-order functional language based on Backus' FP =-=[4]-=-. The implementation of type inference for L is small (about 100 lines of Lisp code). The implementation for FL is considerably larger (about 1000 lines of Lisp code), reflecting the increased complex... |

358 | Principal type-schemes for functional programs - Damas, Milner - 1982 |

216 | Type inclusion constraints and type inference
- AIKEN, WIMMERS
- 1993
(Show Context)
Citation Context ...rated in a most general derivation. We make use of the following theorem. Theorem 5.4 It is decidable whether systems of proper constraints have solutions. Furthermore, all solutions can be exhibited =-=[3]-=-. The constraints generated by a most general derivation are proper, with an extension to handle conditional types, which are not treated in [3]. A definition of proper constraints and the extension f... |

199 |
Flow analysis and optimization of lisp-like structures
- Jones, D, et al.
- 1979
(Show Context)
Citation Context ... by Cartwright and Fagan [6]. Interest in inferring types for dynamically typed programs began with Reynolds [19]. Since then, numerous algorithms have been proposed, based variously on tree grammars =-=[13, 23]-=-, ad hoc extensions of static type systems [6, 10, 21], abstract interpretation [2, 20], and constraint solving [11, 12]. Many of these techniques are complicated, limited in power, or both. In this p... |

198 | Control flow analysis in Scheme
- Shivers
- 1988
(Show Context)
Citation Context ... began with Reynolds [19]. Since then, numerous algorithms have been proposed, based variously on tree grammars [13, 23], ad hoc extensions of static type systems [6, 10, 21], abstract interpretation =-=[2, 20]-=-, and constraint solving [11, 12]. Many of these techniques are complicated, limited in power, or both. In this paper we present a soft typing system that is both simple and powerful. Our method is si... |

192 | Soft typing
- Cartwright, Fagan
- 1991
(Show Context)
Citation Context ...nguages; how much is regained depends on the power of the type inference algorithm. Type inference systems for dynamically typed languages have been dubbed soft typing systems by Cartwright and Fagan =-=[6]-=-. Interest in inferring types for dynamically typed programs began with Reynolds [19]. Since then, numerous algorithms have been proposed, based variously on tree grammars [13, 23], ad hoc extensions ... |

172 | Refinement types for ML
- Freeman, Pfenning
- 1991
(Show Context)
Citation Context ...phism, or conditional types. The subtyping algorithm of [17] has limited union and intersection types, but no function types. Also related to our work are the refinement types of Freeman and Pfenning =-=[8]-=-. Refinement types include union and intersection types, but not conditional types. For each of the systems listed above, it is immediately apparent that our type language is more expressive, and with... |

126 | An ideal model for recursive polymorphic types - MacQueen, Plotkin, et al. - 1986 |

95 |
Set Based Program Analysis
- Heintze
- 1993
(Show Context)
Citation Context ... then, numerous algorithms have been proposed, based variously on tree grammars [13, 23], ad hoc extensions of static type systems [6, 10, 21], abstract interpretation [2, 20], and constraint solving =-=[11, 12]-=-. Many of these techniques are complicated, limited in power, or both. In this paper we present a soft typing system that is both simple and powerful. Our method is simple because we address a type in... |

76 |
P.: Type inference with subtypes
- Fuh, Mishra
(Show Context)
Citation Context ...o that of [6] in practice. In future work we hope to make some empirical measurements of the strengths and weaknesses of both systems. Outside the realm of dynamically typed languages, Fuh and Mishra =-=[9]-=- and Mitchell [18] have given algorithms for type inference with subtypes. Neither approach incorporates union types, parametric polymorphism, or conditional types. The subtyping algorithm of [17] has... |

64 | Static Type Inference in a Dynamically Typed Language
- Aiken, Murphy
- 1991
(Show Context)
Citation Context ... began with Reynolds [19]. Since then, numerous algorithms have been proposed, based variously on tree grammars [13, 23], ad hoc extensions of static type systems [6, 10, 21], abstract interpretation =-=[2, 20]-=-, and constraint solving [11, 12]. Many of these techniques are complicated, limited in power, or both. In this paper we present a soft typing system that is both simple and powerful. Our method is si... |

58 |
Declaration-free type checking
- Mishra, Reddy
- 1985
(Show Context)
Citation Context ...shra [9] and Mitchell [18] have given algorithms for type inference with subtypes. Neither approach incorporates union types, parametric polymorphism, or conditional types. The subtyping algorithm of =-=[17]-=- has limited union and intersection types, but no function types. Also related to our work are the refinement types of Freeman and Pfenning [8]. Refinement types include union and intersection types, ... |

54 | Efficient inference of partial types
- Kozen, Palsberg, et al.
- 1992
(Show Context)
Citation Context ...yped. Another generalization of the Hindley/Milner system is partial types. In partial types, the type 1 is added to the usual Hindley/Milner types, but there is a different type assignment algorithm =-=[14]-=-. Partial types have the same limited expressive power as Gomard's system, and again the types assigned are not very precise. Closest in spirit to our own work is soft typing [6]. In [6], Cartwright a... |

49 | Implementing regular tree expressions
- Aiken, Murphy
- 1991
(Show Context)
Citation Context ...e---a naive implementation is unusable even for small programs. We have relied heavily on a number of simple optimizations that improve the performance of the constraint solver by orders of magnitude =-=[1]-=-. In the current implementation, only about 10% of the time is spent solving constraints. The majority of the time is spent simplifying the representation of type expressions and determining where dyn... |

49 |
Partial type inference for untyped functional programs (extended abstract
- Gomard
- 1990
(Show Context)
Citation Context ... types for dynamically typed programs began with Reynolds [19]. Since then, numerous algorithms have been proposed, based variously on tree grammars [13, 23], ad hoc extensions of static type systems =-=[6, 10, 21]-=-, abstract interpretation [2, 20], and constraint solving [11, 12]. Many of these techniques are complicated, limited in power, or both. In this paper we present a soft typing system that is both simp... |

40 |
Type inference with partial types
- Thatte
- 1988
(Show Context)
Citation Context ... types for dynamically typed programs began with Reynolds [19]. Since then, numerous algorithms have been proposed, based variously on tree grammars [13, 23], ad hoc extensions of static type systems =-=[6, 10, 21]-=-, abstract interpretation [2, 20], and constraint solving [11, 12]. Many of these techniques are complicated, limited in power, or both. In this paper we present a soft typing system that is both simp... |

37 |
Coercion and type inference (summary
- Mitchell
- 1984
(Show Context)
Citation Context ...practice. In future work we hope to make some empirical measurements of the strengths and weaknesses of both systems. Outside the realm of dynamically typed languages, Fuh and Mishra [9] and Mitchell =-=[18]-=- have given algorithms for type inference with subtypes. Neither approach incorporates union types, parametric polymorphism, or conditional types. The subtyping algorithm of [17] has limited union and... |

36 | Dynamic typing
- Henglein
- 1992
(Show Context)
Citation Context ... then, numerous algorithms have been proposed, based variously on tree grammars [13, 23], ad hoc extensions of static type systems [6, 10, 21], abstract interpretation [2, 20], and constraint solving =-=[11, 12]-=-. Many of these techniques are complicated, limited in power, or both. In this paper we present a soft typing system that is both simple and powerful. Our method is simple because we address a type in... |

15 |
An ideal model for recursive polymophic types
- MacQueen, Plotkin, et al.
- 1986
(Show Context)
Citation Context ... ; 1 ; 2 ; : : :. Types that may be quantified are written oe; oe 1 ; oe 2 ; : : :. For semantics we adopt the ideal model, in which types are certain subsets (called ideals) of the semantic domain D =-=[15]-=-. In the ideal model, every typessatisfies four conditions:sis non-empty, wrong 62s,sis directed-closed (closed under limits), andsis downward-closed, which means that if y 2sand if xsy 1 then x 2s. S... |

3 |
The FL language manual parts 1 and 2
- Backus, Williams, et al.
- 1989
(Show Context)
Citation Context ...here all error variables are replaced by 0 corresponds to a well-typed program. 8 Implementation There are two implementations of the type inference algorithm presented here: one for L and one for FL =-=[5]-=-, a dynamically typed, higher-order functional language based on Backus' FP [4]. The implementation of type inference for L is small (about 100 lines of Lisp code). The implementation for FL is consid... |

2 |
Automatic Computation of Data Set Definitions. Information Processing 68
- Reynolds
- 1969
(Show Context)
Citation Context ...Type inference systems for dynamically typed languages have been dubbed soft typing systems by Cartwright and Fagan [6]. Interest in inferring types for dynamically typed programs began with Reynolds =-=[19]-=-. Since then, numerous algorithms have been proposed, based variously on tree grammars [13, 23], ad hoc extensions of static type systems [6, 10, 21], abstract interpretation [2, 20], and constraint s... |

2 | 1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11 - Aiken, Murphy - 1991 |

1 | Set Based Progmm Anal~sis - HEINTZE - 1992 |