Formal methods provide very powerful tools and techniques for the design and analysis of complex systems. Their practical application remains however limited, due to the widely accepted belief that formal methods require extensive expertise and a steep learning curve. Writing correct formal specifications in form of logical formulas is still considered to be a difficult and error prone task. In this paper we propose DeepSTL, a tool and technique for the translation of informal requirements, given as free English sentences, into Signal Temporal Logic (STL), a formal specification language for cyber-physical systems, used both by academia and advanced research labs in industry. A major challenge to devise such a translator is the lack of publicly available informal requirements and formal specifications. We propose a two-step workflow to address this challenge. We first design a grammar-based generation technique of synthetic data, where each output is a random STL formula and its associated set of possible English translations. In the second step, we use a state-of-the-art transformer-based neural translation technique, to train an accurate attentional translator of English to STL. The experimental results show high translation quality for patterns of English requirements that have been well trained, making this workflow promising to be extended for processing more complex translation tasks.
翻译:正式方法为复杂系统的设计和分析提供了非常强大的工具和技术,但实际应用仍然有限,因为人们普遍认为,正式方法需要广泛的专门知识,而且学习曲线陡峭。以逻辑公式的形式编写正确的正式规格仍被认为是一项困难和容易出错的任务。在本文件中,我们提出深STL,这是将非正式要求翻译的工具和技术,作为免费英文句,翻译成Signal Tomoral Locic(STL),这是由学术界和工业高级研究实验室使用的网络物理系统的正式规格语言。设计这种翻译的主要挑战是缺乏公开提供的非正规要求和正式规格。我们提出应对这一挑战的分两步走的工作流程。我们首先设计一种基于语法的合成数据生成技术,其中每种产出都是随机的STL公式及其相关的一套可能的英文翻译。在第二步中,我们使用一种最先进的变异器神经翻译技术,对STL进行精确的注意力翻译。实验结果显示英语要求的翻译质量很高,而这种翻译方式已经经过很好的训练。