c
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' = 1;
        } else if (time < 30) {
            light_on' = true;
            time' = time + 1;
        } else {
            light_on' = false;
            time' = 0;
        }
    }
}
