A Formal Model for Artificial Intelligence Applications in Automation Systems