Abstract
The hardware description language Verilog has been standardized and widely used in industry. Multithreaded Discrete Event Simulation Language (MDESL) is a Verilog-like language and it contains a rich variety of interesting features such as the event-driven computation and shared-variable concurrency as well as the realtime feature. In this paper, we present the denotational semantics for MDESL based on UTP. First a discrete time semantic model is proposed to describe the observation-oriented semantics for MDESL. The observations record the change of variables of atomic actions over time. Then the healthy formulae are defined to denote all different behaviors of programs and the semantics of programs is expressed in terms of healthy formulae. In addition, we demonstrate some interesting properties about the MDESL programs expressing as algebraic laws and their proofs are supported by our formalized denotational semantics. Our theoretical approach is complemented by a practical one, we use the theorem proof assistant Coq to formalize the UTP-based semantics for MDESL. The correctness of the algebraic laws is also verified via the mechanical approach in Coq. Our work provides a novel way to verify the correctness of UTP-based semantics forMDESL both in a theoretical approach and in a practical approach. It is also a new attempt for the application of Coq in the mechanized semantics.
Similar content being viewed by others
References
Arenas, A.E., Bicarregui, J.: Applying unifying theories of programming to real-time programming. Trans SDPS 10(4), 69–88 (2006)
Adam, C.: Certified programming with dependent types. MIT Press, New York (2011)
Adam C (2013) The bedrock structured programming system: combining generative metaprogramming and hoare logic in an extensible program verifier. In: ACM SIGPLAN international conference on functional programming, pp 391–402. Springer
Blech JO, Biha SO (2011) Verification of PLC properties based on formal semantics in coq. In: The 9th international conference software engineering and formal methods, pp 58–73
Bresciani, R., Butterfield, A.: A UTP approach towards probabilistic protocol verification. Secur Commun Netw 7(1), 99–107 (2014)
Butterfield A, Catháin A (2009) Concurrent models of flash memory device behaviour. In: The 12th Brazilian symposium on formal methods, pp 70–83, Brazil
Bertot Y, Castéran P (2013) Interactive theorem proving and program development: Coq'Art: the calculus of inductive constructions. Springer Science & Business Media
Bowen JP, He J, Xu Q (2000) An animatable operational semantics of the Verilog hardware description language. In: The 3rd IEEE international conference on formal engineering methods, pp 199–207. IEEE
Blazy, S., Leroy, X.: Mechanized semantics for the clight subset of the C language. J Automat Reason 43(3), 263–288 (2009)
Bidmeshki M-M, Makris Y (2015) Vericoq: a verilog-to-coq converter for proof-carrying hardware automation. In: 2015 IEEE international symposium on circuits and systems, pp 29–32
Butterfield A, Mjeda A, Noll J (2016) UTP semantics for shared-state, concurrent, context-sensitive process models. In: The 10th international symposium on theoretical aspects of software engineering, pp 93–100
Blech, J.O., Schätz, B.: Towards a formal foundation of behavioral types for UML state-machines. ACM SIGSOFT Softw Eng Notes 37(4), 1–8 (2012)
Butterfield A (2008) Unifying theories of programming. Second international symposium, UTP 2008, Dublin, Ireland, September 8–10, 2008. Revised selected papers, volume 5713 of lecture notes in computer science. Springer
Butterfield A (2016) UTPCalc—a calculator for UTP predicates. In: The 6th international symposium on unifying theories of programming, pp 197–216
Butterfield A (2017) UTCP: compositional semantics for shared-variable concurrency. In: The 20th Brazilian symposium on formal methods: foundations and applications, pp 253–270
Bowen JP, Zhu H (2016) Unifying theories of programming. 6th international symposium, UTP 2016, Reykjavik, Iceland, June 4–5, 2016. Revised selected papers, volume 10134 of lecture notes in computer science. Springer
Chatzikyriakidis S, Luo Z (2016) Proof assistants for natural language semantics. In: The 9th international conference on logical aspects of computational linguistics, pp 85–98
Choi, J., Vijayaraghavan, M., Sherman, B., Chlipala, A., Arvind, : Kami: a platform for high-level parametric hardware specification and its modular verification. Proc ACM Program Lang 1(24), 1–30 (2017)
Cavalcanti, A., Wellings, A.J., Woodcock, J.: The safety-critical java memory model formalised. Formal Asp Comput 25(1), 37–57 (2013)
Dimitrov J (2001) Operational semantics for Verilog. In: The 8th Asia-Pacific software engineering conference, pp 161–168. IEEE
Dunne S, Stoddart B (2006) Unifying Theories of Programming. First international symposium, UTP 2006, Walworth Castle, County Durham, UK, February 5–7, 2006, revised selected papers. volume 4010 of lecture notes in computer science. Springer
Foster S, Baxter J, Cavalcanti A, Woodcock J, Zeyda F (2019) Unifying semantic foundations for automated verification tools in Isabelle/UTP. CoRR arXiv:1905.05500
Foster S, Zeyda F, Nemouchi Y, Ribeiro P, Wolff B (2019) Isabelle/UTP: mechanised theory engineering for unifying theories of programming. Archive of Formal Proofs 2019
Foster S, Zeyda F, Woodcock J (2014) Isabelle/UTP: a mechanised theory engineering framework. In: International Symposium on unifying theories of programming, pp 21–41. Springer
Gordon M (1995) The semantic challenge of verilog hdl. In: Proceedings of tenth annual IEEE symposium on logic in computer science, pp 136–145
Gordon, M.J.C.: Relating event and trace semantics of hardware description languages. Comput J 45(1), 27–36 (2002)
Hansen, M.R., Chaochen, Z.: Duration calculus: logical foundations. Formal Asp Comput 9(3), 283–330 (1997)
He J (2003) An algebraic approach to the Verilog programming. In: Formal methods at the crossroads. From Panacea to Foundational Support, pp 65–80. Springer
Hoare CAR, He J (1998) Unifying theories of programming. volume 14. Prentice Hall Englewood Cliffs
He, J., Hoare, C.A.R.: Linking theories in probabilistic programming. Inf Sci 119(3–4), 205–218 (1999)
Hoare, C.A.R., He, J., Sampaio, A.: Normal form approach to compiler design. Acta Inform 30(8), 701–739 (1993)
Huet G, Kahn G, Paulin-Mohring C (2004) The coq proof assistant a tutorial. Rapport Technique, 178
He, J., Li, X., Liu, Z.: rcos: A refinement calculus of object systems. Theor Comput Sci 365(1–2), 109–142 (2006)
Hoare, T.: Laws of programming: The algebraic unification of theories of concurrency. The 25th international conference on concurrency theory, pp. 1–6. Italy, Rome (2014)
He, J., Seidel, K., McIver, A.: Probabilistic models for the guarded command language. Sci Comput Program 28(2–3), 171–192 (1997)
He J, Xu Q (2000) An operational semantics of a simulator algorithm. In The proceedings of the PDPTA, pp 26–29
He, J., Xu, Q.: Advanced features of duration calculus and their applications in sequential hybrid programs. Formal Asp Comput 15(1), 84–99 (2003)
He J, Zhu H (2000) Formalising Verilog. In The 7th IEEE international conference on electronics, circuits and systems, vol 1, pp 412–415. IEEE
IEEE (2001) IEEE standard hardware description language based on the Verilog hardware description language. IEEE Standard 1364-2001
Andronick J, Chetali B, Ly O (2003) Using coq to verify java card tm applet isolation properties. In: International conference on theorem proving in higher order logics, pp 335–351. Springer
Krebbers R, Leroy X, Wiedijk F (2014) Formal C semantics: Compcert and the C standard. In: The 5th international conference on interactive theorem proving, pp 543–548
Leroy X (2006) Formal certification of a compiler back-end or: programming a compiler with a proof assistant. In: Proceedings of the 33rd ACM SIGPLAN-SIGACT symposium on principles of programming languages, pp 42–54
Li Y, He J (2000) Formalising verilog: Operational semantics and bisimulation. Technical report
Miculan, M.: On the formalization of the modal \({\mu }\)-calculus in the calculus of inductive constructions. Inf. Comput. 164(1), 199–231 (2001)
Meredith P, Katelman M, Meseguer J, Roşu G (2010) A formal executable semantics of Verilog. In: The 8th IEEE/ACM international conference on formal methods and models for codesign, pp 179–188. IEEE
Manna Z, Pnueli A (1981) Verification of concurrent programs. Part I. The temporal framework. Technical report. Department of Computer Science, Stanford University, California
Manna Z, Pnueli A (1992) The temporal logic of reactive and concurrent systems: specification. Springer Science & Business Media
Manna Z, Pnueli A (1995) Temporal verification of reactive systems: safety. Springer Science & Business Media
Naumann D (2014) Unifying theories of programming—5th international symposium, UTP 2014, Singapore, May 13, 2014. Revised selected papers. volume 8963 of lecture notes in computer science. Springer
Oliveira, M., Cavalcanti, A., Woodcock, J.: A UTP semantics for Circus. Formal Asp Comput 21(1–2), 3–32 (2009)
Oliveira, M., Cavalcanti, A., Woodcock, J.: Unifying theories in ProofPower-Z. Formal Asp Comput 25(1), 133–158 (2013)
Owre S, Rushby JM, Shankar N (1992) PVS: a prototype verification system. In 11th international conference on automated deduction, pp 748–752, USA
Palmskog K, Gligoric M, Peña L, Moore B, Rosu G (2018) Verification of casper in the coq proof assistant. Technical report
Poernomo I, Terrell J (2010) Correct-by-construction model transformations from partially ordered specifications in coq. In The 12th international conference on formal engineering methods, pp 56–73
Qin S (2010) Unifying theories of programming—third international symposium, UTP 2010, Shanghai, China, November 15–16, 2010. Proceedings. volume 6445 of Lecture notes in computer science. Springer
Sieczkowski F, Bizjak A, Birkedal L (2015) ModuRes: a coq library for modular reasoning about concurrent higher-order imperative programming languages. In: The 6th international conference on interactive theorem proving, pp 375–390
Sheng, F., Dou, L., Yang, Z.: Mechanized semantics and refinement of UML-Statecharts. Front Inf Technol Electron Eng 18(11), 1773–1783 (2017)
Sheng F (2018) Formalization of Verilog. https://github.com/shengfeng/formalization_of_MDESL/blob/master/denotational_semantics.v
Slind K, Norrish M (2008) A brief overview of HOL4. In: The 21st international conference on theorem proving in higher order logics, pp 28–32
Shi, L., Zhao, Y., Liu, Y., Sun, J., Dong, J.S., Qin, S.: A UTP semantics for communicating processes with shared variables and its formal encoding in PVS. Formal Asp Comput 30(3–4), 351–380 (2018)
Sheng, F., Zhu, H., Yang, Z., He, J., Bowen, J.P.: Theoretical and practical aspects of linking operational and algebraic semantics for mdesl. ACM Trans Softw Eng Methodol 28(3), 1–46 (2019)
Tarski, A., et al.: A lattice-theoretical fixpoint theorem and its applications. Pac J Math 5(2), 285–309 (1955)
Tang X, Woodcock J (2004) Towards mobile processes in unifying theories. In: The 2nd international conference on software engineering and formal methods, pp 44–53, Beijing
Woodcock J, Cavalcanti A (2001) The steam boiler in a unified theory of Z and CSP. In The 8th Asia-Pacific software engineering conference, pp 291–298, China
Woodcock J, Cavalcanti A (2002) The semantics of circus. In The 2nd International Conference of B and Z Users, pp 84–203, France
Wolff B, Gaudel M-C, Feliachi A (2012) Unifying theories of programming, 4th international symposium, UTP 2012, Paris, France, August 27–28, 2012. Revised Selected Papers. volume 7681 of lecture notes in computer science. Springer,
Wan H, Song X, Gu M (2012) Parameterized specification and verification of PLC systems in coq. In The 4th IEEE international symposium on theoretical aspects of software engineering, pp 179–182
Wu X, Zhu H, Wu X (2014) Observation-oriented semantics for calculus of wireless systems. In The 5th international symposium on unifying theories of programming, pp 105–124, Singapore
Xie, W., Xiang, S., Zhu, H.: A utp approach for rtimo. Formal Asp Comput 30(6), 713–738 (2018)
Zhu H, He J (2000) A DC-based semantics for Verilog. In Proceedings of the ICS, pp 421–432. Citeseer
Zhu H, He J (2000) A semantics of Verilog using Duration Calculus. In Proceedings of international conference on software: theory and practice, pp 421–432
Zhu, H., He, J., Bowen, J.P.: From algebraic semantics to denotational semantics for Verilog. Innov Syst Softw Eng 4(4), 341–360 (2008)
Zhou, C., Hoare, C.A.R., Ravn, A.P.: A calculus of durations. Inf Process Lett 40(5), 269–276 (1991)
Zhu H (2005) Linking the semantics of a multithreaded discrete event simulation language. PhD thesis, London South Bank University
Acknowledgements
This work was partly supported by National Key Research and Development Program of China (Grant No.2018YFB2101300), National Natural Science Foundation of China (Grant No. 61872145), Shanghai Collaborative Innovation Center of Trustworthy Software for Internet of Things (GrantNo.ZF1213) and the Fundamental Research Funds for the Central Universities of China.
Author information
Authors and Affiliations
Corresponding author
Additional information
Jin Song Dong and Jim Woodcock
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Sheng, F., Zhu, H., He, J. et al. Theoretical and Practical Approaches to the Denotational Semantics for MDESL based on UTP. Form Asp Comp 32, 275–314 (2020). https://doi.org/10.1007/s00165-020-00513-4
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00165-020-00513-4