Formal Specification Languages:Clock Example
Initially, the time is midnight, the bell is off, and the alarm is disabled.
Whenever the current time is the same as the alarm time and the alarm is enabled, the bell starts ringing.This is the only condition under which the bell begins to ring.
The alarm time can be set at any time.
Only when the alarm is enabled can it be disabled.
If the alarm is disabled while the bell is ringing, the bell stops ringing.
Resetting the clock and enabling or disabling the alarm are considered to be done instantaneously.