← Latest papers
⚡ electrical engineering

ESBMC-Arduino: Closing the Deployment Gap for Formal Verification of Open-Hardware PLCs

This paper introduces ESBMC-Arduino, a hardware-faithful verification framework that bridges the deployment gap for open-hardware PLCs by integrating a declarative hardware abstraction layer and sound input-range modeling to eliminate false alarms caused by idealized integer assumptions while detecting genuine width-dependent defects in IEC 61131-3 programs running on resource-constrained microcontrollers.

Original authors: Pierre Dantas, Lucas Cordeiro, Waldir Junior

Published 2026-07-10
📖 5 min read🧠 Deep dive

Original authors: Pierre Dantas, Lucas Cordeiro, Waldir Junior

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are building a robot to manage a water tank. You write the instructions in a special language called IEC 61131-3, which is like a universal recipe book for industrial machines. For years, engineers have used "super-robot" simulators to check if these recipes are safe. These simulators are like wizards who can think with infinite numbers; they assume the robot can hold any number in its head, from negative infinity to positive infinity, and that sensors can report any value imaginable.

But here is the twist: the actual robot you build isn't a wizard. It's a tiny, cheap microcontroller (like an Arduino) that lives in the real world. This little chip has a very specific, limited brain. It can only hold numbers up to 32,767. If a calculation goes higher, the number doesn't just get bigger; it breaks, snaps back to the bottom, and turns into a negative number. It's like a car odometer that rolls over from 999,999 back to 000,000.

The Great Disconnect
The paper calls this the "deployment gap." It's the difference between the wizard's dream world and the robot's cramped reality.

The authors found that when engineers used the old "wizard" simulators to check their code for safety, they were getting a massive amount of false alarms. Out of 123 real-world programs they tested, the old simulators screamed "DANGER!" 54 times (a 44% false-alarm rate). But when they looked closer, they realized these "dangers" were impossible. The simulators were imagining sensor readings like -32,764. In the real world, a sensor connected to this robot can only read numbers between 0 and 1,023 (because it's a 10-bit sensor). A value of -32,764 is like a thermometer reading "minus 32,764 degrees"—it simply cannot happen.

The paper argues that relying on these old simulators is like a security guard yelling "Intruder!" because they saw a ghost. The guard is technically "correct" about the ghost, but useless because ghosts don't exist. The authors explicitly rule out the idea that you can just check for math errors without also checking what the sensors can actually see. They show that doing so makes the verification "unsound" (unreliable) in practice.

The Magic Fix: The HAL Descriptor
To fix this, the authors built a new tool called ESBMC-Arduino. Think of this tool as a "Reality Check" filter.

Before the wizard simulator looks at the code, this new tool attaches a tiny, automatic note to every sensor. It says, "Hey, remember, this sensor can only give numbers between 0 and 1,023." It also reminds the simulator, "And remember, the robot's brain can only hold numbers up to 32,767."

When the simulator runs with these rules, the magic happens:

  1. The 54 false alarms vanish instantly. The ghost of -32,764 is gone because the simulator now knows that number is impossible.
  2. The 32 programs that were already proven safe stay safe.
  3. Most importantly, the tool didn't miss any real bugs. It found that the old simulators were hiding a specific type of real danger: when a sensor reading gets multiplied by a big number (like turning a raw sensor value into a percentage), the math can overflow the tiny robot's brain.

The Real Danger (and how rare it is)
The paper found that while the "ghost alarms" were common, the real bugs caused by this gap were actually quite rare in the public code they tested. They only found genuine defects in specific scenarios where a sensor reading was multiplied by a large constant (like 100) on a 16-bit board.

For example, if a sensor reads 898 (which is a normal, real value), and the code multiplies it by 100, the result is 89,800. This is too big for the 16-bit robot brain (max 32,767). The number wraps around, becomes a negative number, and the robot thinks the water tank is empty when it's actually overflowing. The new tool caught this exact scenario and gave the engineers a real, physical example of the sensor reading that would cause the crash.

What the Paper Doesn't Claim
The authors are very honest about what they didn't do. They didn't prove that every program is now safe. Out of the 123 programs, 91 ended up with a verdict of "unknown." This isn't because the tool is broken; it's because the math to prove those specific programs safe is too hard for the current engine to finish. The tool successfully removed the noise (the false alarms) and kept the signal (the real proofs), but it couldn't solve the hardest puzzles yet.

Also, they didn't test this on floating-point numbers (decimals like 3.14) or complex physics simulations. They focused strictly on whole numbers (integers) and Boolean logic (on/off switches).

The Bottom Line
The paper demonstrates that to verify open-hardware PLCs (like those used in schools and small factories), you can't just check the math; you have to check the limits of the hardware. By automatically adding a "Reality Check" that tells the simulator what the sensors can actually do, they turned a noisy, unreliable tool into a trustworthy one. They didn't find a million new bugs, but they stopped the tool from crying wolf, making it possible for engineers to trust the safety checks again.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →