Experimental Evaluation of "Automated Termination Analysis of Java Bytecode by Term Rewriting"

We present an automated approach to prove termination of Java Bytecode (JBC) programs by automatically transforming them to term rewrite systems (TRSs). In this way, the numerous techniques and tools developed for TRS termination can now also be used for imperative object-oriented languages like Java, which can be compiled into JBC. A full version of our paper including all proofs is available here.


Implementation in AProVE

A new version of the termination tool AProVE implementing our approach is available here. In particular, this new version of AProVE allows to repeat the experiments below. It can be accessed via a web interface.

The web interface takes an arbitrary jar-file as input. As in the International Termination Competition, it then tries to prove termination of the main method of the class that is indicated in the file META-INF/MANIFEST.MF. For details, please see the definition of JBC termination problems. In order to prove termination of a specific method, one therefore has to add an appropriate main method calling the specific method with random inputs.

Tools

We compare our implementation with two other tools for termination analysis of Java Bytecode. Thus, in our experiments we use the following three tools:

Examples

In our experiments, we tested the tools on the 106 non-recursive JBC examples from the termination problem data base (TPDB) used in the International Termination Competition. We removed one controversial example ("overflow") from the TPDB whose termination depends on the treatment of integer overflows. Furthermore, we added the two examples "count" and "flatten" from our paper. In the experiments, we used a timeout of 60 seconds for each example. This is the same timeout that is used in the International Termination Competition.

The tables below summarize our experiments. They show that for the problems in the current example collection, our rewriting-based approach in AProVE currently yields the most precise results. The main reason is that we do not use a fixed abstraction from data objects to integers, but represent objects as terms. On the other hand, this also explains the longer runtimes of AProVE compared to Julia and COSTA. Still, our approach is efficient enough to solve most examples in reasonable time. Our method benefits substantially from the representation of objects as terms, since afterwards arbitrary TRS termination techniques can be used to prove termination of the algorithms. Of course, while the examples in the TPDB are challenging, they are still quite small. Future work will be concerned with the application and adaption of our approach in order to use it also for large examples and Java libraries. Moreover, in the current paper, we restricted ourselves to JBC programs without recursion. Of course, an extension of our method to recursive programs is another main point for future work.

In the following table Success gives the number of examples where termination was proved, Failure means that the proof failed in less than 60 seconds, Timeout gives the number of examples where the tool took longer than 60 seconds, and Runtime is the average time needed per example.

ToolSuccessFailureTimeoutRuntime
AProVE8951214.3 sec
Julia743202.6 sec
Costa604603.4 sec

In the following table, each row shows the behavior of the tools on one example. The entry "YES" means that termination of that example could be proved by the corresponding tool while "MAYBE" states that the tool gave up without success. Finally, "TIMEOUT" indicates that the tool exceeded the given time limit and was therefore stopped. By clicking on the respective runtime, one can inspect the output produced by the tool. (For COSTA, we did not receive the proofs.) To load an example into the web interface of AProVE, just click on the corresponding button in the first column. Then you can run AProVE on the respective example yourself. Of those examples, 10 are known to be non-terminating, which can be easily proved manually. The corresponding lines contain the remark "(non-term.)".

When using the AProVE web interface, please keep in mind that the computer running the web interface is considerably slower (four AMD Opteron CPU cores with 2.2GHz each) than the one used for the experiments. Therefore, a higher timeout of up to 300 seconds is needed to solve all examples that AProVE could solve in the table below. Please also keep in mind that the computer used for the web interface is used by several other applications as well, so the runtimes may vary.

