Skip to main content

Verifying Hybrid Systems with Modal Kleene Algebra

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 11194))

Abstract

Modal Kleene algebras have been used for building verification components for imperative programs with Isabelle/HOL. We integrate this approach with recent Isabelle components for ordinary differential equations to build two verification components for hybrid systems, where continuous phase space dynamics complement the discrete dynamics on program stores. We demonstrate their feasibility by deriving the most important domain-specific rules of differential dynamic logic and discussing four simple examples.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    https://github.com/yonoteam/CPSVerification.

References

  1. Alur, R.: Formal verification of hybrid systems. In: EMSOFT 2011, pp. 273–278. ACM (2011)

    Google Scholar 

  2. Armstrong, A., Struth, G., Weber, T.: Kleene algebra. Archive of Formal Proofs (2013)

    Google Scholar 

  3. Arnol’d, V.I.: Ordinary Differential Equations. Springer, Heidelberg (1992)

    MATH  Google Scholar 

  4. Back, R., von Wright, J.: Refinement Calculus—A Systematic Introduction. Springer, New York (1998). https://doi.org/10.1007/978-1-4612-1674-2

    Book  MATH  Google Scholar 

  5. Bohrer, B., Rahli, V., Vukotic, I., Völp, M., Platzer, A.: Formally verified differential dynamic logic. In: CPP 2017, pp. 208–221. ACM (2017)

    Google Scholar 

  6. Chlipala, A.: Certified Programming with Dependent Types–A Pragmatic Introduction to the Coq Proof Assistant. MIT Press (2013)

    Google Scholar 

  7. Desharnais, J., Struth, G.: Internal axioms for domain semirings. Sci. Comput. Program. 76(3), 181–203 (2011)

    Article  MathSciNet  Google Scholar 

  8. Dongol, B., Hayes, I.J., Struth, G.: Relational convolution, generalised modalities and incidence algebras. CoRR, abs/1702.04603 (2017)

    Google Scholar 

  9. Fainekos, G.E. Kress-Gazit, H., Pappas, G.J.: Hybrid controllers for path planning: a temporal logic approach. In: IEEE Conference on Decision and Control, pp. 4885–4890 (2005)

    Google Scholar 

  10. Fulton, N., Mitsch, S., Quesel, J.-D., Völp, M., Platzer, A.: KeYmaera X: an axiomatic tactical theorem prover for hybrid systems. In: Felty, A.P., Middeldorp, A. (eds.) CADE 2015. LNCS (LNAI), vol. 9195, pp. 527–538. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21401-6_36

    Chapter  Google Scholar 

  11. Gomes, V.B.F., Guttman, W., Höfner, P., Struth, G., Weber, T.: Kleene algebra with domain. Archive of Formal Proofs (2016)

    Google Scholar 

  12. Gomes, V.B.F., Struth, G.: Modal kleene algebra applied to program correctness. In: Fitzgerald, J., Heitmeyer, C., Gnesi, S., Philippou, A. (eds.) FM 2016. LNCS, vol. 9995, pp. 310–325. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-48989-6_19

    Chapter  Google Scholar 

  13. Gomes, V.B.F., Struth, G.: Program construction and verification components based on Kleene algebra. Archive of Formal Proofs (2016)

    Google Scholar 

  14. Harel, D., Kozen, D., Tiuryn, J.: Dynamic Logic. MIT Press (2000)

    Google Scholar 

  15. Henzinger, T.A.: The theory of hybrid automata. In: LICS 1996, pp. 278–292. IEEE Computer Society (1996)

    Google Scholar 

  16. Höfner, P., Möller, B.: An algebra of hybrid systems. J. Logic Algebraic Program. 78(2), 74–97 (2009)

    Article  MathSciNet  Google Scholar 

  17. Hölzl, J., Immler, F., Huffman, B.: Type classes and filters for mathematical analysis in Isabelle/HOL. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 279–294. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39634-2_21

    Chapter  Google Scholar 

  18. Immler, F., Hölzl, J.: Numerical analysis of ordinary differential equations in Isabelle/HOL. In: Beringer, L., Felty, A. (eds.) ITP 2012. LNCS, vol. 7406, pp. 377–392. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32347-8_26

    Chapter  Google Scholar 

  19. Immler, F., Hölzl, J.: Ordinary differential equations. Archive of Formal Proofs (2012)

    Google Scholar 

  20. Immler, F., Traut, C.: The flow of ODEs. In: Blanchette, J.C., Merz, S. (eds.) ITP 2016. LNCS, vol. 9807, pp. 184–199. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-43144-4_12

    Chapter  Google Scholar 

  21. Jeannin, J., et al.: A formally verified hybrid system for safe advisories in the next-generation airborne collision avoidance system. STTT 19(6), 717–741 (2017)

    Article  Google Scholar 

  22. Klein, G., et al.: Comprehensive formal verification of an OS microkernel. ACM Trans. Comput. Syst. 32(1), 2:1–2:70 (2014)

    Article  Google Scholar 

  23. Leroy, X.: Formal verification of a realistic compiler. CACM 52(7), 107–115 (2009)

    Article  Google Scholar 

  24. Loos, S.M., Platzer, A., Nistor, L.: Adaptive cruise control: hybrid, distributed, and now formally verified. In: Butler, M., Schulte, W. (eds.) FM 2011. LNCS, vol. 6664, pp. 42–56. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-21437-0_6

    Chapter  Google Scholar 

  25. Nipkow, T., Wenzel, M., Paulson, L.C. (eds.): Isabelle/HOL. LNCS, vol. 2283. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45949-9

    Book  MATH  Google Scholar 

  26. Olver, P.J.: Applications of Lie Groups to Differential Equations. Springer, New York (1986). https://doi.org/10.1007/978-1-4684-0274-2

    Book  MATH  Google Scholar 

  27. Platzer, A.: The structure of differential invariants and differential cut elimination. LMCS 8(4), 1–38 (2008)

    MathSciNet  Google Scholar 

  28. Platzer, A.: Logical Analysis of Hybrid Systems. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14509-4

    Book  MATH  Google Scholar 

  29. Quesel, J., Mitsch, S., Loos, S.M., Arechiga, N., Platzer, A.: How to model and prove hybrid systems with KeYmaera: a tutorial on safety. STTT 18(1), 67–91 (2016)

    Article  Google Scholar 

  30. Teschl, G.: Ordinary Differential Equations and Dynamical Systems. AMS (2012)

    Google Scholar 

