A method of failsafe synthesis for hardware system of interlocking device in railway signaling