870 research outputs found
Interval-based Resource Usage Verification by Translation into Horn Clauses and an Application to Energy Consumption
Many applications require conformance with specifications that constrain the
use of resources, such as execution time, energy, bandwidth, etc. We have
presented a configurable framework for static resource usage verification where
specifications can include lower and upper bound, data size-dependent resource
usage functions. To statically check such specifications, our framework infers
the same type of resource usage functions, which safely approximate the actual
resource usage of the program, and compares them against the specification. We
review how this framework supports several languages and compilation output
formats by translating them to an intermediate representation based on Horn
clauses and using the configurability of the framework to describe the resource
semantics of the input language. We provide a more detailed formalization and
extend the framework so that both resource usage specification and
analysis/verification output can include preconditions expressing intervals for
the input data sizes for which assertions are applicable, proved, or disproved.
Most importantly, we also extend the classes of functions that can be checked.
We provide results from an implementation within the Ciao/CiaoPP framework, and
report on a tool built by instantiating this framework for the verification of
energy consumption specifications for imperative/embedded programs. This paper
is under consideration for publication in Theory and Practice of Logic
Programming (TPLP).Comment: Under consideration for publication in Theory and Practice of Logic
Programming (TPLP
Towards Energy Consumption Verification via Static Analysis
In this paper we leverage an existing general framework for resource usage
verification and specialize it for verifying energy consumption specifications
of embedded programs. Such specifications can include both lower and upper
bounds on energy usage, and they can express intervals within which energy
usage is to be certified to be within such bounds. The bounds of the intervals
can be given in general as functions on input data sizes. Our verification
system can prove whether such energy usage specifications are met or not. It
can also infer the particular conditions under which the specifications hold.
To this end, these conditions are also expressed as intervals of functions of
input data sizes, such that a given specification can be proved for some
intervals but disproved for others. The specifications themselves can also
include preconditions expressing intervals for input data sizes. We report on a
prototype implementation of our approach within the CiaoPP system for the XC
language and XS1-L architecture, and illustrate with an example how embedded
software developers can use this tool, and in particular for determining values
for program parameters that ensure meeting a given energy budget while
minimizing the loss in quality of service.Comment: Presented at HIP3ES, 2015 (arXiv: 1501.03064
Incremental and Modular Context-sensitive Analysis
Context-sensitive global analysis of large code bases can be expensive, which
can make its use impractical during software development. However, there are
many situations in which modifications are small and isolated within a few
components, and it is desirable to reuse as much as possible previous analysis
results. This has been achieved to date through incremental global analysis
fixpoint algorithms that achieve cost reductions at fine levels of granularity,
such as changes in program lines. However, these fine-grained techniques are
not directly applicable to modular programs, nor are they designed to take
advantage of modular structures. This paper describes, implements, and
evaluates an algorithm that performs efficient context-sensitive analysis
incrementally on modular partitions of programs. The experimental results show
that the proposed modular algorithm shows significant improvements, in both
time and memory consumption, when compared to existing non-modular, fine-grain
incremental analysis techniques. Furthermore, thanks to the proposed
inter-modular propagation of analysis information, our algorithm also
outperforms traditional modular analysis even when analyzing from scratch.Comment: 56 pages, 27 figures. To be published in Theory and Practice of Logic
Programming. v3 corresponds to the extended version of the ICLP2018 Technical
Communication. v4 is the revised version submitted to Theory and Practice of
Logic Programming. v5 (this one) is the final author version to be published
in TPL
A General Framework for Static Cost Analysis of Parallel Logic Programs
The estimation and control of resource usage is now an important challenge in an increasing number of computing systems. In particular, requirements on timing and energy arise in a wide variety of applications such as internet of things, cloud computing, health, transportation, and robots. At the same time, parallel computing, with (heterogeneous) multi-core platforms in particular, has become the dominant paradigm in computer architecture. Predicting resource usage on such platforms poses a difficult challenge. Most work on static resource analysis has focused on sequential programs, and relatively little progress has been made on the analysis of parallel programs, or more specifically on parallel logic programs. We propose a novel, general, and flexible framework for setting up cost equations/relations which can be instantiated for performing resource usage analysis of parallel logic programs for a wide range of resources, platforms, and execution models. The analysis estimates both lower and upper bounds on the resource usage of a parallel program (without executing it) as functions on input data sizes. In addition, it also infers other meaningful information to better exploit and assess the potential and actual parallelism of a system. We develop a method for solving cost relations involving the max function that arise in the analysis of parallel programs. Finally, we instantiate our general framework for the analysis of logic programs with Independent AndParallelism, report on an implementation within the CiaoPP system, and provide some experimental results. To our knowledge, this is the first approach to the cost analysis of parallel logic programs
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
Solving Recurrence Relations using Machine Learning, with Application to Cost Analysis
Automatic static cost analysis infers information about the resources used by
programs without actually running them with concrete data, and presents such
information as functions of input data sizes. Most of the analysis tools for
logic programs (and other languages) are based on setting up recurrence
relations representing (bounds on) the computational cost of predicates, and
solving them to find closed-form functions that are equivalent to (or a bound
on) them. Such recurrence solving is a bottleneck in current tools: many of the
recurrences that arise during the analysis cannot be solved with current
solvers, such as Computer Algebra Systems (CASs), so that specific methods for
different classes of recurrences need to be developed. We address such a
challenge by developing a novel, general approach for solving arbitrary,
constrained recurrence relations, that uses machine-learning sparse regression
techniques to guess a candidate closed-form function, and a combination of an
SMT-solver and a CAS to check whether such function is actually a solution of
the recurrence. We have implemented a prototype and evaluated it with
recurrences generated by a cost analysis system (the one in CiaoPP). The
experimental results are quite promising, showing that our approach can find
closed-form solutions, in a reasonable time, for classes of recurrences that
cannot be solved by such a system, nor by current CASs.Comment: In Proceedings ICLP 2023, arXiv:2308.1489
Contributions to Securing Software Updates in IoT
The Internet of Things (IoT) is a large network of connected devices. In IoT, devices can communicate with each other or back-end systems to transfer data or perform assigned tasks. Communication protocols used in IoT depend on target applications but usually require low bandwidth. On the other hand, IoT devices are constrained, having limited resources, including memory, power, and computational resources. Considering these limitations in IoT environments, it is difficult to implement best security practices. Consequently, network attacks can threaten devices or the data they transfer. Thus it is crucial to react quickly to emerging vulnerabilities. These vulnerabilities should be mitigated by firmware updates or other necessary updates securely. Since IoT devices usually connect to the network wirelessly, such updates can be performed Over-The-Air (OTA). This dissertation presents contributions to enable secure OTA software updates in IoT. In order to perform secure updates, vulnerabilities must first be identified and assessed. In this dissertation, first, we present our contribution to designing a maturity model for vulnerability handling. Next, we analyze and compare common communication protocols and security practices regarding energy consumption. Finally, we describe our designed lightweight protocol for OTA updates targeting constrained IoT devices. IoT devices and back-end systems often use incompatible protocols that are unable to interoperate securely. This dissertation also includes our contribution to designing a secure protocol translator for IoT. This translation is performed inside a Trusted Execution Environment (TEE) with TLS interception. This dissertation also contains our contribution to key management and key distribution in IoT networks. In performing secure software updates, the IoT devices can be grouped since the updates target a large number of devices. Thus, prior to deploying updates, a group key needs to be established among group members. In this dissertation, we present our designed secure group key establishment scheme. Symmetric key cryptography can help to save IoT device resources at the cost of increased key management complexity. This trade-off can be improved by integrating IoT networks with cloud computing and Software Defined Networking (SDN).In this dissertation, we use SDN in cloud networks to provision symmetric keys efficiently and securely. These pieces together help software developers and maintainers identify vulnerabilities, provision secret keys, and perform lightweight secure OTA updates. Furthermore, they help devices and systems with incompatible protocols to be able to interoperate
A trustworthy framework for resource-aware embedded programming
Funding: EU Horizon 2020 project, TeamPlay (https://www.teamplay-h2020.eu), grant number 779882; UK EPSRC Discovery, grant number EP/P020631/1.Systems with non-functional requirements, such as Energy, Time and Security (ETS), are of increasing importance due to the proliferation of embedded devices with limited resources such as drones, wireless sensors, and tablet computers. Currently, however, there are little to no programmer supported methodologies or frameworks to allow them to reason about ETS properties in their source code. Drive is one such existing framework supporting the developer by lifting non-functional properties to the source-level through the Contract Specification Language (CSL), allowing non-functional properties to be first-class citizens, and supporting programmer-written code-level contracts to guarantee the non-functional specifications of the program are met. In this paper, we extend the Drive system by providing rigorous implementations of the underlying proof-engine, modeling the specification of the annotations and assertions from CSL for a representative subset of C, called Imp. We define both an improved abstract interpretation that automatically derives proofs of assertions, and define inference algorithms for the derivation of both abstract interpretations and the context over which the interpretation is indexed. We use the dependently-typed programming language, Idris, to give a formal definition, and implementation, of our abstract interpretation. Finally, we show our well-formed abstract interpretation over some representative exemplars demonstrating provable assertions of ETS.Postprin
- …