Abstract
This chapter shows how one can write a compiler in CSP M and base a tool around the result. In this case that compiler is for shared variable programs, so this chapter is also an introduction to that subject. We study this through examples such as mutual exclusion, including Lamport’s bakery algorithm, and the dining philosophers. The compiler is based on programs described in a CSP data type, which is generated and interpreted by the front end of the tool, which we call SVA. SVA, a front end for FDR, is available from this book’s web site.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
We will be studying two forms of the language: first a somewhat unconventional one that is closer to implementation and then a more conventional one that is what most users will actually write. We will allow locally defined variables in the latter.
- 2.
This was an exercise set for a number of years by Oxford lecturers, originally by David Walker. This exercise and the paper [155] on which it was based inspired the creation of the compiler described in the present chapter.
- 3.
The SVA front end allows more conventional names for variables, and builds up a table associating each such name with one derived from namestype.
- 4.
A perhaps superior approach would be to transform each thread so that every read of the “non-variable” becomes a constant equal to its initial value. This would work for simple variables, but not for array components: an array of constants is, in effect, a look-up table.
- 5.
This is just an example of a paper where this version is used. The author is not sure where it originated.
References
Börger, E., Gurevich, Y., Rozenweig, D.: The Bakery Algorithm: yet another specification and verification. In: Specification and Verification Methods. Oxford University Press, London (1995)
Clarke, E.M., Grumberg, O., Hamaguchi, K.: Another look at LTL model checking. Form. Methods Syst. Des. 10, 1 (1997)
Dijkstra, E.W.: Cooperating sequential processes. In: The Origin of Concurrent Programming: from Semaphores to Remote Procedure Calls. Springer, Berlin (2002) (paper originally published in 1965)
Hoare, C.A.R.: Monitors: An operating system structuring concept. Commun. ACM 17, 10 (1974)
Hoare, C.A.R.: Communicating Sequential Processes. Prentice Hall, New York (1985)
Hopcroft, P.J., Broadfoot , G.H.: Combining the box structure development method and CSP. Automated Software Engineering (2004)
Hopkins, D., Roscoe, A.W.: SVA, a tool for analysing shared-variable programs. In: Proceedings of AVoCS (2007)
Hyman, H.: Comments on a problem in concurrent programming control. CACM 9, 1 (1966)
Lamport, L.: A new solution of Dijkstra’s concurrent programming problem. Commun. ACM 17, 8 (1974)
Lowe, G.: Casper: a compiler for the analysis of security protocols. In: Proceedings of CSFW (1997)
Peterson, J.L., Silberschatz, A.: Operating System Concepts, 2nd edn. Addison Wesley, Reading (1985)
Roscoe, A.W.: Compiling Shared variable programs into CSP. In: Proceedings of PROGRESS Workshop (2001)
Walker, D.J.: Automated analysis of mutual exclusion algorithms using CCS. Form. Asp. Comput. 1, 1 (1989)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2010 Springer-Verlag London Limited
About this chapter
Cite this chapter
Roscoe, A.W. (2010). Shared-Variable Programs. In: Understanding Concurrent Systems. Texts in Computer Science. Springer, London. https://doi.org/10.1007/978-1-84882-258-0_18
Download citation
DOI: https://doi.org/10.1007/978-1-84882-258-0_18
Publisher Name: Springer, London
Print ISBN: 978-1-84882-257-3
Online ISBN: 978-1-84882-258-0
eBook Packages: Computer ScienceComputer Science (R0)