
module main
{
    var light_on : boolean;
    var door_open : boolean;
    var time : int;

    init {
        light_on = false;
        door_open = false;
        time = 0;
    }

    transition {
        if (door_open) {
            light_on' = true;
            time' = 30;
        } else {
            if (time > 0) {
                time' = time - 1;
                light_on' = true;
            } else {
                light_on' = false;
            }
        }
    }

    next {
        if (door_open) {
            door_open' = true;
        } else {
            door_open' = false;
        }
    }
}
