Experimental Evaluation of "Modular Termination Proofs of Recursive Java Bytecode Programs by Term Rewriting"

In earlier work, we presented an approach to prove termination of non-recursive Java Bytecode (JBC) programs automatically. Here, JBC programs are first transformed to finite termination graphs which represent all possible runs of the program. Afterwards, the termination graphs are translated to term rewrite systems (TRSs) such that termination of the resulting TRSs implies termination of the original JBC programs. So in this way, existing techniques and tools from term rewriting can be used to prove termination of JBC automatically. In this paper, we improve this approach substantially in two ways:
  1. We extend it in order to also analyze recursive JBC programs. To this end, one has to represent call stacks of arbitrary size.
  2. To handle JBC programs with several methods, we modularize our approach in order to re-use termination graphs and TRSs for the separate methods and to prove termination of the resulting TRS in a modular way.
We implemented our approach in the tool AProVE. Our experiments show that the new contributions increase the power of termination analysis for JBC significantly.

Literature

Here, we provide links to our papers. The extended versions of the respective papers include all proofs.


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 the previous version of AProVE and with two other tools for termination analysis of Java Bytecode. Thus, in our experiments we use the following four tools:

Examples

In our experiments, we tested the tools on 83 recursive and 133 non-recursive JBC examples. These examples contain the 172 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. In the experiments, we used a timeout of 120 seconds for each example.

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. (However, there are also several examples where Julia or COSTA succeed whereas AProVE fails.) The main reason for the power of AProVE 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.

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

Recursive examples (83)

ToolYesMaybeTimeoutRuntime
AProVE 20116701630 sec
AProVE 20101536596 sec
Julia572603 sec
COSTA473516 sec

Non-Recursive examples (133)

ToolYesMaybeTimeoutRuntime
AProVE 201110802527 sec
AProVE 2010103131723 sec
Julia963702 sec
COSTA736005 sec

In the following tables, 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, 15 are known to be non-terminating, which can easily be 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 600 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.

Recursive examples

ExampleAProVE 2011AProVE 2010JuliaCOSTA
YES7.12TIMEOUT120YES4.39YES3.08
YES12.91YES13.25YES1.9YES0.69
YES9.9TIMEOUT120YES1.73YES0.55
YES2.78TIMEOUT120YES2.15MAYBE1.21
YES2.15TIMEOUT120YES1.64MAYBE1.18
YES6.15TIMEOUT120MAYBE4.95MAYBE4.35
YES1.65MAYBE48.84MAYBE1.88MAYBE2.15
YES4.94TIMEOUT120MAYBE2.75YES0.67
YES9.12TIMEOUT120MAYBE4.12YES4.1
YES5.25TIMEOUT120MAYBE3.59YES2.44
YES28.11TIMEOUT120YES3.0MAYBE3.92
YES66.4TIMEOUT120MAYBE2.94MAYBE8.35
YES5.25TIMEOUT120MAYBE2.5MAYBE4.37
YES5.44TIMEOUT120MAYBE2.4MAYBE12.25
YES7.93TIMEOUT120MAYBE2.4MAYBE7.27
YES6.13TIMEOUT120MAYBE2.55MAYBE4.83
YES5.48TIMEOUT120MAYBE2.5MAYBE4.84
TIMEOUT120TIMEOUT120MAYBE2.54MAYBE31.51
YES5.93TIMEOUT120MAYBE2.65YES2.74
YES1.7TIMEOUT120YES1.5YES0.21
YES1.99TIMEOUT120YES1.49YES0.08
YES7.39TIMEOUT120MAYBE4.16YES7.06
YES7.31TIMEOUT120MAYBE5.16YES5.3
YES5.48TIMEOUT120MAYBE2.8MAYBE4.2
YES4.89TIMEOUT120MAYBE2.84YES2.54
YES13.9TIMEOUT120MAYBE2.17YES0.6
YES13.33TIMEOUT120YES2.15MAYBE1.69
YES8.44TIMEOUT120MAYBE2.89MAYBE11.17
YES1.57TIMEOUT120YES1.49YES0.2
YES2.11TIMEOUT120YES1.59MAYBE0.84
YES5.69TIMEOUT120MAYBE2.47MAYBE8.63
YES18.32TIMEOUT120MAYBE2.7MAYBE12.96
YES1.58TIMEOUT120YES1.45MAYBE0.46
YES14.45TIMEOUT120MAYBE4.95YES18.41
YES10.48MAYBE50.46YES3.11YES4.4
YES9.32TIMEOUT120YES2.61TIMEOUT120.0
YES4.94TIMEOUT120YES2.17YES0.6
YES4.84TIMEOUT120YES2.25MAYBE3.49
YES2.32TIMEOUT120YES1.48YES1.18
YES1.29TIMEOUT120YES1.44YES0.05
(non-term.)TIMEOUT120TIMEOUT120MAYBE1.39MAYBE0.26
(non-term.)TIMEOUT120TIMEOUT120MAYBE1.47MAYBE0.21
YES2.72TIMEOUT120YES1.65YES0.38
YES1.47TIMEOUT120YES1.67YES0.19
YES2.81TIMEOUT120YES1.74YES1.24
YES1.2YES1.23YES2.0YES0.86
YES1.51YES1.55YES1.84YES0.43
TIMEOUT120TIMEOUT120YES14.8MAYBE0.0
YES1.53YES7.9YES1.44YES0.06
YES1.33YES3.24YES1.39YES0.05
YES1.81YES8.16YES1.44YES0.08
YES1.05YES1.3YES1.59YES0.03
YES1.4YES1.24YES1.69YES0.06
YES1.03YES1.12YES1.94YES0.17
YES1.21YES1.19YES1.79YES0.25
YES1.17YES1.2YES4.15YES1.89
YES1.17YES1.19YES4.0YES2.06
TIMEOUT120TIMEOUT120YES2.81MAYBE0.0
TIMEOUT120TIMEOUT120YES6.09YES9.45
TIMEOUT120TIMEOUT120YES2.35MAYBE0.0
(non-term.)TIMEOUT120TIMEOUT120MAYBE1.39MAYBE0.15
(non-term.)TIMEOUT120TIMEOUT120MAYBE1.74MAYBE0.72
YES1.63YES1.66YES1.83MAYBE1.1
YES3.0TIMEOUT120YES1.64YES1.47
YES3.15TIMEOUT120YES2.04YES0.62
YES7.4YES6.81YES2.2YES1.13
YES2.93TIMEOUT120YES1.99YES0.42
YES3.18TIMEOUT120YES2.05YES0.42
YES1.93TIMEOUT120YES1.88YES0.41
TIMEOUT120TIMEOUT120YES17.24MAYBE77.62
TIMEOUT120TIMEOUT120YES3.7YES2.44
TIMEOUT120MAYBE48.31YES5.49MAYBE47.66
YES17.92TIMEOUT120YES2.29YES1.14
TIMEOUT120TIMEOUT120YES2.94YES0.33
YES44.02TIMEOUT120YES7.54MAYBE0.0
YES3.05YES8.88YES1.55MAYBE0.4
YES5.38TIMEOUT120YES1.93YES0.35
YES2.82TIMEOUT120YES11.25YES0.21
YES88.09TIMEOUT120YES3.59YES11.48
TIMEOUT120TIMEOUT120YES3.59MAYBE0.0
YES22.88TIMEOUT120YES2.49MAYBE5.0
TIMEOUT120TIMEOUT120YES37.05MAYBE0.0
TIMEOUT120TIMEOUT120YES8.45YES8.81

Non-Recursive examples

ExampleAProVE 2011AProVE 2010JuliaCOSTA
YES2.71YES3.59YES1.89YES0.31
TIMEOUT120TIMEOUT120MAYBE1.64MAYBE0.76
YES4.68YES4.98YES2.25MAYBE2.54
YES9.26YES22.26MAYBE4.9MAYBE49.38
YES6.02YES15.52MAYBE3.19MAYBE30.28
YES2.32YES1.73YES1.7YES0.25
YES3.51YES2.98YES1.64YES0.34
YES2.09YES1.78YES1.54YES0.23
YES18.07YES2.66YES1.79YES1.76
YES2.01YES2.1YES1.59YES0.22
YES6.82YES8.51YES3.64MAYBE22.35
YES7.28YES7.31MAYBE3.9MAYBE43.65
YES6.03YES6.31MAYBE4.65MAYBE48.66
YES24.21YES4.06MAYBE1.69MAYBE0.98
YES15.81YES2.58MAYBE1.55MAYBE1.0
YES15.77YES3.04MAYBE1.59MAYBE0.97
YES22.37YES11.85YES1.54MAYBE0.84
YES35.34TIMEOUT120MAYBE1.59MAYBE1.33
YES5.92YES10.14MAYBE2.59MAYBE16.61
YES4.06YES2.38YES2.1YES0.55
YES3.68YES2.18YES1.89YES0.61
YES12.36YES8.18YES2.14YES0.7
YES2.83YES11.89YES2.49MAYBE6.37
YES11.81YES7.35MAYBE1.59MAYBE0.72
YES1.59YES1.71YES1.54YES0.19
YES2.45YES2.23YES1.55MAYBE0.83
YES11.41YES6.7MAYBE1.64MAYBE0.76
YES1.81TIMEOUT120YES1.6MAYBE0.69
TIMEOUT120TIMEOUT120MAYBE1.53MAYBE1.16
YES1.55YES1.7YES1.59YES0.2
YES1.87MAYBE2.93YES1.55MAYBE0.76
TIMEOUT120TIMEOUT120MAYBE1.51MAYBE0.84
YES5.96YES8.98MAYBE3.5MAYBE18.89
YES74.21YES2.34YES1.56YES0.29
YES5.42YES4.96YES1.54YES0.29
YES1.57YES1.87YES1.54YES0.23
YES1.51YES1.75YES1.56YES0.15
YES1.52YES1.77YES1.52YES0.13
YES1.74YES1.75YES1.49YES0.19
YES1.8YES1.85YES1.54YES0.23
YES1.53YES1.78YES1.44YES0.19
YES1.99YES2.06YES1.45YES0.2
YES1.99YES1.97YES1.49YES0.23
YES1.92YES2.03YES1.6YES0.29
YES1.68YES1.55YES1.56YES0.41
YES5.19YES7.97YES1.64YES0.93
YES1.58YES2.23YES1.46YES0.24
YES1.76YES2.7YES1.54YES0.28
YES1.68YES2.11YES1.5YES0.21
YES2.14YES2.36YES1.55YES0.22
YES2.93YES3.37YES1.54YES0.25
YES1.59YES1.78YES1.44YES0.17
YES1.59YES1.68YES1.44YES0.19
YES1.78YES1.7YES1.44YES0.18
YES1.61YES1.88YES1.44YES0.21
YES1.35YES1.49YES1.44YES0.2
YES1.59YES1.5YES1.46YES0.22
YES1.84YES1.8YES1.5YES0.24
YES2.07YES3.36YES1.48YES0.24
YES30.51YES4.74YES1.64YES0.26
YES3.39YES10.92YES1.48YES0.37
YES2.26YES2.54YES1.64YES0.2
YES2.61YES1.99YES1.58YES0.2
YES3.23YES2.07YES1.54YES1.92
TIMEOUT120TIMEOUT120MAYBE1.6YES0.26
YES1.96YES1.68YES1.54YES0.26
YES5.7YES3.76YES1.69YES0.35
YES2.03YES2.09YES1.54MAYBE0.96
TIMEOUT120YES12.07MAYBE1.41MAYBE0.56
YES2.23YES1.85YES1.99YES2.0
TIMEOUT120YES12.94MAYBE5.4MAYBE15.37
YES4.54YES3.04YES2.54MAYBE2.94
TIMEOUT120TIMEOUT120YES2.68MAYBE5.62
YES1.83YES1.55YES1.5YES0.07
YES2.78YES1.95YES1.8YES0.81
YES2.16YES2.26YES1.55YES0.19
YES1.07YES1.21MAYBE1.43MAYBE0.99
YES3.69YES3.05YES1.79YES0.51
YES1.09YES1.14MAYBE1.69MAYBE1.3
YES1.07YES1.15MAYBE1.61MAYBE2.42
TIMEOUT120YES6.88YES3.3MAYBE18.8
YES7.95YES12.64MAYBE4.44MAYBE59.93
YES1.05YES1.31YES1.43MAYBE0.95
YES1.05YES1.21MAYBE1.39MAYBE0.55
YES1.7YES1.69MAYBE1.54YES0.38
YES5.94YES8.01YES2.54YES1.03
YES1.06YES1.13YES1.59MAYBE1.54
YES1.14YES1.4MAYBE1.99MAYBE10.9
YES1.05YES1.32MAYBE1.65MAYBE0.91
YES1.01YES1.48YES1.35YES0.03
YES10.86MAYBE47.34YES1.83YES0.66
YES1.06YES1.12YES1.4YES0.04
(non-term.)TIMEOUT120MAYBE46.89MAYBE1.4MAYBE0.16
YES2.68YES1.8YES1.88MAYBE0.17
YES1.72YES1.59YES1.64MAYBE0.1
YES1.05YES1.41YES1.36MAYBE0.07
YES1.18YES1.21YES1.79MAYBE0.12
(non-term.)TIMEOUT120MAYBE47.4MAYBE1.39MAYBE0.12
(non-term.)TIMEOUT120MAYBE49.54MAYBE2.28MAYBE5.66
YES1.32YES1.37YES3.54YES1.53
(non-term.)TIMEOUT120MAYBE48.46MAYBE1.51MAYBE0.47
(non-term.)TIMEOUT120MAYBE47.9MAYBE1.44MAYBE0.21
YES1.17YES1.16YES1.44YES0.07
(non-term.)TIMEOUT120MAYBE48.2MAYBE1.39MAYBE0.22
YES1.15YES1.2YES1.41YES0.07
YES1.07YES1.29YES1.5YES0.1
(non-term.)TIMEOUT120MAYBE46.77MAYBE1.36MAYBE0.57
TIMEOUT120TIMEOUT120YES3.71YES11.07
YES4.73MAYBE13.68YES3.09MAYBE8.02
YES1.41YES1.46YES1.4YES0.06
YES1.29YES1.25YES1.49YES0.06
YES1.28YES1.34YES1.4YES0.06
YES1.07YES1.13YES1.99YES0.45
(non-term.)TIMEOUT120MAYBE47.65MAYBE1.43MAYBE0.78
(non-term.)TIMEOUT120MAYBE46.64MAYBE1.55MAYBE0.01
(non-term.)TIMEOUT120TIMEOUT120MAYBE1.94MAYBE0.8
YES1.05YES1.17YES1.49MAYBE0.35
YES1.12YES1.15YES2.92YES3.47
YES4.17YES6.32YES2.64YES1.36
TIMEOUT120TIMEOUT120YES12.64MAYBE77.73
TIMEOUT120MAYBE35.42YES14.04MAYBE0.0
YES25.8YES31.76YES6.6YES10.84
TIMEOUT120TIMEOUT120YES5.15YES0.44
YES1.05YES1.14YES1.54MAYBE1.12
TIMEOUT120TIMEOUT120YES18.3MAYBE88.94
YES4.47TIMEOUT120YES2.0YES0.35
(non-term.)TIMEOUT120TIMEOUT120MAYBE1.9MAYBE2.0
YES3.66YES2.92YES2.04YES0.29
YES10.26TIMEOUT120YES3.84YES8.29
YES13.94TIMEOUT120YES4.29YES40.68
YES5.86YES25.31YES2.8MAYBE5.35
YES4.56YES10.8YES2.33MAYBE1.13
TIMEOUT120TIMEOUT120YES2.99YES6.32