LLMs write PLC code that compiles and is still unsafe, so I gated it behind a real compiler and a soft-PLC test harness
Summary
A practitioner builds a deterministic four-gate validation harness (graph check, safety audit, headless CODESYS compile, soft-PLC scan-cycle tests) to verify LLM-generated IEC 61131-3 PLC programs, showing that vendor compilers and simulators are better judges than LLM-as-judge for safety-critical code.
Similar Articles
ESBMC-PLC: Formal Verification of IEC 61131-3 Ladder Diagram Programs Using SMT-Based Model Checking
This paper presents ESBMC-PLC, the first open-source formal verifier with native support for IEC 61131-3 Ladder Diagram programs using SMT-based model checking, enabling automated verification of safety-critical industrial control logic.
Detecting Ladder Logic Bombs in IEC 61131-3 PLC Programs using ESBMC-PLC+: A Formal Verification Approach with Trigger Synthesis
This paper presents ESBMC-LLB, a formal verification approach to detect Ladder Logic Bombs in IEC 61131-3 PLC programs by synthesizing triggers and using ESBMC-PLC+ as the verification engine, achieving high detection rates on public datasets.
My LLM kept implementing every method it found, so I added research and specification gates[D]
An LLM developer added research and specification gates to prevent the model from implementing every method it encounters, improving code generation quality.
SemaPLC: A Project-Grounded, Verification-Gated Agent Harness for PLC Code Generation
SemaPLC is a verification-gated agent harness for PLC code generation that uses external compilation and live runtime execution to achieve higher verified pass rates than baseline methods.
Reproducing History Is Not Enough: Intervention-Level Assurance for LLM-Generated Simulators
The paper proposes Vouch, a library for intervention-level assurance of LLM-generated simulators, which checks whether individual what-if answers can be trusted rather than giving a whole-program pass/fail verdict. Evaluated across three program-generation platforms, five LLMs and four domains, Vouch removed 97.6% of wrong answers while still trusting 80.1% of all answers.