Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with ordering of havoc statements #575

Closed
davidcok opened this issue Oct 7, 2017 · 0 comments
Closed

Problems with ordering of havoc statements #575

davidcok opened this issue Oct 7, 2017 · 0 comments
Labels

Comments

@davidcok
Copy link
Member

davidcok commented Oct 7, 2017

public class TestJava {

public int x;
public int[] a = new int[10];

//@ requires a.length == 10;
public void m() {
    x = 2;
    a[0] = 4;
    a[2] = 6;
    a[3] = 7;
    mm();
    //@ assert a[0] == 4;
    //@ assert a[3] == 7;
    //@ assert  x == 3;
    
}

//@ requires a.length == 10;
//@ assignable x, a[x];
//@ ensures x == 3;
public void mm() {
    x = 3;
}


//@ requires a.length == 10;
public void q() {
    x = 2;
    a[0] = 4;
    a[2] = 6;
    a[3] = 7;
    a[4] = 8;
    qq();
    //@ assert a[0] == 4;
    //@ assert a[4] == 8;
    //@ assert x == 4;
    
}

//@ requires a.length == 10;
//@ assignable x, a[x .. x+1];
//@ ensures x == 4;
public void qq() {
    x = 4;
}

}

davidcok added a commit that referenced this issue Oct 8, 2017
davidcok pushed a commit that referenced this issue Oct 8, 2017
davidcok pushed a commit that referenced this issue Oct 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant