Targeting Completeness: Automated Complexity Analysis of Integer Programs

This page contains additional information on our article “Targeting Completeness: Automated Complexity Analysis of Integer Programs whose full version is available on ArXiv. 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 KoAT2 and a static binary of the new release can be downloaded here. A web interface using this new 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 the 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.

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.

To demonstrate the strength of our new approach, we extended these collections by 20 C programs and 22 integer programs including the examples and variations of the examples from our paper. Detailed information about the new examples can be found here (for CINT) and here (for CITS).

The two new benchmark sets Complexity_C_Non_Linear and Complexity_ITS_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. Hence, we added two more integer programs which include some simple cycles of length more than one and omitted them in the collection of C programs since the transformation into integer programs already yields such cycles. 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_Non_Linear), and MaxCore with CoFloCo or PUBS as its backend (only evaluated on Complexity_C_Integer and Complexity_C_Non_Linear).

For KoAT2 we use the following configurations:

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.

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 10 benchmarks, whereas KoAT2 is able to infer a polynomial bound for 5 of these benchmarks. Note that for all configurations of KoAT2, the integer programs in the output have been rendered as graphs using Graphviz.

ToolO(1)O(log(n))O(n)O(n²)O(nᵏ), k>2O(EXP)< ∞Avg. Runtime on Successful RunsAvg. Runtime on All Runs
KoAT2(F)2410238731853684.71s17.47s
KoAT2(TS)240237722553635.39s18.88s
KoAT2(T)240236691983565.87s17.96s
KoAT2(S)240232701333425.01s14.52s
KoAT2240231661053364.78s14.11s
MaxCore + CoFloCo23022167703181.88s5.46s
KoAT12501707412102911.83s2.83s
MaxCore + PUBS12516488302720.85s6.16s
Loopus17017150702450.53s0.53s

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 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.

ToolO(1)O(log(n))O(n)O(n²)O(nᵏ), k>2O(EXP)< ∞Avg. Runtime on Successful RunsAvg. Runtime on All Runs
KoAT2(F)1281126811125105534.24s23.86s
KoAT2(TS)128026510733135464.52s24.71s
KoAT2(T)128026410623165374.11s23.47s
KoAT2(S)13202571041985204.30s23.71s
KoAT2131025810313115163.89s22.09s
KoAT113202161041494750.71s8.71s
CoFloCo125023395904623.37s17.12s