Cargando…
Complexity and Resource Bound Analysis of Imperative Programs Using Difference Constraints
Difference constraints have been used for termination analysis in the literature, where they denote relational inequalities of the form [Formula: see text] , and describe that the value of x in the current state is at most the value of y in the previous state plus some constant [Formula: see text] ....
Autores principales: | , , |
---|---|
Formato: | Online Artículo Texto |
Lenguaje: | English |
Publicado: |
Springer Netherlands
2017
|
Materias: | |
Acceso en línea: | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6044401/ https://www.ncbi.nlm.nih.gov/pubmed/30069066 http://dx.doi.org/10.1007/s10817-016-9402-4 |
_version_ | 1783339475627147264 |
---|---|
author | Sinn, Moritz Zuleger, Florian Veith, Helmut |
author_facet | Sinn, Moritz Zuleger, Florian Veith, Helmut |
author_sort | Sinn, Moritz |
collection | PubMed |
description | Difference constraints have been used for termination analysis in the literature, where they denote relational inequalities of the form [Formula: see text] , and describe that the value of x in the current state is at most the value of y in the previous state plus some constant [Formula: see text] . We believe that difference constraints are also a good choice for complexity and resource bound analysis because the complexity of imperative programs typically arises from counter increments and resets, which can be modeled naturally by difference constraints. In this article we propose a bound analysis based on difference constraints. We make the following contributions: (1) our analysis handles bound analysis problems of high practical relevance which current approaches cannot handle: we extend the range of bound analysis to a class of challenging but natural loop iteration patterns which typically appear in parsing and string-matching routines. (2) We advocate the idea of using bound analysis to infer invariants: our soundness proven algorithm obtains invariants through bound analysis, the inferred invariants are in turn used for obtaining bounds. Our bound analysis therefore does not rely on external techniques for invariant generation. (3) We demonstrate that difference constraints are a suitable abstract program model for automatic complexity and resource bound analysis: we provide efficient abstraction techniques for obtaining difference constraint programs from imperative code. (4) We report on a thorough experimental comparison of state-of-the-art bound analysis tools: we set up a tool comparison on (a) a large benchmark of real-world C code, (b) a benchmark built of examples taken from the bound analysis literature and (c) a benchmark of challenging iteration patterns which we found in real source code. (5) Our analysis is more scalable than existing approaches: we discuss how we achieve scalability. ELECTRONIC SUPPLEMENTARY MATERIAL: The online version of this article (doi:10.1007/s10817-016-9402-4) contains supplementary material, which is available to authorized users. |
format | Online Article Text |
id | pubmed-6044401 |
institution | National Center for Biotechnology Information |
language | English |
publishDate | 2017 |
publisher | Springer Netherlands |
record_format | MEDLINE/PubMed |
spelling | pubmed-60444012018-07-30 Complexity and Resource Bound Analysis of Imperative Programs Using Difference Constraints Sinn, Moritz Zuleger, Florian Veith, Helmut J Autom Reason Article Difference constraints have been used for termination analysis in the literature, where they denote relational inequalities of the form [Formula: see text] , and describe that the value of x in the current state is at most the value of y in the previous state plus some constant [Formula: see text] . We believe that difference constraints are also a good choice for complexity and resource bound analysis because the complexity of imperative programs typically arises from counter increments and resets, which can be modeled naturally by difference constraints. In this article we propose a bound analysis based on difference constraints. We make the following contributions: (1) our analysis handles bound analysis problems of high practical relevance which current approaches cannot handle: we extend the range of bound analysis to a class of challenging but natural loop iteration patterns which typically appear in parsing and string-matching routines. (2) We advocate the idea of using bound analysis to infer invariants: our soundness proven algorithm obtains invariants through bound analysis, the inferred invariants are in turn used for obtaining bounds. Our bound analysis therefore does not rely on external techniques for invariant generation. (3) We demonstrate that difference constraints are a suitable abstract program model for automatic complexity and resource bound analysis: we provide efficient abstraction techniques for obtaining difference constraint programs from imperative code. (4) We report on a thorough experimental comparison of state-of-the-art bound analysis tools: we set up a tool comparison on (a) a large benchmark of real-world C code, (b) a benchmark built of examples taken from the bound analysis literature and (c) a benchmark of challenging iteration patterns which we found in real source code. (5) Our analysis is more scalable than existing approaches: we discuss how we achieve scalability. ELECTRONIC SUPPLEMENTARY MATERIAL: The online version of this article (doi:10.1007/s10817-016-9402-4) contains supplementary material, which is available to authorized users. Springer Netherlands 2017-01-11 2017 /pmc/articles/PMC6044401/ /pubmed/30069066 http://dx.doi.org/10.1007/s10817-016-9402-4 Text en © The Author(s) 2017 Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. |
spellingShingle | Article Sinn, Moritz Zuleger, Florian Veith, Helmut Complexity and Resource Bound Analysis of Imperative Programs Using Difference Constraints |
title | Complexity and Resource Bound Analysis of Imperative Programs Using Difference Constraints |
title_full | Complexity and Resource Bound Analysis of Imperative Programs Using Difference Constraints |
title_fullStr | Complexity and Resource Bound Analysis of Imperative Programs Using Difference Constraints |
title_full_unstemmed | Complexity and Resource Bound Analysis of Imperative Programs Using Difference Constraints |
title_short | Complexity and Resource Bound Analysis of Imperative Programs Using Difference Constraints |
title_sort | complexity and resource bound analysis of imperative programs using difference constraints |
topic | Article |
url | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6044401/ https://www.ncbi.nlm.nih.gov/pubmed/30069066 http://dx.doi.org/10.1007/s10817-016-9402-4 |
work_keys_str_mv | AT sinnmoritz complexityandresourceboundanalysisofimperativeprogramsusingdifferenceconstraints AT zulegerflorian complexityandresourceboundanalysisofimperativeprogramsusingdifferenceconstraints AT veithhelmut complexityandresourceboundanalysisofimperativeprogramsusingdifferenceconstraints |