Download references

Acknowledgements

This work was funded by a CONACYT scholarship. We are grateful to André Platzer for sharing his wisdom on \(\mathsf {d}\mathcal {L}\), and to Achim Brucker, Michael Herzberg, Andreas Lochbihler and Makarius Wenzel for Isabelle advice.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jonathan Julián Huerta y Munive .

Editor information

Editors and Affiliations

Appendices

A Axioms and Definitions

Semiring. A semiring is a structure \((S,+,\cdot ,0,1)\) that, for all \(\alpha ,\beta ,\gamma \in S\) satisfies

$$\begin{aligned} \begin{array}{c} \alpha \cdot (\beta \cdot \gamma ) = (\alpha \cdot \beta )\cdot \gamma ,\qquad 1\cdot \alpha =\alpha ,\qquad \alpha \cdot 1=\alpha ,\\ \alpha +(\beta +\gamma )= (\alpha +\beta )+ \gamma ,\qquad \alpha +\beta =\beta +\alpha ,\qquad \alpha +0=\alpha ,\qquad 0+\alpha =\alpha ,\\ \alpha \cdot (\beta +\gamma ) = \alpha \cdot \beta +\alpha \cdot \gamma ,\qquad (\alpha +\beta )\cdot \gamma = \alpha \cdot \gamma +\beta \cdot \gamma , \\ 0\cdot \alpha =0,\qquad \alpha \cdot 0=0. \end{array} \end{aligned}$$

Dioid. A dioid is a semiring S that satisfies \(\alpha +\alpha =\alpha \) for all \(x\in S\).

Kleene Algebra. A Kleene algebra is a structure \((K,+,\cdot ,0,1,^*)\) such that \((K,+,\cdot ,0,1)\) is a dioid and, for all \(x,y,z\in K\),

$$\begin{aligned} 1+\alpha \cdot \alpha ^*\le \alpha ^*,\qquad \gamma +\alpha \cdot \beta \le \beta \rightarrow \alpha ^*\cdot \gamma \le \beta ,\\ 1+\alpha ^*\cdot \alpha \le \alpha ^*,\qquad \gamma +\beta \cdot \alpha \le \beta \rightarrow \gamma \cdot \alpha ^*\le \beta . \end{aligned}$$

Modal Kleene Algebra. A modal Kleene algebra is a tuple \((K,+,\cdot ,0,\) \(1,^*, ad , ar )\) such that \((K,+,\cdot ,0,1,^*)\) is a Kleene algebra and, for all \(x,y\in K\),

$$\begin{aligned} \begin{array}{c} ad \, \alpha \cdot \alpha = 0,\qquad ad \, \alpha + ad ^2\, \alpha = 1,\qquad ad \, (\alpha \cdot \beta ) \le ad \, (\alpha \cdot ad ^2\, \beta ),\\ \alpha \cdot ( ar \, \alpha ) = 0,\qquad ar \, \alpha + ar ^2\, \alpha = 1,\qquad ar \, (\alpha \cdot \beta ) \le ar \, ( ar ^2\, \alpha \cdot \beta ),\\ ad ^2\, ( ar ^2\, \alpha )= ar ^2\, \alpha ,\qquad ar ^2\, ( ad ^2\, \alpha )= ad ^2\, \alpha . \end{array} \end{aligned}$$

Syntax of Differential Rings. \(\mathcal {R}{:}{:}= 0\mid 1\mid x\mid c\mid \mathcal {R}+\mathcal {R}\mid \mathcal {R} -\mathcal {R}\mid \mathcal {R}\cdot \mathcal {R}\mid \mathcal {R}'\), where x is drawn from a set of variables and c from a set of constants.

\(\varvec{\mathsf {d}\mathcal {L}}\)-Style Syntax of Hybrid Programs

$$ \begin{aligned} \mathcal {C} {:}{:}= x:=e \mid x' = f \ \& \ G \mid \mathcal {C};\mathcal {C}\mid \mathbf {if}\ P\ \mathbf {then}\ \mathcal {C}\ \mathbf {else}\ \mathcal {C} \mid \mathbf {while}\ P\ \mathbf {inv}\ I\ \mathbf {do}\ \mathcal {C}, \end{aligned}$$

where x is a variable, e an expression, f a vector field expression, G a guard and P a test. However we do not work with an explicit syntax for hybrid programs in Isabelle. The entire development is within the relational flow semantics. We are only creating syntactic illusions within the semantics.

B Background on Differential Equations

Ordinary Differential Equations A system of n ordinary differential equations (ODEs) can be described by a vector field \(f\in C(X,\mathbb {R}^n)\), where X is an open subset of \(\mathbb {R}^{n+1}\). Its solutions are integral curves \(x:I\rightarrow \mathbb {R}^n\) that is, differentiable functions that satisfy \(x'\, t=f\, (t, x\, t)\), where \(t\in I\subseteq \pi _1[X]\) (and \(\pi _1\) is the standard first projection map). An initial value problem for this system of ODEs is specified with an initial condition \(x\ t_0=x_0\) where \(x_0\in X\) and \(t_0\in I\).

Autonomous Systems of ODEs. The vector fields described above are time dependent. Time independent vector fields satisfy \(f\in C(X,\mathbb {R}^n)\) with \(X\subseteq R^n\). The system of ODEs is then called autonomous [30] and its solutions satisfy the equation \(x'\ t = f\ (x\ t)\) for \(t\in I\subseteq \mathbb {R}\).

Lipschitz Continuity. A function \(f:V\rightarrow W\) between normed vector spaces V and W is Lipschitz continuous on \(X\subseteq V\) if there is a constant \(k\ge 0\) such that \(||f\, x-f\, y||\le k||x-y||\) holds for all \(x,y\in X\). The function f is a contraction if it is Lipschitz continuous with \(k<1\).

Solutions to ODEs: Existence and Uniqueness. A Banach space is a complete normed vector space, that is, all Cauchy sequences converge. Let \(B\ne \emptyset \) be a closed subset of a Banach space. Then, by Banach’s fixpoint theorem, every contraction \(f:B\rightarrow B\) has a unique fixpoint. This theorem is essential for proving the Picard-Lindelöf Theorem, which guarantees unique solutions for initial value problems. We state a special case for autonomous systems of ODEs.

Theorem B.1

(Picard-Lindelöf Theorem). For every Lipschitz continuous vector field \(f:X\subseteq \mathbb {R}^n\rightarrow \mathbb {R}^n\) and \(x_0\in X\) there exists a unique integral curve \(x\in C^1(I(x_0))\) that satisfies the initial value problem for the autonomous system \(x'\ t=f\, (x\, t)\) and \(x\, t_0=x_0\). \(I(x_0)\) is the maximal interval of existence for x around \(t_0\).

Flow of an Autonomous System of ODEs. Let \(f:X\subseteq \mathbb {R}^n\rightarrow X\) be a Lipschitz continuous vector field that admits, for each \(x\in X\), a unique integral curve \(\phi _x\in C^1(I(x))\) such that \(\phi _x\ 0=x\) by Picard-Lindelöf’s theorem. The local flow \(\varphi :T\rightarrow X\rightarrow X\) for f is defined by \(\varphi \ t\ x=\phi _x\ t\), where \(T=\bigcap _{x\in X}I(x)\).

For \(\mathbb {R}= T\), the group action equations \(\varphi \ 0= id \) and \(\varphi \ (s+ t) = \varphi \ s \circ \varphi \ t\) are immediately derivable from this definition. The flow is thus indeed an action of the additive group \(\mathbb {R}\) on X, and hence a dynamical system.

C Cross-References to Isabelle Proofs

The following table links the results in this article with facts from the Isabelle repository. The repository contains a readme file with further instructions.

Result in article

Result in Isabelle theories

Definition of evolution statements

subsumed by

Definition of \(\mathsf {Flow}\)

(no uniqueness)

Proposition 5.2

subsumed by

Lemma 5.3

subsumed by

Definition of guarded evolution statement

Proposition 6.1

Lemma 6.2

subsumed by ,

Lemma 6.3

subsumed by

Definition of differential ring language

,

Lemma 7.2

implied by

Rules for solving ODEs in \(\mathbb {R}^{V\cup V'}\)

Differential weakening rule for \(\mathbb {R}^{V\cup V'}\)

Lemma 7.3

Corollary 7.5

Lemma 7.6

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Huerta y Munive, J.J., Struth, G. (2018). Verifying Hybrid Systems with Modal Kleene Algebra. In: Desharnais, J., Guttmann, W., Joosten, S. (eds) Relational and Algebraic Methods in Computer Science. RAMiCS 2018. Lecture Notes in Computer Science(), vol 11194. Springer, Cham. https://doi.org/10.1007/978-3-030-02149-8_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-02149-8_14

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-02148-1

  • Online ISBN: 978-3-030-02149-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics