The CabDisplay class models the three lamps of the Cab Display. The
three instancevariables each represents one of the lamps.
\begin{vdm_al} class CabDisplay
instancevariables
alarm : bool := false;
emergencybreak : bool := false;
groundfault : bool := false;
\end{vdm_al}
set and unset operations exist for each lamp. Setting the alarm lamp
requires that neither the emergency break lamp nor the ground fault
lamp isset. A side effect of setting the emergency lamp is unsetting
the alarm lamp.
\begin{vdm_al} operations
public
setAlarm: () ==> ()
setAlarm () ==
alarm := true pre not emergencybreak and not groundfault;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.