IMPLEMENTATION LeapYear

IMPORT Nat COMPLETELY

DEF leapYear(year) ==
  IF (year % ("400"!) = 0) THEN true
  IF (year % ("400"!) |= 0) and (year % 100 = 0) THEN false
  IF (year % 100 |= 0) and (year % 4 = 0) THEN true
  IF (year % 4 |= 0) THEN false
  FI
