From verified model to executable program: the PAT approach

CSP# is a formal modeling language that emphasizes the design of communication in concurrent systems. PAT framework provides a model checking environment for the simulation and verification of CSP# models. Although the desired properties can be formally verified at the design level, it is not always straightforward to ensure the correctness of the system’s implementation conforms to the behaviors of the formal design model. To avoid human error and enhance productivity, it would be beneficial to have a tool support to automatically generate the executable programs from their corresponding formal models. In this paper, we propose such a solution for translating verified CSP# models into C# programs in the PAT framework. We encoded the CSP# operators in a C# library-“PAT.Runtime”, where the event synchronization is based on the “Monitor” class in C#. The precondition and choice layers are built on top of the CSP event synchronization to support language-specific features. We further developed a code generation tool to automatically transform CSP# models into multi-threaded C# programs. We proved that the generated C# program and original CSP# model are equivalent on the trace semantics. This equivalence guarantees that the verified properties of the CSP# models are preserved in the generated C# programs. Furthermore, based on the existing implementation of choice operator, we improved the synchronization mechanism by pruning the unnecessary communications among the choice operators. The experiment results showed that the improved mechanism notably outperforms the standard JCSP library.

[1]  Jin Song Dong,et al.  Blending Object-Z and Timed CSP: an introduction to TCOZ , 1998, Proceedings of the 20th International Conference on Software Engineering.

[2]  Michael Poppleton,et al.  Java implementation platform for the integrated state- and event-based specification in PROB , 2010 .

[3]  Jun Sun,et al.  PAT 3: An Extensible Architecture for Building Multi-domain Model Checkers , 2011, 2011 IEEE 22nd International Symposium on Software Reliability Engineering.

[4]  Jin Song Dong,et al.  Formal specification-based online monitoring , 2006, 11th IEEE International Conference on Engineering of Complex Computer Systems (ICECCS'06).

[5]  Dusko S. Jovanovic,et al.  gCSP: A Graphical Tool for Designing CSP systems , 2004 .

[6]  Neil Brown,et al.  C++CSP2: A Many-to-Many Threading Model for Multicore Architectures , 2007, CPA.

[7]  Michael Goldsmith,et al.  Programming in occam 2 , 1985, Prentice Hall international series in computer science.

[8]  Jeremy M. R. Martin,et al.  Formal Analysis of Concurrent Java Systems , 2000 .

[9]  Jun Sun,et al.  Model Checking Software Architecture Design , 2012, 2012 IEEE 14th International Symposium on High-Assurance Systems Engineering.

[10]  Christel Baier,et al.  Principles of Model Checking (Representation and Mind Series) , 2008 .

[11]  Jin Song Dong,et al.  Evolution and Runtime Monitoring of Software Systems , 2007, SEKE.

[12]  William B. Gardner CSP++: How Faithful to CSPm? , 2005, CPA.

[13]  Ling Shi,et al.  Modeling and verifying hierarchical real-time systems using stateful timed CSP , 2013, TSEM.

[14]  Wilson Ifill,et al.  Integrating and Extending JCSP , .

[15]  Margo McCall,et al.  IEEE Computer Society , 2019, Encyclopedia of Software Engineering.

[16]  Moritz Kleine,et al.  CSP as a Coordination Language , 2011, COORDINATION.

[17]  Peter H. Welch,et al.  An Introduction to the Kent C++CSP Library , 2003 .

[18]  Alex A. Lehmberg,et al.  An Introduction to CSP.NET , 2006, CPA.

[19]  Gillian Dobbie,et al.  Theorem prover approach to semistructured data design , 2010, Formal Methods Syst. Des..

[20]  W. B. Gardner,et al.  Bridging CSP and C++ with selective formalism and executable specifications , 2003, First ACM and IEEE International Conference on Formal Methods and Models for Co-Design, 2003. MEMOCODE '03. Proceedings..

[21]  Leonardo Freitas,et al.  "JACK: A process algebra implementation in Java" , 2002 .

[22]  Jun Sun,et al.  Model checking approach to automated planning , 2014, Formal Methods Syst. Des..

[23]  C. A. R. Hoare,et al.  Communicating sequential processes , 1978, CACM.

[24]  Jun Sun,et al.  Compositional encoding for bounded model checking , 2008, Frontiers of Computer Science in China.

[25]  C. A. R. Hoare,et al.  Monitors: an operating system structuring concept , 1974, CACM.

[26]  Christel Baier,et al.  Principles of model checking , 2008 .

[27]  Ling Yuan,et al.  Generic Fault Tolerant Software Architecture Reasoning and Customization , 2006, IEEE Transactions on Reliability.

[28]  Peter H. Welch,et al.  A CSP model for Java multithreading , 2000, 2000 Proceedings International Symposium on Software Engineering for Parallel and Distributed Systems.

[29]  Michael Poppleton,et al.  JCSProB: Implementing Integrated Formal Specifications in Concurrent Java , 2007, CPA.

[30]  Geraint Jones Programming in occam , 1986, Prentice Hall International Series in Computer Science.

[31]  M. Serra,et al.  Csp++: an object-oriented application framework for software synthesis from csp specifications , 2000 .

[32]  Neil C. C. Brown,et al.  C++CSP Networked , 2004 .

[33]  Neil Brown,et al.  Integrating and Extending JCSP , 2007 .

[34]  Wilson Ifill,et al.  PyCSP-Communicating Sequential Processes for Python , 2007 .

[35]  Peter H. Welch,et al.  Using Java for Parallel Computing: JCSP versus CTJ, a Comparison , 2000 .

[36]  Jin Song Dong,et al.  Computer-aided dispatch system family architecture and verification: an integrated formal approach , 2006, IEE Proc. Softw..

[37]  John H. Howard Proving monitors , 1976, CACM.

[38]  Jun Sun,et al.  PAT: Towards Flexible Verification under Fairness , 2009, CAV.

[39]  An Introduction to CSP , .

[40]  Pao-Ann Hsiung,et al.  Automatic Generation of Provably Correct Embedded Systems , 2012, ICFEM.

[41]  Jun Sun,et al.  Integrating Specification and Programs for System Modeling and Verification , 2009, 2009 Third IEEE International Symposium on Theoretical Aspects of Software Engineering.

[42]  G. H. Hilderink,et al.  A distributed real-time Java system based on CSP , 1999, Proceedings Third IEEE International Symposium on Object-Oriented Real-Time Distributed Computing (ISORC 2000) (Cat. No. PR00607).