## Semantics of Parametric Polymorphism in Imperative Programming Languages

### BibTeX

@MISC{Dunphy_semanticsof,

author = {Brian P. Dunphy and Uday S. Reddy},

title = {Semantics of Parametric Polymorphism in Imperative Programming Languages},

year = {}

}

### OpenURL

### Abstract

Ada and Modula-3 have included facilities for parametric polymorphism and, more recently, C++ and Java have also added similar facilities. In this paper, we examine the issues of defining denotational semantics for imperative programming languages with polymorphism. We use the framework of reflexive graphs of categories previously developed for a general axiomatization of relational parametricity constraints implicit in polymorphic functions. We specialize it to the context of imperative programming languages, which in turn involve parametricity constraints implicit in local variables. The two levels of parametricity inherent in such languages can be captured in a pleasing way in ”higher-order ” reflexive graphs. 1

### Citations

783 | On understanding types, data abstraction and polymorphism
- Cardelli, Wegner
- 1985
(Show Context)
Citation Context ...intuitions concretely. Vertices are finite maps from sets of location names to data types, written in the form W = {l1: δ1, . . . , ln: δn}. Such store shapes can also be thought of as “record types” =-=[6, 12, 25]-=-. The set of states for a world as shown is S(W ) = ∏ li [δi ]. The set of transformations is T (W ) = [S(W ) → S(W )] and DW is defined by DW (p) = λs. p s s. A vertex morphism W → X exists iff W ⊆ X... |

375 |
Types, abstraction and parametric polymorphism
- Reynolds
- 1983
(Show Context)
Citation Context ...lymorphic in α. It cannot access any of the internal structure of the α-typed information. The semantics of parametric polymorphism has been studied in detail in the context of functional programming =-=[1, 23, 17, 27, 31]-=-. However, its semantics in the imperative programming context has received scant attention. The problem is nontrivial. Imperative programming languages already have elements of parametricity and info... |

299 |
Abstract types have existential type
- Mitchell, Plotkin
- 1988
(Show Context)
Citation Context ...lymorphic in α. It cannot access any of the internal structure of the α-typed information. The semantics of parametric polymorphism has been studied in detail in the context of functional programming =-=[1, 23, 17, 27, 31]-=-. However, its semantics in the imperative programming context has received scant attention. The problem is nontrivial. Imperative programming languages already have elements of parametricity and info... |

165 | The essence of Algol - Reynolds - 1981 |

137 | An indexed model of recursive types for foundational proofcarrying code - Appel, McAllester - 2001 |

125 | A logic for parametric polymorphism
- Plotkin, Abadi
- 1993
(Show Context)
Citation Context ...lymorphic in α. It cannot access any of the internal structure of the α-typed information. The semantics of parametric polymorphism has been studied in detail in the context of functional programming =-=[1, 23, 17, 27, 31]-=-. However, its semantics in the imperative programming context has received scant attention. The problem is nontrivial. Imperative programming languages already have elements of parametricity and info... |

103 | Parametricity and local variables
- O’Hearn, Tennent
- 1995
(Show Context)
Citation Context ...programming context has received scant attention. The problem is nontrivial. Imperative programming languages already have elements of parametricity and information hiding implicit in local variables =-=[16, 20, 18, 25]-=-. Thatis how object-oriented programming is able to provide information hiding even without any explicit type parameters [24]. Parametric polymorphism provides a second layer of information hiding in... |

99 |
Towards fully abstract semantics for local variables: Preliminary report
- Meyer, Sieber
- 1988
(Show Context)
Citation Context ...programming context has received scant attention. The problem is nontrivial. Imperative programming languages already have elements of parametricity and information hiding implicit in local variables =-=[16, 20, 18, 25]-=-. Thatis how object-oriented programming is able to provide information hiding even without any explicit type parameters [24]. Parametric polymorphism provides a second layer of information hiding in... |

59 | Relational reasoning in a nominal semantics for storage - Benton, Leperchey - 2005 |

55 | From Algol to polymorphic linear lambda-calculus
- O’Hearn, Reynolds
(Show Context)
Citation Context ...programming context has received scant attention. The problem is nontrivial. Imperative programming languages already have elements of parametricity and information hiding implicit in local variables =-=[16, 20, 18, 25]-=-. Thatis how object-oriented programming is able to provide information hiding even without any explicit type parameters [24]. Parametric polymorphism provides a second layer of information hiding in... |

51 | Higher-order subtyping
- Pierce, Steffen
- 1997
(Show Context)
Citation Context ...intuitions concretely. Vertices are finite maps from sets of location names to data types, written in the form W = {l1: δ1, . . . , ln: δn}. Such store shapes can also be thought of as “record types” =-=[6, 12, 25]-=-. The set of states for a world as shown is S(W ) = ∏ li [δi ]. The set of transformations is T (W ) = [S(W ) → S(W )] and DW is defined by DW (p) = λs. p s s. A vertex morphism W → X exists iff W ⊆ X... |

43 |
Type algebras, functor categories, and block structure
- Oles
- 1985
(Show Context)
Citation Context ...s. To account for the information hiding implicit in local variables, imperative languages are given a form of possible world semantics using functor categories enriched with relational parametricity =-=[26, 22, 20, 25]-=-. To account for type-based polymorphism and information hiding, we need to construct again what one might call “second-order functors”, enriched with relational parametricity, over the structures obt... |

