Search among the 163582 resources available in the repository
La especialización de programas es una manera particular de producir programas automáticamente. En ella se utiliza un programa fuente general dado para generar diversas versiones particulares, especializadas, del mismo, cada una resolviendo una instancia particular del problema original. La técnica más conocida y más ampliamente estudiada de especialización de programas es llamada evaluación parcial; se la ha utilizado con éxito en varias áreas de aplicación diferentes. Sin embargo, la evaluación parcial tiene problemas cuando se considera la producción automática de programas con tipos. La especialización de tipos es una forma de especialización de programas que puede producir automáticamente programas con tipos a partir de uno fuente. Comprende diversas técnicas muy poderosas, tales como especialización polivariante, especialización de constructores, conversión de clausuras; es la primera de las variantes de especialización de programas que puede generar tipos arbitrarios a partir de un único programa fuente. Creemos que la especialización de tipos puede ser la base sobre la que desarrollar un marco de producción automática de programas. En esta tesis consideramos la especialización de programas, extendiéndola para producir programas polimórficos. Ilustramos eso considerando un intérprete para un lambda cálculo con tipos a la Hindley-Milner, y especializándolo con cualquier programa objeto para producir un programa residual que sea esencialmente igual que el original. En la búsqueda de la generación de polimorfismo, extendemos la especialización de tipos para que pueda expresar la especialización de programas con información estática incompleta, y probamos que para cada término podemos inferir una especialización particular que puede ser usada para reconstruir cada uno de las otras especializaciones de tal término. Llamamos especialización de tipos principal a tal técnica, debido a la analogía de esta propiedad con la noción de tipos principales. Nuestra presentación clarifica muchos de los problemas existentes en la especialización de tipos, lo cual puede ser usado como una guía en la búsqueda de soluciones para ellos.
In EnglishWhen considering the ways in which programs are produced, the main technique that comes to everybody’s mind is writing by hand. Although derivation techniques and tools for producing programs exist, their application is usually restricted to certain kind of problems, or certain domains (such as parsing generators, or visual interfaces). In those cases where such techniques can be applied, productivity and reliability are highly boosted. For that reason, we are concerned with the automatic production of programs in a general setting. Program specialization is a particular way to produce programs automatically. A given, general source program is used to generate several particular, specialized versions of it, each one solving a particular instance of the original problem. The best-known and thoroughly studied technique for program specialization is called partial evaluation; it has been successfully used in several different application areas. But partial evaluation falls short when automatic production of typed programs is considered. Type specialization is a form of program specialization that can automatically produce typed programs from some general source one. It comprises several powerful techniques, such as polyvariant specialization, constructor specialization, and closure conversion, and it is the first variant of program specialization that can generate arbitrary types from a single source program. We believe that type specialization can be the basis in which to develop a framework for automatic program production. In this thesis we consider type specialization, extending it to produce polymorphic programs. We illustrate that by considering an interpreter for Hindley-Milner typed lambda-calculus, and specializing it to any given object program, producing a residual program that is essentially the same as the original one. In achieving the generation of polymorphism, we extend type specialization to be able to express specialization of programs with incomplete static information, and prove that for each term we can infer a particular specialization that can be used to reconstruct every other for that term. We call that principal type specialization because of the analogy this property has with the notion of principal types. Our presentation clarifies some of the problems existing in type specialization, clarification that can be used as a guide in the search for solutions to them. The presentation is divided in four parts. In the first Part we present Type Specialization in its original form, together with some background material. In Part II we develop the presentation of Principal Type Specialization, explaining all the technical details, offering several examples, and presenting our prototype implementation. In Part III we describe the possibilities of the new formulation, by providing an extension of Type Specialization to generate polymorphic programs. And finally, in the last Part we describe related and future work and conclude. This work is the result of seven years of research, performed during my PhD studies.