Ensuring Deployment-Time Safety of Neural Network Controlled Systems via Localized Certificate Repair
Summary
This paper proposes adaptive piecewise barrier certificates and a localized certificate repair framework that restores formal safety guarantees for neural network controlled systems after deployment-time changes, achieving successful repairs in all benchmarks at 17.3× the speed of retraining from scratch.
View Cached Full Text
Cached at: 11/27/26, 09:33 AM
# Ensuring Deployment-Time Safety of Neural Network Controlled Systems via Localized Certificate Repair
Source: [https://arxiv.org/html/2611.33813](https://arxiv.org/html/2611.33813)
††thanks:Corresponding author\. Email address: pxwang@sei\.ecnu\.edu\.cn
###### Abstract
Barrier certificates provide formal safety guarantees for neural network controlled systems by ensuring that system trajectories avoid unsafe regions over time\. However, after deployment, previously unseen obstacles or constraint changes may introduce new unsafe regions, invalidating the original certificate and potentially leading to unsafe behavior\. We address this setting with*adaptive piecewise barrier certificates*, which preserve the original certificate and policy in unchanged regions while introducing localized updates around newly emerged unsafe regions\. The central question is how to perform such updates efficiently during system execution without retraining from scratch\. Our key idea is to cast deployment\-time adaptation as a localized certificate repair problem and reduce it to an optimization task that leverages the learned structure of previous barrier certificates, enabling fast updates without global retraining\. We further design a staged repair framework that progressively transitions from localized repair to joint policy–certificate updates and, when necessary, localized retraining\. Empirical results on four benchmarks with five new obstacles show that our method succeeds in all cases and completes within tens of seconds on average, whereas retraining from scratch fails in most cases\. On instances where retraining succeeds, our method is17\.3×\\timesfaster on average\. It incurs only16\.2%performance degradation relative to the original policy\.
## 1Introduction
Neural network controlled systems \(NNCSs\), particularly those based on deep reinforcement learning \(DRL\), are increasingly deployed in real\-world applications such as robotic manipulation[Kalashnikov et al\. \(2018\)](https://arxiv.org/html/2611.33813#bib.bib23), locomotion[Hwangbo et al\. \(2019\)](https://arxiv.org/html/2611.33813#bib.bib24), and autonomous driving[Kiran et al\. \(2021\)](https://arxiv.org/html/2611.33813#bib.bib25)\. In these safety\-critical settings, ensuring reliable behavior beyond training phases is essential, as violating state or input constraints can lead to severe consequences[Dulac\-Arnold et al\. \(2019\)](https://arxiv.org/html/2611.33813#bib.bib6)\. Barrier certificates \(BCs\) provide a principled approach for formal safety guarantees by ensuring that system trajectories avoid unsafe regions over time[Prajna and Jadbabaie \(2004\)](https://arxiv.org/html/2611.33813#bib.bib8);[Ames et al\. \(2019\)](https://arxiv.org/html/2611.33813#bib.bib7)\. However, such guarantees are typically established for a fixed set of obstacles and constraints\. After deployment, newly emerged obstacles may introduce unsafe regions unseen during training, invalidating the original certificate even for a previously certified system\. This raises a fundamental challenge: how to maintain formal safety guarantees in the presence of newly introduced unsafe regions at deployment time\.
A natural solution is to retrain the controller and certificate in the updated environment as commonly done in safe reinforcement learning and control synthesis[Garcıa and Fernández \(2015\)](https://arxiv.org/html/2611.33813#bib.bib3);[Cheng et al\. \(2019\)](https://arxiv.org/html/2611.33813#bib.bib1)\. However, global retraining is often too costly for deployment\-time budgets[Dulac\-Arnold et al\. \(2019\)](https://arxiv.org/html/2611.33813#bib.bib6)\. Alternatively, runtime verification and shielding enforce safety through online monitoring and intervention[Alshiekh et al\. \(2018\)](https://arxiv.org/html/2611.33813#bib.bib4);[Jansen et al\. \(2020\)](https://arxiv.org/html/2611.33813#bib.bib5);[Banerjee et al\. \(2024\)](https://arxiv.org/html/2611.33813#bib.bib38)\. While shielding approaches provide strong safety guarantees, they are particularly suited to transient environmental changes where obstacles may appear and soon disappear\. For persistent localized changes, repeated interventions around the same obstacle can incur substantial cumulative overhead\. A representative setting arises in autonomous mining and inspection, where systems repeatedly operate in largely stable environments with occasional but persistent localized changes[Jacobson et al\. \(2021\)](https://arxiv.org/html/2611.33813#bib.bib40);[Mansouri et al\. \(2020\)](https://arxiv.org/html/2611.33813#bib.bib41)\.
To address these limitations, we seek an approach that restores safety efficiently at deployment time while avoiding both the cost of global retraining and the overhead of continuous runtime monitoring and intervention\. Our approach is based on the observation that environment changes typically affect only a localized subset of the state space, so that safety can be recovered by modifying the barrier certificate only where necessary\. This motivates a one\-time certified repair, allowing the localized policy and certificate to be reused upon subsequent encounters without further repair\. Building on the observation, we consider neural barrier certificates[Abate et al\. \(2021\)](https://arxiv.org/html/2611.33813#bib.bib18), where the certificate is represented by a neural network, and propose a staged adaptation strategy centered on localized certificate repair\. Inspired by neural network repair[Sotoudeh and Thakur \(2021\)](https://arxiv.org/html/2611.33813#bib.bib15);[Refaeli and Katz \(2022\)](https://arxiv.org/html/2611.33813#bib.bib30);[Majd et al\. \(2021\)](https://arxiv.org/html/2611.33813#bib.bib31);[Dong et al\. \(2021\)](https://arxiv.org/html/2611.33813#bib.bib32), the method first repairs the original certificate in affected regions by reusing learned certificate structure, which can be formulated as a tractable linear program\. When such repair is insufficient, it incrementally increases flexibility by jointly updating the policy and the certificate through a localized bilevel optimization\. As a final fallback, it performs retraining restricted to the affected regions only, avoiding unnecessary recomputation elsewhere\. This design provides a principled middle ground between retraining and runtime monitoring: it restores persistent safety guarantees through targeted, one\-time updates, while maintaining efficiency by reusing the structure of the original neural certificate and policy\.
Our main contributions are as follows:
- •We introduceadaptive piecewise barrier certificates\([Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2)\) for deployment\-time safety repair, preserving the original policy and certificate in unaffected regions while composing them with locally repaired counterparts\. We establish interface compatibility conditions that guarantee global safety across region transitions \([Theorem2](https://arxiv.org/html/2611.33813#Thmtheorem2)\)\.
- •We develop a localized repair pipeline that reuses the structure of pre\-trained certificates\. We reduce continuous BC constraints to finite\-grid constraints \([Theorem3](https://arxiv.org/html/2611.33813#Thmtheorem3)\)\. The pipeline prioritizes certificate repair under a fixed policy, followed by local policy adaptation when necessary, with localized retraining as a fallback \([Theorems4](https://arxiv.org/html/2611.33813#Thmtheorem4)and[5](https://arxiv.org/html/2611.33813#Thmtheorem5)\)\.
- •We implement and evaluate our approach on four benchmarks with five newly introduced obstacles\. Our method restores global safety within seconds, achieving an average17\.3×\\timesspeedup over successful global retraining runs, while preserving nominal performance with an average reward degradation of16\.2%16\.2\\%\.
## 2Related Work
Barrier Certificates for Safety Verification\.Barrier certificates verify safety of dynamical systems by establishing forward invariance of safe sets without explicit reachability analysis[Prajna and Jadbabaie \(2004\)](https://arxiv.org/html/2611.33813#bib.bib8)\. They have been extensively studied in control theory, including the development of control barrier functions for enforcing safety in nonlinear systems[Ames et al\. \(2019\)](https://arxiv.org/html/2611.33813#bib.bib7)\. A recent work use barrier certificates to provide safety guarantees in prescribed dynamic obstacles[Mazouz et al\. \(2026\)](https://arxiv.org/html/2611.33813#bib.bib37)\. More recently, barrier certificates have been combined with learning\-based methods, where neural networks are used to represent certificates or controllers, enabling scalable safety verification for high\-dimensional systems[Cheng et al\. \(2019\)](https://arxiv.org/html/2611.33813#bib.bib1);[Dawson et al\. \(2023\)](https://arxiv.org/html/2611.33813#bib.bib2)\. However, existing barrier certificate methods typically assume a fixed environment and focus on offline synthesis and verification\. They do not address the problem of maintaining safety when new obstacles or constraints are introduced after deployment, which may invalidate previously certified guarantees\.
Safe Reinforcement Learning\.Safe reinforcement learning aims to learn policies that satisfy safety constraints during training or execution[Garcıa and Fernández \(2015\)](https://arxiv.org/html/2611.33813#bib.bib3)\. A common approach is to incorporate constraints into the learning objective or to synthesize safe controllers jointly with certificates, including methods based on barrier functions[Cheng et al\. \(2019\)](https://arxiv.org/html/2611.33813#bib.bib1)\. While effective in principle, these approaches typically rely on retraining when the environment or constraints change, which can be computationally expensive and impractical under deployment\-time constraints[Dulac\-Arnold et al\. \(2019\)](https://arxiv.org/html/2611.33813#bib.bib6)\. In contrast, our work focuses on efficient safety restoration without global retraining\.
Runtime Verification and Shielding\.Runtime verification and shielding ensure safety through online monitoring and intervention[Alshiekh et al\. \(2018\)](https://arxiv.org/html/2611.33813#bib.bib4);[Jansen et al\. \(2020\)](https://arxiv.org/html/2611.33813#bib.bib5);[Banerjee et al\. \(2024\)](https://arxiv.org/html/2611.33813#bib.bib38)\. These methods are particularly suited to transient environmental changes, where obstacles may appear and disappear\. For persistent localized changes, however, repeated interventions around the same obstacles can accumulate substantial overhead\. In contrast, our approach performs one\-time localized repair and verification, allowing the certified policy and certificate to be reused across subsequent executions\.
Neural Network Repair\.Neural network repair techniques aim to correct undesirable behaviors of trained models through minimal modifications, without retraining from scratch[Sotoudeh and Thakur \(2021\)](https://arxiv.org/html/2611.33813#bib.bib15);[Refaeli and Katz \(2022\)](https://arxiv.org/html/2611.33813#bib.bib30);[Majd et al\. \(2021\)](https://arxiv.org/html/2611.33813#bib.bib31);[Dong et al\. \(2021\)](https://arxiv.org/html/2611.33813#bib.bib32)\. These methods have been studied in the context of formal verification and robustness, focusing on enforcing local correctness properties while preserving overall model behavior\. Our work is inspired by this line of research, but differs in that we develop repair techniques for safety certificates in dynamical systems and integrate them into a deployment\-time safety framework\.
## 3Preliminaries
### 3\.1Neural Network Controlled Systems
An NNCS can be modeled as a tupleM=\(S,S0,A,f,π,R,Su\)M=\(S,S\_\{0\},A,f,\\pi,R,S\_\{u\}\), whereS⊆ℝnS\\subseteq\\mathbb\{R\}^\{n\}is the \(continuous\) state space andS0⊆SS\_\{0\}\\subseteq Sis a set of admissible initial states\. At each discrete time stept∈ℕ0t\\in\\mathbb\{N\}\_\{0\}, the controller chooses an actionat∈Aa\_\{t\}\\in Afrom an action spaceA⊆ℝmA\\subseteq\\mathbb\{R\}^\{m\}according to a control policyπ:S→A\\pi:S\\to A, implemented by a deep neural network \(DNN\) via deep reinforcement learning\. Concretely, the system evolves according to the following dynamics
xt\+1=f\(xt,at\),f:S×A→S,x\_\{t\+1\}=f\(x\_\{t\},a\_\{t\}\),\\qquad f:S\\times A\\to S,\(1\)wherext∈Sx\_\{t\}\\in Sdenotes the state at timett\. Consequently, a rewardrt\(xt,at,xt\+1\)r\_\{t\}\(x\_\{t\},a\_\{t\},x\_\{t\+1\}\)is obtained by the reward functionR:S×A×S→ℝR:S\\times A\\times S\\rightarrow\{\\mathbb\{R\}\}\. Safety requirements are specified by an*unsafe set*Su⊆SS\_\{u\}\\subseteq Ssuch thatS0∩Su=∅S\_\{0\}\\cap S\_\{u\}=\\emptyset\(equivalently, a safe set isS∖SuS\\setminus S\_\{u\}\)\.
Trajectories\.Given an NNCSMMand an initial states0∈S0s\_\{0\}\\in S\_\{0\}, a sequence of states generated during interaction with the environment is called atrajectory, denoted asω=\{xt\}t∈ℕ0\\omega=\\\{x\_\{t\}\\\}\_\{t\\in\\mathbb\{N\}\_\{0\}\}\. To simplify notations, we denote byωt\\omega\_\{t\}thet\-th element ofω\\omega, i\.e\.,ωt=xt\\omega\_\{t\}=x\_\{t\}, and byΩM\(S0\)\\Omega\_\{M\}\(S\_\{0\}\)the set of all trajectories fromS0S\_\{0\}in the NNCSMM\. Moreover, we defineℋ\(ΩM\(X\)\):=⋃ω∈ΩM\(X\)\{ωt∈S∣t∈ℕ0\}\\mathcal\{H\}\(\\Omega\_\{M\}\(X\)\):=\\bigcup\_\{\\omega\\in\\Omega\_\{M\}\(X\)\}\\\{\\omega\_\{t\}\\in S\\mid t\\in\\mathbb\{N\}\_\{0\}\\\}, which collects all states appearing along trajectories inΩM\(X\)\\Omega\_\{M\}\(X\)\.
### 3\.2Barrier Certificates and Safety Guarantees
We briefly review barrier certificates for discrete\-time systems and the safety guarantee[Prajna and Jadbabaie \(2004\)](https://arxiv.org/html/2611.33813#bib.bib8);[Ames et al\. \(2019\)](https://arxiv.org/html/2611.33813#bib.bib7);[Xue \(2026\)](https://arxiv.org/html/2611.33813#bib.bib26)\.
###### Definition 1\(Barrier certificates\)\.
A barrier certificate for an NNCSMMis a functionB:S→ℝB:S\\to\\mathbb\{R\}if it satisfies that for some constantλ∈\[0,1\]\\lambda\\in\[0,1\]:
\(Initial condition\)B\(x\)≤0,\\displaystyle B\(x\)\\leq 0,∀x∈S0,\\displaystyle\\forall x\\in S\_\{0\},\(2\)\(Separation\)B\(x\)\>0,\\displaystyle B\(x\)\>0,∀x∈Su,\\displaystyle\\forall x\\in S\_\{u\},\(3\)\(Non Positivity\)B\(f\(x,π\(x\)\)\)−λ⋅B\(x\)≤0,\\displaystyle B\\bigl\(f\(x,\\pi\(x\)\)\\bigr\)\-\\lambda\\cdot B\(x\)\\leq 0,∀x∈S∖Su\.\\displaystyle\\forall x\\in S\\setminus S\_\{u\}\.\(4\)
Condition \([2](https://arxiv.org/html/2611.33813#S3.E2)\) ensures that all admissible initial states satisfy the safety condition\. Condition \([3](https://arxiv.org/html/2611.33813#S3.E3)\) enforces a strict separation between safe and unsafe states\. Condition \([4](https://arxiv.org/html/2611.33813#S3.E4)\) guarantees that the barrier value does not increase along system trajectories, preventing transitions from safe to unsafe regions\.
###### Theorem 1\(Safety Guarantees by Barrier Certificates\)\.
If there exists a barrier certificateBBfor an NNCSMMsatisfying \([2](https://arxiv.org/html/2611.33813#S3.E2)\)–\([4](https://arxiv.org/html/2611.33813#S3.E4)\), then any trajectoryω=\{xt\}t∈ℕ0∈ΩM\(S0\)\\omega=\\\{x\_\{t\}\\\}\_\{t\\in\\mathbb\{N\}\_\{0\}\}\\in\\Omega\_\{M\}\(S\_\{0\}\)withx0∈S0x\_\{0\}\\in S\_\{0\}satisfiesxt∉Sux\_\{t\}\\notin S\_\{u\}for allt∈ℕ0t\\in\\mathbb\{N\}\_\{0\}\. Consequently,MMis safe w\.r\.t\.SuS\_\{u\}\.
Neural barrier certificates \(NBC\)\.Barrier certificates can be parameterized by neural networks[Abate et al\. \(2021\)](https://arxiv.org/html/2611.33813#bib.bib18);[Peruffo et al\. \(2021\)](https://arxiv.org/html/2611.33813#bib.bib17), providing strong expressive power for high\-dimensional systems\. Under the CEGIS paradigm[Abate et al\. \(2018\)](https://arxiv.org/html/2611.33813#bib.bib16), NBC synthesis alternates between learning a candidate certificate and validating it against the barrier conditions in[Eq\.2](https://arxiv.org/html/2611.33813#S3.E2)–[Eq\.4](https://arxiv.org/html/2611.33813#S3.E4), with counterexamples used for refinement[Žikelić et al\. \(2023\)](https://arxiv.org/html/2611.33813#bib.bib27);[Zhi et al\. \(2024a\)](https://arxiv.org/html/2611.33813#bib.bib28)\. In this work, we assume a nominal policyπ\\piis given, along with an NBCBBthat has been synthesized and validated in a nominal environment, and focus on repairingBBunder deployment\-time changes\.
Assumptions\.We assume the system dynamics, policy, and neural barrier certificates are all Lipschitz continuous\. Furthermore, we suppose the state spaceSSis compact\. All the assumptions are commonly used in the literature[Žikelić et al\. \(2023\)](https://arxiv.org/html/2611.33813#bib.bib27);[Zhi et al\. \(2024a\)](https://arxiv.org/html/2611.33813#bib.bib28);[Zhi et al\. \(2024b\)](https://arxiv.org/html/2611.33813#bib.bib33)\.
## 4Deployment\-time Safety Guarantee
### 4\.1Motivation and Problem Statement
Consider an NNCSM=\(S,S0,A,f,π,R,Su\)M=\(S,S\_\{0\},A,f,\\pi,R,S\_\{u\}\)with a control policyπ\\piand a barrier certificateBBthat guarantees safety with respect to the unsafe setSuS\_\{u\}, as shown in[Fig\.2](https://arxiv.org/html/2611.33813#S4.F2)\(a\)\. After deployment, the environment introduces a new unsafe setSunew⊆SS\_\{u\}^\{\\mathrm\{new\}\}\\subseteq SwithSu∩Sunew=∅S\_\{u\}\\cap S\_\{u\}^\{\\mathrm\{new\}\}=\\emptyset, leading to an updated unsafe setS^u:=Su∪Sunew\\hat\{S\}\_\{u\}:=S\_\{u\}\\cup S\_\{u\}^\{\\mathrm\{new\}\}\. Consequently,MMmay enters the new unsafe setSunewS\_\{u\}^\{\\mathrm\{new\}\}\(see[Fig\.2](https://arxiv.org/html/2611.33813#S4.F2)\(b\)\)\. This loss of safety is caused by two reasons\. First, the policyπ\\piis not trained againstSunewS\_\{u\}^\{\\mathrm\{new\}\}and can drive the system into this region\. Second, the barrier certificateBB, synthesized forSuS\_\{u\}, may fail to certify safety with respect toS^u\\hat\{S\}\_\{u\}, e\.g\., the separation condition can be violated onSunewS\_\{u\}^\{\\mathrm\{new\}\}\.
Existing approaches and limitations\.*Global retraining*updates both the policy and barrier certificate, but incurs high computational costs, and must be repeated for new unsafe regions\.*Runtime verification and shielding*handle transient environmental changes through online monitoring and intervention, but repeated interventions around persistent obstacles can accumulate substantial overhead\. For persistent localized changes, we instead seek one\-time deployment\-time repair to restore safety and reuse the certified system across subsequent executions \([Fig\.2](https://arxiv.org/html/2611.33813#S4.F2)\(c\)\)\.
Problem Statement\.Given a newly introduced unsafe setSunewS\_\{u\}^\{\\mathrm\{new\}\}after deployment, leading to the updated unsafe setS^u:=Su∪Sunew\\hat\{S\}\_\{u\}:=S\_\{u\}\\cup S\_\{u\}^\{\\mathrm\{new\}\}, the goal is to restore safety with respect toS^u\\hat\{S\}\_\{u\}, i\.e\.,xt∉S^ux\_\{t\}\\notin\\hat\{S\}\_\{u\}for all timet∈ℕ0t\\in\{\\mathbb\{N\}\}\_\{0\}\. This should be achieved efficiently by preserving the original policy and certificate whenever possible\.
Figure 1:Problem Statement and Methods Comparison
Figure 2:Overview of the proposed local repair framework\.
### 4\.2Safety by Adaptive Piecewise Barrier Certificates
To restore safety with respect to the updated unsafe setS^u=Su∪Sunew\\hat\{S\}\_\{u\}=S\_\{u\}\\cup S\_\{u\}^\{\\mathrm\{new\}\}after deployment\-time changes, we avoid global re\-certification and instead perform localized updates\. Specifically, we partition the state spaceSSinto an unaffected regionSoriginS\_\{\\mathrm\{origin\}\}and a localized repair regionSnewS\_\{\\mathrm\{new\}\}\(see[Section5\.2](https://arxiv.org/html/2611.33813#S5.SS2)\) such thatS=Sorigin∪SnewS=S\_\{\\mathrm\{origin\}\}\\cup S\_\{\\mathrm\{new\}\}andSorigin∩Snew=∅S\_\{\\mathrm\{origin\}\}\\cap S\_\{\\mathrm\{new\}\}=\\emptyset\. Moreover,Su⊆SoriginS\_\{u\}\\subseteq S\_\{\\mathrm\{origin\}\}andSunew⊆SnewS\_\{u\}^\{\\mathrm\{new\}\}\\subseteq S\_\{\\mathrm\{new\}\}andS0⊆SoriginS\_\{0\}\\subseteq S\_\{\\mathrm\{origin\}\}\. OnSoriginS\_\{\\mathrm\{origin\}\}, the original policyπ\\piand barrier certificateBBare retained, while onSnewS\_\{\\mathrm\{new\}\}, a localized policyπnew\\pi\_\{\\mathrm\{new\}\}is used\.111πnew\\pi\_\{\\mathrm\{new\}\}is set to beπ\\piand then updated if necessary to restore system safety, see[Section5](https://arxiv.org/html/2611.33813#S5)\.The resulting system is described byM^=\(S,S0,A,f,π^,R,S^u\)\\hat\{M\}=\(S,S\_\{0\},A,f,\\hat\{\\pi\},R,\\hat\{S\}\_\{u\}\), where the closed\-loop policyπ^\\hat\{\\pi\}is defined piecewise over the two regions, i\.e\.,π^=π\(x\)\\hat\{\\pi\}=\\pi\(x\)whenx∈Soriginx\\in S\_\{\\mathrm\{origin\}\}andπ^=πnew\(x\)\\hat\{\\pi\}=\\pi\_\{\\mathrm\{new\}\}\(x\)whenx∈Snewx\\in S\_\{\\mathrm\{new\}\}\.
To characterize the cross\-region transitions, we introduce the following switching interface sets:
Γin−\\displaystyle\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}:=\{x∣x∈ℋ\(ΩM^\(S0\)\)∩Sorigin,f\(x,π\(x\)\)∈Snew\},\\displaystyle:=\\\{x\\mid x\\in\\mathcal\{H\}\(\\Omega\_\{\\hat\{M\}\}\(S\_\{0\}\)\)\\cap S\_\{\\mathrm\{origin\}\},\\ f\(x,\\pi\(x\)\)\\in S\_\{\\mathrm\{new\}\}\\\},\(5\)Γin\+\\displaystyle\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}:=\{f\(x,π\(x\)\)∣x∈Γin−\},\\displaystyle:=\\\{f\(x,\\pi\(x\)\)\\mid x\\in\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}\\\},\(6\)Γout−\\displaystyle\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}:=\{x∣x∈ℋ\(ΩM^\(Γin\+\)\)∩Snew,f\(x,πnew\(x\)\)∈Sorigin\},\\displaystyle:=\\\{x\\mid x\\in\\mathcal\{H\}\(\\Omega\_\{\\hat\{M\}\}\(\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\)\)\\cap S\_\{\\mathrm\{new\}\},\\ f\(x,\\pi\_\{\\mathrm\{new\}\}\(x\)\)\\in S\_\{\\mathrm\{origin\}\}\\\},\(7\)Γout\+\\displaystyle\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}:=\{f\(x,πnew\(x\)\)∣x∈Γout−\}\.\\displaystyle:=\\\{f\(x,\\pi\_\{\\mathrm\{new\}\}\(x\)\)\\mid x\\in\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}\\\}\.\(8\)HereΓin−\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}andΓin\+\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}describe one\-step transitions from the unaffected regionSoriginS\_\{\\mathrm\{origin\}\}into the localized repair regionSnewS\_\{\\mathrm\{new\}\}, whileΓout−\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}andΓout\+\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}describe one\-step transitions fromSnewS\_\{\\mathrm\{new\}\}back toSoriginS\_\{\\mathrm\{origin\}\}\. The restriction toℋ\(ΩM^\(S0\)\)\\mathcal\{H\}\(\\Omega\_\{\\hat\{M\}\}\(S\_\{0\}\)\)ensures that incoming transitions originate from states reachable fromS0S\_\{0\}under the updated systemM^\\hat\{M\}\. In particular, the entry set of the localized repair region is exactlyS0new=Γin\+S\_\{0\}^\{\\mathrm\{new\}\}=\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\. For each subsequently introduced unsafe region, the same definitions are instantiated using the corresponding currentSoriginS\_\{\\mathrm\{origin\}\},SnewS\_\{\\mathrm\{new\}\}, and updated systemM^\\widehat\{M\}; the sequential construction is detailed in Appendix[A\.2](https://arxiv.org/html/2611.33813#A1.SS2)\.
###### Definition 2\(Adaptive Piecewise Barrier Certificates\)\.
Given an NNCSM^=\(S,S0,A,f,π^,R,S^u\)\\hat\{M\}=\(S,S\_\{0\},A,f,\\hat\{\\pi\},R,\\hat\{S\}\_\{u\}\), a barrier certificateBBw\.r\.t\.π\\piandSuS\_\{u\}\(as defined in[Definition1](https://arxiv.org/html/2611.33813#Thmdefinition1)\), and a localized barrier certificateBnew:S→ℝB\_\{\\mathrm\{new\}\}:S\\rightarrow\{\\mathbb\{R\}\}w\.r\.t\.πnew\\pi\_\{\\mathrm\{new\}\}andSunewS\_\{u\}^\{\\mathrm\{new\}\}satisfying
Bnew\(x\)≤0,\\displaystyle B\_\{\\mathrm\{new\}\}\(x\)\\leq 0,∀x∈S0new,\\displaystyle\\forall x\\in S\_\{0\}^\{\\mathrm\{new\}\},\(9\)Bnew\(x\)\>0,\\displaystyle B\_\{\\mathrm\{new\}\}\(x\)\>0,∀x∈Sunew,\\displaystyle\\forall x\\in S\_\{u\}^\{\\mathrm\{new\}\},\(10\)Bnew\(f\(x,πnew\(x\)\)\)−λ′Bnew\(x\)≤0,\\displaystyle B\_\{\\mathrm\{new\}\}\\\!\\bigl\(f\(x,\\pi\_\{\\mathrm\{new\}\}\(x\)\)\\bigr\)\-\\lambda^\{\\prime\}B\_\{\\mathrm\{new\}\}\(x\)\\leq 0,∀x∈Snew∖Sunew\.\\displaystyle\\forall x\\in S\_\{\\mathrm\{new\}\}\\setminus S\_\{u\}^\{\\mathrm\{new\}\}\.\(11\)An adaptive piecewise barrier certificate forM^\\hat\{M\}is a functionV:S→ℝV:S\\to\\mathbb\{R\}such that
V\(x\)=\{B\(x\),x∈Sorigin,αBnew\(x\),x∈Snew,λ^\(x\)=\{λ,x∈Sorigin,λ′,x∈Snew,\\displaystyle V\(x\)=\\begin\{cases\}B\(x\),&x\\in S\_\{\\mathrm\{origin\}\},\\\\ \\alpha B\_\{\\mathrm\{new\}\}\(x\),&x\\in S\_\{\\mathrm\{new\}\},\\end\{cases\}\\qquad\\hat\{\\lambda\}\(x\)=\\begin\{cases\}\\lambda,&x\\in S\_\{\\mathrm\{origin\}\},\\\\ \\lambda^\{\\prime\},&x\\in S\_\{\\mathrm\{new\}\},\\end\{cases\}withα\>0\\alpha\>0andλ^\(x\)∈\[0,1\]\\hat\{\\lambda\}\(x\)\\in\[0,1\]for allx∈Sx\\in S\.
Here,αBnew\\alpha B\_\{\\mathrm\{new\}\}is also a valid localized barrier certificate onSnewS\_\{\\mathrm\{new\}\}\(see more details in Appendix[A\.1](https://arxiv.org/html/2611.33813#A1.SS1)\)\. The following theorem gives sufficient conditions under which adaptive piecewise barrier certificates can ensure deployment\-time system safety\.
###### Theorem 2\(Deployment\-time Safety by adaptive piecewise barrier certificates\)\.
Consider an NNCSM^=\(S,S0,A,f,π^,R,S^u\)\\hat\{M\}=\(S,S\_\{0\},A,f,\\hat\{\\pi\},R,\\hat\{S\}\_\{u\}\)\. If there exists an adaptive piecewise barrier certificateVVforM^\\hat\{M\}as defined in[Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2), and the switching interface sets satisfy
αUb\(Bnew\(Γin\+\)\)−λLb\(B\(Γin−\)\)≤0,andUb\(B\(Γout\+\)\)−αλ′Lb\(Bnew\(Γout−\)\)≤0,\\alpha U\_\{b\}\\\!\\left\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\)\\right\)\-\\lambda L\_\{b\}\\\!\\left\(B\(\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}\)\\right\)\\leq 0,\\quad\\text\{and\}\\quad U\_\{b\}\\\!\\left\(B\(\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}\)\\right\)\-\\alpha\\lambda^\{\\prime\}L\_\{b\}\\\!\\left\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}\)\\right\)\\leq 0,\(12\)then the systemM^\\hat\{M\}is safe w\.r\.t\.S^u\\hat\{S\}\_\{u\}, whereUb\(⋅\)U\_\{b\}\(\\cdot\)andLb\(⋅\)L\_\{b\}\(\\cdot\)denote the upper and lower bounds of a function over sets, respectively\.
[Theorem2](https://arxiv.org/html/2611.33813#Thmtheorem2)shows that deployment\-time safety can be reduced to synthesizing a localized barrier certificateBnewB\_\{\\mathrm\{new\}\}onSnewS\_\{\\mathrm\{new\}\}and verifying its compatibility with the original barrier certificate over the switching interface sets \(see more details in Appendix[A\.1](https://arxiv.org/html/2611.33813#A1.SS1)\) \. In the next section, we will show how to findBnewB\_\{\\mathrm\{new\}\}at deployment time\.
## 5Repair Framework for Safety Restoration
### 5\.1Overview of the Repair Framework
In this section, we introduce our repair framework in[Fig\.2](https://arxiv.org/html/2611.33813#S4.F2)for safety restoration, which provides formal safety guarantees after system deployment\. Newly introduced obstacles are identified by perception methods[Elfes \(2002\)](https://arxiv.org/html/2611.33813#bib.bib21);[Hornung et al\. \(2013\)](https://arxiv.org/html/2611.33813#bib.bib22)that equipped with our system and taken as input to our framework\.
Input\.The input of our framework consists of an NNCSMMwith a barrier certificateBBw\.r\.t\. the control policyπ\\piand the unsafe setSuS\_\{u\}, and a newly introduced unsafe set \(a\.k\.a\. obstacle\)SunewS^\{\\mathrm\{new\}\}\_\{u\}\.
Step I: Repair Region Construction\.The framework first constructs a localized repair regionSnewS\_\{\\mathrm\{new\}\}that covers the newly introduced unsafe set, i\.e\.,Sunew⊆SnewS^\{\\mathrm\{new\}\}\_\{u\}\\subseteq S\_\{\\mathrm\{new\}\}\(see details in[Section5\.2](https://arxiv.org/html/2611.33813#S5.SS2)\)\. Then it divides the whole state spaceSSinto two disjoint setsSoriginS\_\{\\mathrm\{origin\}\}andSnewS\_\{\\mathrm\{new\}\}\(see[Section4\.2](https://arxiv.org/html/2611.33813#S4.SS2)\)\.
Step II: Transfer\-based Repair\.The framework focuses on the repair regionSnewS\_\{\\mathrm\{new\}\}and aims to reuse the original policy and barrier certificate whenever possible\. This leads to three progressive transfer\-based repair stages \(see[Section5\.2](https://arxiv.org/html/2611.33813#S5.SS2)\)\. The goal of Step II is to obtain a policyπnew\\pi\_\{\\mathrm\{new\}\}and a valid localized barrier certificate onSnewS\_\{\\mathrm\{new\}\}satisfying[Eqs\.9](https://arxiv.org/html/2611.33813#S4.E9),[10](https://arxiv.org/html/2611.33813#S4.E10)and[11](https://arxiv.org/html/2611.33813#S4.E11)\.
Step III: Verification\.After Step II, the framework obtains a localized BCBnewB\_\{\\mathrm\{new\}\}w\.r\.t\.πnew\\pi\_\{\\mathrm\{new\}\}andSunewS\_\{u\}^\{\\mathrm\{new\}\}\. Combined with the original BCBBw\.r\.t\.π\\piandSuS\_\{u\}, it induces an adaptive piecewise barrier certificateVVas defined in[Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2)\. Next, the framework computes the switching interface sets via reachability analysis[Wang et al\. \(2023\)](https://arxiv.org/html/2611.33813#bib.bib9)\(see[Eqs\.5](https://arxiv.org/html/2611.33813#S4.E5),[6](https://arxiv.org/html/2611.33813#S4.E6),[7](https://arxiv.org/html/2611.33813#S4.E7)and[8](https://arxiv.org/html/2611.33813#S4.E8)\) and verifies[Eq\.12](https://arxiv.org/html/2611.33813#S4.E12)in[Theorem2](https://arxiv.org/html/2611.33813#Thmtheorem2)\. The computation of upper and lower boundsUb\(⋅\),Lb\(⋅\)U\_\{b\}\(\\cdot\),L\_\{b\}\(\\cdot\)of BCs over sets is provided in Appendix[A\.3](https://arxiv.org/html/2611.33813#A1.SS3)\.
Output\.If the verification succeeds, the framework outputs an adaptive piecewise barrier certificateVVsatisfying the precondition of[Theorem2](https://arxiv.org/html/2611.33813#Thmtheorem2), and thus provides safety guarantee at deployment time\.
When multiple newly introduced obstacles are present, the framework processes them sequentially, applying the same localized repair procedure above \(See details in Appendix[A\.2](https://arxiv.org/html/2611.33813#A1.SS2)\)\.
### 5\.2Transfer\-Based Repair of Localized Barrier Certificates
Repair Region Construction\.Given a newly introduced unsafe setSunewS\_\{u\}^\{\\mathrm\{new\}\}, we construct a localized repair regionSnewS\_\{\\mathrm\{new\}\}such thatSunew⊆Snew⊆SS\_\{u\}^\{\\mathrm\{new\}\}\\subseteq S\_\{\\mathrm\{new\}\}\\subseteq S\. Specifically,SnewS\_\{\\mathrm\{new\}\}is defined as a box\-shaped expansion ofSunewS\_\{u\}^\{\\mathrm\{new\}\}, i\.e\.,Snew=Sunew⊕𝒩S\_\{\\mathrm\{new\}\}=S\_\{u\}^\{\\mathrm\{new\}\}\\oplus\\mathcal\{N\}, where𝒩⊆ℝn\\mathcal\{N\}\\subseteq\\mathbb\{R\}^\{n\}is the repair margin and⊕\\oplusdenotes the Minkowski sum[LaValle \(2006\)](https://arxiv.org/html/2611.33813#bib.bib11);[Lozano\-Perez and others \(1983\)](https://arxiv.org/html/2611.33813#bib.bib10)\(see more details in Appendix[A\.4](https://arxiv.org/html/2611.33813#A1.SS4)\)\. For example, in a one\-dimensional state space, ifSunew=\[2,3\]S\_\{u\}^\{\\mathrm\{new\}\}=\[2,3\]and𝒩=\[−1,1\]\\mathcal\{N\}=\[\-1,1\], thenSnew=\[2,3\]⊕\[−1,1\]=\[1,4\]S\_\{\\mathrm\{new\}\}=\[2,3\]\\oplus\[\-1,1\]=\[1,4\]\. This construction is commonly used in the literature such as robot motion planning and obstacle avoidance[Best et al\. \(2016\)](https://arxiv.org/html/2611.33813#bib.bib19);[Lien \(2008\)](https://arxiv.org/html/2611.33813#bib.bib20), and our framework is not restricted to this construction as long asSunew⊆Snew⊆SS\_\{u\}^\{\\mathrm\{new\}\}\\subseteq S\_\{\\mathrm\{new\}\}\\subseteq Sholds\.
Transfer\-based Repair\.Once the repair regionSnewS\_\{\\mathrm\{new\}\}is constructed, we seek a localized BCBnewB\_\{\\mathrm\{new\}\}satisfying[Eqs\.9](https://arxiv.org/html/2611.33813#S4.E9),[10](https://arxiv.org/html/2611.33813#S4.E10)and[11](https://arxiv.org/html/2611.33813#S4.E11)on this region\. Here we prioritize transfer\-based repair over localized retraining by reusing the structure of previously learned certificates, as states in the same state space share similar characteristics and such reuse enables fast adaption of a valid BC\. Inspired by DNN repair[Goldberger et al\. \(2020\)](https://arxiv.org/html/2611.33813#bib.bib14);[Sotoudeh and Thakur \(2021\)](https://arxiv.org/html/2611.33813#bib.bib15), which reduces repair to a linear program, we adopt the last\-layer repair strategy\. Without loss of generality, we consider a transfer template\(Si,πi,Bi\)\(S^\{i\},\\pi^\{i\},B\_\{i\}\), whereSiS^\{i\}is a previously certified region\. Our formulation is independent of the template\-selection strategy\. Let the repair region beSjS^\{j\}controlled by policyπj\\pi^\{j\}and its unsafe set isSuj⊆SjS^\{j\}\_\{u\}\\subseteq S^\{j\}\. We initially setπj=πi\\pi^\{j\}=\\pi^\{i\}and aim to transfer a valid BCBjB^\{j\}fromBiB^\{i\}\.
Template Reuse\.Let the template certificate beBi\(x\)=wi⊤ϕ\(x\)B\_\{i\}\(x\)=w\_\{i\}^\{\\top\}\\phi\(x\)forx∈Six\\in S^\{i\}, whereϕ\(⋅\)\\phi\(\\cdot\)is the feature map defined by the preceding layers andwiw\_\{i\}is the last\-layer parameter\. To reuse the feature map onSjS^\{j\}, we introduce a region\-alignment mapTji:Sj→SiT\_\{ji\}:S^\{j\}\\to S^\{i\}, which maps states inSjS^\{j\}to states inSiS^\{i\}\. Since both regions are axis\-aligned boxes,TjiT\_\{ji\}can be an affine transformation that enables cross\-region feature reuse and thus certificate transfer between regions \(see an example in[Fig\.4](https://arxiv.org/html/2611.33813#S6.F4)\)\. Hence,Bj\(x\)=wj⊤ϕ\(Tji\(x\)\)B\_\{j\}\(x\)=w\_\{j\}^\{\\top\}\\phi\(T\_\{ji\}\(x\)\)forx∈Sjx\\in S^\{j\}, andwjw\_\{j\}is an unknown vector to be calculated\.
Given the structure ofBjB\_\{j\}, the repair regionSjS^\{j\}containing the unsafe setSujS\_\{u\}^\{j\}, and the entry setS0jS\_\{0\}^\{j\}\(refer to[Eq\.6](https://arxiv.org/html/2611.33813#S4.E6)\)\. Letπj=πθi\\pi^\{j\}=\\pi^\{i\}\_\{\\theta\}\(θ\\thetais network parameter\), the transferred BCBjB\_\{j\}with the unknown vectorwjw\_\{j\}should satisfy[Eqs\.9](https://arxiv.org/html/2611.33813#S4.E9),[10](https://arxiv.org/html/2611.33813#S4.E10)and[11](https://arxiv.org/html/2611.33813#S4.E11), which can be written as the following constraints:
ginit\(x,wj\)\\displaystyle g\_\{\\mathrm\{init\}\}\(x;w\_\{j\}\):=wj⊤ϕ\(Tji\(x\)\)≤0,\\displaystyle:=w\_\{j\}^\{\\top\}\\phi\(T\_\{ji\}\(x\)\)\\leq 0,∀x∈S0j,\\displaystyle\\forall x\\in S\_\{0\}^\{j\},\(13\)gunsafe\(x,wj\)\\displaystyle g\_\{\\mathrm\{unsafe\}\}\(x;w\_\{j\}\):=−wj⊤ϕ\(Tji\(x\)\)≤−β,\\displaystyle:=\-w\_\{j\}^\{\\top\}\\phi\(T\_\{ji\}\(x\)\)\\leq\-\\beta,∀x∈Suj,\\displaystyle\\forall x\\in S\_\{u\}^\{j\},\(14\)gdyn\(x,wj,θ\)\\displaystyle g\_\{\\mathrm\{dyn\}\}\(x;w\_\{j\},\\theta\):=wj⊤\(ϕ\(Tji\(f\(x,πj\(x,θ\)\)\)\)−λ′ϕ\(Tji\(x\)\)\)≤0,\\displaystyle:=w\_\{j\}^\{\\top\}\\\!\\left\(\\phi\(T\_\{ji\}\(f\(x,\\pi^\{j\}\(x;\\theta\)\)\)\)\-\\lambda^\{\\prime\}\\phi\(T\_\{ji\}\(x\)\)\\right\)\\leq 0,∀x∈Sj∖Suj,\\displaystyle\\forall x\\in S^\{j\}\\setminus S\_\{u\}^\{j\},\(15\)whereβ\>0\\beta\>0is a prescribed safety margin for strict separation from the newly introduced unsafe set\.
Existing DNN repair methods address continuous\-domain constraints through iterative counterexample\-guided repair and verification[Boetius et al\. \(2023\)](https://arxiv.org/html/2611.33813#bib.bib39)\. In contrast, we reduce the continuous BC constraints \([Eqs\.13](https://arxiv.org/html/2611.33813#S5.E13),[14](https://arxiv.org/html/2611.33813#S5.E14)and[15](https://arxiv.org/html/2611.33813#S5.E15)\) to finite grid constraints with Lipschitz\-based margins, enabling a single localized repair step without repeated counterexample generation\. To address this, we discretize the state space with granularityη\>0\\eta\>0, obtaining finite representative sets while leveraging Lipschitz continuity to ensure validity over the continuous domain\. Specifically, for each statexxin a continuous set, there exists a representativex^\\hat\{x\}such that‖x−x^‖1≤η\\\|x\-\\hat\{x\}\\\|\_\{1\}\\leq\\eta\. This yields finite discretized sets𝒟0j⊆S0j\\mathcal\{D\}\_\{0\}^\{j\}\\subseteq S\_\{0\}^\{j\},𝒟uj⊆Suj\\mathcal\{D\}\_\{u\}^\{j\}\\subseteq S\_\{u\}^\{j\}and𝒟dynj⊆Sj\\mathcal\{D\}\_\{\\mathrm\{dyn\}\}^\{j\}\\subseteq S^\{j\}\.
###### Theorem 3\(Continuous validity from discretized transfer constraints\)\.
If a functionBjB\_\{j\}satisfies that
ginit\(x^,wj\)\\displaystyle g\_\{\\mathrm\{init\}\}\(\\hat\{x\};w\_\{j\}\)≤−δinit,\\displaystyle\\leq\-\\delta\_\{\\mathrm\{init\}\},∀x^∈𝒟0j,\\displaystyle\\forall\\hat\{x\}\\in\\mathcal\{D\}\_\{0\}^\{j\},\(16\)gunsafe\(x^,wj\)\\displaystyle g\_\{\\mathrm\{unsafe\}\}\(\\hat\{x\};w\_\{j\}\)≤−\(δunsafe\+β\),\\displaystyle\\leq\-\(\\delta\_\{\\mathrm\{unsafe\}\}\+\\beta\),∀x^∈𝒟uj,\\displaystyle\\forall\\hat\{x\}\\in\\mathcal\{D\}\_\{u\}^\{j\},\(17\)gdyn\(x^,wj,θ\)\\displaystyle g\_\{\\mathrm\{dyn\}\}\(\\hat\{x\};w\_\{j\},\\theta\)≤−δdyn,\\displaystyle\\leq\-\\delta\_\{\\mathrm\{dyn\}\},∀x^∈𝒟dynj,\\displaystyle\\forall\\hat\{x\}\\in\\mathcal\{D\}\_\{\\mathrm\{dyn\}\}^\{j\},\(18\)where constantsδinit\\delta\_\{\\mathrm\{init\}\},δunsafe\\delta\_\{\\mathrm\{unsafe\}\}, andδdyn\\delta\_\{\\mathrm\{dyn\}\}are derived from the granularityη\\etaand the relevant Lipschitz constants of the system, thenBjB\_\{j\}is a valid transferred BC onSjS^\{j\}that satisfies the continuous constraints in[Eqs\.13](https://arxiv.org/html/2611.33813#S5.E13),[14](https://arxiv.org/html/2611.33813#S5.E14)and[15](https://arxiv.org/html/2611.33813#S5.E15)\.
[Theorem3](https://arxiv.org/html/2611.33813#Thmtheorem3)ensures that discretizing the continuous constraints still yields valid BCs over the entire state space \(see more details in Appendix[A\.5](https://arxiv.org/html/2611.33813#A1.SS5)\) \. By settingSj=SnewS^\{j\}=S\_\{\\mathrm\{new\}\}and applying[Theorem3](https://arxiv.org/html/2611.33813#Thmtheorem3), we can obtain a valid localized BC as defined in[Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2)\. As the constraints in[Eqs\.16](https://arxiv.org/html/2611.33813#S5.E16),[17](https://arxiv.org/html/2611.33813#S5.E17)and[18](https://arxiv.org/html/2611.33813#S5.E18)are linear inwjw\_\{j\}under fixed policy parameterθ\\theta, they can be stacked as alinear systemA\(θ\)wj≤−bA\(\\theta\)w\_\{j\}\\leq\-b\(see Appendix[A\.6](https://arxiv.org/html/2611.33813#A1.SS6)for details\)\. To obtainwjw\_\{j\}, we introduce a nonnegative slack variableξ\\xi, requirewjw\_\{j\}to be bounded by some constantW\>0W\>0, i\.e\.,‖wj‖1≤W\\\|w\_\{j\}\\\|\_\{1\}\\leq Wand solve the following linear program:
\(𝐏I\)minwj,ξ,uj\\displaystyle\\mathbf\{\(P\_\{\\mathrm\{I\}\}\)\}\\qquad\\min\_\{w\_\{j\},\\xi,u\_\{j\}\}𝟏⊤ξ\\displaystyle\\mathbf\{1\}^\{\\top\}\\xi\(19\)s\.t\.\\displaystyle\\mathrm\{s\.t\.\}A\(θ\)wj≤−b\+ξ,−uj≤wj≤uj,𝟏⊤uj≤W,ξ≥0,uj≥0\.\\displaystyle A\(\\theta\)w\_\{j\}\\leq\-b\+\\xi,\-u\_\{j\}\\leq w\_\{j\}\\leq u\_\{j\},\\mathbf\{1\}^\{\\top\}u\_\{j\}\\leq W,\\xi\\geq 0,u\_\{j\}\\geq 0\.
Stage I: Last\-layer certificate repair under the template policy\.Stage I solves the linear program\(𝐏I\)\\mathbf\{\(P\_\{\\mathrm\{I\}\}\)\}in[Eq\.19](https://arxiv.org/html/2611.33813#S5.E19)with the policy parameterθ\\thetafixed from the template policyπθi\\pi^\{i\}\_\{\\theta\}\. Under fixedθ\\theta, the constraints are linear in the decision variableswjw\_\{j\},ξ\\xianduju\_\{j\}\. Let\(wj,I⋆,ξI⋆,uj,I⋆\)\(w\_\{j,\\mathrm\{I\}\}^\{\\star\},\\xi\_\{\\mathrm\{I\}\}^\{\\star\},u\_\{j,\\mathrm\{I\}\}^\{\\star\}\)be an optimal solution of\(𝐏I\)\\mathbf\{\(P\_\{\\mathrm\{I\}\}\)\}, and define the aggregate slackεI⋆:=𝟏⊤ξI⋆\\varepsilon\_\{\\mathrm\{I\}\}^\{\\star\}:=\\mathbf\{1\}^\{\\top\}\\xi\_\{\\mathrm\{I\}\}^\{\\star\}, which measures the residual violation of the linear systemA\(θ\)wj≤−bA\(\\theta\)w\_\{j\}\\leq\-b\.
###### Theorem 4\(Feasibility for Stage I \)\.
Assume that\(𝐏I\)\\mathbf\{\(P\_\{\\mathrm\{I\}\}\)\}attains an optimal solution\. ThenεI⋆=0\\varepsilon\_\{\\mathrm\{I\}\}^\{\\star\}=0if and only if there exists a last\-layer parameterwjw\_\{j\}satisfyingA\(θ\)wj≤−bA\(\\theta\)w\_\{j\}\\leq\-b\. Consequently, Stage I succeeds and yields a valid localized barrier certificate as defined in[Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2)\.
IfεI⋆\>0\\varepsilon\_\{\\mathrm\{I\}\}^\{\\star\}\>0, it means that Stage I cannot yield a valid localized barrier certificate\. The framework therefore proceeds to Stage II, where the policy parameter is allowed to be updated\. The proof is in Appendix[A\.7](https://arxiv.org/html/2611.33813#A1.SS7)\.
Stage II: Joint policy adaptation and last\-layer certificate repair\.Stage II adapts the local policy parameter together with the last layer of the transferred barrier certificate, which aims to find a pair\(θ,wj\)\(\\theta,w\_\{j\}\)such thatA\(θ\)wj≤−bA\(\\theta\)w\_\{j\}\\leq\-bholds\. Let\(wj,II⋆\(θ\),ξII⋆\(θ\),uj,II⋆\(θ\)\)\(w\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\),\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\),u\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\)\)an optimal solution of the lower\-level problem for the currentθ\\thetaand the corresponding optimal aggregate slack beεII\(θ\):=𝟏⊤ξII⋆\(θ\)\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta\):=\\mathbf\{1\}^\{\\top\}\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\)\. Stage II solves the following bilevel optimization problem:
\(𝐏II\)minθ\\displaystyle\\mathbf\{\(P\_\{\\mathrm\{II\}\}\)\}\\qquad\\min\_\{\\theta\}εII\(θ\)\\displaystyle\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta\)\(20\)s\.t\.\\displaystyle\\mathrm\{s\.t\.\}\(wj,II⋆\(θ\),ξII⋆\(θ\),uj,II⋆\(θ\)\)∈argminwj,ξ,uj1⊤ξ\\displaystyle\(w\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\),\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\),u\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\)\)\\in\\arg\\min\_\{w\_\{j\},\\xi,u\_\{j\}\}\\ \\mathbf\{1\}^\{\\top\}\\xis\.t\.A\(θ\)wj≤−b\+ξ,−uj≤wj≤uj,𝟏⊤uj≤W,ξ≥0,uj≥0\.\\displaystyle\\mathrm\{s\.t\.\}\\quad A\(\\theta\)w\_\{j\}\\leq\-b\+\\xi,\-u\_\{j\}\\leq w\_\{j\}\\leq u\_\{j\},\\mathbf\{1\}^\{\\top\}u\_\{j\}\\leq W,\\xi\\geq 0,u\_\{j\}\\geq 0\.
The upper\-level problem searches for a policy parameterθ\\thetathat reduces the optimal aggregate slackεII\(θ\)\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta\), while the lower\-level problem computes the optimal last\-layer repairwjw\_\{j\}for the currentθ\\theta\.
###### Theorem 5\(Feasibility for Stage II\)\.
Assume that\(𝐏II\)\\mathbf\{\(P\_\{\\mathrm\{II\}\}\)\}attains an optimal solution\. ThenεII\(θ\)=0\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta\)=0if and only if there exists a tuple\(wj,θ\)\(w\_\{j\},\\theta\)such thatA\(θ\)wj≤−bA\(\\theta\)w\_\{j\}\\leq\-b\. Consequently, Stage II succeeds and yields a valid localized barrier certificate as defined in[Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2)\.
In practice, Stage II solves\(𝐏II\)\\mathbf\{\(P\_\{\\mathrm\{II\}\}\)\}iteratively\. Starting from an initial policy parameterθ\\theta, it solves the lower\-level problem\(𝐏I\(θ\)\)\\mathbf\{\(P\_\{\\mathrm\{I\}\}\(\\theta\)\)\}to obtain the aggregate slackεII\(θ\)\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta\)\. IfεII\(θ\)=0\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta\)=0, then the currentθ\\thetaand the recoveredwj,II⋆\(θ\)w\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\)satisfyA\(θ\)wj≤−bA\(\\theta\)w\_\{j\}\\leq\-b, and Stage II succeeds\. Otherwise, the nonzero slack indicates that the barrier constraints remain violated under the current policy\. In this case, we use the slack as a repair loss to updateθ\\thetavia backpropagation[Rumelhart et al\. \(1986\)](https://arxiv.org/html/2611.33813#bib.bib29),222The lower\-level LP constraints in[Eq\.20](https://arxiv.org/html/2611.33813#S5.E20)are recalculated after each policy update\.and repeat the process until feasibility is achieved; otherwise, the framework proceeds to Stage III once the computational budget is exhausted\. The proof is in Appendix[A\.8](https://arxiv.org/html/2611.33813#A1.SS8)\.
Stage III: Localized retraining both the policy and the barrier certificate\.Stage III performs localized retraining onSnewjS\_\{\\mathrm\{new\}\}^\{j\}to synthesize both the policy and the barrier certificate \(satisfying[Eqs\.9](https://arxiv.org/html/2611.33813#S4.E9),[10](https://arxiv.org/html/2611.33813#S4.E10)and[11](https://arxiv.org/html/2611.33813#S4.E11)\) tailored to the repair region\. When Stage III succeeds, it outputs a valid localized BC as defined in[Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2)\.
Once a localized BC is obtained, Step III \([Section5\.1](https://arxiv.org/html/2611.33813#S5.SS1)\) is triggered to ensure deployment\-time safety\.
## 6Evaluation
We evaluate the proposed framework \([Section5\.1](https://arxiv.org/html/2611.33813#S5.SS1)\) from four aspects: \(i\) the end\-to\-end repair under multiple obstacles, assessing whether it restores global safety efficiently and outperforms global retraining in preserving nominal performance; \(ii\) the effect of the repair region sizeSnewS\_\{\\mathrm\{new\}\}on computational cost, examining the trade\-off introduced by region construction; \(iii\) the impact of template selection on repair efficiency, evaluating robustness across different transfer templates; and \(iv\) the comparison with the shielding method, showcasing the cumulative runtime overhead and task performance under persistent environmental changes\. We measure overhead from the initial detection of each newly introduced obstacle, excluding the detection cost shared by our method and shielding to ensure a fair comparison\.
Experimental Setup\.The proposed framework is tested on four benchmarks: B1, B2[Gallestey and Hokayem \(2019\)](https://arxiv.org/html/2611.33813#bib.bib12), Mountain Car Continuous \(MC\), and Pendulum \(PD\)[Brockman et al\. \(2016\)](https://arxiv.org/html/2611.33813#bib.bib13)\. For each benchmark, we introduce new obstacles that are randomly placed, and construct each repair region by box\-shaped expansion \(see Appendix[A\.4](https://arxiv.org/html/2611.33813#A1.SS4)\)\. The DRL algorithms used for NNCSs and NBCs are DDPG[Lillicrap et al\. \(2020\)](https://arxiv.org/html/2611.33813#bib.bib34)for B1 and B2, PPO[Schulman et al\. \(2017\)](https://arxiv.org/html/2611.33813#bib.bib35)for MC, and SAC[Haarnoja et al\. \(2018\)](https://arxiv.org/html/2611.33813#bib.bib36)for PD\. Experiments are implemented in Python 3\.8\.0 and PyTorch 2\.3\.1, and run on a workstation with a 32\-core AMD Ryzen Threadripper CPU, 128GB RAM, and a 24GB GPU\.
### 6\.1End\-to\-End Repair under Multiple Obstacles
We evaluate our repair framework under multiple newly introduced obstacles, and useOiO\_\{i\}to denote thei\-th obstacle\. By default, we use the previous\-template strategy: the original barrier certificate is used for the first obstacle, and each repaired localized certificate is reused as the source template for the next obstacle\.[Table1](https://arxiv.org/html/2611.33813#S6.T1)reports a representative subset of the runtime results, with complete results of the same claims in Appendix[A\.9](https://arxiv.org/html/2611.33813#A1.SS9)\. We also evaluate system performance by the average cumulative reward over10001000simulations, as shown in[Fig\.4](https://arxiv.org/html/2611.33813#S6.F4)\.
[Table1](https://arxiv.org/html/2611.33813#S6.T1)shows that global retraining becomes infeasible when multiple obstacles are introduced: it times out fromO2O\_\{2\}on B1, B2, and MC, and already fails onO1O\_\{1\}for PD\. In contrast, our repair framework restores a valid loalized barrier certificate for all obstacles and achieves17\.3×\\timesfaster on average on the instances where retraining succeeds\. After the first repair, most subsequent obstacles are handled by Stage I alone, with average runtime of 13\.9s, 10\.9s, 28\.85s and 84\.6s on B1, B2, MC and PD, respectively\. For MC\-O1 and PD\-O1 where Stage II times out, the framework invokes Stage III \(localized retraining\) as a warm\-up step\. After this warm\-up step, the remaining obstacles are handled efficiently by Stage I alone\.
For performance, rewards are computed using the original benchmark reward function with an additional−50\-50collision penalty\. As shown in[Fig\.4](https://arxiv.org/html/2611.33813#S6.F4), after five obstacles, our method incurs only 16\.2% average degradation, whereas global retraining often times out and yields no certified safe policy, causing collisions and larger performance loss\. The nominal policy serves as a performance reference, but its certificate only guarantees safety for the original unsafe setSuS\_\{u\}, requiring repair and verification to restore the safety guarantee underS^u\\widehat\{S\}\_\{u\}\. These results show that our repair framework restores deployment\-time safety while preserving nominal performance\.
Table 1:Runtime \(in seconds\) comparison under multiple obstacles across benchmarks\.Remark\.Original BC: time for synthesizing the original barrier certificate forS0S\_\{0\}andSuS\_\{u\};Verification: time for verifying[Theorem2](https://arxiv.org/html/2611.33813#Thmtheorem2);Total time: end\-to\-end runtime of our repair framework; “F” means retrain failed within 7200s;✓\\checkmark: Stage succeeds; ✗: Stage fails\.
Figure 3:Illustration ofTjiT\_\{ji\}and template reuse
Figure 4:Performance \(average cumulative reward\) under increasing numbers of newly introduced obstacles on all benchmarks\. The error bar applies standard error\.
### 6\.2Effect of Repair Region Size
We investigate how the size of the repair regionSnewS\_\{\\mathrm\{new\}\}affects repair feasibility and runtime\. For each benchmark, we fix the third obstacleO3O\_\{3\}and use the localized repaired certificate forO2O\_\{2\}as the source template, so that only the size ofSnewS\_\{\\mathrm\{new\}\}varies\. Starting from the default neighborhood𝒩\\mathcal\{N\}, we scale it by a factorρ\\rhoand constructSnew\(ρ\)=Sunew⊕\(ρ𝒩\)S\_\{\\mathrm\{new\}\}\(\\rho\)=S\_\{u\}^\{\\mathrm\{new\}\}\\oplus\(\\rho\\mathcal\{N\}\), withρ∈\{0\.6,0\.8,1\.0,1\.2,1\.4\}\\rho\\in\\\{0\.6,0\.8,1\.0,1\.2,1\.4\\\}\.[Table2](https://arxiv.org/html/2611.33813#S6.T2)reports representative results, while full results with the same claim are provided in Appendix[A\.9](https://arxiv.org/html/2611.33813#A1.SS9)\.
[Table2](https://arxiv.org/html/2611.33813#S6.T2)shows a clear trade\-off in choosingSnewS\_\{\\mathrm\{new\}\}\. Small regions lead to infeasibility \(0\.6×0\.6\\timesfails on both MC and PD\), while moderate sizes allow efficient repair via Stage I alone \(8\.2–11\.9s on MC and 10\.5–14\.5s on PD for0\.8×0\.8\\timesand1\.0×1\.0\\times, respectively\)\. Large regions increase cost and require Stage II \(95\.0s on MC and 159\.8s on PD at1\.2×1\.2\\times, respectively\), and may incur Stage III \(1\.4×1\.4\\timeswith high runtime\)\. This suggests choosingSnewS\_\{\\mathrm\{new\}\}large enough for feasibility but small enough to limit cost\. In practice, doubling the obstacle size provides a reasonable starting point for constructingSnewS\_\{\\mathrm\{new\}\}\.
Table 2:Runtime \(in seconds\) under different scaling factors of repair regions\.Remark\.Stage III denotes local retraining in the scaled repair region\. Two stages total denotes the total running time of Stage I and Stage II for the current scaled region\. “F” denotes failure due to timeout in the transfer stage\.
### 6\.3Impact of Template Selection
We study how template selection affects transfer\-based repair efficiency via three strategies: \(i\) using the original global certificate, \(ii\) using the first repaired localized certificate when available, and \(iii\) using the previously repaired certificate, as the source template\. For the first obstacle, where no repaired template exists, the previous\-template strategy is initialized with the original global certificate\.[Table3](https://arxiv.org/html/2611.33813#S6.T3)reports representative results on MC and PD, with full results in Appendix[A\.9](https://arxiv.org/html/2611.33813#A1.SS9)\.
[Table3](https://arxiv.org/html/2611.33813#S6.T3)shows that template selection is critical on MC and PD\. Using Strategy \(i\) leads to Stages I,II timeout across all cases, whereas using Strategy \(ii\) or \(iii\) resolvesO2O\_\{2\}∼\\simO3O\_\{3\}via Stage I alone\. Strategy \(iii\) thus provides a simple default for sequential repair, avoiding repeated reliance on the original global certificate, as the previous repaired templates better capture the updated environment\.
Table 3:Running time \(in seconds\) comparison of template selection across benchmarks\.BenchmarkObstacle IDOriginal global BCFirst repaired local BCPrevious templateStage IStage IITotal timeStage IStage IITotal timeStage IStage IITotal timeMCO111\.5FF–––11\.5FFO211\.6FF12\.2012\.212\.2012\.2O312\.1FF11\.8011\.811\.9011\.9PDO114\.4FF–––14\.4FFO214\.0FF14\.8014\.814\.8014\.8O314\.2FF14\.0014\.014\.5014\.5
Remark\."F" denotes failure due to timeout in the transfer stage\.−\-means no repaired BC available and thus skip repair\.
Table 4:Comparison between our method and shielding under multiple obstacles across benchmarks\.Remark\.Total runtime: total runtime in seconds over 200 executions;Avg\. reward: the average cumulative reward;\# Shield Interventions: number of intervention times by shielding\.
### 6\.4Comparison with Shielding Method
We compare our method with shielding[Banerjee et al\. \(2024\)](https://arxiv.org/html/2611.33813#bib.bib38)over 200 executions per benchmark and obstacle configuration, evaluating empirical success rate, average cumulative reward, and total runtime\. The runtime includes one\-time repair costs for our method and all recurring safety checks and interventions for shielding\.[Table4](https://arxiv.org/html/2611.33813#S6.T4)presents representative results on B1 and B2, with full results in Appendix[A\.9](https://arxiv.org/html/2611.33813#A1.SS9)\.
Our method achieves 100% empirical success, higher average rewards, and lower cumulative runtime across all configurations\. In contrast, shielding achieves 97% on B1\-O3O\_\{3\}and 99% on B2\-O3O\_\{3\}\. On B1\-O3O\_\{3\}, our method requires 95\.7 s versus 573\.2 s for shielding, with average rewards of 54\.59 versus 51\.30\. Shielding incurs 241–1,354 interventions across configurations, accumulating overhead upon repeated encounters with persistent obstacles\. Our method instead repairs each new obstacle once and reuses the certified system across subsequent executions\.
## 7Conclusion
In this paper, we propose an adaptive piecewise barrier certificate framework for deployment\-time safety restoration of NNCSs in response to newly introduced unsafe regions\. By restricting adaptation to the affected regions while preserving the original policy and certificate elsewhere, the framework enables efficient localized repair with global safety guarantees\. It avoids retraining from scratch and largely preserves nominal policy performance\. A current limitation is that transfer\-based certificate repair is restricted to the last layer of the neural BC, which may limit its flexibility in more complex scenarios\. In future work, we plan to extend the repair to multiple layers and further investigate how the locations of newly introduced obstacles affect repair feasibility and computational efficiency\.
## Acknowledgments and Disclosure of Funding
We thank the anonymous reviewers for their constructive comments and valuable suggestions\. This work was partially supported by the National Natural Science Foundation of China \(Grant No\. 62602204, No\. 62372176 and No\. 92582108\); the CCF\-Huawei Populus Grove Fund; Shanghai Trusted Industry Internet Software Collaborative Innovation Center; the Basic Research Program of Institute of Software, CAS \(Grant No\. ISCAS\-JCMS\-202302\); the National Research Foundation, Singapore, under the NRF RSS Scheme NRF\-RSS2022\-009 and the Singapore Global AI VP grant AIVP\-2024\-002\.
## References
- \[1\]D\. Kalashnikov, A\. Irpan, P\. Pastor, J\. Ibarz, A\. Herzog, E\. Jang, D\. Quillen, E\. Holly, M\. Kalakrishnan, V\. Vanhoucke,et al\.\(2018\)Scalable deep reinforcement learning for vision\-based robotic manipulation\.InConference on robot learning,pp\. 651–673\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p1.1)\.
- \[2\]\(2019\)Learning agile and dynamic motor skills for legged robots\.Science robotics4\(26\),pp\. eaau5872\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p1.1)\.
- \[3\]B\. R\. Kiran, I\. Sobh, V\. Talpaert, P\. Mannion, A\. A\. Al Sallab, S\. Yogamani, and P\. Pérez\(2021\)Deep reinforcement learning for autonomous driving: a survey\.IEEE transactions on intelligent transportation systems23\(6\),pp\. 4909–4926\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p1.1)\.
- \[4\]G\. Dulac\-Arnold, N\. Levine, D\. J\. Mankowitz, J\. Li, C\. Paduraru, S\. Gowal, and T\. Hester\(2019\)Challenges of real\-world reinforcement learning\.arXiv preprint arXiv:1904\.12901\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p1.1),[§1](https://arxiv.org/html/2611.33813#S1.p2.1),[§2](https://arxiv.org/html/2611.33813#S2.p2.1)\.
- \[5\]S\. Prajna and A\. Jadbabaie\(2004\)Safety verification of hybrid systems using barrier certificates\.InInternational workshop on hybrid systems: Computation and control,pp\. 477–492\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p1.1),[§2](https://arxiv.org/html/2611.33813#S2.p1.1),[§3\.2](https://arxiv.org/html/2611.33813#S3.SS2.p1.1)\.
- \[6\]A\. D\. Ames, S\. Coogan, M\. Egerstedt, G\. Notomista, K\. Sreenath, and P\. Tabuada\(2019\)Control barrier functions: theory and applications\.In2019 18th European control conference \(ECC\),pp\. 3420–3431\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p1.1),[§2](https://arxiv.org/html/2611.33813#S2.p1.1),[§3\.2](https://arxiv.org/html/2611.33813#S3.SS2.p1.1)\.
- \[7\]J\. Garcıa and F\. Fernández\(2015\)A comprehensive survey on safe reinforcement learning\.Journal of Machine Learning Research16\(1\),pp\. 1437–1480\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p2.1),[§2](https://arxiv.org/html/2611.33813#S2.p2.1)\.
- \[8\]R\. Cheng, G\. Orosz, R\. M\. Murray, and J\. W\. Burdick\(2019\)End\-to\-end safe reinforcement learning through barrier functions for safety\-critical continuous control tasks\.InProceedings of the AAAI conference on artificial intelligence,Vol\.33,pp\. 3387–3395\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p2.1),[§2](https://arxiv.org/html/2611.33813#S2.p1.1),[§2](https://arxiv.org/html/2611.33813#S2.p2.1)\.
- \[9\]M\. Alshiekh, R\. Bloem, R\. Ehlers, B\. Könighofer, S\. Niekum, and U\. Topcu\(2018\)Safe reinforcement learning via shielding\.InProceedings of the AAAI conference on artificial intelligence,Vol\.32\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p2.1),[§2](https://arxiv.org/html/2611.33813#S2.p3.1)\.
- \[10\]N\. Jansen, B\. Könighofer, S\. Junges, A\. Serban, and R\. Bloem\(2020\)Safe reinforcement learning using probabilistic shields\.In31st International Conference on Concurrency Theory \(CONCUR 2020\),pp\. 3–1\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p2.1),[§2](https://arxiv.org/html/2611.33813#S2.p3.1)\.
- \[11\]A\. Banerjee, K\. Rahmani, J\. Biswas, and I\. Dillig\(2024\)Dynamic model predictive shielding for provably safe reinforcement learning\.Advances in Neural Information Processing Systems37,pp\. 100131–100159\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p2.1),[§2](https://arxiv.org/html/2611.33813#S2.p3.1),[§6\.4](https://arxiv.org/html/2611.33813#S6.SS4.p1.1)\.
- \[12\]A\. Jacobson, F\. Zeng, D\. Smith, N\. Boswell, T\. Peynot, and M\. Milford\(2021\)What localizes beneath: a metric multisensor localization and mapping system for autonomous underground mining vehicles\.Journal of Field Robotics38\(1\),pp\. 5–27\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p2.1)\.
- \[13\]S\. S\. Mansouri, C\. Kanellakis, D\. Kominiak, and G\. Nikolakopoulos\(2020\)Deploying mavs for autonomous navigation in dark underground mine environments\.Robotics and Autonomous Systems126,pp\. 103472\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p2.1)\.
- \[14\]A\. Abate, D\. Ahmed, A\. Edwards, M\. Giacobbe, and A\. Peruffo\(2021\)FOSSIL: a software tool for the formal synthesis of lyapunov functions and barrier certificates using neural networks\.InProceedings of the 24th international conference on hybrid systems: computation and control,pp\. 1–11\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p3.1),[§3\.2](https://arxiv.org/html/2611.33813#S3.SS2.p3.1)\.
- \[15\]M\. Sotoudeh and A\. V\. Thakur\(2021\)Provable repair of deep neural networks\.InProceedings of the 42nd ACM SIGPLAN international conference on programming language design and implementation,pp\. 588–603\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p3.1),[§2](https://arxiv.org/html/2611.33813#S2.p4.1),[§5\.2](https://arxiv.org/html/2611.33813#S5.SS2.p2.1)\.
- \[16\]I\. Refaeli and G\. Katz\(2022\)Minimal multi\-layer modifications of deep neural networks\.InInternational workshop on numerical software verification,pp\. 46–66\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p3.1),[§2](https://arxiv.org/html/2611.33813#S2.p4.1)\.
- \[17\]K\. Majd, S\. Zhou, H\. B\. Amor, G\. Fainekos, and S\. Sankaranarayanan\(2021\)Local repair of neural networks using optimization\.arXiv preprint arXiv:2109\.14041\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p3.1),[§2](https://arxiv.org/html/2611.33813#S2.p4.1)\.
- \[18\]G\. Dong, J\. Sun, X\. Wang, X\. Wang, and T\. Dai\(2021\)Towards repairing neural networks correctly\.In2021 IEEE 21st International Conference on Software Quality, Reliability and Security \(QRS\),pp\. 714–725\.Cited by:[§1](https://arxiv.org/html/2611.33813#S1.p3.1),[§2](https://arxiv.org/html/2611.33813#S2.p4.1)\.
- \[19\]R\. Mazouz, L\. Laurenti, and M\. Lahijanian\(2026\)Stochastic barrier certificates in the presence of dynamic obstacles\.arXiv preprint arXiv:2604\.20208\.Cited by:[§2](https://arxiv.org/html/2611.33813#S2.p1.1)\.
- \[20\]C\. Dawson, S\. Gao, and C\. Fan\(2023\)Safe control with learned certificates: a survey of neural lyapunov, barrier, and contraction methods for robotics and control\.IEEE Transactions on Robotics39\(3\),pp\. 1749–1767\.Cited by:[§2](https://arxiv.org/html/2611.33813#S2.p1.1)\.
- \[21\]B\. Xue\(2026\)Sufficient and necessary barrier\-like conditions for safety and reach\-avoid verification of stochastic discrete\-time systems\.Automatica187,pp\. 112919\.Cited by:[§3\.2](https://arxiv.org/html/2611.33813#S3.SS2.p1.1)\.
- \[22\]A\. Peruffo, D\. Ahmed, and A\. Abate\(2021\)Automated and formal synthesis of neural barrier certificates for dynamical models\.InInternational conference on tools and algorithms for the construction and analysis of systems,pp\. 370–388\.Cited by:[§3\.2](https://arxiv.org/html/2611.33813#S3.SS2.p3.1)\.
- \[23\]A\. Abate, C\. David, P\. Kesseli, D\. Kroening, and E\. Polgreen\(2018\)Counterexample guided inductive synthesis modulo theories\.InInternational Conference on Computer Aided Verification,pp\. 270–288\.Cited by:[§3\.2](https://arxiv.org/html/2611.33813#S3.SS2.p3.1)\.
- \[24\]Đ\. Žikelić, M\. Lechner, T\. A\. Henzinger, and K\. Chatterjee\(2023\)Learning control policies for stochastic systems with reach\-avoid guarantees\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.37,pp\. 11926–11935\.Cited by:[§3\.2](https://arxiv.org/html/2611.33813#S3.SS2.p3.1),[§3\.2](https://arxiv.org/html/2611.33813#S3.SS2.p4.1)\.
- \[25\]D\. Zhi, P\. Wang, C\. Chen, and M\. Zhang\(2024\)Robustness verification of deep reinforcement learning based control systems using reward martingales\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.38,pp\. 19992–20000\.Cited by:[§3\.2](https://arxiv.org/html/2611.33813#S3.SS2.p3.1),[§3\.2](https://arxiv.org/html/2611.33813#S3.SS2.p4.1)\.
- \[26\]D\. Zhi, P\. Wang, S\. Liu, C\. L\. Ong, and M\. Zhang\(2024\)Unifying qualitative and quantitative safety verification of dnn\-controlled systems\.InInternational Conference on Computer Aided Verification,pp\. 401–426\.Cited by:[§3\.2](https://arxiv.org/html/2611.33813#S3.SS2.p4.1)\.
- \[27\]A\. Elfes\(2002\)Using occupancy grids for mobile robot perception and navigation\.Computer22\(6\),pp\. 46–57\.Cited by:[§5\.1](https://arxiv.org/html/2611.33813#S5.SS1.p1.1)\.
- \[28\]A\. Hornung, K\. M\. Wurm, M\. Bennewitz, C\. Stachniss, and W\. Burgard\(2013\)OctoMap: an efficient probabilistic 3d mapping framework based on octrees\.Autonomous robots34\(3\),pp\. 189–206\.Cited by:[§5\.1](https://arxiv.org/html/2611.33813#S5.SS1.p1.1)\.
- \[29\]Y\. Wang, W\. Zhou, J\. Fan, Z\. Wang, J\. Li, X\. Chen, C\. Huang, W\. Li, and Q\. Zhu\(2023\)Polar\-express: efficient and precise formal reachability analysis of neural\-network controlled systems\.IEEE Transactions on Computer\-Aided Design of Integrated Circuits and Systems43\(3\),pp\. 994–1007\.Cited by:[§5\.1](https://arxiv.org/html/2611.33813#S5.SS1.p5.1)\.
- \[30\]S\. M\. LaValle\(2006\)Planning algorithms\.Cambridge university press\.Cited by:[§5\.2](https://arxiv.org/html/2611.33813#S5.SS2.p1.1)\.
- \[31\]T\. Lozano\-Perezet al\.\(1983\)Spatial planning: a configuration space approach\.IEEE Trans\. Computers32\(2\),pp\. 108–120\.Cited by:[§5\.2](https://arxiv.org/html/2611.33813#S5.SS2.p1.1)\.
- \[32\]A\. Best, S\. Narang, and D\. Manocha\(2016\)Real\-time reciprocal collision avoidance with elliptical agents\.In2016 IEEE International Conference on Robotics and Automation \(ICRA\),pp\. 298–305\.Cited by:[§5\.2](https://arxiv.org/html/2611.33813#S5.SS2.p1.1)\.
- \[33\]J\. Lien\(2008\)Hybrid motion planning using minkowski sums\.Proceedings of robotics: science and systems IV\.Cited by:[§5\.2](https://arxiv.org/html/2611.33813#S5.SS2.p1.1)\.
- \[34\]B\. Goldberger, G\. Katz, Y\. Adi, and J\. Keshet\(2020\)Minimal modifications of deep neural networks using verification\.\.InLPAR,Vol\.2020,pp\. 23rd\.Cited by:[§5\.2](https://arxiv.org/html/2611.33813#S5.SS2.p2.1)\.
- \[35\]D\. Boetius, S\. Leue, and T\. Sutter\(2023\)A robust optimisation perspective on counterexample\-guided repair of neural networks\.InInternational Conference on Machine Learning,pp\. 2712–2737\.Cited by:[§5\.2](https://arxiv.org/html/2611.33813#S5.SS2.p5.1)\.
- \[36\]D\. E\. Rumelhart, G\. E\. Hinton, and R\. J\. Williams\(1986\)Learning representations by back\-propagating errors\.nature323\(6088\),pp\. 533–536\.Cited by:[§5\.2](https://arxiv.org/html/2611.33813#S5.SS2.p11.1)\.
- \[37\]E\. Gallestey and P\. Hokayem\(2019\)Lecture notes in nonlinear systems and control\.Cited by:[§6](https://arxiv.org/html/2611.33813#S6.p2.1)\.
- \[38\]G\. Brockman, V\. Cheung, L\. Pettersson, J\. Schneider, J\. Schulman, J\. Tang, and W\. Zaremba\(2016\)Openai gym\.arXiv preprint arXiv:1606\.01540\.Cited by:[§6](https://arxiv.org/html/2611.33813#S6.p2.1)\.
- \[39\]T\. P\. Lillicrap, J\. J\. Hunt, A\. Pritzel, N\. M\. O\. Heess, T\. Erez, Y\. Tassa, D\. Silver, and D\. P\. Wierstra\(2020\)Continuous control with deep reinforcement learning\.Google Patents\.Note:US Patent 10,776,692Cited by:[§6](https://arxiv.org/html/2611.33813#S6.p2.1)\.
- \[40\]J\. Schulman, F\. Wolski, P\. Dhariwal, A\. Radford, and O\. Klimov\(2017\)Proximal policy optimization algorithms\.arXiv preprint arXiv:1707\.06347\.Cited by:[§6](https://arxiv.org/html/2611.33813#S6.p2.1)\.
- \[41\]T\. Haarnoja, A\. Zhou, P\. Abbeel, and S\. Levine\(2018\)Soft actor\-critic: off\-policy maximum entropy deep reinforcement learning with a stochastic actor\.InInternational conference on machine learning,pp\. 1861–1870\.Cited by:[§6](https://arxiv.org/html/2611.33813#S6.p2.1)\.
## Appendix ATechnical Appendices and Supplementary Material
### A\.1Proof of[Theorem2](https://arxiv.org/html/2611.33813#Thmtheorem2)
In this section, we prove[Theorem2](https://arxiv.org/html/2611.33813#Thmtheorem2)in the main pages\. First, we present a proposition\.
###### Proposition 1\.
IfB\(x\)B\(x\)is a barrier certificate for a systemMM, then theαB\(x\)\\alpha B\(x\)is also a barrier certificate for systemMM,α\>0,α∈ℝ\\alpha\>0,\\alpha\\in\\mathbb\{R\}\.
###### Proof\.
B\(x\)B\(x\)is a barrier certificate forMM, so it satisfies the following conditions:
B\(x\)≤0\\displaystyle B\(x\)\\leq 0∀x∈S0\\displaystyle\\forall x\\in S\_\{0\}B\(x\)\>0\\displaystyle B\(x\)\>0∀x∈Su\\displaystyle\\forall x\\in S\_\{u\}B\(f\(x,π\(x\)\)\)−λB\(x\)≤0\\displaystyle B\(f\(x,\\pi\(x\)\)\)\-\\lambda B\(x\)\\leq 0∀x∈S∖Su\\displaystyle\\forall x\\in S\\setminus S\_\{u\}
Becauseα\>0\\alpha\>0, so we can get:
αB\(x\)≤0\\displaystyle\\alpha B\(x\)\\leq 0∀x∈S0\\displaystyle\\forall x\\in S\_\{0\}αB\(x\)\>0\\displaystyle\\alpha B\(x\)\>0∀x∈Su\\displaystyle\\forall x\\in S\_\{u\}αB\(f\(x,π\(x\)\)\)−λαB\(x\)≤0\\displaystyle\\alpha B\(f\(x,\\pi\(x\)\)\)\-\\lambda\\alpha B\(x\)\\leq 0∀x∈S∖Su\\displaystyle\\forall x\\in S\\setminus S\_\{u\}
So,αB\(x\)\\alpha B\(x\)is also a barrier certificate for systemMM\. ∎
Then, we present the definition of piecewise barrier certificate and its safety theorem\.
###### Definition 3\(Piecewise Barrier Certificates\)\.
Given a DNN\-controlled systemM=\(S,S0,A,f,π,R,Su\)M=\(S,S\_\{0\},A,f,\\pi,R,S\_\{u\}\)and its extensionM^=\(S,S0,A,f,π^,R,S^u\)\\hat\{M\}=\(S,S\_\{0\},A,f,\\hat\{\\pi\},R,\\hat\{S\}\_\{u\}\), a*piecewise barrier certificate*is a functionV:S→ℝV:S\\to\\mathbb\{R\}such that
V\(x\)≤0,\\displaystyle V\(x\)\\leq 0,∀x∈S0,\\displaystyle\\forall x\\in S\_\{0\},\(21\)V\(x\)\>0,\\displaystyle V\(x\)\>0,∀x∈S^u,\\displaystyle\\forall x\\in\\hat\{S\}\_\{u\},\(22\)V\(f\(x,π^\(x\)\)\)−λ^\(x\)V\(x\)≤0,\\displaystyle V\\bigl\(f\(x,\\hat\{\\pi\}\(x\)\)\\bigr\)\-\\hat\{\\lambda\}\(x\)V\(x\)\\leq 0,∀x∈S∖S^u,\\displaystyle\\forall x\\in S\\setminus\\hat\{S\}\_\{u\},\(23\)where
V\(x\)=\{V1\(x\),x∈Sorigin,V2\(x\),x∈Snew,λ^\(x\)=\{λ,x∈Sorigin,λ′,x∈Snew,V\(x\)=\\begin\{cases\}V\_\{1\}\(x\),&x\\in S\_\{\\mathrm\{origin\}\},\\\\ V\_\{2\}\(x\),&x\\in S\_\{\\mathrm\{new\}\},\\end\{cases\}\\qquad\\hat\{\\lambda\}\(x\)=\\begin\{cases\}\\lambda,&x\\in S\_\{\\mathrm\{origin\}\},\\\\ \\lambda^\{\\prime\},&x\\in S\_\{\\mathrm\{new\}\},\\end\{cases\}withλ^\(x\)∈\[0,1\]\\hat\{\\lambda\}\(x\)\\in\[0,1\]for allx∈Sx\\in S\.
###### Theorem 6\(Safety guarantee of a piecewise barrier certificate\)\.
If there exists a piecewise barrier certificate for the extended systemM^\\hat\{M\}, then any trajectory ofM^\\hat\{M\}under policyπ^\\hat\{\\pi\}never enters the unsafe setS^u\\hat\{S\}\_\{u\}\.
###### Proof\.
Let\{xt\}t∈ℕ0\\\{x\_\{t\}\\\}\_\{t\\in\\mathbb\{N\}\_\{0\}\}be any trajectory of the extended systemM^\\hat\{M\}under the piecewise policyπ^\\hat\{\\pi\}, withx0∈S0x\_\{0\}\\in S\_\{0\}\. By[Eq\.21](https://arxiv.org/html/2611.33813#A1.E21), we have
We prove by induction that
V\(xt\)≤0,∀t∈ℕ0\.V\(x\_\{t\}\)\\leq 0,\\qquad\\forall t\\in\\mathbb\{N\}\_\{0\}\.
Suppose thatV\(xt\)≤0V\(x\_\{t\}\)\\leq 0holds for somet∈ℕ0t\\in\\mathbb\{N\}\_\{0\}\. By[Eq\.22](https://arxiv.org/html/2611.33813#A1.E22), every state in
S^u=Su∪Sunew\\hat\{S\}\_\{u\}=S\_\{u\}\\cup S\_\{u\}^\{\\mathrm\{new\}\}has strictly positiveVV\-value\. Therefore,V\(xt\)≤0V\(x\_\{t\}\)\\leq 0implies
xt∉S^u\.x\_\{t\}\\notin\\hat\{S\}\_\{u\}\.Hence,xt∈S∖S^ux\_\{t\}\\in S\\setminus\\hat\{S\}\_\{u\}, and[Eq\.23](https://arxiv.org/html/2611.33813#A1.E23)applies:
V\(f\(xt,π^\(xt\)\)\)−λ^\(xt\)V\(xt\)≤0\.V\\bigl\(f\(x\_\{t\},\\hat\{\\pi\}\(x\_\{t\}\)\)\\bigr\)\-\\hat\{\\lambda\}\(x\_\{t\}\)V\(x\_\{t\}\)\\leq 0\.
We now prove thatV\(xt\+1\)≤0V\(x\_\{t\+1\}\)\\leq 0by considering the region containing the current statextx\_\{t\}\. Since the state space is partitioned intoSoriginS\_\{\\mathrm\{origin\}\}andSnewS\_\{\\mathrm\{new\}\}, there are two main cases\.
Case 1:xt∈Soriginx\_\{t\}\\in S\_\{\\mathrm\{origin\}\}\.In this case, the active policy, certificate branch, and decay factor are
π^\(xt\)=π\(xt\),V\(xt\)=V1\(xt\),λ^\(xt\)=λ\.\\hat\{\\pi\}\(x\_\{t\}\)=\\pi\(x\_\{t\}\),\\qquad V\(x\_\{t\}\)=V\_\{1\}\(x\_\{t\}\),\\qquad\\hat\{\\lambda\}\(x\_\{t\}\)=\\lambda\.Thus,xt\+1=f\(xt,π\(xt\)\)x\_\{t\+1\}=f\(x\_\{t\},\\pi\(x\_\{t\}\)\), and[Eq\.23](https://arxiv.org/html/2611.33813#A1.E23)gives
V\(xt\+1\)−λV1\(xt\)≤0\.V\(x\_\{t\+1\}\)\-\\lambda V\_\{1\}\(x\_\{t\}\)\\leq 0\.SinceV1\(xt\)=V\(xt\)≤0V\_\{1\}\(x\_\{t\}\)=V\(x\_\{t\}\)\\leq 0andλ∈\[0,1\]\\lambda\\in\[0,1\], we obtain
V\(xt\+1\)≤λV1\(xt\)≤0\.V\(x\_\{t\+1\}\)\\leq\\lambda V\_\{1\}\(x\_\{t\}\)\\leq 0\.To make the piecewise structure explicit, we further distinguish the region ofxt\+1x\_\{t\+1\}\.
Ifxt\+1∈Soriginx\_\{t\+1\}\\in S\_\{\\mathrm\{origin\}\}, thenV\(xt\+1\)=V1\(xt\+1\)V\(x\_\{t\+1\}\)=V\_\{1\}\(x\_\{t\+1\}\), and hence
V1\(xt\+1\)≤λV1\(xt\)≤0\.V\_\{1\}\(x\_\{t\+1\}\)\\leq\\lambda V\_\{1\}\(x\_\{t\}\)\\leq 0\.Ifxt\+1∈Snewx\_\{t\+1\}\\in S\_\{\\mathrm\{new\}\}, thenV\(xt\+1\)=V2\(xt\+1\)V\(x\_\{t\+1\}\)=V\_\{2\}\(x\_\{t\+1\}\), and hence
V2\(xt\+1\)≤λV1\(xt\)≤0\.V\_\{2\}\(x\_\{t\+1\}\)\\leq\\lambda V\_\{1\}\(x\_\{t\}\)\\leq 0\.Therefore, in both subcases underxt∈Soriginx\_\{t\}\\in S\_\{\\mathrm\{origin\}\}, we haveV\(xt\+1\)≤0V\(x\_\{t\+1\}\)\\leq 0\.
Case 2:xt∈Snewx\_\{t\}\\in S\_\{\\mathrm\{new\}\}\.In this case, the active policy, certificate branch, and decay factor are
π^\(xt\)=πnew\(xt\),V\(xt\)=V2\(xt\),λ^\(xt\)=λ′\.\\hat\{\\pi\}\(x\_\{t\}\)=\\pi\_\{\\mathrm\{new\}\}\(x\_\{t\}\),\\qquad V\(x\_\{t\}\)=V\_\{2\}\(x\_\{t\}\),\\qquad\\hat\{\\lambda\}\(x\_\{t\}\)=\\lambda^\{\\prime\}\.Thus,xt\+1=f\(xt,πnew\(xt\)\)x\_\{t\+1\}=f\(x\_\{t\},\\pi\_\{\\mathrm\{new\}\}\(x\_\{t\}\)\), and[Eq\.23](https://arxiv.org/html/2611.33813#A1.E23)gives
V\(xt\+1\)−λ′V2\(xt\)≤0\.V\(x\_\{t\+1\}\)\-\\lambda^\{\\prime\}V\_\{2\}\(x\_\{t\}\)\\leq 0\.SinceV2\(xt\)=V\(xt\)≤0V\_\{2\}\(x\_\{t\}\)=V\(x\_\{t\}\)\\leq 0andλ′∈\[0,1\]\\lambda^\{\\prime\}\\in\[0,1\], we obtain
V\(xt\+1\)≤λ′V2\(xt\)≤0\.V\(x\_\{t\+1\}\)\\leq\\lambda^\{\\prime\}V\_\{2\}\(x\_\{t\}\)\\leq 0\.Again, we distinguish the region ofxt\+1x\_\{t\+1\}\.
Ifxt\+1∈Snewx\_\{t\+1\}\\in S\_\{\\mathrm\{new\}\}, thenV\(xt\+1\)=V2\(xt\+1\)V\(x\_\{t\+1\}\)=V\_\{2\}\(x\_\{t\+1\}\), and hence
V2\(xt\+1\)≤λ′V2\(xt\)≤0\.V\_\{2\}\(x\_\{t\+1\}\)\\leq\\lambda^\{\\prime\}V\_\{2\}\(x\_\{t\}\)\\leq 0\.Ifxt\+1∈Soriginx\_\{t\+1\}\\in S\_\{\\mathrm\{origin\}\}, thenV\(xt\+1\)=V1\(xt\+1\)V\(x\_\{t\+1\}\)=V\_\{1\}\(x\_\{t\+1\}\), and hence
V1\(xt\+1\)≤λ′V2\(xt\)≤0\.V\_\{1\}\(x\_\{t\+1\}\)\\leq\\lambda^\{\\prime\}V\_\{2\}\(x\_\{t\}\)\\leq 0\.Therefore, in both subcases underxt∈Snewx\_\{t\}\\in S\_\{\\mathrm\{new\}\}, we haveV\(xt\+1\)≤0V\(x\_\{t\+1\}\)\\leq 0\.
Combining the two main cases, we have shown that
V\(xt\)≤0⟹V\(xt\+1\)≤0\.V\(x\_\{t\}\)\\leq 0\\quad\\Longrightarrow\\quad V\(x\_\{t\+1\}\)\\leq 0\.By induction,
V\(xt\)≤0,∀t∈ℕ0\.V\(x\_\{t\}\)\\leq 0,\\qquad\\forall t\\in\\mathbb\{N\}\_\{0\}\.
Finally, by[Eq\.22](https://arxiv.org/html/2611.33813#A1.E22), every state inS^u\\hat\{S\}\_\{u\}has strictly positiveVV\-value:
V\(x\)\>0,∀x∈S^u\.V\(x\)\>0,\\qquad\\forall x\\in\\hat\{S\}\_\{u\}\.Since every state along the trajectory satisfiesV\(xt\)≤0V\(x\_\{t\}\)\\leq 0, no trajectory state can belong toS^u\\hat\{S\}\_\{u\}\. Hence,
xt∉S^u,∀t∈ℕ0\.x\_\{t\}\\notin\\hat\{S\}\_\{u\},\\qquad\\forall t\\in\\mathbb\{N\}\_\{0\}\.Therefore, every trajectory ofM^\\hat\{M\}starting fromS0S\_\{0\}remains safe\. ∎
Then we can prove[Theorem2](https://arxiv.org/html/2611.33813#Thmtheorem2)\.
Theorem[2](https://arxiv.org/html/2611.33813#Thmtheorem2)\(Deployment\-time Safety by adaptive piecewise barrier certificates\)\. Consider an NNCSM^=\(S,S0,A,f,π^,R,S^u\)\\hat\{M\}=\(S,S\_\{0\},A,f,\\hat\{\\pi\},R,\\hat\{S\}\_\{u\}\)\. If there exists an adaptive piecewise barrier certificateVVforM^\\hat\{M\}as defined in[Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2), and the switching interface sets satisfy
αUb\(Bnew\(Γin\+\)\)−λLb\(B\(Γin−\)\)≤0,andUb\(B\(Γout\+\)\)−αλ′Lb\(Bnew\(Γout−\)\)≤0,\\alpha U\_\{b\}\\\!\\left\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\)\\right\)\-\\lambda L\_\{b\}\\\!\\left\(B\(\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}\)\\right\)\\leq 0,\\quad\\text\{and\}\\quad U\_\{b\}\\\!\\left\(B\(\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}\)\\right\)\-\\alpha\\lambda^\{\\prime\}L\_\{b\}\\\!\\left\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}\)\\right\)\\leq 0,\([12](https://arxiv.org/html/2611.33813#S4.E12)\)then the systemM^\\hat\{M\}is safe, whereUb\(⋅\)U\_\{b\}\(\\cdot\)andLb\(⋅\)L\_\{b\}\(\\cdot\)denote the upper and lower bounds of a function over a set, respectively\.
###### Proof\.
We prove that the adaptive piecewise barrier certificateVVsatisfies the three conditions in[Definition3](https://arxiv.org/html/2611.33813#Thmdefinition3)\.
First, we verify the[Eq\.21](https://arxiv.org/html/2611.33813#A1.E21)\. Since the admissible initial set belongs to the unaffected region, i\.e\.,S0⊆SoriginS\_\{0\}\\subseteq S\_\{\\mathrm\{origin\}\}, andBBis a barrier certificate for the original system onSoriginS\_\{\\mathrm\{origin\}\}, we have
V\(x\)=B\(x\)≤0,∀x∈S0\.V\(x\)=B\(x\)\\leq 0,\\qquad\\forall x\\in S\_\{0\}\.Thus, the[Eq\.21](https://arxiv.org/html/2611.33813#A1.E21)in[Definition3](https://arxiv.org/html/2611.33813#Thmdefinition3)holds\.
Second, we verify[Eq\.22](https://arxiv.org/html/2611.33813#A1.E22)\. For the original unsafe setSuS\_\{u\}, sinceV\(x\)=B\(x\)V\(x\)=B\(x\)onSoriginS\_\{\\mathrm\{origin\}\}andBBseparatesSuS\_\{u\}, we have
V\(x\)=B\(x\)\>0,∀x∈Su\.V\(x\)=B\(x\)\>0,\\qquad\\forall x\\in S\_\{u\}\.For the newly introduced unsafe setSunewS\_\{u\}^\{\\mathrm\{new\}\}, sinceSunew⊆SnewS\_\{u\}^\{\\mathrm\{new\}\}\\subseteq S\_\{\\mathrm\{new\}\},V\(x\)=αBnew\(x\)V\(x\)=\\alpha B\_\{\\mathrm\{new\}\}\(x\), andBnewB\_\{\\mathrm\{new\}\}satisfies[Eq\.10](https://arxiv.org/html/2611.33813#S4.E10), we have
V\(x\)=αBnew\(x\)\>0,∀x∈Sunew\.V\(x\)=\\alpha B\_\{\\mathrm\{new\}\}\(x\)\>0,\\qquad\\forall x\\in S\_\{u\}^\{\\mathrm\{new\}\}\.Therefore,
V\(x\)\>0,∀x∈S^u=Su∪Sunew\.V\(x\)\>0,\\qquad\\forall x\\in\\hat\{S\}\_\{u\}=S\_\{u\}\\cup S\_\{u\}^\{\\mathrm\{new\}\}\.Thus, the[Eq\.22](https://arxiv.org/html/2611.33813#A1.E22)in[Definition3](https://arxiv.org/html/2611.33813#Thmdefinition3)holds\.
It remains to prove[Eq\.23](https://arxiv.org/html/2611.33813#A1.E23)\. Let
x∈S∖S^u,x\+=f\(x,π^\(x\)\)\.x\\in S\\setminus\\hat\{S\}\_\{u\},\\qquad x^\{\+\}=f\(x,\\hat\{\\pi\}\(x\)\)\.We need to show that
V\(x\+\)−λ^\(x\)V\(x\)≤0\.V\(x^\{\+\}\)\-\\hat\{\\lambda\}\(x\)V\(x\)\\leq 0\.Following the piecewise structure ofVV,π^\\hat\{\\pi\}andλ^\\hat\{\\lambda\}, we divide the proof into two main cases according to the region containing the current statexx\.
Case 1:x∈Soriginx\\in S\_\{\\mathrm\{origin\}\}\.In this case,
V\(x\)=B\(x\),π^\(x\)=π\(x\),λ^\(x\)=λ,V\(x\)=B\(x\),\\qquad\\hat\{\\pi\}\(x\)=\\pi\(x\),\\qquad\\hat\{\\lambda\}\(x\)=\\lambda,and hence
x\+=f\(x,π\(x\)\)\.x^\{\+\}=f\(x,\\pi\(x\)\)\.We further distinguish two subcases according to the region containingx\+x^\{\+\}\.
*Subcase 1\.1:x\+∈Soriginx^\{\+\}\\in S\_\{\\mathrm\{origin\}\}\.*ThenV\(x\+\)=B\(x\+\)V\(x^\{\+\}\)=B\(x^\{\+\}\)\. SinceBBis a barrier certificate onSoriginS\_\{\\mathrm\{origin\}\}, the[Eq\.4](https://arxiv.org/html/2611.33813#S3.E4)gives
B\(f\(x,π\(x\)\)\)−λB\(x\)≤0\.B\(f\(x,\\pi\(x\)\)\)\-\\lambda B\(x\)\\leq 0\.Therefore,
V\(x\+\)−λ^\(x\)V\(x\)=B\(x\+\)−λB\(x\)≤0\.V\(x^\{\+\}\)\-\\hat\{\\lambda\}\(x\)V\(x\)=B\(x^\{\+\}\)\-\\lambda B\(x\)\\leq 0\.
*Subcase 1\.2:x\+∈Snewx^\{\+\}\\in S\_\{\\mathrm\{new\}\}\.*Then the transition crosses fromSoriginS\_\{\\mathrm\{origin\}\}toSnewS\_\{\\mathrm\{new\}\}\. By the definition of the switching interface sets,
x∈Γin−,x\+∈Γin\+\.x\\in\\Gamma\_\{\\mathrm\{in\}\}^\{\-\},\\qquad x^\{\+\}\\in\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\.In this case,
V\(x\)=B\(x\),V\(x\+\)=αBnew\(x\+\),V\(x\)=B\(x\),\\qquad V\(x^\{\+\}\)=\\alpha B\_\{\\mathrm\{new\}\}\(x^\{\+\}\),so the[Eq\.23](https://arxiv.org/html/2611.33813#A1.E23)becomes
αBnew\(x\+\)−λB\(x\)≤0\.\\alpha B\_\{\\mathrm\{new\}\}\(x^\{\+\}\)\-\\lambda B\(x\)\\leq 0\.Using the upper and lower bounds over the interface sets, we have
αBnew\(x\+\)≤αUb\(Bnew\(Γin\+\)\),B\(x\)≥Lb\(B\(Γin−\)\)\.\\alpha B\_\{\\mathrm\{new\}\}\(x^\{\+\}\)\\leq\\alpha U\_\{b\}\\\!\\left\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\)\\right\),\\qquad B\(x\)\\geq L\_\{b\}\\\!\\left\(B\(\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}\)\\right\)\.Therefore, a sufficient condition for this subcase is
αUb\(Bnew\(Γin\+\)\)−λLb\(B\(Γin−\)\)≤0\.\\displaystyle\\alpha U\_\{b\}\\\!\\left\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\)\\right\)\-\\lambda L\_\{b\}\\\!\\left\(B\(\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}\)\\right\)\\leq 0\.\(24\)Under[Eq\.24](https://arxiv.org/html/2611.33813#A1.E24), we obtain
V\(x\+\)−λ^\(x\)V\(x\)\\displaystyle V\(x^\{\+\}\)\-\\hat\{\\lambda\}\(x\)V\(x\)=αBnew\(x\+\)−λB\(x\)\\displaystyle=\\alpha B\_\{\\mathrm\{new\}\}\(x^\{\+\}\)\-\\lambda B\(x\)≤αUb\(Bnew\(Γin\+\)\)−λLb\(B\(Γin−\)\)\\displaystyle\\leq\\alpha U\_\{b\}\\\!\\left\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\)\\right\)\-\\lambda L\_\{b\}\\\!\\left\(B\(\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}\)\\right\)≤0\.\\displaystyle\\leq 0\.
Case 2:x∈Snewx\\in S\_\{\\mathrm\{new\}\}\.In this case,
V\(x\)=αBnew\(x\),π^\(x\)=πnew\(x\),λ^\(x\)=λ′,V\(x\)=\\alpha B\_\{\\mathrm\{new\}\}\(x\),\\qquad\\hat\{\\pi\}\(x\)=\\pi\_\{\\mathrm\{new\}\}\(x\),\\qquad\\hat\{\\lambda\}\(x\)=\\lambda^\{\\prime\},and hence
x\+=f\(x,πnew\(x\)\)\.x^\{\+\}=f\(x,\\pi\_\{\\mathrm\{new\}\}\(x\)\)\.Again, we distinguish two subcases according to the region containingx\+x^\{\+\}\.
*Subcase 2\.1:x\+∈Snewx^\{\+\}\\in S\_\{\\mathrm\{new\}\}\.*ThenV\(x\+\)=αBnew\(x\+\)V\(x^\{\+\}\)=\\alpha B\_\{\\mathrm\{new\}\}\(x^\{\+\}\)\. SinceBnewB\_\{\\mathrm\{new\}\}satisfies the[Eq\.11](https://arxiv.org/html/2611.33813#S4.E11)onSnew∖SunewS\_\{\\mathrm\{new\}\}\\setminus S\_\{u\}^\{\\mathrm\{new\}\}, we have
Bnew\(f\(x,πnew\(x\)\)\)−λ′Bnew\(x\)≤0\.B\_\{\\mathrm\{new\}\}\(f\(x,\\pi\_\{\\mathrm\{new\}\}\(x\)\)\)\-\\lambda^\{\\prime\}B\_\{\\mathrm\{new\}\}\(x\)\\leq 0\.Therefore,
V\(x\+\)−λ^\(x\)V\(x\)=αBnew\(x\+\)−αλ′Bnew\(x\)≤0\.V\(x^\{\+\}\)\-\\hat\{\\lambda\}\(x\)V\(x\)=\\alpha B\_\{\\mathrm\{new\}\}\(x^\{\+\}\)\-\\alpha\\lambda^\{\\prime\}B\_\{\\mathrm\{new\}\}\(x\)\\leq 0\.
*Subcase 2\.2:x\+∈Soriginx^\{\+\}\\in S\_\{\\mathrm\{origin\}\}\.*Then the transition crosses fromSnewS\_\{\\mathrm\{new\}\}toSoriginS\_\{\\mathrm\{origin\}\}\. By the definition of the switching interface sets,
x∈Γout−,x\+∈Γout\+\.x\\in\\Gamma\_\{\\mathrm\{out\}\}^\{\-\},\\qquad x^\{\+\}\\in\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}\.In this case,
V\(x\)=αBnew\(x\),V\(x\+\)=B\(x\+\),V\(x\)=\\alpha B\_\{\\mathrm\{new\}\}\(x\),\\qquad V\(x^\{\+\}\)=B\(x^\{\+\}\),so the[Eq\.23](https://arxiv.org/html/2611.33813#A1.E23)becomes
B\(x\+\)−αλ′Bnew\(x\)≤0\.B\(x^\{\+\}\)\-\\alpha\\lambda^\{\\prime\}B\_\{\\mathrm\{new\}\}\(x\)\\leq 0\.Using the upper and lower bounds over the interface sets, we have
B\(x\+\)≤Ub\(B\(Γout\+\)\),αBnew\(x\)≥αLb\(Bnew\(Γout−\)\)\.B\(x^\{\+\}\)\\leq U\_\{b\}\\\!\\left\(B\(\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}\)\\right\),\\qquad\\alpha B\_\{\\mathrm\{new\}\}\(x\)\\geq\\alpha L\_\{b\}\\\!\\left\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}\)\\right\)\.Therefore, a sufficient condition for this subcase is
Ub\(B\(Γout\+\)\)−αλ′Lb\(Bnew\(Γout−\)\)≤0\.\\displaystyle U\_\{b\}\\\!\\left\(B\(\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}\)\\right\)\-\\alpha\\lambda^\{\\prime\}L\_\{b\}\\\!\\left\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}\)\\right\)\\leq 0\.\(25\)Under[Eq\.25](https://arxiv.org/html/2611.33813#A1.E25), we obtain
V\(x\+\)−λ^\(x\)V\(x\)\\displaystyle V\(x^\{\+\}\)\-\\hat\{\\lambda\}\(x\)V\(x\)=B\(x\+\)−αλ′Bnew\(x\)\\displaystyle=B\(x^\{\+\}\)\-\\alpha\\lambda^\{\\prime\}B\_\{\\mathrm\{new\}\}\(x\)≤Ub\(B\(Γout\+\)\)−αλ′Lb\(Bnew\(Γout−\)\)\\displaystyle\\leq U\_\{b\}\\\!\\left\(B\(\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}\)\\right\)\-\\alpha\\lambda^\{\\prime\}L\_\{b\}\\\!\\left\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}\)\\right\)≤0\.\\displaystyle\\leq 0\.
Since[Eq\.24](https://arxiv.org/html/2611.33813#A1.E24)and[Eq\.25](https://arxiv.org/html/2611.33813#A1.E25)are the given condition in[Theorem2](https://arxiv.org/html/2611.33813#Thmtheorem2), we have
V\(f\(x,π^\(x\)\)\)−λ^\(x\)V\(x\)≤0,∀x∈S∖S^u\.V\(f\(x,\\hat\{\\pi\}\(x\)\)\)\-\\hat\{\\lambda\}\(x\)V\(x\)\\leq 0,\\qquad\\forall x\\in S\\setminus\\hat\{S\}\_\{u\}\.Therefore,[Eq\.23](https://arxiv.org/html/2611.33813#A1.E23)in[Definition3](https://arxiv.org/html/2611.33813#Thmdefinition3)holds\.
So,VVsatisfies[Eq\.21](https://arxiv.org/html/2611.33813#A1.E21),[Eq\.22](https://arxiv.org/html/2611.33813#A1.E22), and[Eq\.23](https://arxiv.org/html/2611.33813#A1.E23)in[Definition3](https://arxiv.org/html/2611.33813#Thmdefinition3)\. It means that the adaptive piecewise barrier certificate is a piecewise barrier certificate in[Definition3](https://arxiv.org/html/2611.33813#Thmdefinition3)\. By[Theorem6](https://arxiv.org/html/2611.33813#Thmtheorem6), the adaptive barrier certificateVVcan ensure the safety ofM^\\hat\{M\}\. ∎
### A\.2Compositional Safety under Sequentially Introduced Obstacles
We now show that the adaptive piecewise barrier certificate construction can be applied sequentially when new unsafe regions are introduced one after another\. Suppose that the first newly introduced unsafe setSunewS\_\{u\}^\{\\mathrm\{new\}\}has already been repaired\. After this repair, the state space is decomposed as
S=Sorigin∪Snew,Sorigin∩Snew=∅,S=S\_\{\\mathrm\{origin\}\}\\cup S\_\{\\mathrm\{new\}\},\\qquad S\_\{\\mathrm\{origin\}\}\\cap S\_\{\\mathrm\{new\}\}=\\emptyset,and the certified piecewise barrier certificate is
V\(x\)=\{B\(x\),x∈Sorigin,αBnew\(x\),x∈Snew\.V\(x\)=\\begin\{cases\}B\(x\),&x\\in S\_\{\\mathrm\{origin\}\},\\\\ \\alpha B\_\{\\mathrm\{new\}\}\(x\),&x\\in S\_\{\\mathrm\{new\}\}\.\\end\{cases\}HereBBis the original barrier certificate retained on the unaffected region, andBnewB\_\{\\mathrm\{new\}\}is the repaired local barrier certificate onSnewS\_\{\\mathrm\{new\}\}\.
Now suppose that another unsafe set, denoted bySunew′S\_\{u\}^\{\\mathrm\{new\}^\{\\prime\}\}, is introduced after the first repair\. LetSnew′S\_\{\\mathrm\{new\}\}^\{\\prime\}be its local repair region, with
Sunew′⊆Snew′⊆Sorigin∖Su\.S\_\{u\}^\{\\mathrm\{new\}^\{\\prime\}\}\\subseteq S\_\{\\mathrm\{new\}\}^\{\\prime\}\\subseteq S\_\{\\mathrm\{origin\}\}\\setminus S\_\{u\}\.That is, the new repair region is carved out from the current unaffected region\. We define the remaining unaffected region as
Sorigin′:=Sorigin∖Snew′\.S\_\{\\mathrm\{origin\}\}^\{\\prime\}:=S\_\{\\mathrm\{origin\}\}\\setminus S\_\{\\mathrm\{new\}\}^\{\\prime\}\.Then the state space admits the refined decomposition
S=Sorigin′∪Snew∪Snew′,S=S\_\{\\mathrm\{origin\}\}^\{\\prime\}\\cup S\_\{\\mathrm\{new\}\}\\cup S\_\{\\mathrm\{new\}\}^\{\\prime\},where the three regions are pairwise disjoint\. The previously repaired local certificateBnewB\_\{\\mathrm\{new\}\}onSnewS\_\{\\mathrm\{new\}\}is retained, and we only synthesize a new local certificateBnew′B\_\{\\mathrm\{new\}\}^\{\\prime\}onSnew′S\_\{\\mathrm\{new\}\}^\{\\prime\}\.
We assume that there are no direct one\-step transitions between the two local repair regions\. Formally,
\{x∈Snew∣f\(x,πnew\(x\)\)∈Snew′\}=∅,\\\{x\\in S\_\{\\mathrm\{new\}\}\\mid f\(x,\\pi\_\{\\mathrm\{new\}\}\(x\)\)\\in S\_\{\\mathrm\{new\}\}^\{\\prime\}\\\}=\\emptyset,and
\{x∈Snew′∣f\(x,πnew′\(x\)\)∈Snew\}=∅\.\\\{x\\in S\_\{\\mathrm\{new\}\}^\{\\prime\}\\mid f\(x,\\pi\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\)\)\\in S\_\{\\mathrm\{new\}\}\\\}=\\emptyset\.Under this assumption, the new repair region only needs to be checked against the refined unaffected regionSorigin′S\_\{\\mathrm\{origin\}\}^\{\\prime\}, since all cross\-region transitions involvingSnewS\_\{\\mathrm\{new\}\}have already been handled by the previous repair\.
For the newly introduced repair regionSnew′S\_\{\\mathrm\{new\}\}^\{\\prime\}, define the switching interface sets as
Γin′−:=\{x∣x∈ℋ\(Ω\(S0\)\)∩Sorigin′,f\(x,π\(x\)\)∈Snew′\},\\Gamma\_\{\\mathrm\{in\}\}^\{\\prime\-\}:=\\\{x\\mid x\\in\\mathcal\{H\}\(\\Omega\(S\_\{0\}\)\)\\cap S\_\{\\mathrm\{origin\}\}^\{\\prime\},f\(x,\\pi\(x\)\)\\in S\_\{\\mathrm\{new\}\}^\{\\prime\}\\\},Γin′\+:=\{f\(x,π\(x\)\)∣x∈Γin′−\},\\Gamma\_\{\\mathrm\{in\}\}^\{\\prime\+\}:=\\\{f\(x,\\pi\(x\)\)\\mid x\\in\\Gamma\_\{\\mathrm\{in\}\}^\{\\prime\-\}\\\},Γout′−:=\{x∣x∈ℋ\(Ω\(Γin′\+\)\)∩Snew′,f\(x,πnew′\(x\)\)∈Sorigin′\},\\Gamma\_\{\\mathrm\{out\}\}^\{\\prime\-\}:=\\\{x\\mid x\\in\\mathcal\{H\}\(\\Omega\(\\Gamma\_\{\\mathrm\{in\}\}^\{\\prime\+\}\)\)\\cap S\_\{\\mathrm\{new\}\}^\{\\prime\},f\(x,\\pi\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\)\)\\in S\_\{\\mathrm\{origin\}\}^\{\\prime\}\\\},Γout′\+:=\{f\(x,πnew′\(x\)\)∣x∈Γout′−\}\.\\Gamma\_\{\\mathrm\{out\}\}^\{\\prime\+\}:=\\\{f\(x,\\pi\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\)\)\\mid x\\in\\Gamma\_\{\\mathrm\{out\}\}^\{\\prime\-\}\\\}\.The entry set of the new local repair region is
S0,new′=Γin′\+\.S\_\{0,\\mathrm\{new\}\}^\{\\prime\}=\\Gamma\_\{\\mathrm\{in\}\}^\{\\prime\+\}\.
###### Theorem 7\(Compositional Safety\)\.
Assume thatVVis a valid adaptive piecewise barrier certificate for the unsafe set
S^u=Su∪Sunew\.\\hat\{S\}\_\{u\}=S\_\{u\}\\cup S\_\{u\}^\{\\mathrm\{new\}\}\.Suppose that another unsafe setSunew′S\_\{u\}^\{\\mathrm\{new\}^\{\\prime\}\}is introduced with a repair regionSnew′⊆Sorigin∖SuS\_\{\\mathrm\{new\}\}^\{\\prime\}\\subseteq S\_\{\\mathrm\{origin\}\}\\setminus S\_\{u\}, and let
S~u:=Su∪Sunew∪Sunew′\.\\tilde\{S\}\_\{u\}:=S\_\{u\}\\cup S\_\{u\}^\{\\mathrm\{new\}\}\\cup S\_\{u\}^\{\\mathrm\{new\}^\{\\prime\}\}\.Assume that there are no direct one\-step transitions betweenSnewS\_\{\\mathrm\{new\}\}andSnew′S\_\{\\mathrm\{new\}\}^\{\\prime\}\. If there exists a local barrier certificateBnew′B\_\{\\mathrm\{new\}\}^\{\\prime\}onSnew′S\_\{\\mathrm\{new\}\}^\{\\prime\}under policyπnew′\\pi\_\{\\mathrm\{new\}\}^\{\\prime\}such that
Bnew′\(x\)≤0\\displaystyle B\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\)\\leq 0∀x∈S0,new′\\displaystyle\\qquad\\forall x\\in S\_\{0,\\mathrm\{new\}\}^\{\\prime\}\(26\)Bnew′\(x\)\>0\\displaystyle B\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\)\>0∀x∈Sunew′\\displaystyle\\qquad\\forall x\\in S\_\{u\}^\{\\mathrm\{new\}^\{\\prime\}\}\(27\)Bnew′\(f\(x,πnew′\(x\)\)\)−λ′′Bnew′\(x\)≤0\\displaystyle B\_\{\\mathrm\{new\}\}^\{\\prime\}\(f\(x,\\pi\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\)\)\)\-\\lambda^\{\\prime\\prime\}B\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\)\\leq 0∀x∈Snew′∖Sunew′\\displaystyle\\qquad\\forall x\\in S\_\{\\mathrm\{new\}\}^\{\\prime\}\\setminus S\_\{u\}^\{\\mathrm\{new\}^\{\\prime\}\}\(28\)
whereλ′′∈\[0,1\]\\lambda^\{\\prime\\prime\}\\in\[0,1\], and if the new interface sets satisfy
βUb\(Bnew′\(Γin′\+\)\)−λLb\(B\(Γin′−\)\)≤0,Ub\(B\(Γout′\+\)\)−βλ′′Lb\(Bnew′\(Γout′−\)\)≤0\\displaystyle\\beta U\_\{b\}\\bigl\(B\_\{\\mathrm\{new\}\}^\{\\prime\}\(\\Gamma\_\{\\mathrm\{in\}\}^\{\\prime\+\}\)\\bigr\)\-\\lambda L\_\{b\}\\bigl\(B\(\\Gamma\_\{\\mathrm\{in\}\}^\{\\prime\-\}\)\\bigr\)\\leq 0,U\_\{b\}\\bigl\(B\(\\Gamma\_\{\\mathrm\{out\}\}^\{\\prime\+\}\)\\bigr\)\-\\beta\\lambda^\{\\prime\\prime\}L\_\{b\}\\bigl\(B\_\{\\mathrm\{new\}\}^\{\\prime\}\(\\Gamma\_\{\\mathrm\{out\}\}^\{\\prime\-\}\)\\bigr\)\\leq 0\(29\)
then the refined piecewise certificate
V~\(x\)=\{B\(x\),x∈Sorigin′,αBnew\(x\),x∈Snew,βBnew′\(x\),x∈Snew′,\\tilde\{V\}\(x\)=\\begin\{cases\}B\(x\),&x\\in S\_\{\\mathrm\{origin\}\}^\{\\prime\},\\\\ \\alpha B\_\{\\mathrm\{new\}\}\(x\),&x\\in S\_\{\\mathrm\{new\}\},\\\\ \\beta B\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\),&x\\in S\_\{\\mathrm\{new\}\}^\{\\prime\},\\end\{cases\}together with the piecewise policy
π~\(x\)=\{π\(x\),x∈Sorigin′,πnew\(x\),x∈Snew,πnew′\(x\),x∈Snew′,\\tilde\{\\pi\}\(x\)=\\begin\{cases\}\\pi\(x\),&x\\in S\_\{\\mathrm\{origin\}\}^\{\\prime\},\\\\ \\pi\_\{\\mathrm\{new\}\}\(x\),&x\\in S\_\{\\mathrm\{new\}\},\\\\ \\pi\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\),&x\\in S\_\{\\mathrm\{new\}\}^\{\\prime\},\\end\{cases\}ensures safety with respect to the updated unsafe setS~u\\tilde\{S\}\_\{u\}\.
###### Proof\.
We prove thatV~\\tilde\{V\}satisfies the barrier certificate conditions over the refined three\-region decomposition\.
First,[Eq\.2](https://arxiv.org/html/2611.33813#S3.E2)holds\. SinceS0⊆Sorigin′S\_\{0\}\\subseteq S\_\{\\mathrm\{origin\}\}^\{\\prime\}andBBis the original barrier certificate, we have
V~\(x\)=B\(x\)≤0,∀x∈S0\.\\tilde\{V\}\(x\)=B\(x\)\\leq 0,\\qquad\\forall x\\in S\_\{0\}\.
Second,[Eq\.3](https://arxiv.org/html/2611.33813#S3.E3)holds for all unsafe regions\. For the original unsafe setSuS\_\{u\}, we have
V~\(x\)=B\(x\)\>0,∀x∈Su\.\\tilde\{V\}\(x\)=B\(x\)\>0,\\qquad\\forall x\\in S\_\{u\}\.For the first repaired unsafe setSunewS\_\{u\}^\{\\mathrm\{new\}\}, the validity of the previous repair gives
V~\(x\)=αBnew\(x\)\>0,∀x∈Sunew\.\\tilde\{V\}\(x\)=\\alpha B\_\{\\mathrm\{new\}\}\(x\)\>0,\\qquad\\forall x\\in S\_\{u\}^\{\\mathrm\{new\}\}\.For the newly introduced unsafe setSunew′S\_\{u\}^\{\\mathrm\{new\}^\{\\prime\}\}, the new local certificate gives
V~\(x\)=βBnew′\(x\)\>0,∀x∈Sunew′\.\\tilde\{V\}\(x\)=\\beta B\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\)\>0,\\qquad\\forall x\\in S\_\{u\}^\{\\mathrm\{new\}^\{\\prime\}\}\.Therefore,
V~\(x\)\>0,∀x∈S~u\.\\tilde\{V\}\(x\)\>0,\\qquad\\forall x\\in\\tilde\{S\}\_\{u\}\.
It remains to prove the[Eq\.4](https://arxiv.org/html/2611.33813#S3.E4)\. Let
x∈S∖S~u,x\+=f\(x,π~\(x\)\)\.x\\in S\\setminus\\tilde\{S\}\_\{u\},\\qquad x^\{\+\}=f\(x,\\tilde\{\\pi\}\(x\)\)\.We consider the region containingxx\.
Case 1:x∈Sorigin′x\\in S\_\{\\mathrm\{origin\}\}^\{\\prime\}\.In this case,
V~\(x\)=B\(x\),π~\(x\)=π\(x\)\.\\tilde\{V\}\(x\)=B\(x\),\\qquad\\tilde\{\\pi\}\(x\)=\\pi\(x\)\.Ifx\+∈Sorigin′x^\{\+\}\\in S\_\{\\mathrm\{origin\}\}^\{\\prime\}, then it gives
V~\(x\+\)−λV~\(x\)=B\(x\+\)−λB\(x\)≤0\.\\tilde\{V\}\(x^\{\+\}\)\-\\lambda\\tilde\{V\}\(x\)=B\(x^\{\+\}\)\-\\lambda B\(x\)\\leq 0\.Ifx\+∈Snewx^\{\+\}\\in S\_\{\\mathrm\{new\}\}, then this transition is already covered by the previous[Eq\.12](https://arxiv.org/html/2611.33813#S4.E12)betweenBBandBnewB\_\{\\mathrm\{new\}\}\. Hence,
V~\(x\+\)−λV~\(x\)=αBnew\(x\+\)−λB\(x\)≤0\.\\tilde\{V\}\(x^\{\+\}\)\-\\lambda\\tilde\{V\}\(x\)=\\alpha B\_\{\\mathrm\{new\}\}\(x^\{\+\}\)\-\\lambda B\(x\)\\leq 0\.Ifx\+∈Snew′x^\{\+\}\\in S\_\{\\mathrm\{new\}\}^\{\\prime\}, thenx∈Γin′−x\\in\\Gamma\_\{\\mathrm\{in\}\}^\{\\prime\-\}andx\+∈Γin′\+x^\{\+\}\\in\\Gamma\_\{\\mathrm\{in\}\}^\{\\prime\+\}\. By[Eq\.29](https://arxiv.org/html/2611.33813#A1.E29),
V~\(x\+\)−λV~\(x\)\\displaystyle\\tilde\{V\}\(x^\{\+\}\)\-\\lambda\\tilde\{V\}\(x\)=βBnew′\(x\+\)−λB\(x\)\\displaystyle=\\beta B\_\{\\mathrm\{new\}\}^\{\\prime\}\(x^\{\+\}\)\-\\lambda B\(x\)≤βUb\(Bnew′\(Γin′\+\)\)−λLb\(B\(Γin′−\)\)≤0\.\\displaystyle\\leq\\beta U\_\{b\}\\bigl\(B\_\{\\mathrm\{new\}\}^\{\\prime\}\(\\Gamma\_\{\\mathrm\{in\}\}^\{\\prime\+\}\)\\bigr\)\-\\lambda L\_\{b\}\\bigl\(B\(\\Gamma\_\{\\mathrm\{in\}\}^\{\\prime\-\}\)\\bigr\)\\leq 0\.
Case 2:x∈Snewx\\in S\_\{\\mathrm\{new\}\}\.In this case,
V~\(x\)=αBnew\(x\),π~\(x\)=πnew\(x\)\.\\tilde\{V\}\(x\)=\\alpha B\_\{\\mathrm\{new\}\}\(x\),\\qquad\\tilde\{\\pi\}\(x\)=\\pi\_\{\\mathrm\{new\}\}\(x\)\.Ifx\+∈Snewx^\{\+\}\\in S\_\{\\mathrm\{new\}\}, then[Eq\.11](https://arxiv.org/html/2611.33813#S4.E11)ofBnewB\_\{\\mathrm\{new\}\}gives
V~\(x\+\)−λ′V~\(x\)=αBnew\(x\+\)−αλ′Bnew\(x\)≤0\.\\tilde\{V\}\(x^\{\+\}\)\-\\lambda^\{\\prime\}\\tilde\{V\}\(x\)=\\alpha B\_\{\\mathrm\{new\}\}\(x^\{\+\}\)\-\\alpha\\lambda^\{\\prime\}B\_\{\\mathrm\{new\}\}\(x\)\\leq 0\.Ifx\+∈Sorigin′x^\{\+\}\\in S\_\{\\mathrm\{origin\}\}^\{\\prime\}, then this transition is already covered by the previous[Eq\.12](https://arxiv.org/html/2611.33813#S4.E12)betweenBnewB\_\{\\mathrm\{new\}\}andBB\. Hence,
V~\(x\+\)−λ′V~\(x\)=B\(x\+\)−αλ′Bnew\(x\)≤0\.\\tilde\{V\}\(x^\{\+\}\)\-\\lambda^\{\\prime\}\\tilde\{V\}\(x\)=B\(x^\{\+\}\)\-\\alpha\\lambda^\{\\prime\}B\_\{\\mathrm\{new\}\}\(x\)\\leq 0\.The remaining casex\+∈Snew′x^\{\+\}\\in S\_\{\\mathrm\{new\}\}^\{\\prime\}is excluded by the assumption that there is no direct transition fromSnewS\_\{\\mathrm\{new\}\}toSnew′S\_\{\\mathrm\{new\}\}^\{\\prime\}\.
Case 3:x∈Snew′x\\in S\_\{\\mathrm\{new\}\}^\{\\prime\}\.In this case,
V~\(x\)=βBnew′\(x\),π~\(x\)=πnew′\(x\)\.\\tilde\{V\}\(x\)=\\beta B\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\),\\qquad\\tilde\{\\pi\}\(x\)=\\pi\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\)\.Ifx\+∈Snew′x^\{\+\}\\in S\_\{\\mathrm\{new\}\}^\{\\prime\}, then[Eq\.28](https://arxiv.org/html/2611.33813#A1.E28)ofBnew′B\_\{\\mathrm\{new\}\}^\{\\prime\}gives
V~\(x\+\)−λ′′V~\(x\)=βBnew′\(x\+\)−βλ′′Bnew′\(x\)≤0\.\\tilde\{V\}\(x^\{\+\}\)\-\\lambda^\{\\prime\\prime\}\\tilde\{V\}\(x\)=\\beta B\_\{\\mathrm\{new\}\}^\{\\prime\}\(x^\{\+\}\)\-\\beta\\lambda^\{\\prime\\prime\}B\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\)\\leq 0\.Ifx\+∈Sorigin′x^\{\+\}\\in S\_\{\\mathrm\{origin\}\}^\{\\prime\}, thenx∈Γout′−x\\in\\Gamma\_\{\\mathrm\{out\}\}^\{\\prime\-\}andx\+∈Γout′\+x^\{\+\}\\in\\Gamma\_\{\\mathrm\{out\}\}^\{\\prime\+\}\. By[Eq\.29](https://arxiv.org/html/2611.33813#A1.E29),
V~\(x\+\)−λ′′V~\(x\)\\displaystyle\\tilde\{V\}\(x^\{\+\}\)\-\\lambda^\{\\prime\\prime\}\\tilde\{V\}\(x\)=B\(x\+\)−βλ′′Bnew′\(x\)\\displaystyle=B\(x^\{\+\}\)\-\\beta\\lambda^\{\\prime\\prime\}B\_\{\\mathrm\{new\}\}^\{\\prime\}\(x\)≤Ub\(B\(Γout′\+\)\)−βλ′′Lb\(Bnew′\(Γout′−\)\)≤0\.\\displaystyle\\leq U\_\{b\}\\bigl\(B\(\\Gamma\_\{\\mathrm\{out\}\}^\{\\prime\+\}\)\\bigr\)\-\\beta\\lambda^\{\\prime\\prime\}L\_\{b\}\\bigl\(B\_\{\\mathrm\{new\}\}^\{\\prime\}\(\\Gamma\_\{\\mathrm\{out\}\}^\{\\prime\-\}\)\\bigr\)\\leq 0\.The remaining casex\+∈Snewx^\{\+\}\\in S\_\{\\mathrm\{new\}\}is excluded by the assumption that there is no direct transition fromSnew′S\_\{\\mathrm\{new\}\}^\{\\prime\}toSnewS\_\{\\mathrm\{new\}\}\.
Combining the three cases, we have shown that
V~\(f\(x,π~\(x\)\)\)−λ~\(x\)V~\(x\)≤0,∀x∈S∖S~u,\\tilde\{V\}\(f\(x,\\tilde\{\\pi\}\(x\)\)\)\-\\tilde\{\\lambda\}\(x\)\\tilde\{V\}\(x\)\\leq 0,\\qquad\\forall x\\in S\\setminus\\tilde\{S\}\_\{u\},where
λ~\(x\)=\{λ,x∈Sorigin′,λ′,x∈Snew,λ′′,x∈Snew′\.\\tilde\{\\lambda\}\(x\)=\\begin\{cases\}\\lambda,&x\\in S\_\{\\mathrm\{origin\}\}^\{\\prime\},\\\\ \\lambda^\{\\prime\},&x\\in S\_\{\\mathrm\{new\}\},\\\\ \\lambda^\{\\prime\\prime\},&x\\in S\_\{\\mathrm\{new\}\}^\{\\prime\}\.\\end\{cases\}Thus,V~\\tilde\{V\}satisfies[Eq\.2](https://arxiv.org/html/2611.33813#S3.E2)[Eq\.3](https://arxiv.org/html/2611.33813#S3.E3)[Eq\.4](https://arxiv.org/html/2611.33813#S3.E4)with respect to the updated unsafe setS~u\\tilde\{S\}\_\{u\}\. Therefore, all trajectories starting fromS0S\_\{0\}avoidS~u\\tilde\{S\}\_\{u\}, and the system remains safe after introducingSunew′S\_\{u\}^\{\\mathrm\{new\}^\{\\prime\}\}\. ∎
### A\.3Computation of the Interface Bounds
After obtaining a repaired local barrier certificate, we compute the switching interface setsΓin−\\Gamma\_\{\\mathrm\{in\}\}^\{\-\},Γin\+\\Gamma\_\{\\mathrm\{in\}\}^\{\+\},Γout−\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}, andΓout\+\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}and then verify[Eq\.12](https://arxiv.org/html/2611.33813#S4.E12)\. This condition requires four bounds:
Ub\(B\(Γout\+\)\),Lb\(Bnew\(Γout−\)\),Lb\(B\(Γin−\)\),Ub\(Bnew\(Γin\+\)\)\.U\_\{b\}\(B\(\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}\)\),\\qquad L\_\{b\}\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}\)\),\\qquad L\_\{b\}\(B\(\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}\)\),\\qquad U\_\{b\}\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\)\)\.
We compute these bounds by discretizing each interface set\. For an interface setGG, let𝒟G\\mathcal\{D\}\_\{G\}be its discretized point set under grid granularityηG\\eta\_\{G\}\. That is, every statex∈Gx\\in Ghas a discretized representativex^∈𝒟G\\hat\{x\}\\in\\mathcal\{D\}\_\{G\}satisfying
‖x−x^‖≤ηG\.\\\|x\-\\hat\{x\}\\\|\\leq\\eta\_\{G\}\.LetCCdenote the barrier certificate evaluated on this set, whereCCis eitherBBorBnewB\_\{\\mathrm\{new\}\}\. IfCCis Lipschitz continuous with constantLCL\_\{C\}, then for anyx∈Gx\\in Gand its representativex^∈𝒟G\\hat\{x\}\\in\\mathcal\{D\}\_\{G\},
\|C\(x\)−C\(x^\)\|≤LC‖x−x^‖≤LCηG\.\|C\(x\)\-C\(\\hat\{x\}\)\|\\leq L\_\{C\}\\\|x\-\\hat\{x\}\\\|\\leq L\_\{C\}\\eta\_\{G\}\.Therefore, for a discretized pointx^\\hat\{x\}, the valueC\(x^\)C\(\\hat\{x\}\)represents all continuous states within distanceηG\\eta\_\{G\}up to an error of at mostLCηGL\_\{C\}\\eta\_\{G\}\. Thus, the upper and lower bounds onC\(G\)C\(G\)are estimated conservatively by
Ub\(C\(G\)\)=maxx^∈𝒟GC\(x^\)\+LCηG,U\_\{b\}\(C\(G\)\)=\\max\_\{\\hat\{x\}\\in\\mathcal\{D\}\_\{G\}\}C\(\\hat\{x\}\)\+L\_\{C\}\\eta\_\{G\},and
Lb\(C\(G\)\)=minx^∈𝒟GC\(x^\)−LCηG\.L\_\{b\}\(C\(G\)\)=\\min\_\{\\hat\{x\}\\in\\mathcal\{D\}\_\{G\}\}C\(\\hat\{x\}\)\-L\_\{C\}\\eta\_\{G\}\.
Accordingly, the four bounds used in[Eq\.12](https://arxiv.org/html/2611.33813#S4.E12)are computed as
Ub\(B\(Γout\+\)\)=maxx^∈𝒟Γout\+B\(x^\)\+LBηΓout\+,U\_\{b\}\(B\(\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}\)\)=\\max\_\{\\hat\{x\}\\in\\mathcal\{D\}\_\{\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}\}\}B\(\\hat\{x\}\)\+L\_\{B\}\\eta\_\{\\Gamma\_\{\\mathrm\{out\}\}^\{\+\}\},Lb\(Bnew\(Γout−\)\)=minx^∈𝒟Γout−Bnew\(x^\)−LBnewηΓout−,L\_\{b\}\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}\)\)=\\min\_\{\\hat\{x\}\\in\\mathcal\{D\}\_\{\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}\}\}B\_\{\\mathrm\{new\}\}\(\\hat\{x\}\)\-L\_\{B\_\{\\mathrm\{new\}\}\}\\eta\_\{\\Gamma\_\{\\mathrm\{out\}\}^\{\-\}\},Lb\(B\(Γin−\)\)=minx^∈𝒟Γin−B\(x^\)−LBηΓin−,L\_\{b\}\(B\(\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}\)\)=\\min\_\{\\hat\{x\}\\in\\mathcal\{D\}\_\{\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}\}\}B\(\\hat\{x\}\)\-L\_\{B\}\\eta\_\{\\Gamma\_\{\\mathrm\{in\}\}^\{\-\}\},and
Ub\(Bnew\(Γin\+\)\)=maxx^∈𝒟Γin\+Bnew\(x^\)\+LBnewηΓin\+\.U\_\{b\}\(B\_\{\\mathrm\{new\}\}\(\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\)\)=\\max\_\{\\hat\{x\}\\in\\mathcal\{D\}\_\{\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\}\}B\_\{\\mathrm\{new\}\}\(\\hat\{x\}\)\+L\_\{B\_\{\\mathrm\{new\}\}\}\\eta\_\{\\Gamma\_\{\\mathrm\{in\}\}^\{\+\}\}\.
Finally, these four conservative bounds are substituted into[Eq\.12](https://arxiv.org/html/2611.33813#S4.E12)to check whether the repaired local certificate is compatible with the original certificate across the switching interface sets\.
### A\.4Box\-Shaped Construction of the Local Repair Region
In[Section5\.2](https://arxiv.org/html/2611.33813#S5.SS2), the local repair region is introduced in the form of a Minkowski sum:
Snew=Sunew⊕𝒩,S\_\{\\mathrm\{new\}\}=S\_\{u\}^\{\\mathrm\{new\}\}\\oplus\\mathcal\{N\},where𝒩\\mathcal\{N\}specifies the neighborhood around the newly introduced unsafe set\. In our experiments, we instantiate𝒩\\mathcal\{N\}as a box\-shaped neighborhood\. This construction is an implementation choice for the benchmarks, while the proposed framework itself only requires
Sunew⊆Snew⊆S\.S\_\{u\}^\{\\mathrm\{new\}\}\\subseteq S\_\{\\mathrm\{new\}\}\\subseteq S\.
For each target obstacle, suppose the newly introduced unsafe set is represented as an axis\-aligned box
Sunew=∏i=1n\[x¯iu,x¯iu\],S\_\{u\}^\{\\mathrm\{new\}\}=\\prod\_\{i=1\}^\{n\}\[\\underline\{x\}\_\{i\}^\{u\},\\overline\{x\}\_\{i\}^\{u\}\],wherex¯iu\\underline\{x\}\_\{i\}^\{u\}andx¯iu\\overline\{x\}\_\{i\}^\{u\}denote the lower and upper bounds of the obstacle along theii\-th state dimension\. Let
di=x¯iu−x¯iud\_\{i\}=\\overline\{x\}\_\{i\}^\{u\}\-\\underline\{x\}\_\{i\}^\{u\}be the obstacle size along this dimension\. Given two expansion factorsρ1,ρ2\>0\\rho\_\{1\},\\rho\_\{2\}\>0, we choose the neighborhood set as
𝒩\(ρ1,ρ2\)=∏i=1n\[−ρ1di,ρ2di\]\.\\mathcal\{N\}\(\\rho\_\{1\},\\rho\_\{2\}\)=\\prod\_\{i=1\}^\{n\}\[\-\\rho\_\{1\}d\_\{i\},\\rho\_\{2\}d\_\{i\}\]\.In general, the two expansion factors is not equal, which means flexible construction ofSnewS\_\{\\mathrm\{new\}\}\. In our experiments, we useρ1=ρ2\\rho\_\{1\}=\\rho\_\{2\}to simplify, which can be written as
𝒩\(ρ\)=∏i=1n\[−ρdi,ρdi\]\.\\mathcal\{N\}\(\\rho\)=\\prod\_\{i=1\}^\{n\}\[\-\\rho d\_\{i\},\\rho d\_\{i\}\]\.
Therefore, the local repair region becomes
Snew\(ρ\)=Sunew⊕𝒩\(ρ\)\.S\_\{\\mathrm\{new\}\}\(\\rho\)=S\_\{u\}^\{\\mathrm\{new\}\}\\oplus\\mathcal\{N\}\(\\rho\)\.
Since bothSunewS\_\{u\}^\{\\mathrm\{new\}\}and𝒩\(ρ\)\\mathcal\{N\}\(\\rho\)are axis\-aligned boxes, their Minkowski sum can be written explicitly as
Snew\(ρ\)=∏i=1n\[x¯iu−ρdi,x¯iu\+ρdi\]\.S\_\{\\mathrm\{new\}\}\(\\rho\)=\\prod\_\{i=1\}^\{n\}\[\\underline\{x\}\_\{i\}^\{u\}\-\\rho d\_\{i\},\\overline\{x\}\_\{i\}^\{u\}\+\\rho d\_\{i\}\]\.If the expanded box exceeds the original state spaceSS, it is clipped toSSso thatSnew\(ρ\)⊆SS\_\{\\mathrm\{new\}\}\(\\rho\)\\subseteq S\.
In our main experiments, we useρ=2\\rho=2as the default expansion factor\. For example, if the newly introduced unsafe set occupies the interval\[2,3\]\[2,3\]along one state dimension, thend=1d=1, and the corresponding local repair interval withρ=2\\rho=2is
\[2−2d,3\+2d\]=\[0,5\]\.\[2\-2d,\\,3\+2d\]=\[0,5\]\.
The expansion factor is not unique and is not a theoretical requirement of the framework\. In practice, the repair region can be selected progressively: one may start from a compact region with a smallerρ\\rho, attempt local repair and compositional verification, and enlargeρ\\rhoif the repair or verification fails\. This small\-to\-large strategy keeps the repair problem localized whenever possible, while still allowing additional room for repair when the initial local region is too restrictive\.
### A\.5Proof of[Theorem3](https://arxiv.org/html/2611.33813#Thmtheorem3)
In this section, we prove[Theorem3](https://arxiv.org/html/2611.33813#Thmtheorem3), which shows that the discretized transfer constraints imply the continuous transferred\-certificate constraints\.
The continuous constraints in[Eqs\.13](https://arxiv.org/html/2611.33813#S5.E13),[14](https://arxiv.org/html/2611.33813#S5.E14)and[15](https://arxiv.org/html/2611.33813#S5.E15)impose infinitely many inequalities on the unknown last\-layer parameters\. Spatial discretization yields finitely many constraints for optimization, but enforcing them only at representative points does not ensure validity throughout the state space\. To bridge this gap, the marginsδinit\\delta\_\{\\mathrm\{init\}\},δunsafe\\delta\_\{\\mathrm\{unsafe\}\}, andδdyn\\delta\_\{\\mathrm\{dyn\}\}bound the variation of the respective constraint functions within distanceη\\etaof each representative\. As derived below, the first two depend on the Lipschitz constants of the alignment and feature maps, while the third also accounts for the closed\-loop dynamics and decay term\. The bound‖wj‖1≤W\\\|w\_\{j\}\\\|\_\{1\}\\leq Wensures that these variation bounds hold uniformly over all admissible last\-layer parameters\. Thus, satisfying the tightened finite constraints in[Eqs\.16](https://arxiv.org/html/2611.33813#S5.E16),[17](https://arxiv.org/html/2611.33813#S5.E17)and[18](https://arxiv.org/html/2611.33813#S5.E18)guarantees the original continuous constraints by[Theorem3](https://arxiv.org/html/2611.33813#Thmtheorem3)\. A smallerη\\etareduces the required margins but increases the number of representative points\.
For a fixed policy parameterθ\\thetaand prescribed margins, the discretized constraints are linear inwjw\_\{j\}and can be stacked as a linear systemA\(θ\)wj≤−bA\(\\theta\)w\_\{j\}\\leq\-b\.
To see this explicitly, let
𝒟0j=\{x^0,r\}r=1N0,𝒟uj=\{x^u,r\}r=1Nu,𝒟dynj=\{x^d,r\}r=1Nd\.\\mathcal\{D\}\_\{0\}^\{j\}=\\\{\\hat\{x\}\_\{0,r\}\\\}\_\{r=1\}^\{N\_\{0\}\},\\quad\\mathcal\{D\}\_\{u\}^\{j\}=\\\{\\hat\{x\}\_\{u,r\}\\\}\_\{r=1\}^\{N\_\{u\}\},\\quad\\mathcal\{D\}\_\{\\mathrm\{dyn\}\}^\{j\}=\\\{\\hat\{x\}\_\{d,r\}\\\}\_\{r=1\}^\{N\_\{d\}\}\.For these discretized state sets, define
Ainit\\displaystyle A\_\{\\mathrm\{init\}\}=\[ϕ\(Tji\(x^0,1\)\)⊤ϕ\(Tji\(x^0,N0\)\)⊤\],\\displaystyle=\\begin\{bmatrix\}\\phi\(T\_\{ji\}\(\\hat\{x\}\_\{0,1\}\)\)^\{\\top\}\\\\ \\vdots\\\\ \\phi\(T\_\{ji\}\(\\hat\{x\}\_\{0,N\_\{0\}\}\)\)^\{\\top\}\\end\{bmatrix\},\(30\)Aunsafe\\displaystyle A\_\{\\mathrm\{unsafe\}\}=\[−ϕ\(Tji\(x^u,1\)\)⊤−ϕ\(Tji\(x^u,Nu\)\)⊤\],\\displaystyle=\\begin\{bmatrix\}\-\\phi\(T\_\{ji\}\(\\hat\{x\}\_\{u,1\}\)\)^\{\\top\}\\\\ \\vdots\\\\ \-\\phi\(T\_\{ji\}\(\\hat\{x\}\_\{u,N\_\{u\}\}\)\)^\{\\top\}\\end\{bmatrix\},\(31\)Adyn\(θ\)\\displaystyle A\_\{\\mathrm\{dyn\}\}\(\\theta\)=\[\(ϕ\(Tji\(f\(x^d,1,π\(x^d,1,θ\)\)\)\)−λ′ϕ\(Tji\(x^d,1\)\)\)⊤\(ϕ\(Tji\(f\(x^d,Nd,π\(x^d,Nd,θ\)\)\)\)−λ′ϕ\(Tji\(x^d,Nd\)\)\)⊤\]\.\\displaystyle=\\begin\{bmatrix\}\\left\(\\phi\(T\_\{ji\}\(f\(\\hat\{x\}\_\{d,1\},\\pi\(\\hat\{x\}\_\{d,1\};\\theta\)\)\)\)\-\\lambda^\{\\prime\}\\phi\(T\_\{ji\}\(\\hat\{x\}\_\{d,1\}\)\)\\right\)^\{\\top\}\\\\ \\vdots\\\\ \\left\(\\phi\(T\_\{ji\}\(f\(\\hat\{x\}\_\{d,N\_\{d\}\},\\pi\(\\hat\{x\}\_\{d,N\_\{d\}\};\\theta\)\)\)\)\-\\lambda^\{\\prime\}\\phi\(T\_\{ji\}\(\\hat\{x\}\_\{d,N\_\{d\}\}\)\)\\right\)^\{\\top\}\\end\{bmatrix\}\.\(32\)Then all discretized constraints can be stacked as
A\(θ\)wj≤−b,\\displaystyle A\(\\theta\)w\_\{j\}\\leq\-b,\(33\)where
A\(θ\)=\[AinitAunsafeAdyn\(θ\)\],b=\[δinit𝟏N0\(δunsafe\+β\)𝟏Nuδdyn𝟏Nd\]\.\\displaystyle A\(\\theta\)=\\begin\{bmatrix\}A\_\{\\mathrm\{init\}\}\\\\ A\_\{\\mathrm\{unsafe\}\}\\\\ A\_\{\\mathrm\{dyn\}\}\(\\theta\)\\end\{bmatrix\},\\qquad b=\\begin\{bmatrix\}\\delta\_\{\\mathrm\{init\}\}\\mathbf\{1\}\_\{N\_\{0\}\}\\\\ \(\\delta\_\{\\mathrm\{unsafe\}\}\+\\beta\)\\mathbf\{1\}\_\{N\_\{u\}\}\\\\ \\delta\_\{\\mathrm\{dyn\}\}\\mathbf\{1\}\_\{N\_\{d\}\}\\end\{bmatrix\}\.\(34\)Here, each row ofA\(θ\)A\(\\theta\)corresponds to one discretized transfer constraint, andbbcollects the prescribed margins\. The dependence onθ\\thetaappears only inAdyn\(θ\)A\_\{\\mathrm\{dyn\}\}\(\\theta\), because the local decrease constraints involve the successor statef\(x,π\(x,θ\)\)f\(x,\\pi\(x;\\theta\)\)\. Therefore, finding a repaired local barrier certificate is reduced to finding a policy parameterθ\\thetaand a final\-layer parameterwjw\_\{j\}satisfying[Eq\.33](https://arxiv.org/html/2611.33813#A1.E33)\.
Theorem[3](https://arxiv.org/html/2611.33813#Thmtheorem3)\(Continuous validity from discretized transfer constraints\) If a functionBjB\_\{j\}satisfies that
ginit\(x^,wj\)\\displaystyle g\_\{\\mathrm\{init\}\}\(\\hat\{x\};w\_\{j\}\)≤−δinit,\\displaystyle\\leq\-\\delta\_\{\\mathrm\{init\}\},∀x^∈𝒟0j,\\displaystyle\\forall\\hat\{x\}\\in\\mathcal\{D\}\_\{0\}^\{j\},\([16](https://arxiv.org/html/2611.33813#S5.E16)\)gunsafe\(x^,wj\)\\displaystyle g\_\{\\mathrm\{unsafe\}\}\(\\hat\{x\};w\_\{j\}\)≤−\(δunsafe\+β\),\\displaystyle\\leq\-\(\\delta\_\{\\mathrm\{unsafe\}\}\+\\beta\),∀x^∈𝒟uj,\\displaystyle\\forall\\hat\{x\}\\in\\mathcal\{D\}\_\{u\}^\{j\},\([17](https://arxiv.org/html/2611.33813#S5.E17)\)gdyn\(x^,wj,θ\)\\displaystyle g\_\{\\mathrm\{dyn\}\}\(\\hat\{x\};w\_\{j\},\\theta\)≤−δdyn,\\displaystyle\\leq\-\\delta\_\{\\mathrm\{dyn\}\},∀x^∈𝒟dynj,\\displaystyle\\forall\\hat\{x\}\\in\\mathcal\{D\}\_\{\\mathrm\{dyn\}\}^\{j\},\([18](https://arxiv.org/html/2611.33813#S5.E18)\)where constantsδinit\\delta\_\{\\mathrm\{init\}\},δunsafe\\delta\_\{\\mathrm\{unsafe\}\}, andδdyn\\delta\_\{\\mathrm\{dyn\}\}are derived from the granularityη\\etaand the relevant Lipschitz constants of the system, thenBjB\_\{j\}is a valid transferred BC onSjS^\{j\}that satisfies the continuous constraints in[Eqs\.13](https://arxiv.org/html/2611.33813#S5.E13),[14](https://arxiv.org/html/2611.33813#S5.E14)and[15](https://arxiv.org/html/2611.33813#S5.E15)\.
###### Proof\.
Letη\>0\\eta\>0be the grid granularity for discretization\. For each continuous statexxin the corresponding domain, there exists a discretized representativex^\\hat\{x\}such that
‖x−x^‖1≤η\.\\\|x\-\\hat\{x\}\\\|\_\{1\}\\leq\\eta\.This produces finite discretized state sets𝒟0j⊆S0j\\mathcal\{D\}\_\{0\}^\{j\}\\subseteq S\_\{0\}^\{j\},𝒟uj⊆Suj\\mathcal\{D\}\_\{u\}^\{j\}\\subseteq S\_\{u\}^\{j\}, and𝒟dynj⊆Sj\\mathcal\{D\}\_\{\\mathrm\{dyn\}\}^\{j\}\\subseteq S^\{j\}for the entry set, the newly introduced unsafe set, and the local repair region, respectively\. Assume that the final\-layer parameter is bounded by some constantW\>0W\>0, i\.e\.,
‖wj‖1≤W,\\\|w\_\{j\}\\\|\_\{1\}\\leq W,and that the alignment mapTjiT\_\{ji\}, the feature mapϕ\\phi, the system dynamicsff, and the policy classπ\(⋅,θ\)\\pi\(\\cdot;\\theta\)are Lipschitz continuous with constantsLTL\_\{T\},LϕL\_\{\\phi\},LfL\_\{f\}, andL¯π\\bar\{L\}\_\{\\pi\}, respectively\. The discretization margins are chosen as
δinit=WLϕLTη,\\delta\_\{\\mathrm\{init\}\}=WL\_\{\\phi\}L\_\{T\}\\eta,δunsafe=WLϕLTη,\\delta\_\{\\mathrm\{unsafe\}\}=WL\_\{\\phi\}L\_\{T\}\\eta,and
δdyn=WLϕLT\(Lf\(1\+L¯π\)\+λ′\)η\.\\delta\_\{\\mathrm\{dyn\}\}=WL\_\{\\phi\}L\_\{T\}\\left\(L\_\{f\}\(1\+\\bar\{L\}\_\{\\pi\}\)\+\\lambda^\{\\prime\}\\right\)\\eta\.We prove the three continuous constraints separately\.
First, consider an arbitrary statex∈S0jx\\in S\_\{0\}^\{j\}\. By the discretization construction, there existsx^∈𝒟0j\\hat\{x\}\\in\\mathcal\{D\}\_\{0\}^\{j\}such that
‖x−x^‖1≤η\.\\\|x\-\\hat\{x\}\\\|\_\{1\}\\leq\\eta\.By the definition ofginitg\_\{\\mathrm\{init\}\},
ginit\(x,wj\)−ginit\(x^,wj\)=wj⊤\(ϕ\(Tji\(x\)\)−ϕ\(Tji\(x^\)\)\)\.g\_\{\\mathrm\{init\}\}\(x;w\_\{j\}\)\-g\_\{\\mathrm\{init\}\}\(\\hat\{x\};w\_\{j\}\)=w\_\{j\}^\{\\top\}\\left\(\\phi\(T\_\{ji\}\(x\)\)\-\\phi\(T\_\{ji\}\(\\hat\{x\}\)\)\\right\)\.Using Hölder’s inequality, we have
\|ginit\(x,wj\)−ginit\(x^,wj\)\|≤‖wj‖1‖ϕ\(Tji\(x\)\)−ϕ\(Tji\(x^\)\)‖∞\.\\left\|g\_\{\\mathrm\{init\}\}\(x;w\_\{j\}\)\-g\_\{\\mathrm\{init\}\}\(\\hat\{x\};w\_\{j\}\)\\right\|\\leq\\\|w\_\{j\}\\\|\_\{1\}\\left\\\|\\phi\(T\_\{ji\}\(x\)\)\-\\phi\(T\_\{ji\}\(\\hat\{x\}\)\)\\right\\\|\_\{\\infty\}\.By the Lipschitz continuity ofϕ\\phiandTjiT\_\{ji\},
‖ϕ\(Tji\(x\)\)−ϕ\(Tji\(x^\)\)‖∞≤LϕLT‖x−x^‖1\.\\left\\\|\\phi\(T\_\{ji\}\(x\)\)\-\\phi\(T\_\{ji\}\(\\hat\{x\}\)\)\\right\\\|\_\{\\infty\}\\leq L\_\{\\phi\}L\_\{T\}\\\|x\-\\hat\{x\}\\\|\_\{1\}\.Therefore,
\|ginit\(x,wj\)−ginit\(x^,wj\)\|≤WLϕLT‖x−x^‖≤WLϕLTη=δinit\.\\left\|g\_\{\\mathrm\{init\}\}\(x;w\_\{j\}\)\-g\_\{\\mathrm\{init\}\}\(\\hat\{x\};w\_\{j\}\)\\right\|\\leq WL\_\{\\phi\}L\_\{T\}\\\|x\-\\hat\{x\}\\\|\\leq WL\_\{\\phi\}L\_\{T\}\\eta=\\delta\_\{\\mathrm\{init\}\}\.Since the discretized entry constraint in[Eq\.16](https://arxiv.org/html/2611.33813#S5.E16)gives
ginit\(x^,wj\)≤−δinit,g\_\{\\mathrm\{init\}\}\(\\hat\{x\};w\_\{j\}\)\\leq\-\\delta\_\{\\mathrm\{init\}\},we obtain
ginit\(x,wj\)≤ginit\(x^,wj\)\+δinit≤−δinit\+δinit=0\.g\_\{\\mathrm\{init\}\}\(x;w\_\{j\}\)\\leq g\_\{\\mathrm\{init\}\}\(\\hat\{x\};w\_\{j\}\)\+\\delta\_\{\\mathrm\{init\}\}\\leq\-\\delta\_\{\\mathrm\{init\}\}\+\\delta\_\{\\mathrm\{init\}\}=0\.Becausex∈S0jx\\in S\_\{0\}^\{j\}was chosen arbitrarily,
ginit\(x,wj\)≤0,∀x∈S0,newj\.g\_\{\\mathrm\{init\}\}\(x;w\_\{j\}\)\\leq 0,\\qquad\\forall x\\in S\_\{0,\\mathrm\{new\}\}^\{j\}\.Thus, the continuous entry constraint in[Eq\.13](https://arxiv.org/html/2611.33813#S5.E13)holds\.
Second, letx∈Sujx\\in S\_\{u\}^\{j\}be chosen arbitrarily\. By the discretization construction, there existsx^∈𝒟uj\\hat\{x\}\\in\\mathcal\{D\}\_\{u\}^\{j\}such that
‖x−x^‖1≤η\.\\\|x\-\\hat\{x\}\\\|\_\{1\}\\leq\\eta\.By the definition ofgunsafeg\_\{\\mathrm\{unsafe\}\},
gunsafe\(x,wj\)−gunsafe\(x^,wj\)=−wj⊤\(ϕ\(Tji\(x\)\)−ϕ\(Tji\(x^\)\)\)\.g\_\{\\mathrm\{unsafe\}\}\(x;w\_\{j\}\)\-g\_\{\\mathrm\{unsafe\}\}\(\\hat\{x\};w\_\{j\}\)=\-w\_\{j\}^\{\\top\}\\left\(\\phi\(T\_\{ji\}\(x\)\)\-\\phi\(T\_\{ji\}\(\\hat\{x\}\)\)\\right\)\.Repeating the same Lipschitz argument as above yields
\|gunsafe\(x,wj\)−gunsafe\(x^,wj\)\|≤WLϕLT‖x−x^‖1≤WLϕLTη=δunsafe\.\\left\|g\_\{\\mathrm\{unsafe\}\}\(x;w\_\{j\}\)\-g\_\{\\mathrm\{unsafe\}\}\(\\hat\{x\};w\_\{j\}\)\\right\|\\leq WL\_\{\\phi\}L\_\{T\}\\\|x\-\\hat\{x\}\\\|\_\{1\}\\leq WL\_\{\\phi\}L\_\{T\}\\eta=\\delta\_\{\\mathrm\{unsafe\}\}\.Since the discretized unsafe\-set constraint in[Eq\.17](https://arxiv.org/html/2611.33813#S5.E17)gives
gunsafe\(x^,wj\)≤−\(δunsafe\+β\),g\_\{\\mathrm\{unsafe\}\}\(\\hat\{x\};w\_\{j\}\)\\leq\-\(\\delta\_\{\\mathrm\{unsafe\}\}\+\\beta\),we obtain
gunsafe\(x,wj\)≤gunsafe\(x^,wj\)\+δunsafe≤−\(δunsafe\+β\)\+δunsafe=−β\.g\_\{\\mathrm\{unsafe\}\}\(x;w\_\{j\}\)\\leq g\_\{\\mathrm\{unsafe\}\}\(\\hat\{x\};w\_\{j\}\)\+\\delta\_\{\\mathrm\{unsafe\}\}\\leq\-\(\\delta\_\{\\mathrm\{unsafe\}\}\+\\beta\)\+\\delta\_\{\\mathrm\{unsafe\}\}=\-\\beta\.Becausex∈Sujx\\in S\_\{u\}^\{j\}was chosen arbitrarily,
gunsafe\(x,wj\)≤−β,∀x∈Suj\.g\_\{\\mathrm\{unsafe\}\}\(x;w\_\{j\}\)\\leq\-\\beta,\\qquad\\forall x\\in S\_\{u\}^\{j\}\.Thus, the continuous unsafe\-set constraint in[Eq\.14](https://arxiv.org/html/2611.33813#S5.E14)holds\.
Third, letx∈Sjx\\in S^\{j\}was chosen arbitrarily\. By the discretization construction, there existsx^∈𝒟dynj\\hat\{x\}\\in\\mathcal\{D\}\_\{\\mathrm\{dyn\}\}^\{j\}such that
‖x−x^‖1≤η\.\\\|x\-\\hat\{x\}\\\|\_\{1\}\\leq\\eta\.Define
z\(x,θ\):=ϕ\(Tji\(f\(x,π\(x,θ\)\)\)\)−λ′ϕ\(Tji\(x\)\)\.z\(x,\\theta\):=\\phi\(T\_\{ji\}\(f\(x,\\pi\(x;\\theta\)\)\)\)\-\\lambda^\{\\prime\}\\phi\(T\_\{ji\}\(x\)\)\.Then
gdyn\(x,wj,θ\)=wj⊤z\(x,θ\)\.g\_\{\\mathrm\{dyn\}\}\(x;w\_\{j\},\\theta\)=w\_\{j\}^\{\\top\}z\(x,\\theta\)\.Hence, by Hölder’s inequality,
\|gdyn\(x,wj,θ\)−gdyn\(x^,wj,θ\)\|≤‖wj‖1‖z\(x,θ\)−z\(x^,θ\)‖∞\.\\left\|g\_\{\\mathrm\{dyn\}\}\(x;w\_\{j\},\\theta\)\-g\_\{\\mathrm\{dyn\}\}\(\\hat\{x\};w\_\{j\},\\theta\)\\right\|\\leq\\\|w\_\{j\}\\\|\_\{1\}\\\|z\(x,\\theta\)\-z\(\\hat\{x\},\\theta\)\\\|\_\{\\infty\}\.We now bound‖z\(x,θ\)−z\(x^,θ\)‖∞\\\|z\(x,\\theta\)\-z\(\\hat\{x\},\\theta\)\\\|\_\{\\infty\}\. By the triangle inequality,
‖z\(x,θ\)−z\(x^,θ\)‖∞≤\\displaystyle\\\|z\(x,\\theta\)\-z\(\\hat\{x\},\\theta\)\\\|\_\{\\infty\}\\leq‖ϕ\(Tji\(f\(x,π\(x,θ\)\)\)\)−ϕ\(Tji\(f\(x^,π\(x^,θ\)\)\)\)‖∞\\displaystyle\\left\\\|\\phi\(T\_\{ji\}\(f\(x,\\pi\(x;\\theta\)\)\)\)\-\\phi\(T\_\{ji\}\(f\(\\hat\{x\},\\pi\(\\hat\{x\};\\theta\)\)\)\)\\right\\\|\_\{\\infty\}\+λ′‖ϕ\(Tji\(x\)\)−ϕ\(Tji\(x^\)\)‖∞\.\\displaystyle\+\\lambda^\{\\prime\}\\left\\\|\\phi\(T\_\{ji\}\(x\)\)\-\\phi\(T\_\{ji\}\(\\hat\{x\}\)\)\\right\\\|\_\{\\infty\}\.Using the Lipschitz continuity ofϕ\\phiandTjiT\_\{ji\},
‖ϕ\(Tji\(f\(x,π\(x,θ\)\)\)\)−ϕ\(Tji\(f\(x^,π\(x^,θ\)\)\)\)‖∞≤LϕLT‖f\(x,π\(x,θ\)\)−f\(x^,π\(x^,θ\)\)‖1\.\\left\\\|\\phi\(T\_\{ji\}\(f\(x,\\pi\(x;\\theta\)\)\)\)\-\\phi\(T\_\{ji\}\(f\(\\hat\{x\},\\pi\(\\hat\{x\};\\theta\)\)\)\)\\right\\\|\_\{\\infty\}\\leq L\_\{\\phi\}L\_\{T\}\\left\\\|f\(x,\\pi\(x;\\theta\)\)\-f\(\\hat\{x\},\\pi\(\\hat\{x\};\\theta\)\)\\right\\\|\_\{1\}\.SinceffisLfL\_\{f\}\-Lipschitz,
‖f\(x,π\(x,θ\)\)−f\(x^,π\(x^,θ\)\)‖1≤Lf\(‖x−x^‖1\+‖π\(x,θ\)−π\(x^,θ\)‖1\)\.\\left\\\|f\(x,\\pi\(x;\\theta\)\)\-f\(\\hat\{x\},\\pi\(\\hat\{x\};\\theta\)\)\\right\\\|\_\{1\}\\leq L\_\{f\}\\left\(\\\|x\-\\hat\{x\}\\\|\_\{1\}\+\\\|\\pi\(x;\\theta\)\-\\pi\(\\hat\{x\};\\theta\)\\\|\_\{1\}\\right\)\.Using the Lipschitz continuity of the policy class,
‖π\(x,θ\)−π\(x^,θ\)‖1≤L¯π‖x−x^‖1\.\\\|\\pi\(x;\\theta\)\-\\pi\(\\hat\{x\};\\theta\)\\\|\_\{1\}\\leq\\bar\{L\}\_\{\\pi\}\\\|x\-\\hat\{x\}\\\|\_\{1\}\.Therefore,
‖f\(x,π\(x,θ\)\)−f\(x^,π\(x^,θ\)\)‖1≤Lf\(1\+L¯π\)‖x−x^‖1\.\\left\\\|f\(x,\\pi\(x;\\theta\)\)\-f\(\\hat\{x\},\\pi\(\\hat\{x\};\\theta\)\)\\right\\\|\_\{1\}\\leq L\_\{f\}\(1\+\\bar\{L\}\_\{\\pi\}\)\\\|x\-\\hat\{x\}\\\|\_\{1\}\.Moreover,
‖ϕ\(Tji\(x\)\)−ϕ\(Tji\(x^\)\)‖∞≤LϕLT‖x−x^‖1\.\\left\\\|\\phi\(T\_\{ji\}\(x\)\)\-\\phi\(T\_\{ji\}\(\\hat\{x\}\)\)\\right\\\|\_\{\\infty\}\\leq L\_\{\\phi\}L\_\{T\}\\\|x\-\\hat\{x\}\\\|\_\{1\}\.Combining the above inequalities gives
‖z\(x,θ\)−z\(x^,θ\)‖∞≤LϕLT\(Lf\(1\+L¯π\)\+λ′\)‖x−x^‖1\.\\\|z\(x,\\theta\)\-z\(\\hat\{x\},\\theta\)\\\|\_\{\\infty\}\\leq L\_\{\\phi\}L\_\{T\}\\left\(L\_\{f\}\(1\+\\bar\{L\}\_\{\\pi\}\)\+\\lambda^\{\\prime\}\\right\)\\\|x\-\\hat\{x\}\\\|\_\{1\}\.Using‖wj‖1≤W\\\|w\_\{j\}\\\|\_\{1\}\\leq W, we obtain
\|gdyn\(x,wj,θ\)−gdyn\(x^,wj,θ\)\|≤WLϕLT\(Lf\(1\+L¯π\)\+λ′\)‖x−x^‖1≤WLϕLT\(Lf\(1\+L¯π\)\+λ′\)η=δdyn\.\\left\|g\_\{\\mathrm\{dyn\}\}\(x;w\_\{j\},\\theta\)\-g\_\{\\mathrm\{dyn\}\}\(\\hat\{x\};w\_\{j\},\\theta\)\\right\|\\leq WL\_\{\\phi\}L\_\{T\}\\left\(L\_\{f\}\(1\+\\bar\{L\}\_\{\\pi\}\)\+\\lambda^\{\\prime\}\\right\)\\\|x\-\\hat\{x\}\\\|\_\{1\}\\leq WL\_\{\\phi\}L\_\{T\}\\left\(L\_\{f\}\(1\+\\bar\{L\}\_\{\\pi\}\)\+\\lambda^\{\\prime\}\\right\)\\eta=\\delta\_\{\\mathrm\{dyn\}\}\.Since the discretized decrease constraint in[Eq\.18](https://arxiv.org/html/2611.33813#S5.E18)gives
gdyn\(x^,wj,θ\)≤−δdyn,g\_\{\\mathrm\{dyn\}\}\(\\hat\{x\};w\_\{j\},\\theta\)\\leq\-\\delta\_\{\\mathrm\{dyn\}\},we obtain
gdyn\(x,wj,θ\)≤gdyn\(x^,wj,θ\)\+δdyn≤−δdyn\+δdyn=0\.g\_\{\\mathrm\{dyn\}\}\(x;w\_\{j\},\\theta\)\\leq g\_\{\\mathrm\{dyn\}\}\(\\hat\{x\};w\_\{j\},\\theta\)\+\\delta\_\{\\mathrm\{dyn\}\}\\leq\-\\delta\_\{\\mathrm\{dyn\}\}\+\\delta\_\{\\mathrm\{dyn\}\}=0\.Becausex∈Snewjx\\in S\_\{\\mathrm\{new\}\}^\{j\}was chosen arbitrarily,
gdyn\(x,wj,θ\)≤0,∀x∈Snewj\.g\_\{\\mathrm\{dyn\}\}\(x;w\_\{j\},\\theta\)\\leq 0,\\qquad\\forall x\\in S\_\{\\mathrm\{new\}\}^\{j\}\.Thus, the continuous decrease constraint in[Eq\.15](https://arxiv.org/html/2611.33813#S5.E15)holds\.
Combining the three parts, we conclude that the discretized constraints in[Eqs\.16](https://arxiv.org/html/2611.33813#S5.E16),[17](https://arxiv.org/html/2611.33813#S5.E17)and[18](https://arxiv.org/html/2611.33813#S5.E18)imply the continuous constraints in[Eqs\.13](https://arxiv.org/html/2611.33813#S5.E13),[14](https://arxiv.org/html/2611.33813#S5.E14)and[15](https://arxiv.org/html/2611.33813#S5.E15)\. This proves[Theorem3](https://arxiv.org/html/2611.33813#Thmtheorem3)\. ∎
### A\.6Supplementary Proof for[Section5\.2](https://arxiv.org/html/2611.33813#S5.SS2)
###### Theorem 8\(Continuous formulation of transferred local repair\)\.
Consider the transferred local barrier certificateBjB\_\{j\}defined asBj\(x\)=wj⊤ϕ\(Tji\(x\)\)B\_\{j\}\(x\)=w\_\{j\}^\{\\top\}\\phi\(T\_\{ji\}\(x\)\)\. If there exists a final\-layer parameterwjw\_\{j\}such that the continuous constraints in[Eqs\.13](https://arxiv.org/html/2611.33813#S5.E13),[14](https://arxiv.org/html/2611.33813#S5.E14)and[15](https://arxiv.org/html/2611.33813#S5.E15)hold, thenBjB\_\{j\}satisfies the local barrier conditions in[Eqs\.9](https://arxiv.org/html/2611.33813#S4.E9),[10](https://arxiv.org/html/2611.33813#S4.E10)and[11](https://arxiv.org/html/2611.33813#S4.E11)onSnewjS\_\{\\mathrm\{new\}\}^\{j\}\.
###### Proof\.
Consider thejj\-th target repair regionSnewjS\_\{\\mathrm\{new\}\}^\{j\}, and let the repaired local barrier certificate be instantiated by the transferred certificate
Bnew\(x\)=Bj\(x\)=wj⊤ϕ\(Tji\(x\)\),x∈Snewj\.B\_\{\\mathrm\{new\}\}\(x\)=B\_\{j\}\(x\)=w\_\{j\}^\{\\top\}\\phi\(T\_\{ji\}\(x\)\),\\qquad x\\in S\_\{\\mathrm\{new\}\}^\{j\}\.We prove thatBjB\_\{j\}satisfies the three local barrier conditions\.
First, by[Eq\.13](https://arxiv.org/html/2611.33813#S5.E13), for allx∈S0,newjx\\in S\_\{0,\\mathrm\{new\}\}^\{j\},
ginit\(x,wj\)=wj⊤ϕ\(Tji\(x\)\)=Bj\(x\)≤0\.g\_\{\\mathrm\{init\}\}\(x;w\_\{j\}\)=w\_\{j\}^\{\\top\}\\phi\(T\_\{ji\}\(x\)\)=B\_\{j\}\(x\)\\leq 0\.Therefore,
Bnew\(x\)≤0,∀x∈S0,newj,B\_\{\\mathrm\{new\}\}\(x\)\\leq 0,\\qquad\\forall x\\in S\_\{0,\\mathrm\{new\}\}^\{j\},which is[Eq\.9](https://arxiv.org/html/2611.33813#S4.E9)\.
Second, by[Eq\.14](https://arxiv.org/html/2611.33813#S5.E14), for allx∈Sujx\\in S\_\{u\}^\{j\},
gunsafe\(x,wj\)=−wj⊤ϕ\(Tji\(x\)\)=−Bj\(x\)≤−β\.g\_\{\\mathrm\{unsafe\}\}\(x;w\_\{j\}\)=\-w\_\{j\}^\{\\top\}\\phi\(T\_\{ji\}\(x\)\)=\-B\_\{j\}\(x\)\\leq\-\\beta\.Sinceβ\>0\\beta\>0, this implies
Bj\(x\)≥β\>0,∀x∈Suj\.B\_\{j\}\(x\)\\geq\\beta\>0,\\qquad\\forall x\\in S\_\{u\}^\{j\}\.Hence,
Bnew\(x\)\>0,∀x∈Suj,B\_\{\\mathrm\{new\}\}\(x\)\>0,\\qquad\\forall x\\in S\_\{u\}^\{j\},which is[Eq\.10](https://arxiv.org/html/2611.33813#S4.E10)\.
Third, by[Eq\.15](https://arxiv.org/html/2611.33813#S5.E15), for allx∈Snewjx\\in S\_\{\\mathrm\{new\}\}^\{j\},
gdyn\(x,wj,θ\)=wj⊤\(ϕ\(Tji\(f\(x,π\(x,θ\)\)\)\)−λ′ϕ\(Tji\(x\)\)\)≤0\.g\_\{\\mathrm\{dyn\}\}\(x;w\_\{j\},\\theta\)=w\_\{j\}^\{\\top\}\\left\(\\phi\(T\_\{ji\}\(f\(x,\\pi\(x;\\theta\)\)\)\)\-\\lambda^\{\\prime\}\\phi\(T\_\{ji\}\(x\)\)\\right\)\\leq 0\.Using the definition ofBjB\_\{j\}, this inequality is equivalent to
Bj\(f\(x,π\(x,θ\)\)\)−λ′Bj\(x\)≤0,∀x∈Snewj\.B\_\{j\}\(f\(x,\\pi\(x;\\theta\)\)\)\-\\lambda^\{\\prime\}B\_\{j\}\(x\)\\leq 0,\\qquad\\forall x\\in S\_\{\\mathrm\{new\}\}^\{j\}\.Let the local policy beπnew=πnewj\(⋅,θ\)\\pi\_\{\\mathrm\{new\}\}=\\pi\_\{\\mathrm\{new\}\}^\{j\}\(\\cdot;\\theta\)onSnewjS\_\{\\mathrm\{new\}\}^\{j\}\. Then
Bnew\(f\(x,πnew\(x\)\)\)−λ′Bnew\(x\)≤0,∀x∈Snewj\.B\_\{\\mathrm\{new\}\}\(f\(x,\\pi\_\{\\mathrm\{new\}\}\(x\)\)\)\-\\lambda^\{\\prime\}B\_\{\\mathrm\{new\}\}\(x\)\\leq 0,\\qquad\\forall x\\in S\_\{\\mathrm\{new\}\}^\{j\}\.SinceSnewj∖Suj⊆SnewjS\_\{\\mathrm\{new\}\}^\{j\}\\setminus S\_\{u\}^\{j\}\\subseteq S\_\{\\mathrm\{new\}\}^\{j\}, the same inequality also holds for allx∈Snewj∖Sujx\\in S\_\{\\mathrm\{new\}\}^\{j\}\\setminus S\_\{u\}^\{j\}\. This proves the local decrease condition in[Eq\.11](https://arxiv.org/html/2611.33813#S4.E11)\.
Combining these conditions,BjB\_\{j\}satisfies the local barrier conditions in[Eqs\.9](https://arxiv.org/html/2611.33813#S4.E9),[10](https://arxiv.org/html/2611.33813#S4.E10)and[11](https://arxiv.org/html/2611.33813#S4.E11)onSnewjS\_\{\\mathrm\{new\}\}^\{j\}\. Therefore,BjB\_\{j\}is a valid repaired local barrier certificate on the target repair region\. ∎
### A\.7Proof of[Theorem4](https://arxiv.org/html/2611.33813#Thmtheorem4)
In this section, we prove[Theorem4](https://arxiv.org/html/2611.33813#Thmtheorem4), which gives the success condition for Stage I local repair under the original policy\.
Theorem[4](https://arxiv.org/html/2611.33813#Thmtheorem4)\(Feasibility for Stage I\)\. Assume that\(𝐏I\)\\mathbf\{\(P\_\{\\mathrm\{I\}\}\)\}attains an optimal solution\. ThenεI⋆=0\\varepsilon\_\{\\mathrm\{I\}\}^\{\\star\}=0if and only if there exists a last\-layer parameterwjw\_\{j\}satisfyingA\(θ\)wj≤−bA\(\\theta\)w\_\{j\}\\leq\-b\. Consequently, Stage I succeeds and yields a valid localized barrier certificate as defined in[Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2)\.
###### Proof\.
Recall that Stage I fixes the policy parameter asθ=θ0\\theta=\\theta\_\{0\}and solves the following linear program:
\(𝐏I\)minwj,ξ,uj\\displaystyle\(\\mathbf\{P\}\_\{\\mathrm\{I\}\}\)\\qquad\\min\_\{w\_\{j\},\\xi,u\_\{j\}\}𝟏⊤ξ\\displaystyle\\mathbf\{1\}^\{\\top\}\\xi\(35\)s\.t\.\\displaystyle\\text\{s\.t\.\}A\(θ0\)wj≤−b\+ξ,\\displaystyle A\(\\theta\_\{0\}\)w\_\{j\}\\leq\-b\+\\xi,ξ≥0,\\displaystyle\\xi\\geq 0,−uj≤wj≤uj,\\displaystyle\-u\_\{j\}\\leq w\_\{j\}\\leq u\_\{j\},𝟏⊤uj≤W,\\displaystyle\\mathbf\{1\}^\{\\top\}u\_\{j\}\\leq W,uj≥0\.\\displaystyle u\_\{j\}\\geq 0\.Let\(wj,I⋆,ξI⋆,uj,I⋆\)\(w\_\{j,\\mathrm\{I\}\}^\{\\star\},\\xi\_\{\\mathrm\{I\}\}^\{\\star\},u\_\{j,\\mathrm\{I\}\}^\{\\star\}\)be an optimal solution of\(𝐏I\)\(\\mathbf\{P\}\_\{\\mathrm\{I\}\}\), and let
εI⋆=𝟏⊤ξI⋆\\varepsilon\_\{\\mathrm\{I\}\}^\{\\star\}=\\mathbf\{1\}^\{\\top\}\\xi\_\{\\mathrm\{I\}\}^\{\\star\}be the optimal aggregate slack\.
We prove the equivalence in two directions\. First, suppose there exists a final\-layer parameterw¯j\\bar\{w\}\_\{j\}such that
A\(θ0\)w¯j≤−b,‖w¯j‖1≤W\.A\(\\theta\_\{0\}\)\\bar\{w\}\_\{j\}\\leq\-b,\\qquad\\\|\\bar\{w\}\_\{j\}\\\|\_\{1\}\\leq W\.
Then choosing
wj=w¯j,ξ=0,uj=\|wj¯\|w\_\{j\}=\\bar\{w\}\_\{j\},\\qquad\\xi=0,\\qquad u\_\{j\}=\|\\bar\{w\_\{j\}\}\|satisfies
A\(θ0\)wj=A\(θ0\)w¯j≤−b=−b\+ξ,A\(\\theta\_\{0\}\)w\_\{j\}=A\(\\theta\_\{0\}\)\\bar\{w\}\_\{j\}\\leq\-b=\-b\+\\xi,and also satisfiesξ≥0\\xi\\geq 0\. Hence,\(w¯j,0,\|w¯j\|\)\(\\bar\{w\}\_\{j\},0,\|\\bar\{w\}\_\{j\}\|\)is feasible for\(𝐏I\)\(\\mathbf\{P\}\_\{\\mathrm\{I\}\}\), with objective value𝟏⊤ξ=0\\mathbf\{1\}^\{\\top\}\\xi=0\.
Since every feasible solution of\(𝐏I\)\\mathbf\{\(P\_\{\\mathrm\{I\}\}\)\}satisfiesξ≥0\\xi\\geq 0, the objective value𝟏⊤ξ\\mathbf\{1\}^\{\\top\}\\xiis always nonnegative\. Therefore, the optimal value must be
εI⋆=0\.\\varepsilon\_\{\\mathrm\{I\}\}^\{\\star\}=0\.
Conversely, suppose that
εI⋆=0\.\\varepsilon\_\{\\mathrm\{I\}\}^\{\\star\}=0\.Because\(𝐏I\)\\mathbf\{\(P\_\{\\mathrm\{I\}\}\)\}attains an optimal solution, there exists\(wj,I⋆,ξI⋆,uj,I⋆\)\(w\_\{j,\\mathrm\{I\}\}^\{\\star\},\\xi\_\{\\mathrm\{I\}\}^\{\\star\},u\_\{j,\\mathrm\{I\}\}^\{\\star\}\)such that
A\(θ0\)wj,I⋆≤−b\+ξI⋆,ξI⋆≥0,A\(\\theta\_\{0\}\)w\_\{j,\\mathrm\{I\}\}^\{\\star\}\\leq\-b\+\\xi\_\{\\mathrm\{I\}\}^\{\\star\},\\qquad\\xi\_\{\\mathrm\{I\}\}^\{\\star\}\\geq 0,and
𝟏⊤ξI⋆=0\.\\mathbf\{1\}^\{\\top\}\\xi\_\{\\mathrm\{I\}\}^\{\\star\}=0\.Since every component ofξI⋆\\xi\_\{\\mathrm\{I\}\}^\{\\star\}is nonnegative, the equality
𝟏⊤ξI⋆=0\\mathbf\{1\}^\{\\top\}\\xi\_\{\\mathrm\{I\}\}^\{\\star\}=0implies
ξI⋆=0\.\\xi\_\{\\mathrm\{I\}\}^\{\\star\}=0\.SubstitutingξI⋆=0\\xi\_\{\\mathrm\{I\}\}^\{\\star\}=0into the relaxed constraint yields
A\(θ0\)wj,I⋆≤−b\.A\(\\theta\_\{0\}\)w\_\{j,\\mathrm\{I\}\}^\{\\star\}\\leq\-b\.
Moreover, the optimal solution satisfies−uj,I⋆≤wj,I⋆≤uj,I⋆\-u\_\{j,\\mathrm\{I\}\}^\{\\star\}\\leq w\_\{j,\\mathrm\{I\}\}^\{\\star\}\\leq u\_\{j,\\mathrm\{I\}\}^\{\\star\}and𝟏⊤uj,I⋆≤W\\mathbf\{1\}^\{\\top\}u\_\{j,\\mathrm\{I\}\}^\{\\star\}\\leq W\. Therefore,
‖wj,I⋆‖1≤𝟏⊤uj,I⋆≤W\.\\\|w\_\{j,\\mathrm\{I\}\}^\{\\star\}\\\|\_\{1\}\\leq\\mathbf\{1\}^\{\\top\}u\_\{j,\\mathrm\{I\}\}^\{\\star\}\\leq W\.
Therefore, there exists a final\-layer parameterwjw\_\{j\}, namelywj,I⋆w\_\{j,\\mathrm\{I\}\}^\{\\star\}, such that
A\(θ0\)wj≤−b\.A\(\\theta\_\{0\}\)w\_\{j\}\\leq\-b\.
Combining the two directions, we have shown that
εI⋆=0⟺∃wj:A\(θ0\)wj≤−b,∥wj∥1≤W\.\\varepsilon\_\{\\mathrm\{I\}\}^\{\\star\}=0\\quad\\Longleftrightarrow\\quad\\exists w\_\{j\}:\\quad A\(\\theta\_\{0\}\)w\_\{j\}\\leq\-b,\\quad\\\|w\_\{j\}\\\|\_\{1\}\\leq W\.
Thus, Stage I succeeds if and only if the optimal aggregate slack is zero\.
By[Theorem3](https://arxiv.org/html/2611.33813#Thmtheorem3), we further have thatBj\(x\)=wj⊤ϕ\(Tji\(x\)\)B\_\{j\}\(x\)=w\_\{j\}^\{\\top\}\\phi\(T\_\{ji\}\(x\)\)forx∈Sjx\\in S^\{j\}is a valid transferred BC onSjS^\{j\}that satisfies the continuous constraints in[Eqs\.13](https://arxiv.org/html/2611.33813#S5.E13),[14](https://arxiv.org/html/2611.33813#S5.E14)and[15](https://arxiv.org/html/2611.33813#S5.E15)\. Then by[Theorem8](https://arxiv.org/html/2611.33813#Thmtheorem8), we have thatBjB\_\{j\}satisfies the local barrier conditions in[Eqs\.9](https://arxiv.org/html/2611.33813#S4.E9),[10](https://arxiv.org/html/2611.33813#S4.E10)and[11](https://arxiv.org/html/2611.33813#S4.E11)onSjS^\{j\}withSj=SnewS^\{j\}=S\_\{\\mathrm\{new\}\}\. Therefore, we conclude that Stage I succeeds and yields a valid localized barrier certificate as defined in[Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2)\.
∎
### A\.8Proof of[Theorem5](https://arxiv.org/html/2611.33813#Thmtheorem5)
In this subsection, we prove[Theorem5](https://arxiv.org/html/2611.33813#Thmtheorem5), which gives the success condition for Stage II local repair when the policy parameter is allowed to change\.
Theorem[5](https://arxiv.org/html/2611.33813#Thmtheorem5)\(Feasibility for Stage II\) Assume that\(𝐏II\)\\mathbf\{\(P\_\{\\mathrm\{II\}\}\)\}attains an optimal solution\. ThenεII\(θ\)=0\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta\)=0if and only if there exists a tuple\(wj,θ\)\(w\_\{j\},\\theta\)such thatA\(θ\)wj≤−bA\(\\theta\)w\_\{j\}\\leq\-b\. Consequently, Stage II succeeds and yields a valid localized barrier certificate as defined in[Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2)\.
###### Proof\.
Fix a policy parameterθ\\theta\. Recall that, for this fixedθ\\theta, Stage II solves the lower\-level linear program
\(𝐏IIlow\(θ\)\)minwj,ξ,uj\\displaystyle\(\\mathbf\{P\}\_\{\\mathrm\{II\}\}^\{\\mathrm\{low\}\}\(\\theta\)\)\\qquad\\min\_\{w\_\{j\},\\xi,u\_\{j\}\}𝟏⊤ξ\\displaystyle\\mathbf\{1\}^\{\\top\}\\xi\(36\)s\.t\.\\displaystyle\\text\{s\.t\.\}A\(θ\)wj≤−b\+ξ,\\displaystyle A\(\\theta\)w\_\{j\}\\leq\-b\+\\xi,ξ≥0,\\displaystyle\\xi\\geq 0,−uj≤wj≤uj,\\displaystyle\-u\_\{j\}\\leq w\_\{j\}\\leq u\_\{j\},𝟏⊤uj≤W,\\displaystyle\\mathbf\{1\}^\{\\top\}u\_\{j\}\\leq W,uj≥0\.\\displaystyle u\_\{j\}\\geq 0\.
Let
\(wj,II⋆\(θ\),ξII⋆\(θ\),uj,II⋆\(θ\)\)\(w\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\),\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\),u\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\)\)be an optimal solution of\(𝐏IIlow\(θ\)\)\\mathbf\{\(P\_\{\\mathrm\{II\}\}^\{\\mathrm\{low\}\}\(\\theta\)\)\}\. By definition, the optimal aggregate slack is
εII\(θ\)=𝟏⊤ξII⋆\(θ\)\.\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta\)=\\mathbf\{1\}^\{\\top\}\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\)\.
We prove the equivalence in two directions\.
First, suppose that there exists a final\-layer parameterw¯j\\bar\{w\}\_\{j\}such that
A\(θ\)w¯j≤−b,‖w¯j‖1≤W\.A\(\\theta\)\\bar\{w\}\_\{j\}\\leq\-b,\\qquad\\\|\\bar\{w\}\_\{j\}\\\|\_\{1\}\\leq W\.
Then choosing
wj=w¯j,ξ=0,uj=\|wj¯\|w\_\{j\}=\\bar\{w\}\_\{j\},\\qquad\\xi=0,\\qquad u\_\{j\}=\|\\bar\{w\_\{j\}\}\|satisfies the relaxed lower\-level constraint:
A\(θ\)wj=A\(θ\)w¯j≤−b=−b\+ξ,A\(\\theta\)w\_\{j\}=A\(\\theta\)\\bar\{w\}\_\{j\}\\leq\-b=\-b\+\\xi,and also satisfiesξ≥0\\xi\\geq 0\. Hence,\(w¯j,0,\|w¯j\|\)\(\\bar\{w\}\_\{j\},0,\|\\bar\{w\}\_\{j\}\|\)is feasible for\(PIIlow\(θ\)\)\(P\_\{\\mathrm\{II\}\}^\{\\mathrm\{low\}\}\(\\theta\)\), with objective value𝟏⊤ξ=0\\mathbf\{1\}^\{\\top\}\\xi=0\.
Since every feasible solution satisfiesξ≥0\\xi\\geq 0, the objective value𝟏⊤ξ\\mathbf\{1\}^\{\\top\}\\xiis always nonnegative\. Therefore, the optimal value must be
εII\(θ\)=0\.\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta\)=0\.
Conversely, suppose that
εII\(θ\)=0\.\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta\)=0\.Since\(𝐏IIlow\(θ\)\)\\mathbf\{\(P\_\{\\mathrm\{II\}\}^\{\\mathrm\{low\}\}\(\\theta\)\)\}attains an optimal solution, there exists
\(wj,II⋆\(θ\),ξII⋆\(θ\),uj,II⋆\(θ\)\)\(w\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\),\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\),u\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\)\)such that
A\(θ\)wj,II⋆\(θ\)≤−b\+ξII⋆\(θ\),ξII⋆\(θ\)≥0,A\(\\theta\)w\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\)\\leq\-b\+\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\),\\qquad\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\)\\geq 0,and
𝟏⊤ξII⋆\(θ\)=0\.\\mathbf\{1\}^\{\\top\}\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\)=0\.Because every component ofξII⋆\(θ\)\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\)is nonnegative, the equality
𝟏⊤ξII⋆\(θ\)=0\\mathbf\{1\}^\{\\top\}\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\)=0implies
ξII⋆\(θ\)=0\.\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\)=0\.SubstitutingξII⋆\(θ\)=0\\xi\_\{\\mathrm\{II\}\}^\{\\star\}\(\\theta\)=0into the relaxed constraint gives
A\(θ\)wj,II⋆\(θ\)≤−b\.A\(\\theta\)w\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\)\\leq\-b\.
Furthermore, the auxiliary constraints of the lower\-level problem ensure that
‖wj,II⋆\(θ\)‖1≤𝟏⊤uj,II⋆\(θ\)≤W\.\\\|w\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\)\\\|\_\{1\}\\leq\\mathbf\{1\}^\{\\top\}u\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\)\\leq W\.
Therefore, there exists a final\-layer parameterwjw\_\{j\}, namelywj,II⋆\(θ\)w\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta\), such that
A\(θ\)wj≤−b\.A\(\\theta\)w\_\{j\}\\leq\-b\.
Combining the two directions, we obtain
εII\(θ\)=0⟺∃wj:A\(θ\)wj≤−b,∥wj∥1≤W\.\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta\)=0\\quad\\Longleftrightarrow\\quad\\exists w\_\{j\}:\\quad A\(\\theta\)w\_\{j\}\\leq\-b,\\quad\\\|w\_\{j\}\\\|\_\{1\}\\leq W\.
Finally, if Stage II finds a policy parameterθ⋆\\theta^\{\\star\}such that
εII\(θ⋆\)=0,\\varepsilon\_\{\\mathrm\{II\}\}\(\\theta^\{\\star\}\)=0,then by the equivalence proved above, there exists a corresponding final\-layer parameter
wj⋆=wj,II⋆\(θ⋆\)w\_\{j\}^\{\\star\}=w\_\{j,\\mathrm\{II\}\}^\{\\star\}\(\\theta^\{\\star\}\)such that
A\(θ⋆\)wj⋆≤−b\.A\(\\theta^\{\\star\}\)w\_\{j\}^\{\\star\}\\leq\-b\.This is exactly the compact transfer constraint in[Eq\.33](https://arxiv.org/html/2611.33813#A1.E33)under the adapted local policyπ\(⋅,θ⋆\)\\pi\(\\cdot;\\theta^\{\\star\}\)\.
By[Theorem3](https://arxiv.org/html/2611.33813#Thmtheorem3), we further have thatBj\(x\)=wj⊤ϕ\(Tji\(x\)\)B\_\{j\}\(x\)=w\_\{j\}^\{\\top\}\\phi\(T\_\{ji\}\(x\)\)forx∈Sjx\\in S^\{j\}is a valid transferred BC onSjS^\{j\}that satisfies the continuous constraints in[Eqs\.13](https://arxiv.org/html/2611.33813#S5.E13),[14](https://arxiv.org/html/2611.33813#S5.E14)and[15](https://arxiv.org/html/2611.33813#S5.E15)\. Then by[Theorem8](https://arxiv.org/html/2611.33813#Thmtheorem8), we have thatBjB\_\{j\}satisfies the local barrier conditions in[Eqs\.9](https://arxiv.org/html/2611.33813#S4.E9),[10](https://arxiv.org/html/2611.33813#S4.E10)and[11](https://arxiv.org/html/2611.33813#S4.E11)onSjS^\{j\}withSj=SnewS^\{j\}=S\_\{\\mathrm\{new\}\}\. Therefore, we conclude that Stage II succeeds and yields a valid localized barrier certificate as defined in[Definition2](https://arxiv.org/html/2611.33813#Thmdefinition2)\. ∎
### A\.9Detailed Experimental Results
This section provides the complete experimental tables corresponding to the compact tables reported in[Section6](https://arxiv.org/html/2611.33813#S6)\. Specifically,[Table5](https://arxiv.org/html/2611.33813#A1.T5)is the complete version of[Table1](https://arxiv.org/html/2611.33813#S6.T1),[Table6](https://arxiv.org/html/2611.33813#A1.T6)is the complete version of[Table2](https://arxiv.org/html/2611.33813#S6.T2),[Table7](https://arxiv.org/html/2611.33813#A1.T7)is the complete version of[Table3](https://arxiv.org/html/2611.33813#S6.T3)and[Table8](https://arxiv.org/html/2611.33813#A1.T8)is the complete version of[Table4](https://arxiv.org/html/2611.33813#S6.T4)\. We additionally examine the learning\-rate sensitivity of global retraining in[Table9](https://arxiv.org/html/2611.33813#A1.T9)and discuss the scope of the obstacle\-location evaluation\.
#### End\-to\-End Repair under Multiple Obstacles\.
[Table1](https://arxiv.org/html/2611.33813#S6.T1)in the main text reports a representative subset of the end\-to\-end running\-time results under multiple newly introduced obstacles, while[Table5](https://arxiv.org/html/2611.33813#A1.T5)reports the complete results over all five sequential obstacles for each benchmark\. The full table includes the running time of global retraining, the three stages of our repair pipeline, verification time, and the final end\-to\-end repair time\. These complete results further support the same conclusion as[Table1](https://arxiv.org/html/2611.33813#S6.T1): global retraining often becomes infeasible under sequentially introduced obstacles, whereas the proposed localized repair pipeline restores safety for all obstacles within the deployment\-time budget\.
#### Effect of Repair Region Size\.
[Table2](https://arxiv.org/html/2611.33813#S6.T2)in the main text reports representative results on the effect of the repair\-region size, while[Table6](https://arxiv.org/html/2611.33813#A1.T6)provides the complete results across all four benchmarks\. These results show the same trade\-off consistently across benchmarks: overly small repair regions may make repair infeasible, moderate repair regions often allow efficient Stage I repair, and overly large repair regions increase the computational cost and may require Stage II or lead to timeout\.
#### Impact of Template Selection\.
[Table3](https://arxiv.org/html/2611.33813#S6.T3)in the main text summarizes the impact of template selection on MC and PD, where the effect is most pronounced\.[Table7](https://arxiv.org/html/2611.33813#A1.T7)reports the complete template\-selection comparison across all four benchmarks\. The full results confirm that using a repaired local certificate as the transfer template is generally more effective than repeatedly using the original global certificate, especially in sequential repair settings where later obstacles can benefit from templates adapted to previously repaired regions\.
#### Comparison with Shielding\.
[Table4](https://arxiv.org/html/2611.33813#S6.T4)in the main text reports a representative comparison with shielding on B1 and B2, while[Table8](https://arxiv.org/html/2611.33813#A1.T8)provides the complete results across all four benchmarks\. The full results support the same conclusion: under repeated executions following persistent environmental changes, our method achieves a 100% empirical success rate across all evaluated configurations, with consistently lower total runtime and higher average cumulative reward than shielding\. The two approaches offer different cost trade\-offs: shielding relies on continued runtime monitoring and intervention when necessary, whereas our method incurs a one\-time repair and verification cost after each environmental change\. For persistent localized changes, this cost can be amortized over repeated executions while the updated environment remains unchanged\. Our results therefore demonstrate an advantage in this setting, rather than uniform superiority over shielding\.
#### Learning\-Rate Sensitivity of Global Retraining\.
To assess the sensitivity of global retraining to the learning rate, we evaluate three settings,10−510^\{\-5\},10−410^\{\-4\}, and10−310^\{\-3\}, across all configurations, comprising four benchmarks and five sequential obstacle configurations per benchmark\. Each configuration is evaluated over 20 runs;10−510^\{\-5\}is the setting used in the main experiments\. We measure the end\-to\-end time to obtain a controller–certificate pair that passes formal verification, including both training and verification rather than gradient updates alone\. The results are reported in[Table9](https://arxiv.org/html/2611.33813#A1.T9)\.
At10−510^\{\-5\}, the runtimes for obtaining verified solutions are of the same order of magnitude as the global\-retraining results reported in Table 1\. In contrast, at10−410^\{\-4\}and10−310^\{\-3\}, all runs across the 20 configurations time out without obtaining a verified safe solution\. Thus, increasing the learning rate does not improve the observed end\-to\-end certification outcomes under the evaluated settings\. These results highlight that aggressive parameter updates do not necessarily translate into a shorter time to obtain a verified safe controller–certificate pair\.
#### Discussion of Obstacle Locations\.
The sequential\-obstacle experiments in[Table5](https://arxiv.org/html/2611.33813#A1.T5)include multiple randomly placed obstacles across the benchmarks, providing an initial evaluation of certificate repair under different obstacle locations\. However, these experiments do not isolate the effect of obstacle location on repair difficulty\. A more systematic sensitivity analysis of how obstacle location affects repair feasibility and runtime is left for future work\.
Table 5:Running time \(in seconds\) comparison under multiple newly introduced obstacles across benchmarks\.Remark\.Original BC: time for synthesizing the original barrier certificate forS0S\_\{0\}andSuS\_\{u\};Global retrain: time for retraining a policy and a global barrier certificate forSuS\_\{u\}andSunewS\_\{u\}^\{\\mathrm\{new\}\}from scratch;Stage III: time for retraining a policy and a local barrier certificate forSunewS\_\{u\}^\{\\mathrm\{new\}\}inSnewS\_\{\\mathrm\{new\}\}from scratch;Verification: time for computing the switching interface sets required for the compositional verification in[Theorem2](https://arxiv.org/html/2611.33813#Thmtheorem2);Total time: end\-to\-end running time of our repair pipeline\. “F” means global retraining failed within 7200s, and “Timeout\(x\)” means Stage II failed withinxxseconds\.
Table 6:Running time \(in seconds\) under different scaling factors of repair regions\.Remark\.Stage IIIdenotes local retraining in the scaled repair region\.Total time of Stages I,IIdenotes the total running time of Stage I and Stage II for the current scaled region\. “F” denotes failure due to timeout in the transfer stage\.
Table 7:Running time comparison of different template\-selection strategies across four benchmarks\.BenchmarkObstacle IDOriginal global BCFirst repaired local BCPrevious templateStage IStage IIStep timeStage IStage IIStep timeStage IStage IIStep timeB1O110\.655\.365\.9–––10\.655\.365\.9O210\.554\.264\.710\.3010\.310\.3010\.3O310\.9010\.910\.6010\.611\.0011\.0O411\.4011\.410\.9010\.911\.3011\.3O511\.3011\.311\.3011\.311\.6011\.6B2O18\.240\.748\.9–––8\.240\.748\.9O28\.244\.352\.58\.144\.852\.98\.144\.852\.9O38\.708\.78\.608\.68\.908\.9O49\.009\.09\.309\.39\.209\.2O59\.009\.08\.508\.59\.109\.1MCO111\.5FF–––11\.5FFO211\.6FF12\.2012\.212\.2012\.2O312\.1FF11\.8011\.811\.9011\.9O411\.7FF12\.0012\.011\.3011\.3O511\.7FF12\.0012\.012\.1012\.1PDO114\.4FF–––14\.4FFO214\.0FF14\.8014\.814\.8014\.8O314\.2FF14\.0014\.014\.5014\.5O414\.6FF14\.3014\.314\.8014\.8O514\.7FF14\.2014\.214\.1014\.1
Remark\.Step time is the total repair time at the current sequential step, i\.e\., the sum of Stage I and Stage II\. In the*Previous repaired BC*strategy, the repaired local barrier certificate obtained at the previous step is used as the source template for the next step\. "F" denotes failure due to timeout in the transfer stage\.
Table 8:Comparison between our method and shielding under multiple obstacles across benchmarks\.Remark\.Total runtime: total runtime in seconds over the 200 runs;Avg\. reward: the mean cumulative reward;Success rate: percentage of successful runs;\# Shield Interventions: number of times that the shielder modifies or replaces the nominal action across the 200 runs\.
Table 9:Effect of the learning rate on global retraining\. Numerical entries report the mean end\-to\-end runtime \(in seconds\) over 20 runs per configuration\.Remark\.“F” means global retraining failed within 7200s\.Similar Articles
When Certificates Fail: A Unified Safety Framework for Embedded Neural Interface Models
This paper demonstrates that formal robustness certificates for embedded neural interface models can pass even when task accuracy collapses under adversarial attack, and proposes a unified empirical audit framework to address alignment failures between training objectives and operational user welfare.
Uncovering the Limits of Proof Sharing for Neural Networks
This paper conducts a systematic study on template-based acceleration for neural network robustness verification and introduces FastCert, a technique to automatically distribute templates for improved performance.
On the Applicability of Safety Nets: A Safety-By-Design Solution for Certifying Neural Networks
This paper provides the first systematic analysis of Safety Nets for certifying neural networks in safety-critical aviation systems, demonstrating optimal design configurations that minimize storage size while guaranteeing 100% correct outputs per EASA guidelines.
Safe and Adaptive Cloud Healing: Verifying LLM-Generated Recovery Plans with a Neural-Symbolic World Model
This paper presents PASE, a neuro-symbolic framework that uses LLMs to generate structured recovery plans for cloud systems and verifies them via a neural-symbolic world model, achieving over 40% reduction in recovery time.
Training Under Challenge: Executable Certificates and Challenge-Closed Optimality for Neural Networks
Introduces 'Training Under Challenge', an executable-certificate framework that uses architecture-valid procedures to construct alternative models and estimate the empirical global-optimality gap of neural network checkpoints, with theoretical guarantees and experiments on ResNet-18 distillation and quantized denoising.