@article{SelvarajEtAl2024, title = {On proving that an unsafe controller is not proven safe}, journal = {Journal of Logical and Algebraic Methods in Programming}, publisher="Elsevier", volume = {137}, pages = {100939}, year = {2024}, issn = {2352-2208}, doi = {https://doi.org/10.1016/j.jlamp.2023.100939}, url = {https://www.sciencedirect.com/science/article/pii/S2352220823000937}, author = {Yuvaraj Selvaraj and Jonas Krook and Wolfgang Ahrendt and Martin Fabian}, keywords = {Hybrid systems, Automated driving, Formal verification, Loop invariant, Theorem proving}, abstract = {Cyber-physical systems are often safety-critical and their correctness is crucial, such as in the case of automated driving. Using formal mathematical methods is one way to guarantee correctness and improve safety. Although these methods have shown their usefulness, care must be taken because modelling errors might result in proving a faulty controller safe, which is potentially catastrophic in practice. This paper deals with two such modelling errors in differential dynamic logic, a formal specification and verification language for hybrid systems, which are mathematical models of cyber-physical systems. The main contributions are to provide conditions under which these two modelling errors cannot cause a faulty controller to be proven safe, and to show how these conditions can be proven with help of the interactive theorem prover KeYmaera X. The problems are illustrated with a real world example of a safety controller for automated driving, and it is shown that the formulated conditions have the intended effect both for a faulty and a correct controller. It is also shown how the formulated conditions aid in finding a loop invariant candidate to prove properties of hybrid systems with feedback loops. Furthermore, the relation between such a loop invariant and the characterisation of the maximal control invariant set is discussed.} }