Please wait, while we are loading the content...
Please wait, while we are loading the content...
| Content Provider | ACM Digital Library |
|---|---|
| Author | Leivant, Daniel |
| Abstract | The benefits of strong typing to disciplined programming, tocompile-time error detection and to program verification are wellknown. Strong typing is especially natural for functional(applicative) languages, in which function application is thecentral construct, and type matching is therefore a principalprogram correctness check. In practice, however, assigning a typeto each and every expression in a functional program can beprohibitively cumbersome. As expressions are compounded, the taskof assigning a type to each expression and subexpression becomespractically impossible, even more so because the type-expressionsthemselves grow longer. It becomes imperative therefore to designfriendly programming environments that permit the user type-freeprogramming, but that generate fully typed programs in which thetypes of all expressions are inferred by the system from theprogram. For interactive functional programming environments of thekind implemented for the Edinburgh functional programming languageML, a type-inference system is an invaluable tool for on-lineparse-time error detection and debugging.The issue of type inference leads naturally totype-schemes. If all one has of a functional program is adefinition statement such as f(x)=3, then all one cansay of the type of f is that it must be of the form’Ѩint, i.e. --- an instance of the type schemet ¨ int, where t is a type variable. As more ofthe program appears, say x(true)=z, t may berestricted, to bool¨s. We are thereforeinterested in type-schemes, using type parameters(free type variables). All one needs then to obtain a rudimentaryform of generic procedures is a device for type instantiation. Thisfunction is fulfilled in ML by the construct let. Other methods aredescribed in Ü4 below.During the process of inferring a type for a given program, onewould like at each step to find a most general (so-calledprincipal) type scheme for each subexpression, so that typesto be assigned to variables and subexpressions in the sequel may beassumed to be instances of those assigned earlier. The notion ofprincipal type was introduced by Curry and Feys [CF] forCombinatory Logic, and Hindley [Hin] showed that the principal typeexists for any Combinatory Logic expression and that it can befound using J.A. Robinson's Unification algorithm [Rob].The seminalpaper on type-inference for functional programs is Milner's [Mil],where an algorithm W is defined for inferring a type for any MLprogram (without recursively defined types). More recently, Damasand Milner [DM] defined a simple formal calculus of type inference,with respect to which W is proved complete.In this paper we study several aspects of type inference forpolymorphic type disciplines. First, we deal with type inferencefor parametric type systems, that is --- type systems that includesimple types defied over constant types and type variables. Werecast Milner's algorithm W in a general "algebraic" form, whichapplies to a variety of generic type disciplines (Ü2). InÜ3 we present an alternative algorithm V for type inference,fundamentally different from W, which easily accommodates typecoercion and overloading, allows efficient local updates to theuser program, and is more efficient than W for implementations thatallow concurrency.In Ü4 we briefly describe four polymorphic disciplines:type abstraction, type quantification, type conjunction(intersection) and the ML construct let.In Ü5 type inference for the abstraction and quantificationdisciplines is discussed. We point out that the two disciplines arecombinatorially isomorphic, and we outline a type inferencealgorithm for them.Ü6 is devoted to type inference for the conjunctivediscipline. We mention some limitations to type inference here, inparticular --- the fact that the set of typable expressions is noteffectively decidable. Moreover, there is no feasible algorithmthat would type expressions even when these are given with aquantificational typing. This kind of non-effectiveness motivatesour considering a restriction to types where type conjunction ispermitted only at low levels of functionality. Here the level offunctionality of a function (or procedure) is recursively definedas one plus the greatest level of functionality of its arguments.This gives rise to a hierarchy on polymorphic types, a notion thatis equally natural for the type abstraction and type quantificationdisciplines. We show that our algorithm V (of Ü3) can benaturally extended to the restriction of the conjunctive disciplineto types of rank 2 in the hierarchy, and we outline an argumentshowing that already for a low rank, seemingly 3, type inference isnot effectively decidable.In Ü7 we discuss the ML construct let in light of ourprevious results. We point out that the polymorphic discipline ofML is isomorphic to the restriction to rank 2 of each one of theother disciplines. This gives weight to the particular choice ofpolymorphism in ML, and to the completeness of Milner's algorithm Wfor that choice. At the same time, the equivalence suggests moreflexible representations of this discipline (namely --- either theconjunctive or the quantificational disciplines restricted to rank2) in which the anomaly in ML, of legal expressions withwell-formed illegal subexpressions, is avoided. |
| Starting Page | 88 |
| Ending Page | 98 |
| Page Count | 11 |
| File Format | |
| ISBN | 0897910907 |
| DOI | 10.1145/567067.567077 |
| Language | English |
| Publisher | Association for Computing Machinery (ACM) |
| Publisher Date | 1983-01-24 |
| Publisher Place | New York |
| Access Restriction | Subscribed |
| Content Type | Text |
| Resource Type | Article |
National Digital Library of India (NDLI) is a virtual repository of learning resources which is not just a repository with search/browse facilities but provides a host of services for the learner community. It is sponsored and mentored by Ministry of Education, Government of India, through its National Mission on Education through Information and Communication Technology (NMEICT). Filtered and federated searching is employed to facilitate focused searching so that learners can find the right resource with least effort and in minimum time. NDLI provides user group-specific services such as Examination Preparatory for School and College students and job aspirants. Services for Researchers and general learners are also provided. NDLI is designed to hold content of any language and provides interface support for 10 most widely used Indian languages. It is built to provide support for all academic levels including researchers and life-long learners, all disciplines, all popular forms of access devices and differently-abled learners. It is designed to enable people to learn and prepare from best practices from all over the world and to facilitate researchers to perform inter-linked exploration from multiple sources. It is developed, operated and maintained from Indian Institute of Technology Kharagpur.
Learn more about this project from here.
NDLI is a conglomeration of freely available or institutionally contributed or donated or publisher managed contents. Almost all these contents are hosted and accessed from respective sources. The responsibility for authenticity, relevance, completeness, accuracy, reliability and suitability of these contents rests with the respective organization and NDLI has no responsibility or liability for these. Every effort is made to keep the NDLI portal up and running smoothly unless there are some unavoidable technical issues.
Ministry of Education, through its National Mission on Education through Information and Communication Technology (NMEICT), has sponsored and funded the National Digital Library of India (NDLI) project.
| Sl. | Authority | Responsibilities | Communication Details |
|---|---|---|---|
| 1 | Ministry of Education (GoI), Department of Higher Education |
Sanctioning Authority | https://www.education.gov.in/ict-initiatives |
| 2 | Indian Institute of Technology Kharagpur | Host Institute of the Project: The host institute of the project is responsible for providing infrastructure support and hosting the project | https://www.iitkgp.ac.in |
| 3 | National Digital Library of India Office, Indian Institute of Technology Kharagpur | The administrative and infrastructural headquarters of the project | Dr. B. Sutradhar bsutra@ndl.gov.in |
| 4 | Project PI / Joint PI | Principal Investigator and Joint Principal Investigators of the project |
Dr. B. Sutradhar bsutra@ndl.gov.in Prof. Saswat Chakrabarti will be added soon |
| 5 | Website/Portal (Helpdesk) | Queries regarding NDLI and its services | support@ndl.gov.in |
| 6 | Contents and Copyright Issues | Queries related to content curation and copyright issues | content@ndl.gov.in |
| 7 | National Digital Library of India Club (NDLI Club) | Queries related to NDLI Club formation, support, user awareness program, seminar/symposium, collaboration, social media, promotion, and outreach | clubsupport@ndl.gov.in |
| 8 | Digital Preservation Centre (DPC) | Assistance with digitizing and archiving copyright-free printed books | dpc@ndl.gov.in |
| 9 | IDR Setup or Support | Queries related to establishment and support of Institutional Digital Repository (IDR) and IDR workshops | idr@ndl.gov.in |
|
Loading...
|