Elvira Albert

dblp:a/ElviraAlbert · DBLP profile ↗
← Back
122ranked-venue papers
110as first author
20since 2021 · last 2026
0000-0003-0048-0705ORCID · verified

Domains — the database's venue-derived domains; a paper can count in several

Software engineering, systems software and programming languages · 101 · 90 first-author · 18 since 2021Theory of computation · 46 · 42 first-author · 5 since 2021Artificial intelligence and machine learning · 8 · 8 first-authorSecurity and privacy · 2 · 2 first-author · 2 since 2021Databases, data management, data science and information retrieval · 2 · 2 first-authorSystems, architecture and hardware · 1Computer networks · 1 · 1 first-author
YearPublicationVenuePosition
2026 Towards Formally Verified Smart Contracts Compilation
abstract
Abstract Many compilation stages of smart contracts on the Ethereum blockchain have been transitioned to the intermediate language . Tasks such as smart contract optimization and bytecode generation are—or will soon be—performed directly at the level in the compilers for the higher-level languages such as Solidity. In this paper, we develop a formal semantics of programs in Rocq, suitable for verification, which allows formal reasoning at the level of code or generation tools processing programs. Our semantics is expressive enough to be the basis for formal verification tools, and simple enough to make the development of such tools feasible. In order to prove its adequacy for verification, we develop in Rocq a checker (and associated soundness proofs), based on our semantics, able to verify the results of the liveness analysis stage of the official Solidity compiler , which opens the door towards formally verified Ethereum’s smart contracts compilation. Experiments on more than 1,500 smart contracts show that we are able to automatically verify ’s liveness analysis results in negligible time.
Elvira Albert, Samir Genaim, Enrique Martin-Martin
FM (2)1
2025 Verifying Smart Contracts in Yul via Transformation to CHC by Interpreter Specialization
Elvira Albert, Emanuele De Angelis, Fabio Fioravanti, Alejandro Hernández-Cerezo, Giulia Matricardi
LOPSTR1
2025 Securely Optimized (Ethereum) Smart Contracts Using Formal Methods
Elvira Albert, Samir Genaim, Pablo Gordillo, Alejandro Hernández-Cerezo, Enrique Martin-Martin, Albert Rubio
SEFM1
2025 Neural-guided superoptimization in ethereum
abstract
Context: Superoptimization is a synthesis technique that, given a loop-free sequence of instructions, searches for an equivalent sequence that is optimal wrt. an objective function. Superoptimization of Ethereum smart contracts aims at minimizing the size of their bytecode and the gas consumption of executing the contract’s functions. The search for the optimal solution poses huge computational demands –as the search space to find the optimal sequence is exponential on the given size-bound – being the main challenge for superoptimization today to scale up to real, industrial software. Even if the underlying problem for finding the optimal solution is decidable, practical tools often prioritize efficiency over completeness. This means they might be implemented to find a sub-optimal solution or even time out. Objective: This work aims at leveraging superoptimization to a real setting: Ethereum blockchain. This paper proposes a neural-guided superoptimization (NGS) approach which incorporates deep neural networks using (supervised) learning into superoptimization to improve scalability by predicting: (1) if a sequence is already optimal and hence the search can be skipped; (2) the size-bound for the optimal solution in order to reduce the search space. Method: We have downloaded over 13,000 smart contracts deployed on the blockchain for training and testing the machine learning models, and a disjoint set with 100 of the smart contracts with more transactions to prove our scalability gains and impact for the Ethereum community. Results: Incorporating DNNs resulted in a 16x overall speedup (12x for gas) with only 12% optimization loss (14% for gas), or a 3-4x speedup with no optimization loss. For the 100 analyzed contracts, this approach reduced the average compilation time to 3 min per contract and achieved monetary savings of $1.24M. Conclusions: The integration of machine learning models mitigates several limitations of traditional superoptimization by drastically reducing execution times while maintaining most of the original optimization gains.
Matheus Araújo Aguiar, Elvira Albert, Samir Genaim, Pablo Gordillo, Alejandro Hernández-Cerezo, Daniel Kirchner, Albert Rubio
Inf. Softw. Technol.2
2025 Harnessing heap analysis for the synthesis of superoptimized bytecode
Elvira Albert, Jesús Correas Fernández, Pablo Gordillo, Guillermo Román-Díez, Albert Rubio
J. Syst. Softw.1
2025 Secure Optimizations on Ethereum Bytecode Jump-Free Sequences
abstract
Program optimization is a key factor for green software. In the context of the Ethereum blockchain, optimization is particularly relevant because there is a fee to pay for each EVM (Ethereum Virtual Machine) instruction executed and also there exist bytecode-size limitations for deploying the software on the blockchain. Still, optimization of EVM code is not as widely spread as one could imagine. This is at least partly due to the lack of trust in the correctness of the tools, as security is even more relevant than efficiency in the blockchain context in which bugs may cause huge economical losses. This article develops a formal verification framework using Coq to ensure the security of EVM optimizations performed on jump-free sequences of EVM bytecode. By means of Coq’s theorem proving capabilities, we are able to automatically verify/certify that an optimized jump-free sequence of EVM opcodes is semantically equivalent to a given original one. We also present an extension to our framework that can handle inter-block optimizations that propagate global information across blocks. We have applied our tool to successfully prove the security of peephole optimizations performed by the standard Solidity compiler, and also to existing EVM superoptimization tools (namely GASOL and Superstack) in which we have found bugs that have been reported and fixed.
Elvira Albert, Samir Genaim, Daniel Kirchner, Enrique Martin-Martin
IEEE Trans. Dependable Secur. Comput.1
2025 Certified Cost Bounds for Abstract Programs
abstract
A program containing placeholders for unspecified statements or expressions is called an abstract (or schematic) program. Placeholder symbols occur naturally in program transformation rules, as used in refactoring, compilation or optimization. Static cost analysis derives the precise cost—or upper and lower bounds for it—of executing programs, as functions in terms of the program's input data size. We present a generalization of automated cost analysis that can handle abstract programs and, hence, can analyze the impact on the cost effect of program transformations . This kind of relational property requires provably precise cost bounds which are not always produced by cost analysis. Therefore, we certify by deductive verification that the inferred abstract cost bounds are correct and sufficiently precise. It is the first approach solving this problem. Both, abstract cost analysis and certification, are based on quantitative abstract execution (QAE) which in turn is a variation of abstract execution, a recently developed symbolic execution technique for abstract programs. To realize QAE the new concept of a cost invariant is introduced. QAE is implemented and runs fully automatically on a benchmark set consisting of representative optimization rules.
Elvira Albert, Reiner Hähnle, Alicia Merayo-Corcoba, Dominic Steinhöfel
ACM Trans. Softw. Eng. Methodol.1
2024 Synthesis of Sound and Precise Storage Cost Bounds via Unsound Resource Analysis and Max-SMT
abstract
A storage is a persistent memory whose contents are kept across different program executions. In the blockchain technology, storage contents are replicated and incur the largest costs of a program’s execution (a.k.a. gas fees). Storage costs are dynamically calculated using a rather complex model which assigns a much larger cost to the first access made in an execution to a storage key, and besides assigns different costs to write accesses depending on whether they change the values w.r.t. the initial and previous contents. Safely assuming the largest cost for all situations, as done in existing gas analyzers, is an overly-pessimistic approach that might render useless bounds because of being too loose. The challenge is to soundly, and yet accurately, synthesize storage bounds which take into account the dynamicity implicit to the cost model. Our solution consists in using an off-the-shelf static resource analysis —but do not always assuming a worst-case cost— and hence yielding unsound bounds; and then, in a posterior stage, computing corrections to recover soundness in the bounds by using a new Max-SMT based approach. We have implemented our approach and used it to improve the precision of two gas analyzers for Ethereum, gastap and asparagus. Experimental results on more than 400,000 functions show that we achieve great accuracy gains, up to 75%, on the storage bounds, being the most frequent gains between 10-20%.
Elvira Albert, Jesús Correas Fernández, Pablo Gordillo, Guillermo Román-Díez, Albert Rubio
ISSTA1
2024 SuperStack: Superoptimization of Stack-Bytecode via Greedy, Constraint-Based, and SAT Techniques
abstract
Given a loop-free sequence of instructions, superoptimization techniques use a constraint solver to search for an equivalent sequence that is optimal for a desired objective. The complexity of the search grows exponentially with the length of the solution being constructed and the problem becomes intractable for large sequences of instructions. This paper presents a new approach to superoptimizing stack-bytecode via three novel components: (1) a greedy algorithm to refine the bound on the length of the optimal solution; (2) a new representation of the optimization problem as a set of weighted soft clauses in MaxSAT; (3) a series of domain-specific dominance and redundant constraints to reduce the search space for optimal solutions. We have developed a tool, named S uper S tack , which can be used to find optimal code translations of modern stack-based bytecode, namely WebAssembly or Ethereum bytecode. Experimental evaluation on more than 500,000 sequences shows the proposed greedy, constraint-based and SAT combination is able to greatly increase optimization gains achieved by existing superoptimizers and reduce to at least a fourth the optimization time.
Elvira Albert, Maria Garcia de la Banda, Alejandro Hernández-Cerezo, Alexey Ignatiev, Albert Rubio, Peter J. Stuckey
Proc. ACM Program. Lang.1
2023 Formally Verified EVM Block-Optimizations
abstract
Abstract The efficiency and the security of smart contracts are their two fundamental properties, but might come at odds: the use of optimizers to enhance efficiency may introduce bugs and compromise security. Our focus is on (Ethereum Virtual Machine) block-optimizations , which enhance the efficiency of jump-free blocks of opcodes by eliminating, reordering and even changing the original opcodes. We reconcile efficiency and security by providing the verification technology to formally prove the correctness of block-optimizations on smart contracts using the Coq proof assistant. This amounts to the challenging problem of proving semantic equivalence of two blocks of instructions, which is realized by means of three novel Coq components: a symbolic execution engine which can execute an block and produce a symbolic state; a number of simplification lemmas which transform a symbolic state into an equivalent one; and a checker of symbolic states to compare the symbolic states produced for the two blocks under comparison. Artifact: https://doi.org/10.5281/zenodo.7863483
Elvira Albert, Samir Genaim, Daniel Kirchner, Enrique Martin-Martin
CAV (3)1
2023 Inferring Needless Write Memory Accesses on Ethereum Bytecode
abstract
Abstract Efficiency is a fundamental property of any type of program, but it is even more so in the context of the programs executing on the blockchain (known as smart contracts ). This is because optimizing smart contracts has direct consequences on reducing the costs of deploying and executing the contracts, as there are fees to pay related to their bytes-size and to their resource consumption (called gas ). Optimizing memory usage is considered a challenging problem that, among other things, requires a precise inference of the memory locations being accessed. This is also the case for the Ethereum Virtual Machine (EVM) bytecode generated by the most-widely used compiler, , whose rather unconventional and low-level memory usage challenges automated reasoning. This paper presents a static analysis, developed at the level of the EVM bytecode generated by , that infers write memory accesses that are needless and thus can be safely removed. The application of our implementation on more than 19,000 real smart contracts has detected about 6,200 needless write accesses in less than 4 hours. Interestingly, many of these writes were involved in memory usage patterns generated by that can be greatly optimized by removing entire blocks of bytecodes. To the best of our knowledge, existing optimization tools cannot infer such needless write accesses, and hence cannot detect these inefficiencies that affect both the deployment and the execution costs of Ethereum smart contracts.
Elvira Albert, Jesús Correas Fernández, Pablo Gordillo, Guillermo Román-Díez, Albert Rubio
TACAS (1)1
2023 Optimal dynamic partial order reduction with context-sensitive independence and observers
abstract
Dynamic Partial Order Reduction (DPOR) algorithms are used in stateless model checking of concurrent programs to avoid the exploration of equivalent execution sequences. In order to detect equivalence, DPOR relies on the notion of independence between execution steps. As this notion must be approximated, it can lose precision and thus treat execution steps as interfering when they are not. Our work is inspired by recent progress in the area that has introduced more accurate ways to exploit conditional notions of independence: Context-Sensitive DPOR considers two steps p and t independent in the current state if the states obtained by executing p⋅t and t⋅p are the same; Optimal DPOR with Observers makes their dependency conditional to the existence of future events that observe their operations. This article introduces a new algorithm, Optimal Context-Sensitive DPOR with Observers, that combines these two notions of conditional independence, and goes beyond them by exploiting their synergies. The implementation of our algorithm has been undertaken within the Nidhugg model checking tool. Our experimental evaluation, using benchmarks from the previous works, shows that our algorithm is able to effectively combine the benefits of both context-sensitive and observers-based independence and that it can produce exponential reductions over both of them.
Elvira Albert, Maria Garcia de la Banda, Miguel Gómez-Zamalloa, Miguel Isabel, Peter J. Stuckey
J. Syst. Softw.1
2023 Relaxed Effective Callback Freedom: A Parametric Correctness Condition for Sequential Modules With Callbacks
abstract
Callbacks are an essential mechanism for event-driven programming. Unfortunately, callbacks make reasoning challenging because they introduce behaviors where calls to the module are interleaved. We present a parametric method that, from a particular invariant of the program, allows reducing the problem of verifying the invariant in the presence of callbacks, to the callback-free setting. Intuitively, we allow callbacks to introduce behaviors that cannot be produced by callback free executions, as long as they do not affect correctness. A chief insight is that the user is aware of the potential effect of the callbacks on the program state. To this end, we present a parametric verification technique which accepts this insight as a relation between callback and callback free executions. We implemented our approach and applied it successfully to a large set of real-world programs.
Elvira Albert, Shelly Grossman, Noam Rinetzky, Clara Rodríguez-Núñez, Albert Rubio, Shmuel Sagiv
IEEE Trans. Dependable Secur. Comput.1
2022 Distilling Constraints in Zero-Knowledge Protocols
abstract
Abstract The most widely used Zero-Knowledge (ZK) protocols require provers to prove they know a solution to a computational problem expressed as a Rank-1 Constraint System (R1CS). An R1CS is essentially a system of non-linear arithmetic constraints over a set of signals, whose security level depends on its non-linear part only, as the linear (additive) constraints can be easily solved by an attacker. Distilling the essential constraints from an R1CS by removing the part that does not contribute to its security is important, not only to reduce costs (time and space) of producing the ZK proofs, but also to reveal to cryptographic programmers the real hardness of their proofs. In this paper, we formulate the problem of distilling constraints from an R1CS as the (hard) problem of simplifying constraints in the realm of non-linearity. To the best of our knowledge, it is the first time that constraint-based techniques developed in the context of formal methods are applied to the challenging problem of analysing and optimizing ZK protocols.
Elvira Albert, Marta Bellés-Muñoz, Miguel Isabel, Clara Rodríguez-Núñez, Albert Rubio
CAV (1)1
2022 A Max-SMT Superoptimizer for EVM handling Memory and Storage
abstract
Abstract Superoptimization is a compilation technique that searches for the optimal sequence of instructions semantically equivalent to a given (loop-free) initial sequence. With the advent of SMT solvers, it has been successfully applied to LLVM code (to reduce the number of instructions) and to Ethereum EVM bytecode (to reduce its gas consumption). Both applications, when proven practical, have left out memory operations and thus missed important optimization opportunities. A main challenge to superoptimization today is handling memory operations while remaining scalable. We present $$\textsf {GASOL}^{v2}$$ GASOL v 2 , a gas and bytes-size superoptimization tool for Ethereum smart contracts, that leverages a previous Max-SMT approach for only stack optimization to optimize also wrt. memory and storage. $$\textsf {GASOL}^{v2}$$ GASOL v 2 can be used to optimize the size in bytes, aligned with the optimization criterion used by the Solidity compiler , and it can also be used to optimize gas consumption. Our experiments on 12,378 blocks from 30 randomly selected real contracts achieve gains of 16.42% in gas wrt. the previous version of the optimizer without memory handling, and gains of 3.28% in bytes-size over code already optimized by .
Elvira Albert, Pablo Gordillo, Alejandro Hernández-Cerezo, Albert Rubio
TACAS (1)1
2022 Super-optimization of Smart Contracts
abstract
Smart contracts are programs deployed on a blockchain. They are executed for a monetary fee paid in gas —a clear optimization target for smart contract compilers. Because smart contracts are a young, fast-moving field without (manually) fine-tuned compilers, they highly benefit from automated and adaptable approaches, especially as smart contracts are effectively immutable, and as such need a high level of assurance. This makes them an ideal domain for applying formal methods. Super-optimization is a technique to find the best translation of a block of instructions by trying all possible sequences of instructions that produce the same result. We present a framework for super-optimizing smart contracts based on Max-SMT with two main ingredients: (1) a stack functional specification extracted from the basic blocks of a smart contract, which is simplified using rules capturing the semantics of arithmetic, bit-wise, and relational operations, and (2) the synthesis of optimized blocks , which finds—by means of an efficient SMT encoding—basic blocks with minimal gas cost whose stack functional specification is equal (modulo commutativity) to the extracted one. We implemented our framework in the tool syrup 2.0 . Through large-scale experiments on real-world smart contracts, we analyze performance improvements for different SMT encodings, as well as tradeoffs between quality of optimizations and required optimization time.
Elvira Albert, Pablo Gordillo, Alejandro Hernández-Cerezo, Albert Rubio, Maria Anna Schett
ACM Trans. Softw. Eng. Methodol.1
2021 Lower-Bound Synthesis Using Loop Specialization and Max-SMT
abstract
Abstract This paper presents a new framework to synthesize lower-bounds on the worst-case cost for non-deterministic integer loops. As in previous approaches, the analysis searches for a metering function that under-approximates the number of loop iterations. The key novelty of our framework is the specialization of loops, which is achieved by restricting their enabled transitions to a subset of the inputs combined with the narrowing of their transition scopes. Specialization allows us to find metering functions for complex loops that could not be handled before or be more precise than previous approaches. Technically, it is performed (1) by using quasi-invariants while searching for the metering function, (2) by strengthening the loop guards, and (3) by narrowing the space of non-deterministic choices. We also propose a Max-SMT encoding that takes advantage of the use of soft constraints to force the solver look for more accurate solutions. We show our accuracy gains on benchmarks extracted from the 2020 Termination and Complexity Competition by comparing our results to those obtained by the "Image missing" system.
Elvira Albert, Samir Genaim, Enrique Martin-Martin, Alicia Merayo-Corcoba, Albert Rubio
CAV (2)1
2021 Certified Abstract Cost Analysis
abstract
Abstract A program containing placeholders for unspecified statements or expressions is called an abstract (or schematic) program. Placeholder symbols occur naturally in program transformation rules, as used in refactoring, compilation, optimization, or parallelization. We present a generalization of automated cost analysis that can handle abstract programs and, hence, can analyze the impact on the cost of program transformations. This kind of relational property requires provably precise cost bounds which are not always produced by cost analysis. Therefore, we certify by deductive verification that the inferred abstract cost bounds are correct and sufficiently precise. It is the first approach solving this problem. Both, abstract cost analysis and certification, are based on quantitative abstract execution (QAE) which in turn is a variation of abstract execution, a recently developed symbolic execution technique for abstract programs. To realize QAE the new concept of a cost invariant is introduced. QAE is implemented and runs fully automatically on a benchmark set consisting of representative optimization rules.
Elvira Albert, Reiner Hähnle, Alicia Merayo-Corcoba, Dominic Steinhöfel
FASE1
2021 Actor-based model checking for Software-Defined Networks
Elvira Albert, Miguel Gómez-Zamalloa, Miguel Isabel, Albert Rubio, Matteo Sammartino, Alexandra Silva 0001
J. Log. Algebraic Methods Program.1
2021 Don't run on fumes - Parametric gas bounds for smart contracts
Elvira Albert, Jesús Correas Fernández, Pablo Gordillo, Guillermo Román-Díez, Albert Rubio
J. Syst. Softw.1
2020 Synthesis of Super-Optimized Smart Contracts Using Max-SMT
abstract
With the advent of smart contracts that execute on the blockchain ecosystem, a new mode of reasoning is required for developers that must pay meticulous attention to the gas spent by their smart contracts, as well as for optimization tools that must be capable of effectively reducing the gas required by the smart contracts. Super-optimization is a technique which attempts to find the best translation of a block of code by trying all possible sequences of instructions that produce the same result. This paper presents a novel approach for super-optimization of smart contracts based on Max-SMT which is split into two main phases: (i) the extraction of a stack functional specification from the basic blocks of the smart contract, which is simplified using rules that capture the semantics of the arithmetic, bit-wise, relational operations, etc. (ii) the synthesis of optimized blocks which, by means of an efficient Max-SMT encoding, finds the bytecode blocks with minimal gas cost whose stack functional specification is equal (modulo commutativity) to the extracted one. Our experimental results are very promising: we are able to optimize 55.41 % of the blocks, and prove that 34.28 % were already optimal, for more than 61000 blocks from the most called 2500 Ethereum contracts.
Elvira Albert, Pablo Gordillo, Albert Rubio, Maria Anna Schett
CAV (1)1
2020 Smart, and also Reliable and Gas-Efficient, Contracts
abstract
A smart contract is a software program that runs on top of a blockchain. It contains a collection of public functions that can be invoked within the transactions launched over the contract by parties interacting with it. Being computer programs, well-studied formal verification techniques can be applied to them. Indeed, smart contracts are a very interesting application domain for validation, verification and optimization techniques since (1) they are relatively small in size, hence the application of these techniques scales better than when applied to larger industrial code, (2) they are valuable (in the corresponding blockchain cryptocurrency), hence software bugs or inefficiencies can cause economical losses and there is much interest in formally proving their safety and security, and (3) they require proving new specific properties to ensure their reliability and efficiency.
Elvira Albert, Jesús Correas Fernández, Pablo Gordillo, Guillermo Román-Díez, Albert Rubio
ICST1
2020 GASOL: Gas Analysis and Optimization for Ethereum Smart Contracts
abstract
Abstract We present the main concepts, components, and usage of G asol , a Gas AnalysiS and Optimization tooL for Ethereum smart contracts. G asol offers a wide variety of cost models that allow inferring the gas consumption associated to selected types of EVM instructions and/or inferring the number of times that such types of bytecode instructions are executed. Among others, we have cost models to measure only storage opcodes, to measure a selected family of gas-consumption opcodes following the Ethereum’s classification, to estimate the cost of a selected program line, etc. After choosing the desired cost model and the function of interest, G asol returns to the user an upper bound of the cost for this function. As the gas consumption is often dominated by the instructions that access the storage, G asol uses the gas analysis to detect under-optimized storage patterns, and includes an (optional) automatic optimization of the selected function. Our tool can be used within an Eclipse plugin for which displays the gas and instructions bounds and, when applicable, the gas-optimized function.
Elvira Albert, Jesús Correas Fernández, Pablo Gordillo, Guillermo Román-Díez, Albert Rubio
TACAS (2)1
2020 A Formal, Resource Consumption-Preserving Translation from Actors with Cooperative Scheduling to Haskell
abstract
We present a formal translation of a resource-aware extension of the Abstract Behavioral Specification (ABS) language to the functional language Haskell. ABS is an actor-based language tailored to the modeling of distributed systems. It combines asynchronous method calls with a suspend and resume mode of execution of the method invocations. To cater for the resulting cooperative scheduling of the method invocations of an actor, the translation exploits for the compilation of ABS methods Haskell functions with continuations. The main result of this article is a correctness proof of the translation by means of a simulation relation between a formal semantics of the source language and a high-level operational semantics of the target language, i.e., a subset of Haskell. We further prove that the resource consumption of an ABS program extended with a cost model is preserved over this translation, as we establish an equivalence of the cost of executing the ABS program and its corresponding Haskell-translation. Concretely, the resources consumed by the original ABS program and those consumed by the Haskell program are the same, considering a cost model. Consequently, the resource bounds automatically inferred for ABS programs extended with a cost model, using resource analysis tools, are sound resource bounds also for the translated Haskell programs. Our experimental evaluation confirms the resource preservation over a set of benchmarks featuring different asymptotic costs.
Elvira Albert, Nikolaos Bezirgiannis, Frank S. de Boer, Enrique Martin-Martin
Fundam. Informaticae1
2020 Taming callbacks for smart contract modularity
abstract
Callbacks are an effective programming discipline for implementing event-driven programming, especially in environments like Ethereum which forbid shared global state and concurrency. Callbacks allow a callee to delegate the execution back to the caller. Though effective, they can lead to subtle mistakes principally in open environments where callbacks can be added in a new code. Indeed, several high profile bugs in smart contracts exploit callbacks. We present the first static technique ensuring modularity in the presence of callbacks and apply it to verify prominent smart contracts. Modularity ensures that external calls to other contracts cannot affect the behavior of the contract. Importantly, modularity is guaranteed without restricting programming. In general, checking modularity is undecidable—even for programs without loops. This paper describes an effective technique for soundly ensuring modularity harnessing SMT solvers. The main idea is to define a constructive version of modularity using commutativity and projection operations on program segments. We believe that this approach is also accessible to programmers, since counterexamples to modularity can be generated automatically by the SMT solvers, allowing programmers to understand and fix the error. We implemented our approach in order to demonstrate the precision of the modularity analysis and applied it to real smart contracts, including a subset of the 150 most active contracts in Ethereum. Our implementation decompiles bytecode programs into an intermediate representation and then implements the modularity checking using SMT queries. Overall, we argue that our experimental results indicate that the method can be applied to many realistic contracts, and that it is able to prove modularity where other methods fail.
Elvira Albert, Shelly Grossman, Noam Rinetzky, Clara Rodríguez-Núñez, Albert Rubio, Shmuel Sagiv
Proc. ACM Program. Lang.1
2020 A Transformational Approach to Resource Analysis with Typed-norms Inference
abstract
Abstract In order to automatically infer the resource consumption of programs, analyzers track how data sizes change along program’s execution. Typically, analyzers measure the sizes of data by applying norms which are mappings from data to natural numbers that represent the sizes of the corresponding data. When norms are defined by taking type information into account, they are named typed-norms. This article presents a transformational approach to resource analysis with typed-norms that are inferred by a data-flow analysis. The analysis is based on a transformation of the program into an intermediate abstract program in which each variable is abstracted with respect to all considered norms which are valid for its type. We also present the data-flow analysis to automatically infer the required, useful, typed-norms from programs. Our analysis is formalized on a simple rule-based representation to which programs written in different programming paradigms (e.g., functional, logic, and imperative) can be automatically translated. Experimental results on standard benchmarks used by other type-based analyzers show that our approach is both efficient and accurate in practice.
Elvira Albert, Samir Genaim, Raúl Gutiérrez, Enrique Martin-Martin
Theory Pract. Log. Program.1
2019 Optimal context-sensitive dynamic partial order reduction with observers
abstract
Dynamic Partial Order Reduction (DPOR) algorithms are used in stateless model checking to avoid the exploration of equivalent execution sequences. DPOR relies on the notion of independence between execution steps to detect equivalence. Recent progress in the area has introduced more accurate ways to detect independence: Context-Sensitive DPOR considers two steps p and t independent in the current state if the states obtained by executing p · t and t · p are the same; Optimal DPOR with Observers makes their dependency conditional to the existence of future events that observe their operations. We introduce a new algorithm, Optimal Context-Sensitive DPOR with Observers, that combines these two notions of conditional independence, and goes beyond them by exploiting their synergies. Experimental evaluation shows that our gains increase exponentially with the size of the considered inputs.
Elvira Albert, Maria Garcia de la Banda, Miguel Gómez-Zamalloa, Miguel Isabel, Peter J. Stuckey
ISSTA1
2019 SAFEVM: a safety verifier for Ethereum smart contracts
abstract
Ethereum smart contracts are public, immutable and distributed and, as such, they are prone to vulnerabilities sourcing from programming mistakes of developers. This paper presents SAFEVM, a verification tool for Ethereum smart contracts that makes use of state-of-the-art verification engines for C programs. SAFEVM takes as input an Ethereum smart contract (provided either in Solidity source code, or in compiled EVM bytecode), optionally with assert and require verification annotations, and produces in the output a report with the verification results. Besides general safety annotations, SAFEVM handles the verification of array accesses: it automatically generates SV-COMP verification assertions such that C verification engines can prove safety of array accesses. Our experimental evaluation has been undertaken on all contracts pulled from etherscan.io (more than 24,000) by using as back-end verifiers CPAchecker, SeaHorn and VeryMax.
Elvira Albert, Jesús Correas Fernández, Pablo Gordillo, Guillermo Román-Díez, Albert Rubio
ISSTA1
2019 Running on Fumes - Preventing Out-of-Gas Vulnerabilities in Ethereum Smart Contracts Using Static Resource Analysis
Elvira Albert, Pablo Gordillo, Albert Rubio, Ilya Sergey
VECoS1
2019 Peak resource analysis of concurrent distributed systems
Elvira Albert, Jesús Correas Fernández, Guillermo Román-Díez
J. Syst. Softw.1
2019 Resource Analysis driven by (Conditional) Termination Proofs
abstract
Abstract When programs feature a complex control flow, existing techniques for resource analysis produce cost relation systems (CRS) whose cost functions retain the complex flow of the program and, consequently, might not be solvable into closed-form upper bounds. This paper presents a novel approach to resource analysis that is driven by the result of a termination analysis. The fundamental idea is that the termination proof encapsulates the flows of the program which are relevant for the cost computation so that, by driving the generation of the CRS using the termination proof, we produce a linearly-bounded CRS (LB-CRS). A LB-CRS is composed of cost functions that are guaranteed to be locally bounded by linear ranking functions and thus greatly simplify the process of CRS solving. We have built a new resource analysis tool, named MaxCore, that is guided by the VeryMax termination analyzer and uses CoFloCo and PUBS as CRS solvers. Our experimental results on the set of benchmarks from the Complexity and Termination Competition 2019 for C Integer programs show that MaxCore outperforms all other resource analysis tools.
Elvira Albert, Miquel Bofill, Cristina Borralleras, Enrique Martin-Martin, Albert Rubio
Theory Pract. Log. Program.1
2018 EthIR: A Framework for High-Level Analysis of Ethereum Bytecode
Elvira Albert, Pablo Gordillo, Benjamin Livshits, Albert Rubio, Ilya Sergey
ATVA1
2018 Constrained Dynamic Partial Order Reduction
abstract
The cornerstone of dynamic partial order reduction (DPOR) is the notion of independence that is used to decide whether each pair of concurrent events p and t are in a race and thus both $$p \cdot t$$ and $$t \cdot p$$ must be explored. We present constrained dynamic partial order reduction (CDPOR), an extension of the DPOR framework which is able to avoid redundant explorations based on the notion of conditional independence—the execution of p and t commutes only when certain independence constraints (ICs) are satisfied. ICs can be declared by the programmer, but importantly, we present a novel SMT-based approach to automatically synthesize ICs in a static pre-analysis. A unique feature of our approach is that we have succeeded to exploit ICs within the state-of-the-art DPOR algorithm, achieving exponential reductions over existing implementations.
Elvira Albert, Miguel Gómez-Zamalloa, Miguel Isabel, Albert Rubio
CAV (2)1
2018 SDN-Actors: Modeling and Verification of SDN Programs
Elvira Albert, Miguel Gómez-Zamalloa, Albert Rubio, Matteo Sammartino, Alexandra Silva 0001
FM1
2018 Systematic testing of actor systems
abstract
Summary Testing concurrent systems requires exploring all possible nondeterministic interleavings that the concurrent execution may have, as any of the interleavings may reveal the erroneous behavior. In testing of actor systems, we can distinguish 2 sources of nondeterminism: (1)actor selection, the order in which actors are explored, and (2)task selection, the order in which the tasks within each actor are explored. This article provides new strategies and heuristics for pruning redundant state‐exploration when testing actor systems by reducing the amount of unnecessary nondeterminism of both types. Furthermore, we extend these techniques to handle synchronization primitives that allow awaiting for the completion of an asynchronous task. We report on an implementation and experimental evaluation of the proposed techniques in SYCO, a testing tool for actor‐based concurrency.
Elvira Albert, Puri Arenas, Miguel Gómez-Zamalloa
Softw. Test. Verification Reliab.1
2018 Parallel Cost Analysis
abstract
This article presents parallel cost analysis , a static cost analysis targeting to over-approximate the cost of parallel execution in distributed systems. In contrast to the standard notion of serial cost , parallel cost captures the cost of synchronized tasks executing in parallel by exploiting the true concurrency available in the execution model of distributed processing. True concurrency is challenging for static cost analysis, because the parallelism between tasks needs to be soundly inferred, and the waiting and idle processor times at the different locations need to be accounted for. Parallel cost analysis works in three phases: (1) it performs a block-level analysis to estimate the serial costs of the blocks between synchronization points in the program; (2) it then constructs a distributed flow graph (DFG) to capture the parallelism, the waiting, and idle times at the locations of the distributed system; and (3) the parallel cost can finally be obtained as the path of maximal cost in the DFG. We prove the correctness of the proposed parallel cost analysis, and provide a prototype implementation to perform an experimental evaluation of the accuracy and feasibility of the proposed analysis.
Elvira Albert, Jesús Correas Fernández, Einar Broch Johnsen, Violet Ka I Pun, Guillermo Román-Díez
ACM Trans. Comput. Log.1
2017 May-Happen-in-Parallel Analysis with Returned Futures
Elvira Albert, Samir Genaim, Pablo Gordillo
ATVA1
2017 Context-Sensitive Dynamic Partial Order Reduction
Elvira Albert, Puri Arenas, Maria Garcia de la Banda, Miguel Gómez-Zamalloa, Peter J. Stuckey
CAV (1)1
2017 Generation of Initial Contexts for Effective Deadlock Detection
Elvira Albert, Miguel Gómez-Zamalloa, Miguel Isabel
LOPSTR1
2017 Rely-Guarantee Termination and Cost Analyses of Loops with Concurrent Interleavings
Elvira Albert, Antonio Flores-Montoya, Samir Genaim, Enrique Martin-Martin
J. Autom. Reason.1
2017 Preface for selected and extended papers from Principles and Practice of Declarative Programming (PPDP'15)
Elvira Albert
Sci. Comput. Program.1
2016 SYCO: a systematic testing tool for concurrent objects
abstract
We present the concepts, usage and prototypical implementation of SYCO: a SYstematic testing tool for Concurrent Objects. The system receives as input a program, a selection of method to be tested, and a set of initial values for its parameters. SYCO offers a visual web interface to carry out the testing process and visualize the results of the different executions as well as the sequences of tasks scheduled as a sequence diagram. Its kernel includes state-of-the-art partial-order reduction techniques to avoid redundant computations during testing. Besides, SYCO incorporates an option to effectively catch deadlock errors. In particular, it uses advanced techniques which guide the execution towards potential deadlock paths and discard paths that are guaranteed to be deadlock free.
Elvira Albert, Miguel Gómez-Zamalloa, Miguel Isabel
CC1
2016 Combining Static Analysis and Testing for Deadlock Detection
Elvira Albert, Miguel Gómez-Zamalloa, Miguel Isabel
IFM1
2016 A Formal, Resource Consumption-Preserving Translation of Actors to Haskell
Elvira Albert, Nikolaos Bezirgiannis, Frank S. de Boer, Enrique Martin-Martin
LOPSTR1
2016 Testing of concurrent and imperative software using CLP
abstract
Testing is a vital part of the software development process. In static testing, instead of executing the program on normal values (e.g., numbers), typically the program is executed on symbolic variables representing arbitrary values. Constraints on the symbolic variables are used to represent the conditions under which the execution paths are taken. Testing tools can uncover issues such as memory leaks, buffer overflows, and also concurrency errors like deadlocks or data races. Due to its inherent symbolic execution mechanism and the availability of constraint solvers, Constraint Logic Programming (CLP) has a big potential in the field of testing. In this talk, we will describe a fully CLP-based framework to testing of a today's imperative language. We will also discuss the extension of this framework to handle actor-based concurrency, used in languages such as Go, Actor-Foundry, Erlang, and Scala, among others.
Elvira Albert, Puri Arenas, Miguel Gómez-Zamalloa
PPDP1
2016 A formal verification framework for static analysis - As well as its instantiation to the resource analyzer COSTA and formal verification tool KeY
Elvira Albert, Richard Bubel, Samir Genaim, Reiner Hähnle, Germán Puebla, Guillermo Román-Díez
Softw. Syst. Model.1
2016 May-Happen-in-Parallel Analysis for Actor-Based Concurrency
abstract
This article presents a may-happen-in-parallel (MHP) analysis for languages with actor-based concurrency . In this concurrency model, actors are the concurrency units such that, when a method is invoked on an actor a 2 from a task executing on actor a 1 , statements of the current task in a 1 may run in parallel with those of the (asynchronous) call on a 2 , and with those of transitively invoked methods. The goal of the MHP analysis is to identify pairs of statements in the program that may run in parallel in any execution. Our MHP analysis is formalized as a method-level ( local ) analysis whose information can be modularly composed to obtain application-level ( global ) information. The information yielded by the MHP analysis is essential to infer more complex properties of actor-based concurrent programs, for example, data race detection, deadlock freeness, termination, and resource consumption analyses can greatly benefit from the MHP relations to increase their accuracy. We report on MayPar, a prototypical implementation of an MHP static analyzer for a distributed asynchronous language.
Elvira Albert, Antonio Flores-Montoya, Samir Genaim, Enrique Martin-Martin
ACM Trans. Comput. Log.1
2015 Test Case Generation of Actor Systems
Elvira Albert, Puri Arenas, Miguel Gómez-Zamalloa
ATVA1
2015 Resource Analysis: From Sequential to Concurrent and Distributed Programs
Elvira Albert, Puri Arenas, Jesús Correas Fernández, Samir Genaim, Miguel Gómez-Zamalloa, Enrique Martin-Martin, Germán Puebla, Guillermo Román-Díez
FM1
2015 Parallel Cost Analysis of Distributed Systems
Elvira Albert, Jesús Correas Fernández, Einar Broch Johnsen, Guillermo Román-Díez
SAS1
2015 May-Happen-in-Parallel Analysis for Asynchronous Programs with Inter-Procedural Synchronization
Elvira Albert, Samir Genaim, Pablo Gordillo
SAS1
2015 Non-cumulative Resource Analysis
Elvira Albert, Jesús Correas Fernández, Guillermo Román-Díez
TACAS1
2015 Quantified abstract configurations of distributed systems
abstract
Abstract When reasoning about distributed systems, it is essential to have information about the different kinds of nodes that compose the system, how many instances of each kind exist, and how nodes communicate with other nodes. In this paper we present a static-analysis-based approach which is able to provide information about the questions above. In order to cope with an unbounded number of nodes and an unbounded number of calls among them, the analysis performs an abstraction of the system producing a graph whose nodes may represent (infinitely) many concrete nodes and arcs represent any number of (infinitely) many calls among nodes. The crux of our approach is that the abstraction is enriched with upper bounds inferred by resource analysis that limit the number of concrete instances that the nodes and arcs represent and their resource consumption. The information available in our quantified abstract configurations allows us to define performance indicators which measure the quality of the system. In particular, we present several indicators that assess the level of distribution in the system, the amount of communication among distributed nodes that it requires, and how balanced the load of the distributed nodes that compose the system is. Our performance indicators are given as functions on the input data sizes, and they can be used to automate the comparison of different distributed settings and guide towards finding the optimal configuration.
Elvira Albert, Jesús Correas Fernández, Germán Puebla, Guillermo Román-Díez
Formal Aspects Comput.1
2015 A practical comparator of cost functions and its applications
Elvira Albert, Puri Arenas, Samir Genaim, Germán Puebla
Sci. Comput. Program.1
2015 Object-sensitive cost analysis for concurrent objects
abstract
Summary This article presents a novel cost analysis framework for concurrent objects. Concurrent objects form a well‐established model for distributed concurrent systems. In this model, objects are the concurrency units that communicate among them via asynchronous method calls. Cost analysis aims at automatically approximating the resource consumption of executing a program in terms of its input parameters. While cost analysis for sequential programming languages has received considerable attention, concurrency and distribution have been notably less studied. The main challenges of cost analysis in a concurrent setting are as follows. First, inferring precise size abstractions for data in the program in the presence of shared memory. This information is essential for bounding the number of iterations of loops. Second, distribution suggests that analysis must infer the cost of the diverse distributed components separately. We handle this by means of a novel form of object‐sensitive recurrence equations that use cost centres in order to keep the resource usage assigned to the different components separate. We have implemented our analysis and evaluated it on several small applications that are classical examples of concurrent and distributed programming. Copyright © 2015 John Wiley & Sons, Ltd.
Elvira Albert, Puri Arenas, Jesús Correas Fernández, Samir Genaim, Miguel Gómez-Zamalloa, Germán Puebla, Guillermo Román-Díez
Softw. Test. Verification Reliab.1
2015 A multi-domain incremental analysis engine and its application to incremental resource analysis
Elvira Albert, Jesús Correas Fernández, Germán Puebla, Guillermo Román-Díez
Theor. Comput. Sci.1
2014 Actor- and Task-Selection Strategies for Pruning Redundant State-Exploration in Testing
Elvira Albert, Puri Arenas, Miguel Gómez-Zamalloa
FORTE1
2014 Static Inference of Transmission Data Sizes in Distributed Systems
Elvira Albert, Jesús Correas Fernández, Enrique Martin-Martin, Guillermo Román-Díez
ISoLA (2)1
2014 Peak Cost Analysis of Distributed Systems
Elvira Albert, Jesús Correas Fernández, Guillermo Román-Díez
SAS1
2014 SACO: Static Analyzer for Concurrent Objects
Elvira Albert, Puri Arenas, Antonio Flores-Montoya, Samir Genaim, Miguel Gómez-Zamalloa, Enrique Martin-Martin, Germán Puebla, Guillermo Román-Díez
TACAS1
2014 Conditional termination of loops over heap-allocated data
Elvira Albert, Puri Arenas, Samir Genaim, Germán Puebla, Guillermo Román-Díez
Sci. Comput. Program.1
2014 Selected and extended papers from Partial Evaluation and Program Manipulation 2013
Elvira Albert, Shin-Cheng Mu
Sci. Comput. Program.1
2014 Formal modeling and analysis of resource management for cloud architectures: an industrial case study using Real-Time ABS
Elvira Albert, Frank S. de Boer, Reiner Hähnle, Einar Broch Johnsen, Rudolf Schlatte, Silvia Lizeth Tapia Tarifa, Peter Y. H. Wong
Serv. Oriented Comput. Appl.1
2013 Termination and Cost Analysis of Loops with Concurrent Interleavings
Elvira Albert, Antonio Flores-Montoya, Samir Genaim, Enrique Martin-Martin
ATVA1
2013 Quantified Abstractions of Distributed Systems
Elvira Albert, Jesús Correas Fernández, Germán Puebla, Guillermo Román-Díez
IFM1
2013 A Transformational Approach to Resource Analysis with Typed-Norms
Elvira Albert, Samir Genaim, Raúl Gutiérrez
LOPSTR1
2013 May-Happen-in-Parallel Analysis for Priority-Based Scheduling
Elvira Albert, Samir Genaim, Enrique Martin-Martin
LPAR1
2013 aPET: a test case generation tool for concurrent objects
abstract
We present the concepts, usage and prototypical implementation of aPET, a test case generation tool for a distributed asynchronous language based on concurrent objects. The system receives as input a program, a selection of methods to be tested, and a set of parameters that include a selection of a coverage criterion. It yields as output a set of test cases which guarantee that the selected coverage criterion is achieved. aPET is completely integrated within the language's IDE via Eclipse. The generated test cases can be displayed in textual mode and, besides, it is possible to generate ABSUnit code (i.e., code runnable in a simple framework similar to JUnit to write repeatable tests). The information yield by aPET can be relevant to spot bugs during program development and also to perform regression testing.
Elvira Albert, Puri Arenas, Miguel Gómez-Zamalloa, Peter Y. H. Wong
ESEC/SIGSOFT FSE1
2013 Heap space analysis for garbage collected languages
Elvira Albert, Samir Genaim, Miguel Gómez-Zamalloa
Sci. Comput. Program.1
2013 On the Inference of Resource Usage Upper and Lower Bounds
abstract
Cost analysis aims at determining the amount of resources required to run a program in terms of its input data sizes. The most challenging step is to infer the cost of executing the loops in the program. This requires bounding the number of iterations of each loop and finding tight bounds for the cost of each of its iterations. This article presents a novel approach to infer upper and lower bounds from cost relations . These relations are an extended form of standard recurrence equations that can be nondeterministic, contain inexact size constraints and have multiple arguments that increase and/or decrease. We propose novel techniques to automatically transform cost relations into worst-case and best-case deterministic one-argument recurrence relations. The solution of each recursive relation provides a precise upper-bound and lower-bound for executing a corresponding loop in the program. Importantly, since the approach is developed at the level of the cost equations, our techniques are programming language independent.
Elvira Albert, Samir Genaim, Abu Naser Masud
ACM Trans. Comput. Log.1
2013 A CLP heap solver for test case generation
abstract
Abstract One of the main challenges to software testing today is to efficiently handle heap-manipulating programs. These programs often build complex, dynamically allocated data structures during execution and, to ensure reliability, the testing process needs to consider all possible shapes these data structures can take. This creates scalability issues since high (often exponential) numbers of shapes may be built due to the aliasing of references. This paper presents a novel CLP heap solver for the test case generation of heap-manipulating programs that is more scalable than previous proposals, thanks to the treatment of reference aliasing by means of disjunction, and to the use of advanced back-propagation of heap related constraints. In addition, the heap solver supports the use of heap assumptions to avoid aliasing of data that, though legal, should not be provided as input.
Elvira Albert, Maria Garcia de la Banda, Miguel Gómez-Zamalloa, José Miguel Rojas, Peter J. Stuckey
Theory Pract. Log. Program.1
2012 Verified Resource Guarantees for Heap Manipulating Programs
Elvira Albert, Richard Bubel, Samir Genaim, Reiner Hähnle, Guillermo Román-Díez
FASE1
2012 Automated Extraction of Abstract Behavioural Models from JMS Applications
Elvira Albert, Bjarte M. Østvold, José Miguel Rojas
FMICS1
2012 Automatic Inference of Resource Consumption Bounds
Elvira Albert, Puri Arenas, Samir Genaim, Miguel Gómez-Zamalloa, Germán Puebla
LPAR1
2012 Symbolic Execution of Concurrent Objects in CLP
Elvira Albert, Puri Arenas, Miguel Gómez-Zamalloa
PADL1
2012 COSTABS: a cost and termination analyzer for ABS
abstract
ABS is an abstract behavioural specification language to model distributed concurrent systems. Characteristic features of ABS are that: (1) it allows abstracting from implementation details while remaining executable: a functional sub-language over abstract data types is used to specify internal, sequential computations; and (2) the imperative sub-language provides flexible concurrency and synchronization mechanisms by means of asynchronous method calls, release points in method definitions, and cooperative scheduling of method activations. This paper presents COSTABS, a COSt and Termination analyzer for ABS, which is able to prove termination and obtain resource usage bounds for both the imperative and functional fragments of programs. The resources that COSTABS can infer include termination, number of execution steps, memory consumption, number of asynchronous calls, among others. The analysis bounds provide formal guarantees that the execution of the program will never exceed the inferred amount of resources. The system can be downloaded as free software from its web site, where a repository of examples and a web interface are also provided. To the best of our knowledge, COSTABS is the first system able to perform resource analysis for a concurrent language.
Elvira Albert, Puri Arenas, Samir Genaim, Miguel Gómez-Zamalloa, Germán Puebla
PEPM1
2012 Incremental resource usage analysis
abstract
The aim of incremental global analysis is, given a program, its analysis results and a series of changes to the program, to obtain the new analysis results as efficiently as possible and, ideally, without having to (re-)analyze fragments of code which are not affected by the changes. incremental analysis can significantly reduce both the time and the memory requirements of analysis. This paper presents an incremental resource usage analysis for a sequential Java-like language. Our main contributions are (1) a multi-domain incremental fixed-point algorithm which can be used by all global pre-analyses required to infer the cost (including class, sharing, cyclicity, constancy, and size analyses), and which takes care of propagating dependencies among such domains, and (2) a novel form of cost summaries which allows us to incrementally reconstruct only those components of cost functions affected by the change. Experimental results in the COSTA system show that the proposed incremental analysis performs very efficiently in practice.
Elvira Albert, Jesús Correas Fernández, Germán Puebla, Guillermo Román-Díez
PEPM1
2012 MayPar: a may-happen-in-parallel analyzer for concurrent objects
abstract
We present the concepts, usage and prototypical implementation of MayPar, a may-happen-in-parallel (MHP) static analyzer for a distributed asynchronous language based on concurrent objects. Our tool allows analyzing an application and finding out the pairs of statements that can execute in parallel. The information can be displayed by means of a graphical representation of the MHP analysis graph or, in a textual way, as a set of pairs which identify the program points that may run in parallel. The information yield by MayPar can be relevant (1) to spot bugs in the program related to fragments of code which should not run in parallel and also (2) to improve the precision of other analyses which infer more complex properties (e.g., termination and cost).
Elvira Albert, Antonio Flores-Montoya, Samir Genaim
SIGSOFT FSE1
2012 The ABS tool suite: modelling, executing and analysing distributed adaptable object-oriented systems
Peter Y. H. Wong, Elvira Albert, Radu Muschevici, José Proença, Jan Schäfer 0002, Rudolf Schlatte
Int. J. Softw. Tools Technol. Transf.2
2012 Cost analysis of object-oriented bytecode programs
Elvira Albert, Puri Arenas, Samir Genaim, Germán Puebla, Damiano Zanardini
Theor. Comput. Sci.1
2012 Certificate size reduction in abstraction-carrying code
abstract
Abstract Abstraction-Carrying Code (ACC) has recently been proposed as a framework for mobile code safety in which the code supplier provides a program together with an abstraction (or abstract model of the program) whose validity entails compliance with a predefined safety policy. The abstraction plays thus the role of safety certificate and its generation is carried out automatically by a fixpoint analyzer. The advantage of providing a (fixpoint) abstraction to the code consumer is that its validity is checked in a single pass (i.e., one iteration) of an abstract interpretation-based checker. A main challenge to make ACC useful in practice is to reduce the size of certificates as much as possible while at the same time not increasing checking time. The intuitive idea is to only include in the certificate information that the checker is unable to reproduce without iterating. We introduce the notion of reduced certificate which characterizes the subset of the abstraction which a checker needs in order to validate (and re-construct) the full certificate in a single pass. Based on this notion, we instrument a generic analysis algorithm with the necessary extensions in order to identify the information relevant to the checker. Interestingly, the fact that the reduced certificate omits (parts of) the abstraction has implications in the design of the checker. We provide the sufficient conditions which allow us to ensure that (1) if the checker succeeds in validating the certificate, then the certificate is valid for the program (correctness) and (2) the checker will succeed for any reduced certificate which is valid (completeness). Our approach has been implemented and benchmarked within the CiaoPP system. The experimental results show that our proposal is able to greatly reduce the size of certificates in practice.
Elvira Albert, Puri Arenas, Germán Puebla, Manuel V. Hermenegildo
Theory Pract. Log. Program.1
2011 Cost Analysis of Concurrent OO Programs
Elvira Albert, Puri Arenas, Samir Genaim, Miguel Gómez-Zamalloa, Germán Puebla
APLAS1
2011 Simulating Concurrent Behaviors with Worst-Case Cost Bounds
Elvira Albert, Samir Genaim, Miguel Gómez-Zamalloa, Einar Broch Johnsen, Rudolf Schlatte, Silvia Lizeth Tapia Tarifa
FM1
2011 Task-level analysis for a language with async/finish parallelism
abstract
The task level of a program is the maximum number of tasks that can be available (i.e., not finished nor suspended) simultaneously during its execution for any input data. Static knowledge of the task level is of utmost importance for understanding and debugging parallel programs as well as for guiding task schedulers. We present, to the best of our knowledge, the first static analysis which infers safe and precise approximations on the task level for a language with async-finish parallelism. In parallel languages, async and finish are basic constructs for, respectively, spawning tasks and waiting until they terminate. They are the core of modern, parallel, distributed languages like X10. Given a (parallel) program, our analysis returns a task-level upper bound, i.e., a function on the program's input arguments that guarantees that the task level of the program will never exceed its value along any execution. Our analysis provides a series of useful (over)-approximations, going from the total number of tasks spawned in the execution up to an accurate estimation of the task level.
Elvira Albert, Puri Arenas, Samir Genaim, Damiano Zanardini
LCTES1
2011 Resource-Driven CLP-Based Test Case Generation
Elvira Albert, Miguel Gómez-Zamalloa, José Miguel Rojas
LOPSTR1
2011 Verified resource guarantees using COSTA and KeY
abstract
Resource guarantees allow being certain that programs will run within the indicated amount of resources, which may refer to memory consumption, number of instructions executed, etc. This information can be very useful, especially in real-time and safety-critical applications. Nowadays, a number of automatic tools exist, often based on type systems or static analysis, which produce such resource guarantees. In spite of being based on theoretically sound techniques, the implemented tools may contain bugs which render the resource guarantees thus obtained not completely trustworthy. Performing full-blown verification of such tools is a daunting task, since they are large and complex. In this work we investigate an alternative approach whereby, instead of the tools, we formally verify the results of the tools. We have implemented this idea using COSTA, a state-of-the-art static analysis system, for producing resource guarantees and KeY, a state-of-the-art verification tool, for formally verifying the correctness of such resource guarantees. Our preliminary results show that the proposed tool cooperation can be used for automatically producing verified resource guarantees.
Elvira Albert, Richard Bubel, Samir Genaim, Reiner Hähnle, Germán Puebla, Guillermo Román-Díez
PEPM1
2011 More Precise Yet Widely Applicable Cost Analysis
Elvira Albert, Samir Genaim, Abu Naser Masud
VMCAI1
2011 Closed-Form Upper Bounds in Static Cost Analysis
Elvira Albert, Puri Arenas, Samir Genaim, Germán Puebla
J. Autom. Reason.1
2011 Efficient local unfolding with ancestor stacks
abstract
Abstract The most successful unfolding rules used nowadays in the partial evaluation of logic programs are based on well quasi orders (wqo) applied over (covering) ancestors, i.e., a subsequence of the atoms selected during a derivation. Ancestor (sub)sequences are used to increase the specialization power of unfolding while still guaranteeing termination and also to reduce the number of atoms for which the wqo has to be checked. Unfortunately, maintaining the structure of the ancestor relation during unfolding introduces significant overhead. We propose an efficient, practical local unfolding rule based on the notion of covering ancestors which can be used in combination with a wqo and allows a stack-based implementation without losing any opportunities for specialization. Using our technique, certain nonleftmost unfoldings are allowed as long as local unfolding is performed, i.e., we cover depth-first strategies. To deal with practical programs, we propose assertion-based techniques which allow our approach to treat programs that include (Prolog) built-ins and external predicates in a very extensible manner, for the case of leftmost unfolding. Finally, we report on our implementation of these techniques embedded in a practical partial evaluator, which shows that our techniques, in addition to dealing with practical programs, are also significantly more efficient in time and somewhat more efficient in memory than traditional tree-based implementations.
Germán Puebla, Elvira Albert, Manuel V. Hermenegildo
Theory Pract. Log. Program.2
2010 Parametric inference of memory requirements for garbage collected languages
abstract
The accurate prediction of program's memory requirements is a critical component in software development. Existing heap space analyses either do not take deallocation into account or adopt specific models of garbage collectors which do not necessarily correspond to the actual memory usage. We present a novel approach to inferring upper bounds on memory requirements of Java-like programs which is parametric on the notion of object lifetime, i.e., on when objects become collectible. If objects lifetimes are inferred by a reachability analysis, then our analysis infers accurate upper bounds on the memory consumption for a reachability-based garbage collector. Interestingly, if objects lifetimes are inferred by a heap liveness analysis, then we approximate the program minimal memory requirement, i.e., the peak memory usage when using an optimal garbage collector which frees objects as soon as they become dead. The key idea is to integrate information on objects lifetimes into the process of generating the recurrence equations which capture the memory usage at the different program states. If the heap size limit is set to the memory requirement inferred by our analysis, it is ensured that execution will not exceed the memory limit with the only assumption that garbage collection works when the limit is reached. Experiments on Java bytecode programs provide evidence of the feasibility and accuracy of our analysis.
Elvira Albert, Samir Genaim, Miguel Gómez-Zamalloa
ISMM1
2010 Compositional CLP-Based Test Data Generation for Imperative Languages
Elvira Albert, Miguel Gómez-Zamalloa, José Miguel Rojas, Germán Puebla
LOPSTR1
2010 PET: a partial evaluation-based test case generation tool for Java bytecode
abstract
PET is a prototype Partial Evaluation-based Test case generation tool for a subset of Java bytecode programs. It performs white-box test generation by means of two consecutive Partial Evaluations (PE). The first PE decompiles the Java bytecode program into an equivalent CLP (Constraint Logic Programming) counterpart. The second PE generates a test-case generator from the CLP program. This generator captures interesting test coverage criteria and it is able to generate further test cases on demand. For the first PE, PET incorporates an existing tool which decompiles bytecode to CLP. The main contribution of this work is the implementation of the second PE and the proof of concept of the approach. This has required the development of a partial evaluator for CLP with appropriate control strategies to ensure the required coverage criteria and to generate test-case generators. PET can be downloaded as free software from its web site, where a repository of examples and a web interface are also provided. Though PET has to be extended to be applicable to larger programs, we argue that it provides some evidence that the approach can be of practical interest.
Elvira Albert, Miguel Gómez-Zamalloa, Germán Puebla
PEPM1
2010 From Object Fields to Local Variables: A Practical Approach to Field-Sensitive Analysis
Elvira Albert, Puri Arenas, Samir Genaim, Germán Puebla, Diana V. Ramírez-Deantes
SAS1
2010 Test case generation for object-oriented imperative languages in CLP
abstract
Abstract Testing is a vital part of the software development process. Test Case Generation (TCG) is the process of automatically generating a collection of test-cases which are applied to a system under test. White-box TCG is usually performed by means of symbolic execution, i.e., instead of executing the program on normal values (e.g., numbers), the program is executed on symbolic values representing arbitrary values. When dealing with an object-oriented (OO) imperative language, symbolic execution becomes challenging as, among other things, it must be able to backtrack, complex heap-allocated data structures should be created during the TCG process and features like inheritance, virtual invocations and exceptions have to be taken into account. Due to its inherent symbolic execution mechanism, we pursue in this paper that Constraint Logic Programming (CLP) has a promising application field in tcg. We will support our claim by developing a fully CLP-based framework to TCG of an OO imperative language, and by assessing it on a corresponding implementation on a set of challenging Java programs.
Miguel Gómez-Zamalloa, Elvira Albert, Germán Puebla
Theory Pract. Log. Program.2
2009 Asymptotic Resource Usage Bounds
Elvira Albert, Diego Esteban Alonso-Blas, Puri Arenas, Samir Genaim, Germán Puebla
APLAS1
2009 Field-Sensitive Value Analysis by Field-Insensitive Analysis
Elvira Albert, Puri Arenas, Samir Genaim, Germán Puebla
FM1
2009 Live heap space analysis for languages with garbage collection
abstract
The peak heap consumption of a program is the maximum size of the live data on the heap during the execution of the program, i.e., the minimum amount of heap space needed to run the program without exhausting the memory. It is well-known that garbage collection (GC) makes the problem of predicting the memory required to run a program difficult. This paper presents, the best of our knowledge, the first live heap space analysis for garbage-collected languages which infers accurate upper bounds on the peak heap usage of a program's execution that are not restricted to any complexity class, i.e., we can infer exponential, logarithmic, polynomial, etc., bounds. Our analysis is developed for an (sequential) object-oriented bytecode language with a scoped-memory manager that reclaims unreachable memory when methods return. We also show how our analysis can accommodate other GC schemes which are closer to the ideal GC which collects objects as soon as they become unreachable. The practicality of our approach is experimentally evaluated on a prototype implementation. We demonstrate that it is fully automatic, reasonably accurate and efficient by inferring live heap space bounds for a standardized set of benchmarks, the JOlden suite.
Elvira Albert, Samir Genaim, Miguel Gómez-Zamalloa
ISMM1
2009 Decompilation of Java bytecode to Prolog by partial evaluation
Miguel Gómez-Zamalloa, Elvira Albert, Germán Puebla
Inf. Softw. Technol.2
2009 Type-based homeomorphic embedding for online termination
Elvira Albert, John P. Gallagher, Miguel Gómez-Zamalloa, Germán Puebla
Inf. Process. Lett.1
2008 Test Data Generation of Bytecode by CLP Partial Evaluation
Elvira Albert, Miguel Gómez-Zamalloa, Germán Puebla
LOPSTR1
2008 Automatic Inference of Upper Bounds for Recurrence Relations in Cost Analysis
Elvira Albert, Puri Arenas, Samir Genaim, Germán Puebla
SAS1
2008 Modular Decompilation of Low-Level Code by Partial Evaluation
abstract
Decompiling low-level code to a high-level intermediate representation facilitates the development of analyzers, model checkers, etc. which reason about properties of the low-level code (e.g., bytecode, .NET). Interpretive decompilation consists in partially evaluating an interpreter for the low-level language (written in the high-level language) w.r.t. the code to be decompiled. There have been proofs-of-concept that interpretive decompilation is feasible, butt here remain important open issues when it comes to decompile a real language: does the approach scale up? is the quality of decompiled programs comparable to that obtained by ad-hoc decompilers? do decompiled programs preserve the structure of the original programs? This paper addresses these issues by presenting, to the best of our knowledge, the first modular scheme to enable interpretive decompilation of low-level code to a high-level representation, namely, we decompile bytecode into Prolog. We introduce two notions of optimality. The first one requires that each method/block is decompiled just once. The second one requires that each program point is traversed at most once during decompilation. We demonstrate the impact of our modular approach and optimality issues on a series of realistic benchmarks. Decompilation times and decompiled program sizes are linear with the size of the input bytecode program. This demostrates empirically the scalability of modular decompilation of low-level code by partial evaluation.
Miguel Gómez-Zamalloa, Elvira Albert, Germán Puebla
SCAM2
2007 Cost Analysis of Java Bytecode
Elvira Albert, Puri Arenas, Samir Genaim, Germán Puebla, Damiano Zanardini
ESOP1
2007 Heap space analysis for java bytecode
abstract
This article presents a heap space analysis for (sequential) Java bytecode. The analysis generates heap space cost relations which define at compile-time the heap consumption of a program as a function of its data size. These relations can be used to obtain upper bounds on the heap space located during the execution of the different methods. In addition, we describe how to refine the cost relations, by relying on escape analysis, in order to take into account the heap space that can be safely deallocated by the garbage collector upon exit from a corresponding method. These refined cost relations are then used to infer upper bounds on the active heap space upon methods return. Example applications for the analysis consider inference of constant heap usage and heap usage proportional to the data size (including polynomial and exponential heap consumption). Our prototype implementation is reported and demonstrated by means of a series of examples which illustrate how the analysis naturally encompasses standard data-structures like lists, trees and arrays with several dimensions written in object-oriented programming style.
Elvira Albert, Samir Genaim, Miguel Gómez-Zamalloa
ISMM1
2007 Type-Based Homeomorphic Embedding and Its Applications to Online Partial Evaluation
Elvira Albert, John P. Gallagher, Miguel Gómez-Zamalloa, Germán Puebla
LOPSTR1
2007 Verification of Java Bytecode Using Analysis and Transformation of Logic Programs
Elvira Albert, Miguel Gómez-Zamalloa, Laurent Hubert, Germán Puebla
PADL1
2006 Reduced Certificates for Abstraction-Carrying Code
Elvira Albert, Puri Arenas, Germán Puebla, Manuel V. Hermenegildo
ICLP1
2006 An Incremental Approach to Abstraction-Carrying Code
Elvira Albert, Puri Arenas, Germán Puebla
LPAR1
2006 Abstract Interpretation with Specialized Definitions
Germán Puebla, Elvira Albert, Manuel V. Hermenegildo
SAS2
2005 A Generic Framework for the Analysis and Specialization of Logic Programs
Germán Puebla, Elvira Albert, Manuel V. Hermenegildo
ICLP2
2005 Non-leftmost Unfolding in Partial Evaluation of Logic Programs with Impure Predicates
Elvira Albert, Germán Puebla, John P. Gallagher
LOPSTR1
2005 Converting One Type-Based Abstract Domain to Another
John P. Gallagher, Germán Puebla, Elvira Albert
LOPSTR3
2005 Abstraction carrying code and resource-awareness
abstract
Proof-Carrying Code (PCC) is a general approach to mobile code safety in which the code supplier augments the program with a certificate (or proof). The intended benefit is that the program consumer can locally validate the certificate w.r.t. the "untrusted" program by means of a certificate checker---a process which should be much simpler, efficient, and automatic than generating the original proof. Abstraction Carrying Code (ACC) is an enabling technology for PCC in which an abstract model of the program plays the role of certificate. The generation of the certificate, i.e., the abstraction, is automatically carried out by an abstract interpretation-based analysis engine, which is parametric w.r.t. different abstract domains. While the analyzer on the producer side typically has to compute a semantic fixpoint in a complex, iterative process, on the receiver it is only necessary to check that the certificate is indeed a fixpoint of the abstract semantics equations representing the program. This is done in a single pass in a much more efficient process. ACC addresses the fundamental issues in PCC and opens the door to the applicability of the large body of frameworks and domains based on abstract interpretation as enabling technology for PCC. We present an overview of ACC and we describe in a tutorial fashion an application to the problem of resource-aware security in mobile code. Essentially the information computed by a cost analyzer is used to generate cost certificates which attest a safe and efficient use of a mobile code. A receiving side can then reject code which brings cost certificates (which it cannot validate or) which have too large cost requirements in terms of computing resources (in time and/or space) and accept mobile code which meets the established requirements.
Manuel V. Hermenegildo, Elvira Albert, Pedro López-García 0001, Germán Puebla
PPDP2
2005 Operational semantics for declarative multi-paradigm languages
Elvira Albert, Michael Hanus, Frank Huch, Javier Oliver 0001, Germán Vidal
J. Symb. Comput.1
2004 Some Techniques for Automated, Resource-Aware Distributed and Mobile Computing in a Multi-paradigm Programming System
Manuel V. Hermenegildo, Elvira Albert, Pedro López-García 0001, Germán Puebla
Euro-Par2
2004 Abstract Interpretation-Based Mobile Code Certification
Elvira Albert, Germán Puebla, Manuel V. Hermenegildo
ICLP1
2004 Efficient Local Unfolding with Ancestor Stacks for Full Prolog
Germán Puebla, Elvira Albert, Manuel V. Hermenegildo
LOPSTR2
2004 Abstraction-Carrying Code
Elvira Albert, Germán Puebla, Manuel V. Hermenegildo
LPAR1
2003 A residualizing semantics for the partial evaluation of functional logic programs
Elvira Albert, Michael Hanus, Germán Vidal
Inf. Process. Lett.1
2000 Using an Abstract Representation to Specialize Functional Logic Programs
Elvira Albert, Michael Hanus, Germán Vidal
LPAR1
1999 A Partial Evaluation Framework for Curry Programs
Elvira Albert, María Alpuente, Michael Hanus, Germán Vidal
LPAR1
1998 Improving Control in Functional Logic Program Specialization
Elvira Albert, María Alpuente, Moreno Falaschi, Pascual Julián Iranzo, Germán Vidal
SAS1