40 | D.Sannella: Hope: an experimental applicative language
- Burstall
- 1980
(Show Context)
Citation Context ... Introduction Imperative programming languages, dating back to CLU in 1976 [15], have incorporated parametrized types and polymorphic functions. Functional programming languages such as ML [10], Hope =-=[5]-=- and Haskell [13] also use parametric polymorphism in an essential way. But note that ML includes imperative features as well, as do some variants of Haskell. Other imperative languages incorporating ... |

30 | Possible world semantics for general storage in call-by-value - Levy - 2002 |

24 | Algol-like Languages (Two volumes - O’Hearn, Tennent - 1997 |

22 | Objects and classes in Algol-like languages
- Reddy
- 1998
(Show Context)
Citation Context ...ametricity and information hiding implicit in local variables [16, 20, 18, 25]. Thatis how object-oriented programming is able to provide information hiding even without any explicit type parameters =-=[24]-=-. Parametric polymorphism provides a second layer of information hiding in addition to that of local variables. This signifies a rich semantic structure in such programming languages. In this paper, w... |

22 | Correctness of data representations involving heap data structures
- Reddy, Yang
- 2004
(Show Context)
Citation Context |

20 | A relational modal logic for higher-order stateful ADTs - Dreyer, Neis, et al. - 2009 |

19 |
eds). Report on Programming Language Haskell, A Non-strict Purely Functional Language (Version 1.0
- Hudak, Wadler
- 1990
(Show Context)
Citation Context ...perative programming languages, dating back to CLU in 1976 [15], have incorporated parametrized types and polymorphic functions. Functional programming languages such as ML [10], Hope [5] and Haskell =-=[13]-=- also use parametric polymorphism in an essential way. But note that ML includes imperative features as well, as do some variants of Haskell. Other imperative languages incorporating polymorphic featu... |

16 | On functors expressible in the polymorphic typed lambda calculus
- Reynolds, Plotkin
- 1990
(Show Context)
Citation Context ...entations [29]. One way to verify if the parametricity conditions capture enough uniformity is to examine a number of type isomorphisms that are dubbed “initial algebra” and “final coalgebra” results =-=[28]-=-. We examine a few such results that are expressible in the predicative polymorphic calculus. A basic result is to show that the type ∀α. α → α is isomorphic to the terminal object. This should intuit... |

14 | A Metalanguage for Interactive Proof - Gordon, Milner, et al. - 1978 |

13 |
Correctness of data representations in Algol-like languages. In: A Classical Mind: Essays
- Tennent
- 1994
(Show Context)
Citation Context ...phic functions are defined uniformly at all types. If they do, then it becomes possible to prove a variety of program equivalences such as “free” theorems [31] and correctness of data representations =-=[29]-=-. One way to verify if the parametricity conditions capture enough uniformity is to examine a number of type isomorphisms that are dubbed “initial algebra” and “final coalgebra” results [28]. We exami... |

11 | Parametricity as a Notion of Uniformity in Reflexive Graphs
- Dunphy
- 2002
(Show Context)
Citation Context ...yer. To carry out such sophisticated constructions, one needs a suitably general mathematical theory of functors enriched with relational parametricity. Such a theory was defined in our previous work =-=[8, 9]-=- based on O’Hearn and Tennent’s reflexive graph categories [20]. We make essential use of this framework. After defining the constructions, we were surprise to discover that the traditional Reynolds-O... |

7 |
Parametric limits
- Dunphy, Redddy
- 2004
(Show Context)
Citation Context ...yer. To carry out such sophisticated constructions, one needs a suitably general mathematical theory of functors enriched with relational parametricity. Such a theory was defined in our previous work =-=[8, 9]-=- based on O’Hearn and Tennent’s reflexive graph categories [20]. We make essential use of this framework. After defining the constructions, we were surprise to discover that the traditional Reynolds-O... |

3 |
Theorems for free! In: The Fourth
- Wadler
- 1989
(Show Context)
Citation Context |

2 | State-dependent representation independence. In Thirty Sixth Ann - Ahmed, Dreyer, et al. |

2 |
R.D.: A fibrational framework for possible-world semantics of Algol-like languages
- Hermida, Tennent
- 2007
(Show Context)
Citation Context ...reedom, that of morphisms, and is unable to capture relational parametricity conditions. O’Hearn and Tennent [20] proposed the framework of reflexive graphs (of categories) to address this issue. (In =-=[11]-=-, fibrations are proposed to achieve a similar effect. Birkedal and Møgelberg have also used reflexive graph-based models for Plotkin-Abadi logic.) The reflexive graph Set has the category of sets and... |

1 |
An introduction to CLU
- Liskov
- 1975
(Show Context)
Citation Context ...wo levels of parametricity inherent in such languages can be captured in a pleasing way in ”higher-order” reflexive graphs. 1 Introduction Imperative programming languages, dating back to CLU in 1976 =-=[15]-=-, have incorporated parametrized types and polymorphic functions. Functional programming languages such as ML [10], Hope [5] and Haskell [13] also use parametric polymorphism in an essential way. But ... |