Formal Verification of Embedded Software for SIL-4 Systems

Author: Thom Lijn March 15, 2024

At Codewit Solutions, we specialize in the formal verification of embedded software for safety-critical systems, such as railway signals and bridge controls. Our approach guarantees that control algorithms function flawlessly under all conceivable conditions, up to the highest Safety Integrity Level (SIL-4).

The core of our method lies in static code analysis and mathematical proof. Instead of relying on traditional testing methods, we model system behavior and prove its correctness using formal logic. This process eliminates the uncertainty inherent in sample-based testing.

// Example of a verified state machine
typedef enum {
    STATE_IDLE,
    STATE_ACTIVE,
    STATE_FAULT
} SystemState;

bool verifyTransition(SystemState current, SystemState next) {
    // Formal specification of allowed transitions
    return (current == STATE_IDLE && next == STATE_ACTIVE) ||
           (current == STATE_ACTIVE && next == STATE_IDLE) ||
           (current == STATE_ACTIVE && next == STATE_FAULT) ||
           (current == STATE_FAULT && next == STATE_IDLE);
}

Our verification pipeline includes:

  • Model Checking: Exhaustive verification of all possible system states.
  • Theorem Proving: Mathematical proof of algorithmic correctness.
  • Abstract Interpretation: Analysis of runtime properties without execution.

The result is software that meets the strictest standards, such as EN 50128 for railways and IEC 61508 for industrial systems. By eliminating errors in the design phase, we prevent costly recalls and, more importantly, potentially dangerous situations.

Comments

Damian van Wallaert
Excellent article that clearly explains the core of formal verification. The practical examples are very relevant for our work in the railway sector.
March 16, 2024
Jayda van Vliet
Interesting to see how you apply theorem proving to embedded systems. Do you also have experience with mixed-criticality systems?
March 17, 2024
Pieter de Vries
The code snippet illustrates the concept well. More technical depth about the tools used (e.g., CBMC, Frama-C) would be welcome in a follow-up article.
March 18, 2024

Cookie Preference

This website uses cookies to improve the user experience and ensure functionality. By continuing, you consent to the use of these cookies. You can manage your preferences at any time.

🌐 Language
NL EN