Synthesizing switching logic using constraint solving

  • Ankur Taly
  • Sumit Gulwani
  • Ashish Tiwari
VMCAI 2009


For a system that can operate in multiple different modes, we define the switching logic synthesis problem as follows: given a description of the dynamics in each mode of the system, find the conditions for switching between the modes so that the resulting system satisfies some desired properties. In this paper, we present an approach for solving the switching logic synthesis problem in the case when (1) the dynamics in each mode of the system are given using differential equations and, hence, the synthesized system is a hybrid system, and (2) the desired property is a safety property. Our approach for solving the switching logic synthesis problem, called the constraint-based approach, consists of two steps. In the first constraint generation step, the synthesis problem is reduced to satisfiability of a quantified formula over the theory of reals. In the second constraint solving step, the quantified formula is solved. This paper focuses on constraint generation. The constraint generation step is based on the concept of a controlled inductive invariant. The search for controlled inductive invariant is cast as a constraint solving problem. The controlled inductive invariant is then used to arrive at the maximally liberal switching logic. We prove that the synthesized switching logic always gives us a well-formed and safe hybrid system. When the system, the safety property, and the controlled inductive invariant are all expressed only using polynomials, the generated constraint is an \({\exists\forall}\) formula in the theory of reals, whose satisfiability is decidable.


Formal methods Controller synthesis Hybrid systems 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Alur R., Courcoubetis C., Halbwachs N., Henzinger T.A., Ho P.-H., Nicollin X., Olivero A., Sifakis J., Yovine S.: The algorithmic analysis of hybrid systems. Theor. Comput. Sci. 138(3), 3–34 (1995)zbMATHCrossRefGoogle Scholar
  2. 2.
    Asarin E., Bournez O., Dang T., Maler O., Pnueli A.: Effective synthesis of switching controllers for linear systems. Proc. IEEE 88(7), 1011–1025 (2000)CrossRefGoogle Scholar
  3. 3.
    Blanchini F.: Set invariance in control. Automatica 35, 1747–1767 (1999)MathSciNetzbMATHCrossRefGoogle Scholar
  4. 4.
    Burns K., Gidea M.: Differential Geometry and Topology: With a view to dynamical systems. Chapman & Hall, London (2005)zbMATHGoogle Scholar
  5. 5.
    Chaudhuri, S., Solar-Lezama, A.: Smooth interpretation. In: ACM Conference on Programming Language Design and Implementation PLDI (2010)Google Scholar
  6. 6.
    Colón, M.: Schema-guided synthesis of imperative programs by constraint solving. In: LOPSTR, pp. 166–181 (2004)Google Scholar
  7. 7.
    Cury J., Krogh B., Niinomi T.: Supervisory controllers for hybrid systems based on approximating automata. IEEE Trans. Aut. Control 43, 564–568 (1998)MathSciNetzbMATHCrossRefGoogle Scholar
  8. 8.
    Gulwani, S., Srivastava, S., Venkatesan, R.: Program analysis as constraint solving. In: Proceedings of ACM Conference on Programming Language Design and Implementation PLDI, pp. 281–292 (2008)Google Scholar
  9. 9.
    Gulwani, S., Tiwari, A.: Constraint-based approach for analysis of hybrid systems. In: CAV, volume 5123 of LNCS, pp. 190–203. Springer (2008)Google Scholar
  10. 10.
    Hong, H.: Quantifier elimination procedure by cylindrical algebraic decomposition (1995).,
  11. 11.
    Jha, S., Gulwani, S., Seshia, S., Tiwari, A.: Synthesizing switching logic for safety and dwell-time requirements. In: ACM/IEEE International Conference on Cyber-Physical Systems, ICCPS (2010)Google Scholar
  12. 12.
    Koo, T., Sastry, S.: Mode switching synthesis for reachability specification. In: Proceedings of HSCC 2001, LNCS 2034, pp. 333–346 (2001)Google Scholar
  13. 13.
    Liberzon D., Morse A.S.: Benchmark problems in stability and design of switched systems. IEEE Control Syst. Mag. 19, 59–70 (1999)CrossRefGoogle Scholar
  14. 14.
    Lustig, Y., Vardi, M.: Synthesis from component libraries. In: Proc. FoSSaCS, pp. 395–409 (2009)Google Scholar
  15. 15.
    Manna Z., Waldinger R.: A deductive approach to program synthesis. ACM TOPLAS 2(1), 90–121 (1980)zbMATHCrossRefGoogle Scholar
  16. 16.
    Manon, P., Valentin-Roubinet, C.: Controller synthesis for hybrid systems with linear vector fields. In: Proceedings of IEEE Symposium on Intell. Control, pp. 17–22 (1999)Google Scholar
  17. 17.
    Moor, T., Raisch, J.: Discrete control of switched linear systems. In: Proceedings of European Control Conference on ECC’99 (1999)Google Scholar
  18. 18.
    Platzer A.: Differential-algebraic dynamic logic for differential-algebraic programs. J. Log. Comput. 20(1), 309–352 (2010) Advance Access published on (November 18 2008)MathSciNetzbMATHCrossRefGoogle Scholar
  19. 19.
    Prajna, S., Jadbabaie, A.: Safety verification of hybrid systems using barrier certificates. In: Proceedings of HSCC, volume 2993 of LNCS, pp. 477–492 (2004)Google Scholar
  20. 20.
    Prajna, S., Jadbabaie, A., Pappas, G.: A framework for worst-case and stochastic safety verification using barrier certificates. IEEE Trans. Automat. Contr. 52(8) (2007)Google Scholar
  21. 21.
    Sankaranarayanan, S., Sipma, H., Manna, Z.: Constructing invariants for hybrid systems. In: Proceedings of HSCC, volume 2993 of LNCS, pp. 539–554 (2004)Google Scholar
  22. 22.
    Shapiro E.Y.: Algorithmic Program DeBugging. MIT Press, Cambridge (1983)Google Scholar
  23. 23.
    Solar-Lezama, A., Tancau, L., Bodík, R., Seshia, S., Saraswat, V.: Combinatorial sketching for finite programs. In: ASPLOS (2006)Google Scholar
  24. 24.
    Taly, A., Gulwani, S., Tiwari, A.: Synthesizing switching logic using constraint solving. In: Proceedings of 10th International Conference on Verification, Model Checking and Abstract Interpretation, VMCAI, volume 5403 of LNCS, pp. 305–319. Springer (2009)Google Scholar
  25. 25.
    Taly, A., Tiwari, A.: Deductive verification of continuous dynamical systems. In: IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2009), volume 4 of Leibniz International Proceedings in Informatics (LIPIcs), pp. 383–394. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik (2009)Google Scholar
  26. 26.
    Tarski A.: A Decision Method for Elementary Algebra and Geometry. 2nd edn. University of California Press, California (1948)zbMATHGoogle Scholar
  27. 27.
    Tomlin C., Lygeros L., Sastry S.: A game-theoretic approach to controller design for hybrid systems. Proc. IEEE 88(7), 949–970 (2000)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag 2010

Authors and Affiliations

  1. 1.Computer Science DepartmentStanford UniversityStanfordUSA
  2. 2.Microsoft ResearchRedmondUSA
  3. 3.SRI InternationalMenlo ParkUSA

Personalised recommendations