ExampleAProVEJuliaCOSTA
YES19.26YES2.7YES0.54
TIMEOUT60MAYBE2.24MAYBE0.72
YES8.43YES2.97MAYBE3.64
YES39.74MAYBE5.04MAYBE38.0
YES6.42MAYBE4.78MAYBE11.08
YES3.97YES2.04YES0.26
YES3.99YES2.08YES0.42
YES2.44YES2.26YES0.25
YES4.67YES2.54YES1.18
YES2.34YES2.08YES0.18
YES27.32YES4.95MAYBE32.12
YES20.33MAYBE5.56MAYBE23.29
YES11.73MAYBE4.7MAYBE36.93
YES36.82MAYBE2.24MAYBE1.12
YES10.43MAYBE2.13MAYBE1.15
YES9.33MAYBE2.44MAYBE1.09
YES13.0YES2.39MAYBE0.9
YES49.51MAYBE2.59MAYBE1.31
YES18.34MAYBE4.16MAYBE10.8
YES5.3YES2.96YES0.91
YES3.17YES2.55YES1.0
YES19.29YES2.96YES1.09
YES3.92YES3.7MAYBE8.45
YES25.76MAYBE2.31MAYBE0.78
YES2.18YES2.29MAYBE0.24
YES3.22YES2.61MAYBE0.93
YES20.52MAYBE2.35MAYBE0.76
TIMEOUT60YES2.14MAYBE0.62
TIMEOUT60MAYBE2.12MAYBE0.98
YES2.51YES1.97YES0.2
YES3.53YES2.19MAYBE0.73
TIMEOUT60MAYBE2.13MAYBE0.95
YES26.16MAYBE4.61MAYBE25.22
YES4.34YES2.15YES0.34
YES30.39YES2.23YES0.29
YES4.92YES2.28YES0.18
YES2.35YES2.03YES0.18
YES2.23YES1.82YES0.18
YES2.78YES2.13YES0.23
YES2.42YES2.18YES0.25
YES2.0YES2.13YES0.19
YES2.93YES2.07YES0.22
YES4.48YES1.98YES0.24
YES3.83YES2.04YES0.26
YES2.83YES2.23YES0.34
YES35.67YES2.34YES0.53
YES4.46YES1.78YES0.26
YES5.95YES2.23YES0.31
YES4.8YES2.18YES0.19
YES12.53YES2.34MAYBE0.27
YES9.22YES2.29YES0.26
YES2.03YES2.13YES0.17
YES2.04YES2.18YES0.19
YES2.64YES2.18MAYBE0.16
YES2.22YES2.09YES0.19
YES2.13YES1.93YES0.17
YES2.09YES2.13YES0.2
YES2.56YES2.14MAYBE0.24
YES3.63YES2.39YES0.19
YES9.2YES2.28YES0.34
YES9.25YES2.2YES0.36
YES3.72YES2.28YES0.16
YES5.39MAYBE2.08YES0.19
YES7.31YES2.26YES0.62
TIMEOUT60MAYBE2.14YES0.19
YES3.1YES2.19YES0.27
YES6.04YES2.24YES0.43
YES3.12YES2.34MAYBE0.85
YES13.53MAYBE1.93MAYBE0.52
YES2.76YES3.12YES1.28
YES23.78MAYBE4.76MAYBE25.73
YES4.54YES3.72MAYBE4.03
TIMEOUT60MAYBE3.86MAYBE4.33
YES2.04YES1.96YES0.16
YES2.65YES2.45YES1.5
YES25.19MAYBE7.82MAYBE28.3
YES1.33MAYBE1.71MAYBE0.72
YES1.24YES1.87YES0.05
YES8.42YES2.61YES1.43
YES1.59YES2.04YES0.06
(non-term.)MAYBE17.37MAYBE1.92MAYBE0.2
(non-term.)MAYBE18.68MAYBE2.51MAYBE6.13
YES1.6YES4.64YES2.15
YES3.35YES2.44YES0.91
YES2.32YES1.99YES0.23
YES1.28YES2.13YES0.2
YES1.46YES2.62YES2.27
(non-term.)TIMEOUT60MAYBE1.75MAYBE0.94
(non-term.)TIMEOUT60MAYBE1.88MAYBE0.35
(non-term.)TIMEOUT60MAYBE1.97MAYBE0.19
YES1.42YES1.97YES0.09
(non-term.)TIMEOUT60MAYBE1.92MAYBE0.2
YES1.36YES2.13YES0.09
YES1.3YES1.97YES0.19
(non-term.)MAYBE17.14MAYBE2.02MAYBE0.52
TIMEOUT60YES4.24YES21.47
YES6.04YES4.58MAYBE22.2
YES1.97YES1.71YES0.11
YES1.55YES2.19YES0.08
YES1.5YES1.77YES0.06
YES1.28YES2.71YES1.45
(non-term.)TIMEOUT60MAYBE2.03MAYBE0.91
(non-term.)MAYBE17.08MAYBE2.14MAYBE0.12
(non-term.)TIMEOUT60MAYBE2.01MAYBE1.8
YES1.39YES2.13MAYBE0.5
YES1.34YES4.08MAYBE12.42