First part of TD
This commit is contained in:
parent
522bdb0218
commit
f295671946
3 changed files with 27 additions and 6 deletions
|
@ -5,13 +5,17 @@
|
|||
|
||||
/*@ logic integer abs(integer n) = 0<n?n:-n;*/
|
||||
|
||||
/*@ terminates \true;
|
||||
/*@
|
||||
requires INT_MIN <= n;
|
||||
terminates \true;
|
||||
ensures \result == abs(n);
|
||||
*/
|
||||
int abs(int n);
|
||||
|
||||
/*@ terminates \true;
|
||||
/*@
|
||||
requires INT_MIN <= n * (int)((int)n % 2 + ((int)n +1)%2) <= INT_MAX;
|
||||
terminates \true;
|
||||
ensures \result == abs(n);*/
|
||||
int abs2(int n);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue