Automated Formal Synthesis of Neural Barrier Certificates for Dynamical Models

Andrea Peruffo, Daniele Ahmed, Alessandro AbatearXiv 2020

Introduction

Ensuring the safety of complex dynamical systems—ranging from autonomous drones to biological models—is a critical challenge. A standard approach involves finding Barrier Certificates (BC), mathematical functions that partition the state space into safe and unsafe regions. If a valid BC exists, it serves as a formal proof that the system will never enter an unsafe state.

However, synthesizing these certificates is notoriously difficult. Traditional methods like Sum-of-Squares (SOS) optimization often fail on non-polynomial systems or produce numerically unsound results. While neural networks (NNs) offer a promising alternative for finding these certificates, they typically require massive datasets and lack the formal guarantees necessary for safety-critical applications. This paper introduces a formal, automated framework that combines neural learning with SMT-based verification to synthesize safety proofs up to 100x faster and with 1,000x less data than previous state-of-the-art methods.

Methods: The CEGIS Framework

The core of the proposed approach is a CounterExample-Guided Inductive Synthesis (CEGIS) loop. This framework automates the discovery of Barrier Certificates by alternating between a learning phase and a verification phase.

The CounterExample-Guided Inductive Synthesis (CEGIS) loop for Barrier Certificate generation.

1. The Learner (Neural Network)

A neural network is trained to serve as a candidate Barrier Certificate. To ensure the resulting function is differentiable and interpretable for formal verification, the authors utilize polynomial activation functions. A bespoke loss function is employed that goes beyond simple error penalization, instead "rewarding" the network for establishing a robust safety margin.

2. The Verifier (SMT Solver)

The candidate BC is passed to a Satisfiability Modulo Theory (SMT) solver (such as dReal or Z3). The solver exhaustively searches the state space for any point that violates the safety conditions:

  • Verification: If no violations are found, the BC is formally proven correct.
  • Counter-example Generation: If a violation is detected, the solver generates a counter-example.

A key innovation in this framework is the handling of counter-examples. Rather than passing a single point back to the learner, the authors generate a "cloud" of points around the violation. By using gradient-based methods to identify the most "unsafe" directions within this cloud, the learner receives richer information, significantly accelerating convergence.

Evaluation and Benchmarks

The framework was evaluated across eight benchmarks, including classic polynomial models (Darboux), non-polynomial models (Exponential), and a 3D obstacle avoidance problem for a 2D airplane. The authors also introduced a 2D Hybrid Model and high-dimensional ODE models (4D to 8D) to test scalability.

Key Results

The CEGIS approach demonstrates significant improvements over existing methods:

  • Efficiency: Synthesis was up to two orders of magnitude faster than previous neural methods, with the verification step seeing speedups of up to five orders of magnitude.
  • Data Sparsity: The method is highly data-efficient. In the obstacle avoidance benchmark, it required only 0.02% of the training data used by prior state-of-the-art techniques.
  • Scalability and Soundness: The framework successfully verified an 8-dimensional system, a regime where many formal methods struggle. Unlike SOS-based methods, the CEGIS loop provides numerically sound, formal proofs.

Conclusion

By integrating neural learning with formal SMT verification in a closed loop, this work provides a scalable and efficient path toward automated safety proofs for complex systems. While the framework currently requires some manual tuning of hyperparameters and network architecture, it represents a major step toward "push-button" formal verification for engineers. Future work aims to automate the selection of activation functions and architectures to further enhance usability.

Summary updated

BibTeX
@misc{peruffo2020automated,
  author = {Andrea Peruffo and Daniele Ahmed and Alessandro Abate},
  title = {{Automated Formal Synthesis of Neural Barrier Certificates for Dynamical Models}},
  year = {2020},
  eprint = {2007.03251},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.03251},
}
Figure