40 research outputs found

    Deriving overloaded success type schemes in Erlang

    Get PDF
    Erlang is a programming language which brings together the features of functional programming and actor-based concurrency. Although it is a dynamically-typed language, there exists a tool (Dialyzer) that analyses Erlang programs in order to detect type discrepancies at compile-time. This tool is based on the notion of success types, which are overapproximations to the actual semantics of expressions, so that the evaluation of an ‘ill-typed’ expression will eventually fail at runtime. Dialyzer allows programmers to provide their own type specifications. Although such specifications can be polymorphic and overloaded (i.e., reflecting different executing branches) for documentation purposes, the type analysis disregards the information provided by polymorphic type schemes and so does, in some cases, with overloaded types. In this paper we introduce: (1) a type system that allows us to obtain polymorphic overloaded success type schemes for programs, (2) a semantic definition of this kind of types, and (3) correctness results that prove that the adequacy of the obtained types w.r.t. the semantics of expressions

    Extending Liquid Types to Arrays

    Get PDF
    A liquid type is an ordinary Hindley-Milner type annotated with a logical predicate that states the properties satisfied by the elements of that type. Liquid types are a powerful tool for program verification, since programmers can use them to specify pre- and postconditions of their programs, while the predicates of intermediate variables and auxiliary functions are inferred automatically. Type inference is feasible in this context, since the logical predicates within liquid types are constrained to a quantifier-free logic in order to maintain decidability. In this paper we extend liquid types by allowing them to contain quantified properties on arrays, so that they can be used to infer invariants on array-related programs (for example, implementations of sorting algorithms). Although quantified logic is, in general, undecidable, we restrict properties on arrays to a decidable subset introduced by Bradley et al. We describe in detail the extended type system, the verification condition generator, and the iterative weakening algorithm for inferring invariants. After proving the correctness and completeness of these two algorithms, we apply them to find invariants on a set of algorithms involving array manipulations

    Herramienta interactiva de manipulación y corrección de entregas de ejercicios en asignaturas con evaluación continua

    Get PDF
    En este proyecto se extiende el conjunto de herramientas del proyecto Innova-Docencia nº 49 (2016/2017) introduciendo un asistente que permite, de modo interactivo, navegar y realizar operaciones por lotes en todas las entregas de un mismo ejercicio

    Juez automático para el aprendizaje de bases de datos

    Get PDF
    Proponemos desarrollar un juez automático para el aprendizaje de bases de datos. Este sistema web permitirá a los estudiantes practicar con diferentes ejercicios de bases de datos desde casa y recibir retroalimentación inmediata sobre los fallos

    Análisis de propiedades de seguridad y consumo acotado de memoria en un lenguaje funcional sin recolección de basura

    Get PDF
    La mayoría de lenguajes funcionales abstraen al programador del manejo de la memoria. Suelen disponer de un recolector de basura encargado de determinar, en tiempo de ejecución, qué partes de memoria ya no se necesitan y pueden ser liberadas. La principal ventaja de este enfoque es que los programadores no tienen que molestarse con asuntos relativos a la memoria. Sin embargo, este enfoque puramente implícito dificulta la tarea de predecir en tiempo de compilación los tiempos de vida en ejecución de las estructuras de datos. Por el contrario, otros lenguajes delegan completamente el manejo de la memoria en el programador. De este modo, se conoce en tiempo de compilación cuándo se liberan las estructuras de datos. No obstante, este enfoque es proclive a errores, ya que el programador puede, por error, tratar de acceder a zonas de memoria que han sido liberadas (punteros descolgados), debido a comparticiones inesperadas entre las estructuras de datos. Safe es un lenguaje funcional de primer orden que proporciona un enfoque semiexplícito al manejo de la memoria mediante dos mecanismos: regiones (inferidas por el compilador) y ajuste de patrones destructivo (controlado por el programador). De este modo se pretende prescindir de un recolector de basura para liberar las estructuras de datos que ya no se utilizan y, con ello, aumentar la predictibilidad en el uso de memoria por parte de los programas. Esto permitirá diseñar un análisis estático para inferir cotas superiores a la cantidad de memoria que un programa necesita para su ejecución. La incorporación de mecanismos explícitos de destrucción de memoria en un programa implica el riesgo de acceder a memoria ya liberada. El primer objetivo de la tesis es el desarrollo de un análisis para garantizar la seguridad de un programa con respecto a los accesos a memoria (en particular, la ausencia de punteros descolgados). Una vez que el compilador comprueba esta propiedad de seguridad para un programa concreto, el segundo objetivo es la formalización de dicha propiedad en forma de certificado, de modo que pueda ser comprobada automáticamente por el consumidor de dicho programa. Finalmente, se desarrollará un análisis basado en técnicas de interpretación abstracta para inferir cotas superiores al consumo de memoria de programas. Puesto que la meta final del proyecto Safe es la certificación de las propiedades de seguridad y consumo acotado de memoria, en esta tesis se ha puesto especial énfasis en la corrección formal de cada uno de los análisis expuestos. [ABSTRACT]In most functional languages, memory management is delegated to the runtime system. There usually exists a garbage collector in charge of determining, at runtime, which parts of the memory are no longer needed and can be disposed of. The main advantage of this approach is that programmers are not bothered about memory management issues. However, this purely implicit approach makes it difficult to predict, at compile time, the lifetimes of the data structures at runtime. Other languages delegate the task of memory management to the programmer. In this way, the lifetimes of data structures are known at compile time. However, this is an error-prone approach, since the programmer might try to access to memory areas which have been disposed of previously (dangling pointers), mainly due to unexpected sharing between data structures. Safe is a first-order functional language that provides a semiexplicit approach to memory management by means of two mechanisms: regions (inferred by the compiler), and destructive pattern matching (controlled by the programmer). In this way, we can do without a garbage collector to destroy the data structures that are no longer used. As a consequence, the behaviour of programs (regarding memory usage) becomes more predictable, and eases the task of developing a static analysis to infer upper bounds on the memory needs of a program. The incorporation of explicit mechanisms for memory destruction implies the risk of accessing dangling pointers. The first goal of this thesis is to develop a static analysis for guaranteeing the safety of a program with regard to its memory accesses (specifically, the absence of dangling pointers). Once the compiler has checked the presence of this property for a given program, our next goal is to formalize this property as a certificate, so the latter can be automatically checked by the code receiver. Finally, we will develop an abstract interpretation-based analysis for inferring upper bounds to the memory needs of a program. Since the final aim of the Safe project is the certification of pointer-safety properties and bounded memory execution, we have put emphasis on the formal correctness of each analysis

    Inferencia de tipos seguros en un lenguaje funcional con destrucción explícita de memoria

    Get PDF
    En este trabajo se describirá con detalle el diseño e implementación de un algoritmo de inferencia para un lenguaje funcional con manejo de regiones y destrucción explícita de memoria, llamado SAFE. Este algoritmo permite trabajar de modo seguro con estructuras de datos, ya que a partir del código fuente de un programa escrito en SAFE garantiza que durante la ejecución del mismo no se producirán accesos a zonas de la memoria ya liberadas

    Rigid Body Simulation

    Get PDF
    Los sólidos rígidos son un caso especial de un sistema de partículas, donde la distancia relativa entre dos puntos cualquiera del sistema permanece constante. El objetivo de nuestro proyecto es el desarrollo e implementación en lenguaje C++ de una API que permita modelar y simular el comportamiento de los sólidos rígidos. Este comportamiento tiene dos facetas: la correspondiente a cada cuerpo en solitario (translaciones, rotaciones) y la debida al contacto entre varios (colisión y equilibrio). Para ello es necesario aplicar conceptos relacionados con la mecánica (cinemática y dinámica del sólido rígido), el análisis numérico (métodos de resolución de ecuaciones diferenciales ordinarias) y la geometría computacional (detección de colisiones). Además de la API hemos desarrollado varios ejemplos que muestran diversas capacidades de ésta. Para la visualización de estos ejemplos hemos utilizado la librería gráfica OpenGL. No obstante, se ha procurado que la representación gráfica de las escenas simuladas sea completamente independiente de su estructura interna. El resultado de este proyecto puede ser aplicado a diversos campos, como la programación de videojuegos y simulación de sistemas físicos. [ABSTRACT] Rigid bodies are a special case of particle systems where the relative distance between each pair of points of the system remain constant. Our project’s aim is to develop and provide a C++ implementation of an API which allow us to model and simulate rigid bodies’ behaviour, which has two aspects: the one corresponding to each body by itself (translations and rotations) and the one due to contact among bodies (collision and balance). In order to achieve this, concepts related to rigid body mechanics (kinematics and kinetics), numerical analysis (ordinary differential equations solving methods) and computational geometry (collision detection) must be applied. In addition to this API, several examples have been developed to show its capabilities. OpenGL graphics library has been used to render these examples. However, our purpose was to isolate the graphical representation of simulated scenes of its inner structure. Our project’s result can be applied to many areas, like game programming and simulation of physical systems

    Estudio de viabilidad de un entorno de aprendizaje colaborativo de lenguajes de programación

    Get PDF
    En este trabajo proponemos un sistema colaborativo para aprendizaje de lenguajes de programació
    corecore