[论文解读] On Formal Reasoning on the Semantics of PLC using Coq
本文提出了一种使用 Coq 证明助手的形式化验证框架,用于可编程逻辑控制器(PLC),针对 IEC 61131-3 标准的 IL、SFC、LD 和 FBD 语言。该框架形式化了这些语言的语义,实现了从 SFC 到 Coq 代码的自动生成,并在案例研究中证明了安全性属性,展示了针对 PLC 验证的认证方法,具备可重用的语义与工业应用的工具链支持。
Programmable Logic Controllers (PLC) and its programming standard IEC 61131-3 are widely used in embedded systems for the industrial automation domain. We propose a framework for the formal treatment of PLC based on the IEC 61131-3 standard. A PLC system description typically combines code written in different languages that are defined in IEC 61131-3. For the top-level specification we regard the Sequential Function Charts (SFC) language, a graphical high-level language that allows to describe the main control-flow of the system. In addition to this, we describe the Instruction List (IL) language -- an assembly like language -- and two other graphical languages: Ladder Diagrams (LD) and Function Block Diagrams (FBD). IL, LD, and FBD are used to describe more low level structures of a PLC. We formalize the semantics of these languages and describe and prove relations between them. Formalization and associated proofs are carried out using the proof assistant Coq. In addition to this, we present work on a tool for automatically generating SFC representations from a graphical description -- the IL and LD languages can be handled in Coq directly -- and its usage for verification purposes. We sketch possible usages of our formal framework, and present an example application for a PLC in a project demonstrator and prove safety properties.
研究动机与目标
- 建立针对 IEC 61131-3 PLC 编程语言核心语言(包括 IL、SFC、LD 和 FBD)的形式化、可重用语义。
- 开发一个工具链,能够从图形化 SFC 描述自动生成可被 Coq 使用的表示形式与证明。
- 利用 Coq 中的交互式定理证明技术,实现对 PLC 程序中安全性属性的形式化验证。
- 支持长期目标:构建一个集成于现有已认证编译栈中的 PLC 代码认证编译器。
提出的方法
- 使用 Coq 证明助手及其 SSReflect 扩展,对 IL、SFC、LD 和 FBD 的语义进行形式化。
- 利用 Coq 的提取机制,从形式化语义中生成已认证的解释器或编译器。
- 设计并实现一个工具,将图形化 SFC 图形自动转换为等价的 Coq 规范及关联定理。
- 利用 Coq 对归纳类型、依赖类型和可判定等式的原生支持,建模 PLC 数据类型与控制流。
- 在真实工业级 PLC 控制分拣机演示系统上,应用标准 Coq 证明技术,验证安全性属性。
- 将形式化语义与 CertPLC 工具集成,实现自动化证明生成与验证。
实验结果
研究问题
- RQ1如何在证明助手中统一、形式化地建模多种 IEC 61131-3 PLC 编程语言的语义?
- RQ2是否能够开发一个工具,从图形化 SFC 规范自动生成形式化验证的 Coq 表示?
- RQ3在工业 PLC 系统中,使用 Coq 中的交互式定理证明验证安全性属性具有哪些实际优势?
- RQ4如何在单一验证框架内,建立并证明 IL、LD 和 SFC 语义之间的一致性?
- RQ5将此形式化框架应用于真实工业 PLC 应用的可行性与可扩展性如何?
主要发现
- 作者成功地在 Coq 中形式化了 IL、SFC、LD 以及 FBD 的高层抽象语义,使对 PLC 程序的正式推理成为可能。
- 开发了一款工具,能够从图形化 SFC 输入自动生成可被 Coq 使用的 SFC 表示及关联定理,显著减少了手动规格化的工作量。
- 该框架成功验证了真实工业分拣机演示系统中的安全性属性,证明了其在实际应用中的可行性。
- 形式化支持代码提取,为基于 CompCert 栈的从 PLC IL 到 C 的认证编译器铺平了道路。
- 该方法为 PLC 验证提供了一个可重用、形式化基础,具备集成到 EasyLab 等开发环境的潜力。
- 本工作表明,Coq 中的交互式定理证明在工业 PLC 验证中是可行的,在某些场景下可提供比模型检测更强的保证。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。