Mathematical formulation of hazardous scenarios for automate