Going forward, but gently...
This commit is contained in:
parent
4a30965654
commit
97a81f159a
4 changed files with 36 additions and 8 deletions
|
@ -6,16 +6,20 @@
|
|||
/*@ logic integer abs(integer n) = 0<n?n:-n;*/
|
||||
|
||||
/*@
|
||||
requires INT_MIN <= n;
|
||||
requires INT_MIN < n < INT_MAX;
|
||||
terminates \true;
|
||||
ensures \result == abs(n);
|
||||
assigns \nothing;
|
||||
*/
|
||||
int abs(int n);
|
||||
|
||||
/*@
|
||||
requires INT_MIN <= n * (int)((int)n % 2 + ((int)n +1)%2) <= INT_MAX;
|
||||
requires INT_MIN < n < INT_MAX;
|
||||
requires INT_MIN <= n * (int)((int)n % 2 + ((int)n + 1)%2) <= INT_MAX;
|
||||
terminates \true;
|
||||
ensures \result == abs(n);*/
|
||||
ensures \result == abs(n);
|
||||
assigns \nothing;
|
||||
*/
|
||||
int abs2(int n);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue