Formal verification provides strong guarantees of correctness of software, which are especially important in safety or security critical systems. Hoare logic is a widely used formalism for rigorous verification of software against specifications in the form of pre-condition/post-condition assertions. The advancement of semantic parsing techniques and higher computational capabilities enable us to extract semantic content from natural language text as formal logical forms, with increasing accuracy and coverage. This paper proposes a formal framework for Hoare logic-based formal verification of imperative programs using logical forms generated from compositional semantic parsing of natural language assertions. We call our reasoning approach Natural Hoare Logic. This enables formal verification of software directly against safety requirements specified by a domain expert in natural language. We consider both declarative assertions of program invariants and state change as well as imperative assertions that specify commands which alter the program state. We discuss how the reasoning approach can be extended using domain knowledge and a practical approach for guarding against semantic parser errors.
翻译:正式核查为软件的正确性提供了有力的保证,在安全或保安关键系统中这一点尤其重要。Hare逻辑是一种广泛使用的正规主义,用于严格核查软件,使其符合先决条件/后条件声明形式的规格。语义分解技术和更高的计算能力的发展使我们能够从自然语言文本中提取语义内容,作为正式逻辑形式,提高准确性和覆盖面。本文件提出了一个基于逻辑的Hoare逻辑正式核查紧急程序的正式框架,使用自然语言的构成语义分解所产生的逻辑形式。我们称之为“自然Hoare Logic ”的推理方法。这样可以直接根据自然语言领域专家规定的安全要求对软件进行正式核查。我们既考虑对程序变异性的宣示性主张,也考虑国家变化以及必须说明如何指定改变程序状态的指令。我们讨论如何利用域知识扩展推理方法,并采用实用方法来防范语义派错误。