implement logic generation for interlocking