Safety Analysis of Real-Time Discrete-Event and Hybrid Systems