K-ST: A Formal Executable Semantics of the Structured Text Language for PLCs
Kun Wang, Jingyi Wang, Christopher M. Poskitt, Xiangxiang Chen, Jun, Sun, and Peng Cheng

TL;DR
This paper introduces K-ST, a formal executable semantics for the Structured Text language used in PLCs, enabling verification of compiler correctness and uncovering bugs in open-source implementations.
Contribution
The paper presents K-ST, a high-level formal semantics for ST based on IEC 61131-3, validated through extensive testing and comparison with commercial PLC compilers.
Findings
Validated K-ST with 509 programs from Github
Uncovered 5 bugs in OpenPLC compiler
Demonstrated K-ST's effectiveness in verifying compiler correctness
Abstract
Programmable Logic Controllers (PLCs) are responsible for automating process control in many industrial systems (e.g. in manufacturing and public infrastructure), and thus it is critical to ensure that they operate correctly and safely. The majority of PLCs are programmed in languages such as Structured Text (ST). However, a lack of formal semantics makes it difficult to ascertain the correctness of their translators and compilers, which vary from vendor-to-vendor. In this work, we develop K-ST, a formal executable semantics for ST in the K framework. Defined with respect to the IEC 61131-3 standard and PLC vendor manuals, K-ST is a high-level reference semantics that can be used to evaluate the correctness and consistency of different ST implementations. We validate K-ST by executing 509 ST programs extracted from Github and comparing the results against existing commercial compilers…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsBusiness Process Modeling and Analysis · Software System Performance and Reliability · Service-Oriented Architecture and Web Services
