Abstract
The design and implementation of software for medical devices is challenging due to the closed-loop interaction with the patient, which is a stochastic physical environment. The safety-critical nature and the lack of existing industry standards for verification make this an ideal domain for exploring applications of formal modeling and closed-loop analysis. The biggest challenge is that the environment model(s) have to be both complex enough to express the physiological requirements and general enough to cover all possible inputs to the device. In this effort, we use a dual chamber implantable pacemaker as a case study to demonstrate verification of software specifications of medical devices as timed-automata models in UPPAAL. The pacemaker model is based on the specifications and algorithm descriptions from Boston Scientific. The heart is modeled using timed automata based on the physiology of heart. The model is gradually abstracted with timed simulation to preserve properties. A manual Counter-Example-Guided Abstraction and Refinement (CEGAR) framework has been adapted to refine the heart model when spurious counter-examples are found. To demonstrate the closed-loop nature of the problem and heart model refinement, we investigated two clinical cases of Pacemaker Mediated Tachycardia and verified their corresponding correction algorithms in the pacemaker. Along with our tools for code generation from UPPAAL models, this effort enables model-driven design and certification of software for medical devices.
Similar content being viewed by others
References
List of Device Recalls, U.S. Food and Drug Admin., (last visited Jul. 19, 2010)
Sandler, K., Ohrstrom, L., Moy, L., McVay R.: Killed by Code: Software Transparency in Implantable Medical Devices. Software Freedom Law Center (2010)
AUTOSAR. http://www.autosar.org/
AVSI. http://www.avsi.aero
Alur, R., Dill, D.L.: A theory of timed automata. Theoret. Comput. Sci. 126, 183–235 (1994)
Larsen, K.G., Pettersson, P., Yi, W.: UPPAAL in a nutshell. Int. J. Softw. Tools Technol. Transf. (STTT) 134–152 (1997)
Josephson, M.E.: Clinical Cardiac Electrophysiology. Lippincot Williams and Wilkins, Baltimore (2008)
Barold, S., Stroobandt, R., Sinnaeve, A.: Cardiac Pacemakers Step by Step. Blackwell Futura, Hoboken (2004)
Clarke, E.M., Grumberg, O., Long, D.E.: Model checking and abstraction. ACM Trans. Program. Lang. Syst. 16(5), 1512–1542 (1994)
Clarke, E.M., Grumberg, O., Peled, D.A.: Model checking (2000)
Clarke, E., Grumberg, O., Jha, S., Lu, Y., Helmut, V.: Counter example-guided abstraction refinement for symbolic model checking. J. ACM 50(5), 752–794 (2003)
Jiang, Z., Pajic, M., Moarref, S., Alur, R., Mangharam, R.: Modeling and verification of a dual chamber implantable pacemaker. Tools Algorith. Construct. Anal. Syst. 7214, 188–203 (2012)
The Compass–Technical Guide to Boston Scientific Cardiac Rhythm Management Products (2007)
Jiang, Z., Pajic, M., Alur, A., Rahul, M.: Pacemaker UPPAAL model download: http://mlab.seas.upenn.edu
Pajic, M., Jiang, Z., Lee, I., Sokolsky, O., Rahul, M.: From verification to implementation: a model translation tool and a pacemaker case study. In: Proceedings of the 2012 IEEE 18th Real Time and Embedded Technology and Applications Symposium, RTAS ’12, pp. 173–184 (2012)
Fogoros, R.N.: EP testing. Blackwell Science, New York (1999)
Yamane, S.: Timed weak simulation verification and its application to stepwise refinement of real time software. Int. J. Comput. Sci. Netw. Secur. 6 (2006)
Behrmann, G., David, A., Larsen, K.G.: A tutorial on UPPAAL, pp. 200–236. Formal Methods for the Design of Real-Time Systems. Lecture Notes in Computer Science (2004)
Clarke, E.M., Emerson, E.A.: Design and synthesis of synchronization skeletons using branching-time temporal logic. In: Logic of Programs, Workshop, pp. 52–71 (1982)
Jiang, Z., Pajic, M., Mangharam, R.: Cyber-Physical modeling of implantable cardiac medical devices. Proc. IEEE 100(1), 122–137 (2012)
Jiang, Z., Mangharam, R.: Modeling cardiac pacemaker malfunctions with the virtual heart model. In: Engineering in Medicine and Biology Society, EMBC, 2011 Annual International Conference of the IEEE, pp. 263–266 (2011)
Jiang, Z., Pajic, M., Mangharam, R.: Model-based closed-loop testing of implantable pacemakers. In: ICCPS’11: ACM/IEEE 2nd Intl. Conf. on Cyber-Physical Systems (2011)
PACEMAKER System Specification. Boston Scientific, Natick (2007)
Jiang, Z., Radhakrishnan, S., Sampath, V., Sarode, S., Pajic, M., Mangharam, R.: Heart-on-a-Chip: a closed-loop testing platform for implantable pacemakers. In: Third Workshop on Design, Modeling and Evaluation of Cyber Physical Systems (CyPhy), CPS Week (2013)
Chen, T., Diciolla, M., Kwiatkowska, M., Mereacre, A.: Quantitative verification of implantable cardiac pacemakers. In: Hybrid Systems: Computation and Control (HSCC 2013) (2013)
Jee, E., Wang, S., Kim, J. K., Lee, J., Sokolsky, O., Lee, I.: A safety-assured development approach for real-time software. In: The Proceedings of 16th IEEE International Conference on Embedded and Real-Time Computing Systems and Applications, pp. 133–142 (2010)
Tuan, L.A., Zheng, M.C., Tho, Q.T.: Modeling and verification of safety critical systems: a case study on pacemaker. Fourth International Conference on Secure Software Integration and Reliability Improvement, pp. 23–32 (2010)
Wiggelinkhuizen, J.E.: Feasibility of Formal Model Checking in the Vitatron Environment. Eindhoven University of Technology, Master thesis (2007)
Macedo, H.D., Larsen, P.G., Fitzgerald, J.: Incremental Development of a Distributed Real-Time Model of a Cardiac Pacing System using VDM, pp. 28–30. Formal Methods (2008)
Gomes, A.O., Oliveira, M.V.: Formal specification of a cardiac pacing system. In: Proceedings of the 2nd World Congress on Formal Methods (FM ’09), pp. 692–707 (2009)
Mery, D., Singh, N.K.: Pacemaker’s Functional Behaviors in Event-B. Research report, INRIA (2009)
Acknowledgments
The authors would like to thank Ashutosh Trivedi, from the University of Pennsylvania and the Indian Institute of Technology, Mumbai, for fruitful discussions during the preparation of this paper.
Author information
Authors and Affiliations
Corresponding author
Additional information
This research was partially supported by NSF research grants MRI 0923518, CAREER 1253842, CNS 1035715 and CCF 0915777.
Appendix
Appendix
Proof for \(N_2^1\Vert P_2\Vert N_2^2\preceq _t N_3^1\Vert P_3\Vert N_3^2\) In this section we manually prove the timed simulation relation \(N_2^1\Vert P_2\Vert N_2^2\preceq _t N_3^1\Vert P_3\Vert N_3^2\). The other relations can be proved accordingly.
1.1 Timed simulation relation sim
For two timed automata \(T^1\) and \(T^2\), we write timed simulation relation sim is defined on \(\varOmega _1\times \varOmega _2\) where \((s,v)\in \varOmega _1\) and \(v\) is the valuation of all clocks \(t_1\in X_1\). \(((s,v),(s',v'))\) is in sim if and only if \(v'=v(\lambda +\delta )\), for \(\delta \in D\), such that sim \((s,v)=(s',v(\lambda +D))\).
Let \(T^1=N_2^1\Vert P_2\Vert N_2^2\) and \(T^2=N_3^1\Vert P_3\Vert N_3^2\). \(X_1=\{tn_2^1,tp_2,tn_2^2\}\) and \(X_2=\{tn_3^1,tp_3,tn_3^2\}\), the state mapping for the timed simulation relation is shown below:
sim \((RE\Vert ID\Vert RE,v)=(RE\Vert ID\Vert RE,v(tn_3^1+D_1,tn_3^2+D_2))\) where \(D_1=[N_2^1.Terp\_min,N_2^1.Terp\_max]\),
A special condition for this mapping is the initial state: sim \((RE\Vert ID\Vert RE,v(tn_3^1:=0,tp_3:=0,tn_3^2:=0))= (RE\Vert ID\Vert RE,v(tn_3^1+D_1,tn_3^2+D_2))\)
where \(D=[N_2^2.Terp\_min,N_2^2.Terp\_max]\)
where \(D=[N_2^1.Terp\_min,N_2^1.Terp\_max]\)
The location mapping is shown in Fig. 5.
1.2 Timed transitions
Here we want to ensure every timed transition for \(T^1\) has a corresponding timed transition in \(T^2\). We denote \(S=(s,v)\) and \(S_\delta =(s,v+\delta )\). For each location in \(T^1\) we have \(S\xrightarrow {\delta }S_\delta \) for \(\forall \delta \in \mathbb{R }\) under condition \(v+\delta \models inv(s)\). In \(T^2\) we use \(S'=(s',v')\) and \(S_\delta '=(s',v'+\delta )\). For \((S,S')\in \) sim we show that there exists \(S_\delta '\) such that \(s'\xrightarrow {\delta }s_\delta '\) and \((s_\delta ,s_\delta ')\in \) sim. For every location we list all the corresponding components and provide proof.
For location \(RE\Vert ID\Vert RE\) in \(T^1\) we have:
Since
we have \(inv(s)\equiv inv(s')\) so the correspondence holds.
For location \(ER\Vert AN\Vert RE\) in \(T^1\) we have:
Since \(P_2.Tcond\_max==P_3.Tcond\_max\), we have \(inv(s)\equiv inv(s')\) so the correspondence holds.
For location \(RE\Vert RT\Vert ER\) in \(T^1\) we have:
Since \(P_2.Tcond\_max==P_3.Tcond\_max\), we have \(inv(s)\equiv inv(s')\) so the correspondence holds.
For location \(ER\Vert ID\Vert ER\) in \(T^1\) we have:
Since
We have \(inv(s)\subseteq inv(s')\) so the correspondence holds.
For location \(ER\Vert ID\Vert RE\) in \(T^1\) we have:
Since
We have \(inv(s)\subseteq inv(s')\) so the correspondence holds.
For location \(RE\Vert ID\Vert ER\) in \(T^1\) we have:
Since
We have \(inv(s)\subseteq inv(s')\) so the correspondence holds.
1.3 Discrete transitions
During a discrete transition, a state \(S=(s,v)\) proceed to \(S_\lambda =(s',v(\lambda :=0))\). Here we prove that for every discrete transition \(S\xrightarrow {\sigma }S_\lambda \) in \(T^1\), there exists \(S_1=(s_1,v)\) such that \((S,S_1)\in \) sim, \(S_1\xrightarrow {\sigma }S_{\lambda ,1}\) for \(S_{\lambda ,1}=(s_1',v(\lambda ':=0))\) and \((S_\lambda ,S_{\lambda ,1})\in \) sim.
Self-activation for \(N_2^1\) triggers antegrade conduction, we have \(N_3.Trest=N_2.Terp+N_2.Trest\)
Self-activation for \(N_2^2\) triggers retrograde conduction, we have \(N_3.Trest=N_2.Terp+N_2.Trest\).
\(N_2^2\) activated after antegrade conduction
\(N_2^1\) activated after retrograde conduction
ERP of \(N_2^1\) finishes first
ERP of \(N_2^2\) finishes first
ERP of \(N_2^2\) finishes after \(N_2^1\)
ERP of \(N_2^1\) finishes after \(N_2^2\)
\(N_2^2\) is activated when \(N_2^1\) is in ERP
\(N_2^2\) is activated when \(N_2^1\) is in ERP
Blocking during ERP is simulated by a non-deterministic transition in the path
Rights and permissions
About this article
Cite this article
Jiang, Z., Pajic, M., Alur, R. et al. Closed-loop verification of medical devices with model abstraction and refinement. Int J Softw Tools Technol Transfer 16, 191–213 (2014). https://doi.org/10.1007/s10009-013-0289-7
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10009-013-0289-7