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

assert fails to respond to !false in the same way as if !false #63

Open
davidstreader opened this issue Jul 20, 2020 · 0 comments
Open

Comments

@davidstreader
Copy link

davidstreader commented Jul 20, 2020

Hi with the code below

function method palin(a:seq<int>) :bool {
    forall i:int :: (0<=i && i<(|a|/2)) ==> a[i]==a[|a|-i -1]
}
method Main() { 
    var xe:seq<int> := [0,1,2,3,0];
    var se:seq<int> := [0,1,2,1,0];
    var ohb := palin(se);
    var ohx :bool := palin(xe);
    print "ohb= ",ohb,"\n";
    print "ohx= ",ohx,"\n";
    assert ohb;
    //assert !ohx;    
}

when run the output is:

    ohb= true
    ohx= false

But uncommenting the final assert and it will not verify.
As the if statement knows that ohx is false I assume that the assert should also know this?
regards david

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants