
PhD Thesis, University of Illinois, December 2010 A REWRITING APPROACH TO CONCURRENT PROGRAMMING LANGUAGE DESIGN AND SEMANTICS BY TRAIAN FLORIN SERBANUTA DISSERTATION Submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy in Computer Science in the Graduate College of the University of Illinois at Urbana-Champaign, 2011 Urbana, Illinois Doctoral Committee: Associate Professor Grigore Ros, u, Chair and Director of Research Principal Researcher Thomas Ball, Microsoft Research Assistant Professor Darko Marinov Professor Jos´eMeseguer Assistant Professor Madhusudan Parthasarathy PhD Thesis, University of Illinois, December 2010 Abstract A plethora of programming languages have been and continue to be developed to keep pace with hardware advancements and the ever more demanding require- ments of software development. As these increasingly sophisticated languages need to be well understood by both programmers and implementors, precise specifications are increasingly required. Moreover, the safety and adequacy with respect to requirements of programs written in these languages needs to be tested, analyzed, and, if possible, proved. This dissertation proposes a rigorous approach to define programming languages based on rewriting, which allows to easily design and test language extensions, and to specify and analyze safety and adequacy of program executions. To this aim, this dissertation describes the K framework, an executable semantic framework inspired from rewriting logic but specialized and optimized for programming languages. The K framework consists of three components: (1) a language definitional technique; (2) a specialized notation; and (3) a resource- sharing concurrent rewriting semantics. The language definitional technique is a rewriting technique built upon the lessons learned from capturing and studying existing operational semantics frameworks within rewriting logic, and upon attempts to combine their strengths while avoiding their limitations. The specialized notation makes the technical details of the technique transparent to the language designer, and enhances modularity, by allowing the designer to specify the minimal context needed for a semantic rule. Finally, the resource- sharing concurrent semantics relies on the particular form of the semantic rules to enhance concurrency, by allowing overlapping rule instances (e.g., two threads writing in different locations in the store, which overlap on the store entity) to apply concurrently as long as they only overlap on the parts they do not change. The main contributions of the dissertation are: (1) a uniform recasting of the major existing operational semantics techniques within rewriting logic; (2) an overview description of the K framework and how it can be used to define, extend and analyze programming languages; (3) a semantics for K concurrent rewriting obtained through an embedding in graph rewriting; and (4) a description of the K-Maude tool, a tool for defining programming languages using the K technique on top of the Maude rewriting language. ii PhD Thesis, University of Illinois, December 2010 proc δόξan Θεού iii PhD Thesis, University of Illinois, December 2010 Acknowledgments Concerning my pre-PhD formation, I would like to thank my grandfather Gheor- ghe and my mid- and high-school mathematics professor Cornel Noan˘afor instilling and sustaining my love for mathematics, to my mother Olivia and my brother Virgil for instilling and sustaining my love for programming, and finally to my College and Masters professors Virgil Emil C˘az˘anescu, Alexandru Mateescu, and R˘azvan Diaconescu, for showing me that computer science is more than programming, and for guiding my first research steps. My entire PhD research, including the results presented in this dissertation would not have been possible without my advisor Grigore Ros, u. I would like to especially thank him for providing countless research ideas, as well as help and guidance through the darkness of \nothing works"; his inspiration and his readiness in working together for overcoming any research obstacle have proved instrumental in my formation. In particular, his introduction of K in 2003 as a rewriting technique for defining programming languages, and the fact that he continuously used K in teaching programming language design at UIUC ever since, played a very important role in the development of the K framework, the K-Maude tool, and of this dissertation itself. I would also like to thank the rest of my research committee, made up of Darko Marinov, Jos´eMeseguer, Madhusudan Parthasarathy, and Tom Ball, for providing valuable feedback which helped in presenting my research in a better light and strengthen the value of this dissertation, and for their insight- ful suggestions for potential future work related to the presented research; in particular, I would like to thank Jos´eMeseguer for his vision over the rewrit- ing logic semantics project and for his direct collaboration in developing the initial stages of this dissertation. My research life at UIUC would have been a lot more stern without all my previous and current colleagues within the Formal Systems and Formal Methods and Declarative Languages groups, among which Marcelo d'Amorim, Feng Chen, Chucky Ellison, Michael Ilseman, Mark Hills, Dongyun Jin, Mike Katelman, Choonghwan Lee, Patrick Meredith, Andrei Popescu, Ralf Sasse, and Andrei S, tef˘anescu were always ready to offer a good advice, to argue about everything, or simply to help procrastinating before deadlines. Thank you guys! iv PhD Thesis, University of Illinois, December 2010 A special thanks is due to my family from both sides of the ocean, including, but not limited to my parents Mircea and Olivia, my brother Virgil and his wife Gabriela, and to my parents-in-law Ioan and Aurelia, for always loving me and trusting in my potential; in particular, to my wife Claudia, for going through all this process together, for growing together, celebrating together, and also suffering together at times, and to my girls, Cezara Maria and Teodora, for bringing light on dark days and constantly reminding me that there are far more important things in life than research. Thanks is also due to my non-research related friends from this \new world", among which Bogdan, Cristi, Francisco, Matei, Nick, and Thyago, for helping me face the \cultural shock", and for being good friends, whether in need or in celebrating the happy moments of our lives. Finally, I would like to thank the entire Three Hierarchs Greek Orthodox Church community, for being a home away from home for us, and in particular to Fr. George Pyle, and Fr. Michael Condos, for their continuous spiritual support and counsel during all this time. The research in this dissertation has been supported in part by NSF grants CCF-0916893, CNS-0720512, CNS-0509321, CCF-0448501, by NASA contract NNL08AA23C, by a Samsung SAIT grant, and by several Microsoft gifts. v PhD Thesis, University of Illinois, December 2010 Table of Contents Chapter 1 Introduction ........................ 1 Chapter 2 Background........................ 23 Chapter 3 A Rewriting Logic Approach to Operational Semantics ...................... 37 Chapter 4 An Overview of the K Semantic Framework..... 87 Chapter 5 From Language Definitions to (Runtime) Analysis Tools ................................. 128 Chapter 6 A Concurrent Semantics for K Rewriting...... 150 Chapter 7 K-Maude|A Rewriting Logic Implementation of the K Framework.......................... 194 Chapter 8 Related Work ...................... 214 Chapter 9 Conclusions.........................221 Bibliography............................... 225 vi PhD Thesis, University of Illinois, December 2010 Chapter 1 Introduction This dissertation shows that rewriting is a natural environment to formally define the semantics of real-life concurrent programming languages and to test and analyze programs written in those languages. 1.1 Motivation Computers are becoming an integral part of our life. Besides the increase in personal computer usage, there are now programable devices embedded in all aspects of modern life, from consumer electronics to life critical systems such as transportation and medical devices. Moreover, the internet and the information age has brought a whole world of previously remote services at only a click distance. All these services, be they provided by embedded systems or by personal or remote computers, share a common characteristic: they result from programming their host using specialized languages. These languages can vary to a high degree in their level of abstraction from machine description languages such as Verilog and VHDL, whose instructions are very close to the hardware circuits they describe, to high level imperative, object oriented and/or functional languages, such as Java, C#, or OCaml. To address the continuous increase in difficulty of software specifications, these language have to evolve and new domain specific languages and methodologies must be designed and deployed. At the same time, paradigm changes in hardware design must be accompanied by similar changes in language design. Moore's law [119] states that the number of transistors on an integrated circuit chip doubles about every two years. However, while this trend is expected to continue for the next 10-20 years (until its physical limits are attained), the implication that doubling the number of transistors doubles serial computing power no longer holds true. The move to multi-core architectures is therefore
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages246 Page
-
File Size-