Abstract:The problem of finding a constant bound on a term given a set of assumptions has wide applications in optimization as well as program analysis. However, in many contexts the objective term may be unbounded. Still, some sort of symbolic bound may be useful. In this paper we introduce the optimal symbolic-bound synthesis problem, and a technique that tackles this problem for non-linear arithmetic with function symbols. This allows us to automatically produce symbolic bounds on complex arithmetic expressions from a set of both equality and inequality assumptions. Our solution employs a novel combination of powerful mathematical objects -- Gröbner bases together with polyhedral cones -- to represent an infinite set of implied inequalities. We obtain a sound symbolic bound by reducing the objective term by this infinite set. We implemented our method in a tool, AutoBound, which we tested on problems originating from real Solidity programs. We find that AutoBound yields relevant bounds in each case, matching or nearly-matching upper bounds produced by a human analyst on the same set of programs.
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: given a set of hypotheses and axioms, how to find the optimal symbolic bound of a target term. Specifically, this problem can be stated as follows:
- **Problem Description**:
Given a (possibly nonlinear) formula \(\varphi\) representing hypotheses and axioms, and a target term \(t\), find a term \(t^*\) such that:
1. **Boundary Condition**: \(\varphi \models t \leq t^*\)
2. **Optimality**: For any term \(s\) that satisfies the first condition, \(t^* \preceq s\), where \(\preceq\) represents some kind of "term desirability".
- **Background and Motivation**:
In program analysis, logical formulas \(\varphi\) are usually extracted from programs to represent the semantics of the programs. However, such formulas may contain temporary variables and disjunctions, so it is difficult for humans to directly understand the behavior of the programs. By solving the Optimal Symbolic Bound (OSB) synthesis problem, users can specify an interested term \(t\) (such as time, space, or the value of a financial asset), and obtain a concise and useful upper bound \(t^*\), while eliminating all temporary variables.
- **Challenges**:
In many cases, the target term \(t\) may be unbounded, or even if it is bounded, the bound may be too loose to be useful. Therefore, the paper proposes a new method to find symbolic bounds instead of constant bounds.
- **Solution**:
The paper introduces a mathematical object that combines Gröbner bases and polyhedral cones - the cone of polynomials, which is used to represent an infinite set of inequalities implied by the formula \(\varphi\). Through this method, symbolic bounds of complex arithmetic expressions can be automatically generated in nonlinear arithmetic.
In summary, this paper aims to solve how to automatically generate optimal symbolic upper bounds for complex arithmetic expressions given hypotheses and axioms, and ensure that these bounds are concise and useful. This has wide applications in program analysis and optimization.