368 research outputs found
Automatic Inference of Determinacy and Mutual Exclusion for Logic Programs Using Mode and Type Analyses
We propose an analysis for detecting procedures and goals
that are deterministic (i.e., that produce at most one solution at most once),or predicates whose clause tests are mutually exclusive (which implies that at most one of their clauses will succeed) even if they are not deterministic.
The analysis takes advantage of the pruning operator in order to improve the detection of mutual exclusion and determinacy. It also supports arithmetic equations and disequations, as well as equations and disequations on terms,for which we give a complete satisfiability testing algorithm, w.r.t. available type information. Information about determinacy can be used for program debugging and optimization, resource consumption and granularity control,
abstraction carrying code, etc. We have implemented the analysis and integrated it in the CiaoPP system, which also infers automatically the mode and type information that our analysis takes as input. Experiments performed on this implementation show that the analysis is fairly accurate and efficient
Inferring determinacy and mutual exclusion in logic programs using mode and type analysis.
We propose an analysis for detecting procedures and goals that are deterministic (i.e., that produce at most one solution at most once), or predicates whose clause tests are mutually exclusive (which implies that at most one of their clauses will succeed) even if they are not deterministic. The analysis takes advantage of the pruning operator in order to improve the detection of mutual exclusion and determinacy. It also supports arithmetic equations and disequations, as well as equations and disequations on terms, for which we give a complete satisfiability testing algorithm, w.r.t. available type information. We have implemented the analysis and integrated it in the CiaoPP system, which also infers automatically the mode and type information that our analysis takes as input. Experiments performed on this implementation show that the analysis is fairly accurate and efficient
Towards an Abstract Domain for Resource Analysis of Logic Programs Using Sized Types
We present a novel general resource analysis for logic programs based on
sized types.Sized types are representations that incorporate structural (shape)
information and allow expressing both lower and upper bounds on the size of a
set of terms and their subterms at any position and depth. They also allow
relating the sizes of terms and subterms occurring at different argument
positions in logic predicates. Using these sized types, the resource analysis
can infer both lower and upper bounds on the resources used by all the
procedures in a program as functions on input term (and subterm) sizes,
overcoming limitations of existing analyses and enhancing their precision. Our
new resource analysis has been developed within the abstract interpretation
framework, as an extension of the sized types abstract domain, and has been
integrated into the Ciao preprocessor, CiaoPP. The abstract domain operations
are integrated with the setting up and solving of recurrence equations for
both, inferring size and resource usage functions. We show that the analysis is
an improvement over the previous resource analysis present in CiaoPP and
compares well in power to state of the art systems.Comment: Part of WLPE 2013 proceedings (arXiv:1308.2055
Static Analysis-based Debugging, Certification, Testing, and Optimization with CiaoPP
Facilitate the development of safe, efficient programs.
Approach:
•Next-generation, higher-level, multiparadigm prog. languages.
•Improved program development environments.
•A framework (CiaoPP) which integrates:
•Debugging.
•Verification and certification.
•Testing.
•Optimization (optimized compilation, parallelization, ...
An overview of ciao and its design philosophy
We provide an overall description of the Ciao multiparadigm programming system emphasizing some of the novel aspects and motivations behind its design and implementation. An important aspect of Ciao is that, in addition to supporting logic programming (and, in particular, Prolog), it provides the programmer with a large number of useful features from different programming paradigms and styles and that the use of each of these features (including those of Prolog) can be turned on and off at will for each program module. Thus,
a given module may be using, e.g., higher order functions and constraints, while another module may be using assignment, predicates, Prolog meta-programming, and concurrency. Furthermore, the language is designed to be extensible in a simple and modular way. Another important aspect of Ciao is its programming environment, which provides a powerful preprocessor (with an associated assertion language) capable of statically finding non-trivial bugs, verifying that programs comply with specifications, and performing many types of optimizations (including automatic parallelization). Such optimizations produce code that is highly competitive with other dynamic languages or, with the (experimental) optimizing compiler, even that of static languages, all while retaining the flexibility and interactive development of a dynamic language. This compilation architecture supports modularity and separate compilation throughout. The environment also includes a powerful autodocumenter and a unit testing framework, both closely integrated with the assertion system. The paper provides an informal overview of the language and program development environment. It aims at illustrating the design philosophy rather than at being exhaustive, which would be impossible in a single journal paper, pointing instead to previous Ciao literature
Resource usage analysis of logic programs via abstract interpretation using sized types
We present a novel general resource analysis for logic programs based on sized types. Sized
types are representations that incorporate structural (shape) information and allow expressing
both lower and upper bounds on the size of a set of terms and their subterms at any position
and depth. They also allow relating the sizes of terms and subterms occurring at different
argument positions in logic predicates. Using these sized types, the resource analysis can infer
both lower and upper bounds on the resources used by all the procedures in a program
as functions on input term (and subterm) sizes, overcoming limitations of existing resource
analyses and enhancing their precision. Our new resource analysis has been developed within
the abstract interpretation framework, as an extension of the sized types abstract domain,
and has been integrated into the Ciao preprocessor, CiaoPP. The abstract domain operations
are integrated with the setting up and solving of recurrence equations for inferring both size
and resource usage functions. We show that the analysis is an improvement over the previous
resource analysis present in CiaoPP and compares well in power to state of the art systems
Improved static analysis and verification of energy consumption and other resources via abstract interpretation
Resource analysis aims at inferring the cost of executing programs for any possible input,
in terms of a given resource, such as the traditional execution steps, time ormemory,
and, more recently energy consumption or user defined resources (e.g., number of
bits sent over a socket, number of database accesses, number of calls to particular procedures,
etc.). This is performed statically, i.e., without actually running the programs.
Resource usage information is useful for a variety of optimization and verification
applications, as well as for guiding software design. For example, programmers
can use such information to choose different algorithmic solutions to a problem; program
transformation systems can use cost information to choose between alternative
transformations; parallelizing compilers can use cost estimates for granularity control,
which tries to balance the overheads of task creation and manipulation against the
benefits of parallelization.
In this thesis we have significatively improved an existing prototype implementation
for resource usage analysis based on abstract interpretation, addressing a number
of relevant challenges and overcoming many limitations it presented. The goal of that
prototype was to show the viability of casting the resource analysis as an abstract domain,
and howit could overcome important limitations of the state-of-the-art resource
usage analysis tools. For this purpose, it was implemented as an abstract domain in the
abstract interpretation framework of the CiaoPP system, PLAI.We have improved both
the design and implementation of the prototype, for eventually allowing an evolution
of the tool to the industrial application level.
The abstract operations of such tool heavily depend on the setting up and finding
closed-form solutions of recurrence relations representing the resource usage behavior
of program components and the whole program as well. While there exist many
tools, such as Computer Algebra Systems (CAS) and libraries able to find closed-form
solutions for some types of recurrences, none of them alone is able to handle all the
types of recurrences arising during program analysis. In addition, there are some types
of recurrences that cannot be solved by any existing tool. This clearly constitutes a bottleneck
for this kind of resource usage analysis. Thus, one of the major challenges we
have addressed in this thesis is the design and development of a novel modular framework
for solving recurrence relations, able to combine and take advantage of the results
of existing solvers. Additionally, we have developed and integrated into our novel
solver a technique for finding upper-bound closed-form solutions of a special class of
recurrence relations that arise during the analysis of programs with accumulating parameters.
Finally, we have integrated the improved resource analysis into the CiaoPP general
framework for resource usage verification, and specialized the framework for verifying
energy consumption specifications of embedded imperative programs in a real application,
showing the usefulness and practicality of the resulting tool.---ABSTRACT---El Análisis de recursos tiene como objetivo inferir el coste de la ejecución de programas
para cualquier entrada posible, en términos de algún recurso determinado, como
pasos de ejecución, tiempo o memoria, y, más recientemente, el consumo de energía
o recursos definidos por el usuario (por ejemplo, número de bits enviados a través de
un socket, el número de accesos a una base de datos, cantidad de llamadas a determinados
procedimientos, etc.). Ello se realiza estáticamente, es decir, sin necesidad de
ejecutar los programas.
La información sobre el uso de recursos resulta muy útil para una gran variedad
de aplicaciones de optimización y verificación de programas, así como para asistir en
el diseño de los mismos. Por ejemplo, los programadores pueden utilizar dicha información
para elegir diferentes soluciones algorítmicas a un problema; los sistemas de
transformación de programas pueden utilizar la información de coste para elegir entre
transformaciones alternativas; los compiladores paralelizantes pueden utilizar las estimaciones
de coste para realizar control de granularidad, el cual trata de equilibrar el
coste debido a la creación y gestión de tareas, con los beneficios de la paralelización.
En esta tesis hemos mejorado de manera significativa la implementación de un
prototipo existente para el análisis del uso de recursos basado en interpretación abstracta,
abordando diversos desafíos relevantes y superando numerosas limitaciones
que éste presentaba. El objetivo de dicho prototipo era mostrar la viabilidad de definir
el análisis de recursos como un dominio abstracto, y cómo se podían superar las limitaciones
de otras herramientas similares que constituyen el estado del arte. Para ello,
se implementó como un dominio abstracto en el marco de interpretación abstracta
presente en el sistema CiaoPP, PLAI. Hemos mejorado tanto el diseño como la implementación
del mencionado prototipo para posibilitar su evolución hacia una herramienta
utilizable en el ámbito industrial.
Las operaciones abstractas de dicha herramienta dependen en gran medida de la
generación, y posterior búsqueda de soluciones en forma cerrada, de relaciones recurrentes,
las cuales modelizan el comportamiento, respecto al consumo de recursos, de
los componentes del programa y del programa completo. Si bien existen actualmente
muchas herramientas capaces de encontrar soluciones en forma cerrada para ciertos
tipos de recurrencias, tales como Sistemas de Computación Algebraicos (CAS) y librerías
de programación, ninguna de dichas herramientas es capaz de tratar, por sí sola,
todos los tipos de recurrencias que surgen durante el análisis de recursos. Existen incluso
recurrencias que no las puede resolver ninguna herramienta actual. Esto constituye
claramente un cuello de botella para este tipo de análisis del uso de recursos. Por lo tanto, uno de los principales desafíos que hemos abordado en esta tesis es el diseño
y desarrollo de un novedoso marco modular para la resolución de relaciones recurrentes,
combinando y aprovechando los resultados de resolutores existentes. Además
de ello, hemos desarrollado e integrado en nuestro nuevo resolutor una técnica para
la obtención de cotas superiores en forma cerrada de una clase característica de relaciones
recurrentes que surgen durante el análisis de programas lógicos con parámetros
de acumulación.
Finalmente, hemos integrado el nuevo análisis de recursos con el marco general
para verificación de recursos de CiaoPP, y hemos instanciado dicho marco para la verificación
de especificaciones sobre el consumo de energía de programas imperativas
embarcados, mostrando la viabilidad y utilidad de la herramienta resultante en una
aplicación real
Static Analysis of Run-Time Errors in Embedded Real-Time Parallel C Programs
We present a static analysis by Abstract Interpretation to check for run-time
errors in parallel and multi-threaded C programs. Following our work on
Astr\'ee, we focus on embedded critical programs without recursion nor dynamic
memory allocation, but extend the analysis to a static set of threads
communicating implicitly through a shared memory and explicitly using a finite
set of mutual exclusion locks, and scheduled according to a real-time
scheduling policy and fixed priorities. Our method is thread-modular. It is
based on a slightly modified non-parallel analysis that, when analyzing a
thread, applies and enriches an abstract set of thread interferences. An
iterator then re-analyzes each thread in turn until interferences stabilize. We
prove the soundness of our method with respect to the sequential consistency
semantics, but also with respect to a reasonable weakly consistent memory
semantics. We also show how to take into account mutual exclusion and thread
priorities through a partitioning over an abstraction of the scheduler state.
We present preliminary experimental results analyzing an industrial program
with our prototype, Th\'es\'ee, and demonstrate the scalability of our
approach
- …