Difference Constraints: An adequate Abstraction for Complexity Analysis of Imperative Programs
Moritz Sinn, Florian Zuleger, Helmut Veith

TL;DR
This paper introduces a practical method for analyzing the complexity of imperative programs using difference constraints, enabling automated resource analysis and demonstrating improved performance over existing tools.
Contribution
It presents the first practical algorithm for difference constraint program analysis and shows how C programs can be abstracted into this model for complexity analysis.
Findings
Tool Loopus computes complexity for more functions.
Loopus performs analysis faster than related tools.
Effective for real-world C code.
Abstract
Difference constraints have been used for termination analysis in the literature, where they denote relational inequalities of the form x' <= y + c, and describe that the value of x in the current state is at most the value of y in the previous state plus some integer constant c. In this paper, we argue that the complexity of imperative programs typically arises from counter increments and resets, which can be modeled naturally by difference constraints. We present the first practical algorithm for the analysis of difference constraint programs and describe how C programs can be abstracted to difference constraint programs. Our approach contributes to the field of automated complexity and (resource) bound analysis by enabling automated amortized complexity analysis for a new class of programs and providing a conceptually simple program model that relates invariant- and bound analysis.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Formal Methods in Verification · Software Testing and Debugging Techniques
