You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Hi with the code below
when run the output is:
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
The text was updated successfully, but these errors were encountered: