Transposing F to C : Expressivity of parametric ... - Semantic Scholar
Recommend Documents
AbstractâChroma representations of musical excerpts are nowadays ... The authors are with the Music Technology Group, Universitat Pompeu. Fabra, Ocata 1 ...
seldom used (Friedman, Ween, & Albert, 1993). Because of the varying ...... Pugh, K. R., Shaywitz, B. A., Shaywitz, S. E., Constable, R. T.,. Skudlarski, P.
parametrically re-equalized using class specific references to reduce the acoustic ... front-ends of speech recognizers in noisy environments [4]â[8]. Two inherent ...
In this paper we shall follow the established || practice of post- ... 1f F. Hausdorff,
Mengenlehre, pp. ... any set B, kB is equal to the limit as /3 increases of MB. By.
Franz Baader, Hans-J urgen B urckert, Bernhard Nebel,. Werner Nutt, and Gert Smolka. German Research Center for Arti cial Intelligence. Saarbr ucken ...
Aug 30, 2009 - http://www.comlab.ox.ac.uk/jeremy.gibbons/. Ross Paterson ...... [12] Cordelia Hall, Kevin Hammond, Simon Peyton Jones, and Philip. Wadler.
UMD, and Daniel Marcus for writing the implementation of P-SPT-FM-D that was used ... [17] Nelson, R. T., R. K. Sarin and R. L. Daniels (1986), Scheduling with ...
on ai; bi]. As in 17, 15], for a vector q = (q1; q2; q3) de ne jjjq1jjj2. 1;E = k+1. X j2=1. Aj2(b2 ?a2) k+1. X j3=1. Aj3(b3 ?a3). Z b1 a1 jq1(x1; g2 j2; g3 j3)j2 dx1; ...
variation in relation to the body mass index. (A Clinical and Biochemical study). Abdullatif A.H. Al-Juboury, B.D.S., Ph.D. (1). Fakhri A. Al-Kaisi, B.D.S., M.Sc. (2).
Dentistry, College of Dentistry, University of Baghdad. (2)Assistant Professor. Department of Pedodontics and Preventive. Dentistry, College of Dentistry, ...
DeFigueiredo, Lions, Nussbaum, A priori estimates and existence of positive solu- tions of semilinear elliptic equations, J. Math. Pures Appl. 61 (1983)).
Aug 16, 2011 - Pushpike J. Thilakarathne1,â, Lieven Clement1,2,Dan Lin1,2, Ziv Shkedy2, ...... Kondapalli, L., Soltani, K., and Lacouture, M.E. (2005).
Oct 31, 2014 - package and standardized across arrays so that the median standard ... calculated using median polish summarization and the custom chip.
that the canonical trace on C ? takes rational values on idempotents. Next, we contribute to the conjecture of idempotents by proving the following result: for a ...
There is a growing recognition that economic development is not âmanna from heavenâ, but the result of a transformation process induced and governed by ...
Abstract. Background: Gluteal muscle contracture (GMC), a debilitating disease, usually starts in early childhood after variable dose of injections around the ...
Sep 5, 2014 - Daphne J. Holt1,2,3*, Emily A. Boeke1, Rick P. F. Wolthusen1,4, Shahin .... have shown that faces are processed âholisticallyâ (Kemp et al.,.
Dec 2, 2010 - deals with the optimal tolerance design for an assembly simultaneously .... not require any tunable parameter, thereby making the .... Illustration.
[email protected] http://www.kth.se/itm/inst?l=en_UK. Abstract: - The ... Ivan V. Kazachkov ...... [29] Kazachkov I.V. Stabilization of the interchange.
nology, Aalborg University, Denmark (phone: +45 96 35 86 72, email: ..... a set of coding templates Ts (different models, model orders, number of bits, etc.). Next ...
Apr 9, 2010 - Gaussian, Wishart, and inverse Wishart distributions. .... For example, for the multivariate Gaussian distribution, the maximum likelihood ...
approach are compared using the StreeterâPhelps model of dissolved oxygen in a ... Carlo sampling and set theory are applied to the StreeterâPhelps example.
University of Houston, Houston, Texas. R. H. Goulding. Oak Ridge National Laboratory, Oak Ridge, Tennessee. M. Light. Los Alamos National Laboratory, Los ...
Feb 5, 2011 - converter; see Fig. 2 for a schematic ... as the KÏ -length vector whose ith element is given by Ai (ejÏ
Transposing F to C : Expressivity of parametric ... - Semantic Scholar
into a forthcoming revision of the Cd programming language supporting parameterized ..... by an instance of a class extending an Arrow type whose method app ...
CONCURRENCY AND COMPUTATION: PRACTICE AND EXPERIENCE Concurrency Computat.: Pract. Exper. 2003; 00:1–7 Prepared using cpeauth.cls [Version: 2002/09/19 v2.02]
Transposing F to C]: Expressivity of parametric polymorphism in an object-oriented language Andrew Kennedy1 and Don Syme1 1
Microsoft Research, Cambridge, U.K.
SUMMARY We present a type-preserving translation of System F (the polymorphic lambda calculus) into a forthcoming revision of the C] programming language supporting parameterized classes and polymorphic methods. The forthcoming revision of Java in JDK 1.5 also makes a suitable target. We formalize the translation using a subset of C] similar to Featherweight Java. We prove that the translation is fully type-preserving and that it preserves behaviour via the novel use of an environment-style semantics for System F. We observe that whilst parameterized classes alone are sufficient to encode the parameterized datatypes and let-polymorphism of languages such as ML and Haskell, it is the presence of dynamic dispatch for polymorphic methods that supports the encoding of the “first-class polymorphism” found in System F and recent extensions to ML and Haskell. key words: Polymorphism, Java, C] , System F, Closure Conversion
1.
Introduction
Parametric polymorphism is a well-known and well-studied feature of declarative programming languages such as Haskell and ML. It ranges in expressive power from the parameterized types and let-polymorphism of core ML, through the parameterized modules of Standard ML and Caml, in which module parameters may themselves contain polymorphic values, right up to full support for first-class polymorphism found in extensions to Haskell [9, 13] and ML [17]. The polymorphic lambda calculus, System F, and its higher-order variant Fω [15] are foundational calculi that capture the range of polymorphic constructs found in such languages. Some object-oriented languages have introduced support for polymorphism. Eiffel supports parameterized classes, whilst extensions to Java such as Pizza, GJ and NextGen [14, 3, 4], the forthcoming version of Java based on GJ [2], and the forthcoming version of C] [10, 6] also support the type-parameterization of static and virtual methods. Received 5 Jan 2003 c 2003 John Wiley & Sons, Ltd. Copyright
2
A. J. KENNEDY AND D. SYME
In this paper we pose the question “what’s the difference?” and show that the combination of parameterized classes and polymorphic virtual methods is sufficient to encode the firstclass notion of polymorphism supported by System F and extensions to ML and Haskell. We demonstrate this through a formal translation of a variant of System F into a subset of C] with polymorphism. The translation is fully type-preserving and preserves the evaluation behaviour of terms. When mentioning C] in the rest of this paper, we assume the inclusion of generics [10]. The paper is structured as follows. We begin by discussing informally the various flavours of polymorphism. In Sections 2 and 3 we define typing and evaluation rules for System F and C] , and in Section 4 we present the formal translation and a proof that it is fully typepreserving. Section 5 proves semantic soundness of the translation by first recasting System F in an environment-style semantics. Section 6 concludes. 1.1.
Core ML polymorphism
The following piece of SML code typifies the use of polymorphism in the core language: datatype ’a Tree = Leaf of ’a | Node of ’a Tree * ’a Tree fun tmap (f : ’a->’b) (t : ’a Tree) = case t of Leaf v => Leaf (f v) | Node(left,right) => Node (tmap f left, tmap f right) val itree = Leaf 5 val stree = tmap Int.toString itree
This code illustrates two aspects to polymorphism in ML: the type-parameterization of types (here, the type parameter ’a to the type Tree) and of functions (implicit type parameters ’a and ’b in the map function). Both aspects of polymorphism also feature in the object-oriented systems of Pizza, GJ, NextGen and Generic C] , where parameterized classes and interfaces play the same role as parameterized types, and polymorphic methods play the role of polymorphic functions. The corresponding Generic C] code suggests that parameterized classes alone are sufficient to achieve a direct encoding of core ML into an object-oriented language with parametric polymorphism: abstract class Tree { } class Leaf : Tree { public A val; public Leaf(A a) { val = a; } } class Node : Tree { public Tree left; public Tree right; public Node(Tree l, Tree r) { left = l; right = r; } } interface Arrow { B apply(A x); }