Formalizing moving block railway interlocking system for directed network