Guest User

Untitled

a guest
Jan 24th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. /*@
  2. public invariant
  3. capacity >= 1;
  4. @*/
  5. /*@
  6. public invariant
  7. highscores.length == capacity;
  8. @*/
  9. /*@
  10. public invariant
  11. highscores != null;
  12. @*/
  13. /*@
  14. public invariant
  15. (\forall int i; (i >= 0 && i < highscores.length); (highscores[i] == null) ==> (i >= size));
  16. @*/
  17. /*@
  18. public invariant
  19. (\forall Highscore h1, h2; \created(h1) && \created(h2); h1 != h2 ==> h1.highscores != h2.highscores);
  20. @*/
  21. /*@
  22. public invariant
  23. (min == (-1)) <==> (size == 0);
  24. @*/
  25. /*@
  26. public invariant
  27. min >= (-1) && min < size;
  28. @*/
  29. /*@
  30. public invariant
  31. min != (-1) ==> (\forall int i; i >= 0 && i < size;
  32. highscores[min].score <= highscores[i].score);
  33. @*/
Add Comment
Please, Sign In to add comment