Tool for static verification of Contracts for Concurrency in Java programs
Switch branches/tags
Nothing to show
Clone or download
orium Java 8 warns that using _ as identifier might be removed in future re…
…leases, so

we clean that up in this commit.
Latest commit f1cfdf3 Sep 8, 2014


Gluon statically verifies the atomicity of the execution of sequences of calls to methods of a class.

The following code exemplifies how should this tool be used. This and can be found in test/simple/example.

@Contract(clauses="a b c;"
                 +"c c;")
class Module
    public Module() { }
    public void a() { }
    public void b() { }
    public void c() { }

public class Main
    private static Module m;
    private static void f()
    private static void g()
    public static void main(String[] args)
        m=new Module();
        for (int i=0; i < 10; i++)
            if (i%2 == 0)

In this case we have two traces that can call a() b() c(): one calls a() and b() in the for loop and c() in method f(); and one calls this sequence of methods in g(). Only the latter guarantees the atomicity of execution of this sequence of calls.

We also check that the calls c() c() are never performed.

The output of this test is

Checking thread Main.main():

  Verifying word a b c:

      Method: Main.g()
      Calls Location:
      Atomic: YES

      Method: Main.main()
      Calls Location:
      Atomic: NO

  Verifying word c c:

    No occurrences


To compile gluon you need to run


Compiling the tests is equally easy:

ant tests

Running the Example Test

After the compilation gluon and the tests the example test can be ran with

./ example

This example can be found in test/simple/example. You are encouraged to modify and play with the example.

Running the Validation Tests

After the compilation a set of validation tests can be run with

cd test/validation

The results are saved in each of the test directories, in a file named result.