module Latch {
  var reset: boolean;

  next {
    reset' = false;

  }
}
module Thermostat {
  input temp: real;

  output heatOn: boolean;
  output heatOff: boolean;

  instance thermostatState: Latch();

  next {
    next(thermostatState);
    heatOn' = (temp > 22.0);
    heatOff' = (temp < 18.0);

  }
}
