Using Closed Forms for Size Bounds of Integer Programs

This page contains additional information on our article “Targeting Completeness: Using Closed Forms for Size Bounds of Integer Programs”. More precisely, we describe our implementation and our experiments.

Implementation

The source code of our new version of KoAT corresponding to our paper can be found here. The most recent official version of KoAT is also available on GitHub. See our documentation for a list of external tools and libraries used by KoAT.

Our implementation can be executed via the web interfaces, via a Docker image, and via the provided static binary. A Docker image containing both KoAT2 and iRankFinder and a static binary of the new size bound-release can be downloaded here. A web interface using the size bound-release is provided for integer programs and C programs.

Concerning the input format, for integer programs we use the corresponding input format from the Termination and Complexity Competition as described here. Note that a disjunction is modeled by two parallel transitions with the same update, and negations are modeled by flipping every comparator (i.e., ¬(x<y) is equivalent to x≥y). Additionally, we also allow for costs in transitions as described here.

For C programs, we also use the corresponding input format from the Termination and Complexity Competition as described here. To analyze C programs, KoAT translates them into its format for integer programs using Clang and llvm2kittel.

Experiments

To evaluate the power and performance of our approach we tested it on two benchmark sets from the TPDB.

These sets contain almost only examples with linear arithmetic (only 27 examples in Complexity_C_Integer and 37 in Complexity_ITS have non-linear arithmetic). On both collections Complexity_C_Integer and Complexity_ITS, the existing tools already infer finite runtimes for more than 88 % of those examples that might terminate.

The main benefit of our new integration of the technique for the generation of size bounds is that in this way one can also infer finite runtime bounds for consecutive loops with non-linear guards or updates. To demonstrate this, we extended both collections by 15 new examples that represent typical (almost only) non-linear programs, including several benchmarks from the literature. So in contrast to our former work, we are now able to infer finite runtime bounds for programs which consists of multiple consecutive loops such that relevant size bounds depend on non-linear updates. For detailed information about the new examples click on the respective links.

The two benchmark sets Complexity_C_Size_Non_Linear and Complexity_ITS_Size_Non_Linear are similar but they differ slightly, as an update of an integer program is performed simultaneously on all variables, whereas in a C program each variable is updated individually. Additionally, we often made non-deterministic branching in an integer program explicit by slightly changing the control-flow.

We compare the runtime bounds computed by the tools asymptotically as functions which depend on the largest initial absolute value n of all program variables. All tools were run inside an Ubuntu Docker container on a machine with an AMD Ryzen 7 3700X octa-core CPU and 48 GB of RAM. The benchmarks were evaluated in parallel such that at most 8 containers were running at once, each limited to 1.9 CPU cores. In particular, the runtimes of the tools include the times to start and remove the container. We give both the average runtime of each tool on all runs and the average runtime on successful runs, i.e., where the tool inferred a finite runtime bound before reaching the timeout. A timeout of 5 minutes was enforced for every tool and program.

We compare the results of our tool KoAT2 in different configurations to that of other state-of-the-art tools such as KoAT1 (the original implementation of KoAT), CoFloCo, Loopus (only evaluated on Complexity_C_Integer and Complexity_C_Size_Non_Linear), and MaxCore with CoFloCo as its backend (only evaluated on Complexity_C_Integer and Complexity_C_Size_Non_Linear).

Complexity_C_Integer

The programs of this benchmark set are C programs on integer values. For the analysis these are assumed to be mathematical integers. The tools MaxCore and Loopus can directly analyze these programs. For KoAT1 and KoAT2 they are translated into integer programs by using the tools Clang and llvm2kittel. For CoFloCo we used the corresponding configuration that was used in the Termination and Complexity Competition 2019.

Please click on the tool names to obtain a detailed list of all results or to download the output of the corresponding configuration. For example, the detailed results show that KoAT1 infers an exponential runtime for 5 benchmarks, whereas KoAT2 is able to infer a polynomial bound for these benchmarks. Note that for all configurations of KoAT2, the integer programs in the output have been rendered as graphs using Graphviz.

Tool O(1) O(n) O(n²) O(nᵏ), k>2 O(EXP) < ∞ Avg. Runtime on Successful Runs Avg. Runtime on All Runs
KoAT2 + Size 26 231 70 16 1 344 9.00 s 22.61 s
KoAT2orig 26 231 70 15 1 343 8.23 s 21.22 s
MaxCore 23 216 66 7 0 312 1.98 s 5.31 s
CoFloCo 22 196 66 5 0 289 0.59 s 2.74 s
KoAT1 25 169 74 12 5 285 0.96 s 3.49 s
Loopus 17 170 49 5 0 241 0.40 s 0.40 s

Complexity_C_Size_Non_Linear

The programs of this benchmark set are again C programs on integer values. Thus, the details on the tools are the same as above.

Again, please click on the tool names to obtain a detailed list of all results or to download the output of the corresponding configuration.

All benchmarks can be viewed here.

Tool O(1) O(n) O(n²) O(nᵏ), k>2 O(EXP) < ∞ Avg. Runtime on Successful Runs Avg. Runtime on All Runs
KoAT2 + Size 0 2 1 9 2 14 33.87 s 31.98 s
MaxCore 0 4 1 0 0 5 0.83 s 3.23 s
KoAT2orig 0 1 0 0 4 5 12.68 s 31.52 s
KoAT1 0 1 0 0 3 4 1.29 s 3.37 s
Loopus 0 1 1 1 0 3 0.56 s 0.56 s
CoFloCo 0 1 0 0 0 1 0.71 s 0.82 s


Complexity_ITS

The programs of this benchmark set are integer programs in the format described in our paper. They can directly be analyzed by KoAT. For CoFloCo we again used the corresponding configuration from the Termination and Complexity Competition 2019. We do not evaluate MaxCore and Loopus on these benchmarks, as these tools cannot handle integer transitions systems.

Please click on the tool names to obtain a detailed list of all results or to download the output of the corresponding configuration. For all configurations of KoAT2, the integer programs in the output have again been rendered as graphs using Graphviz.

Tool O(1) O(n) O(n²) O(nᵏ), k>2 O(EXP) < ∞ Avg. Runtime on Successful Runs Avg. Runtime on All Runs
KoAT2 + Size 132 261 102 20 7 522 6.52 s 33.05 s
KoAT2orig 132 261 101 19 7 520 6.12 s 32.89 s
KoAT1 132 215 104 14 5 470 0.67 s 9.53 s
CoFloCo 125 232 95 9 0 461 3.40 s 17.94 s

Complexity_ITS_Size_Non_Linear

The programs of this benchmark set are again integer programs. Thus, the details on the tools are the same as above.

Again, please click on the tool names to obtain a detailed list of all results or to download the output of the corresponding configuration.

All benchmarks can be viewed here.

Tool O(1) O(n) O(n²) O(nᵏ), k>2 O(EXP) < ∞ Avg. Runtime on Successful Runs Avg. Runtime on All Runs
KoAT2 + Size 0 2 1 9 2 14 6.00 s 5.76 s
KoAT2orig 0 1 0 0 4 5 3.34 s 4.21 s
KoAT1 0 1 0 0 3 4 0.46 s 0.95 s
CoFloCo 0 1 0 0 0 1 0.44 s 0.66 s