COS 360 Programming Languages Formal Semantics

Total Page:16

File Type:pdf, Size:1020Kb

COS 360 Programming Languages Formal Semantics COS 360 Programming Languages Formal Semantics Semantics has to do with meaning, and typically the meaning of a complex whole is a function of the meaning of its parts. Just as in an English sentence, we parse a sentence into subject, verb, objects, adjectives(noun qualifiers) and adverbs(verb qualifiers), so with a program we break it up into control structures, statements, expressions, each of which has a meaning. The meanings of the constituents contribute to the meaning of the program as a whole. Another way this is put is to say that the semantics is compositional en.wikipedia.org/wiki/Denotational_semantics#Compositionality Consequently, the grammar of a language guides the exposition of its meaning. Each of the three approaches to formal semantics, axiomatic, operational, and denotational, will use the grammar as a structuring device to explain the meaning. The grammar used, however, is not the same one that the compiler’s parser uses. It eliminates the punctuation and just contains the relevant, meaning carrying pieces and is often ambiguous, but the notion is that the parsing has already taken place and the parse tree simplified to what is referred to as an abstract syntax tree. Learning Objectives 1. to understand the difference between the abstract syntax trees used in expositions of semantics and the concrete syntax trees, or parse trees, used in parsing 2. to understand how the abstract syntax tree contributes to the explanation of program- ming language semantics 3. to understand the three major approaches to programming language semantics: ax- iomatic, operational, and denotational 4. to understand how axiomatic semantics can be used to prove algorithms are correct 5. to understand how small step operational semantics define computation sequences for programs from abstract syntax trees 6. to understand how the semantic evaluation functions of denotational semantics define the meanings of abstract syntax trees in associated semantic domains and how to define such semantic evaluation functions 7. to appreciate the different roles with respect to a programming language: implementer(compiler writer), user (programmer), and designer 8. to appreciate how the three approaches have different emphases that favor one role over another We make a few preliminary observations. We say “formal” semantics because the explication is intended to be very precise, complete, and based on formal notations(a programming language itself is a formal language), like the formal notations in mathematics and logic. The alternative would be “informal”, which could still be of value, but wouldn’t have the same degree of rigor. Based as it is on mathematics and logic, the formal description of programming language semantics is one of the most technically sophisticated areas of computer science. Many of the contributors to its development, such as Robert W. Floyd, C. A. R. Hoare, Dana Scott, Leslie Lamport, Robin Milner, and Amir Pnueli have been recipients of the ACM Turing Award, the highest recognition for an academic computer scientist. We are not going to go into this area at great depth, which could easily occupy several graduate level courses in computer science, but will attempt to give you a sense of how the three main approaches proceed, using the same simple example in each. For imperative languages, a key notion is that of an environment, which is an association of values to variables. The program’s meaning is a map from some specific initial environment to another environment, the environment the machine is left in when the program terminates. Suppose the program is C (for “Command”), and let E stand for the set of all possible environ- ments, augmented(“lifted” is the verb that is used) to include a special value, the “undefined environment”, which we symbolize with ⊥. This ⊥ value is needed to cover the case when a program does not terminate; it is the result image environment of an initial environment that induces the program to go into an infinite loop. It is just a way for us to make the definition of the program’s function into a total function, defined on all environments in E. The function C computes from E to E, which we name fC because it is induced by C, is defined to be, for e ∈E fC (e) = ⊥ if e = ⊥ (a program cannot recover from undefined) ⊥ if e =6 ⊥ and C, when started in e, fails to terminate e′ if e =6 ⊥ and C terminates in e′ when started in e Since the focus is on the computation, the i/o is typically ignored in these discussions. The models assume the variables have been loaded with their appropriate input values and then exposition confines itself to just environment changes wrought by assignments, expression evaluation, and flow of control. As indicated above, the parse trees used in discussions of programming language semantics are not the same as the parse trees associated with a grammar for the language. Languages typically use parentheses to force certain orders of evaluation, but once the parse has taken place so that the higher priority subexpression is lower in the tree, the parentheses are not needed any more and just clutter up the tree. Like the Lone Ranger and Tonto at the end of an episode, their work is done and it’s time for them to vanish. The trees used in semantics are called abstract syntax trees and are usually very spare with ambiguous grammars. You can imagine that the real parsing has already been done and the resulting parse trees have been cleaned up. Here’s a stripped back grammar for abstract syntax trees of an imperative programming lan- guage whose only type is the integers. The start symbol is <program>. <program> ::= <stmnt> <stmnt> ::= <assign> | <while> | <if> | skip | <stmnt><stmnt> <assign> ::= id <- <e> <while> ::= while <test> <stmnt> <if> ::= if <test> <stmnt> | if <test> <stmnt> else <stmnt> <test> ::= <test> and <test> | <test> or <test> | not <test> | <comparison> <comparison> ::= <e> < <e> | <e> <= <e> | <e> > <e> | <e> >= <e> | <e> = <e> | <e> != <e> <e> ::= id | c | <e> + <e> | <e> - <e> | <e> * <e> | <e> / <e> | <e> mod <e> | - <exp> This language has terminals while if else and or not <- < <= > >= = != + - * / mod id c skip The first three are reserved words to indicate the control statements and mark the second branch of an the if statement. The next three are reserved words for the boolean operators. The next one is the assignment operator. The next six are numerical comparison operators. The next five are the arithmetic operators that return integer results. Note that - is overloaded as a binary and a unary operator and that mod is for the integer remainder of a division. The last two, id and c, are for identifiers and integer constants. We will assume that these have attributes for the actual string of the variable identifier(id.s) and the actual value of the integer constant(c.v). The last terminal, skip, is a “do nothing” statement that has the same meaning as x <- x. It has a technical use below. You will note the obvious ambiguity in the replacements for the expression syntactic category, <e>. Similarly, the <test> variable for boolean valued expressions has an ambiguous collection of replacements. Expression evaluation in this language, for both boolean valued expressions and integer valued expressions, does not have side effects to the environment, which is unlike constructs such as ++n and similar expressions of C and its descendants. The only action that changes the envi- ronment is the execution of the assignment statement, and it changes only a single variable’s value. If we have an environment σ ∈E and a statement id <- <e> that is executed in the environment σ and n is the value that <e> evaluates to in σ (which we might indicate with σ(<e>) by extending σ to be a map from not just the variables, but from all expressions), it is common to use a notation like σ[id.s 7→ n] or σ[n/id.s] to indicate the new environment that results from the assignment. It is exactly like σ except at the variable id.s, which it maps to n. We could lift the space of integer values to include ⊥ to accommodate the result of dividing by zero, or taking the remainder of a division by zero, and have the environment associate variables to values in the lifted space. We could then propagate the error to have the result of assigning ⊥ to a variable be the undefined environment. Those are design decisions for the language designer who is specifying the meaning of the language. Here is a simple program in this language that calculates into result the value of base raised to the power exponent, if exponent is not negative, or just 1 if it is. result <- 1 while exponent > 0 if exponent mod 2 = 1 result <- result * base base <- base * base exponent <- exponent / 2 Because the punctuation is mostly thrown out, I have used indentation to indicate the subordi- nation of statements. The program has two statements, the first one an assignment statement, and the second one a while statement. The while loop body has three statements, the first one an if with no else branch, and then two assignment statements. A It would be very difficult for me to draw the abstract syntax tree for this program in LTEX, but I did draw it by hand and it has 63 nodes. Since it has 28 terminals, it has 35 variable nodes. Once you accept that the while loop and if contain the statements given by the indentation, the only ambiguity comes from the <stmnt> ::= <stmnt><stmnt> replacement, since we could group the three statements of the while loop body as two followed by one or one followed by two.
Recommended publications
  • Obituary: Amir Pnueli, 1941–2009 Krzysztof R. Apt and Lenore D. Zuck
    Obituary: Amir Pnueli, 1941–2009 Krzysztof R. Apt and Lenore D. Zuck Amir Pnueli was born in Nahalal, Israel, on April 22, 1941 and passed away in New York City on November 2, 2009 as a result of a brain hemorrhage. Amir founded the computer science department in Tel-Aviv University in 1973. In 1981 he joined the department of mathematical sciences at the Weiz- mann Institute of Science, where he spent most of his career and where he held the Estrin family chair. In recent years, Amir was a faculty member at New York University where he was a NYU Silver Professor. Throughout his career, in spite of an impressive list of achievements, Amir remained an extremely modest and selfless researcher. His unique combination of excellence and integrity has set the tone in the large community of researchers working on specification and verification of programs and systems, program semantics and automata theory. Amir was devoid of any arrogance and those who knew him as a young promising researcher were struck how he maintained his modesty throughout his career. Amir has been an active and extremely hard working researcher till the last moment. His sudden death left those who knew him in a state of shock and disbelief. For his achievements Amir received the 1996 ACM Turing Award. The citation reads: “For seminal work introducing temporal logic into computing science and for outstanding contributions to program and system verification.” Amir also received, for his contributions, the 2000 Israel Award in the area of exact sciences. More recently, in 2007, he shared the ACM Software System Award.
    [Show full text]
  • Pdf, 184.84 KB
    Nir Piterman, Associate Professor Coordinates Email: fi[email protected] Homepage: www.cs.le.ac.uk/people/np183 Phone: +44-XX-XXXX-XXXX Research Interests My research area is formal verification. I am especially interested in algorithms for model checking and design synthesis. A major part of my work is on the automata-theoretic approach to verification and especially to model checking. I am also working on applications of formal methods to biological modeling. Qualifications Oct. 2000 { Mar. 2005 Ph.D. in the Department of Computer Science and Applied Mathe- matics at the Weizmann Institute of Science, Rehovot, Israel. • Research Area: Formal Verification. • Thesis: Verification of Infinite-State Systems. • Supervisor: Prof. Amir Pnueli. Oct. 1998 { Oct. 2000 M.Sc. in the Department of Computer Science and Applied Mathe- matics at the Weizmann Institute of Science, Rehovot, Israel. • Research Area: Formal Verification. • Thesis: Extending Temporal Logic with !-Automata. • Supervisor: Prof. Amir Pnueli and Prof. Moshe Vardi. Oct. 1994 { June 1997 B.Sc. in Mathematics and Computer Science in the Hebrew Univer- sity, Jerusalem, Israel. Academic Employment Mar. 2019 { Present Senior Lecturer/Associate Professor in the Department of Com- puter Science and Engineering in University of Gothenburg. Oct. 2012 { Feb. 2019 Reader/Associate Professor in the Department of Informatics in University of Leicester. Oct. 2010 { Sep. 2012 Lecturer in the Department of Computer Science in University of Leicester. Aug. 2007 { Sep. 2010 Research Associate in the Department of Computing in Imperial College London. Host: Dr. Michael Huth Oct. 2004 { July 2007 PostDoc in the school of Computer and Communication Sciences at the Ecole Polytechnique F´ed´eralede Lausanne.
    [Show full text]
  • A Networked Robotic System and Its Use in an Oil Spill Monitoring Exercise
    A Networked Robotic System and its Use in an Oil Spill Monitoring Exercise El´oiPereira∗† Co-authors: Pedro Silvay, Clemens Krainerz, Christoph Kirschz, Jos´eMorgadoy, and Raja Sengupta∗ cpcc.berkeley.edu, eloipereira.com [email protected] Swarm at the Edge of the Could - ESWeek'13, Montreal, Canada September 29, 2013 ∗ - Systems Engineering, UC Berkeley y - Research Center, Portuguese Air Force Academy z - Computer Science Dept., University of Salzburg Programming the Ubiquitous World • In networked mobile systems (e.g. teams of robots, smartphones, etc.) the location and connectivity of \machines" may vary during the execution of its \programs" (computation specifications) • We investigate models for bridging \programs" and \machines" with dynamic structure (location and connectivity) • BigActors [PKSBdS13, PPKS13, PS13] are actors [Agh86] hosted by entities of the physical structure denoted as bigraph nodes [Mil09] E. Pereira, C. M. Kirsch, R. Sengupta, and J. B. de Sousa, \Bigactors - A Model for Structure-aware Computation," in ACM/IEEE 4th International Conference on Cyber-Physical Systems, 2013, pp. 199-208. Case study: Oil spill monitoring scenario • \Bilge dumping" is an environmental problem of great relevance for countries with large area of jurisdictional waters • EC created the European Maritime Safety Agency to \...prevent and respond to pollution by ships within the EU" • How to use networked robotics to monitor and take evidences of \bilge dumping" Figure: Portuguese Jurisdiction waters and evidences of \Bilge dumping".
    [Show full text]
  • The Best Nurturers in Computer Science Research
    The Best Nurturers in Computer Science Research Bharath Kumar M. Y. N. Srikant IISc-CSA-TR-2004-10 http://archive.csa.iisc.ernet.in/TR/2004/10/ Computer Science and Automation Indian Institute of Science, India October 2004 The Best Nurturers in Computer Science Research Bharath Kumar M.∗ Y. N. Srikant† Abstract The paper presents a heuristic for mining nurturers in temporally organized collaboration networks: people who facilitate the growth and success of the young ones. Specifically, this heuristic is applied to the computer science bibliographic data to find the best nurturers in computer science research. The measure of success is parameterized, and the paper demonstrates experiments and results with publication count and citations as success metrics. Rather than just the nurturer’s success, the heuristic captures the influence he has had in the indepen- dent success of the relatively young in the network. These results can hence be a useful resource to graduate students and post-doctoral can- didates. The heuristic is extended to accurately yield ranked nurturers inside a particular time period. Interestingly, there is a recognizable deviation between the rankings of the most successful researchers and the best nurturers, which although is obvious from a social perspective has not been statistically demonstrated. Keywords: Social Network Analysis, Bibliometrics, Temporal Data Mining. 1 Introduction Consider a student Arjun, who has finished his under-graduate degree in Computer Science, and is seeking a PhD degree followed by a successful career in Computer Science research. How does he choose his research advisor? He has the following options with him: 1. Look up the rankings of various universities [1], and apply to any “rea- sonably good” professor in any of the top universities.
    [Show full text]
  • Toward a Mathematical Semantics for Computer Languages
    (! 1 J TOWARD A MATHEMATICAL SEMANTICS FOR COMPUTER LANGUAGES by Dana Scott and - Christopher Strachey Oxford University Computing Laboratory Programming Research Group-Library 8-11 Keble Road Oxford OX, 3QD Oxford (0865) 54141 Oxford University Computing Laboratory Programming Research Group tI. cr• "';' """, ":.\ ' OXFORD UNIVERSITY COMPUTING LABORATORY PROGRAMMING RESEARCH GROUP ~ 4S BANBURY ROAD \LJ OXFORD ~ .. 4 OCT 1971 ~In (UY'Y L TOWARD A ~ATHEMATICAL SEMANTICS FOR COMPUTER LANGUAGES by Dana Scott Princeton University and Christopher Strachey Oxford University Technical Monograph PRG-6 August 1971 Oxford University Computing Laboratory. Programming Research Group, 45 Banbury Road, Oxford. ~ 1971 Dana Scott and Christopher Strachey Department of Philosophy, Oxford University Computing Laboratory. 1879 lIall, Programming Research Group. Princeton University, 45 Banbury Road. Princeton. New Jersey 08540. Oxford OX2 6PE. This pape r is also to appear in Fl'(.'ceedinBs 0;- the .';y-,;;;o:illT:: on ComputeT's and AutoJ7'ata. lo-licroloo'ave Research Institute Symposia Series Volume 21. Polytechnic Institute of Brooklyn. and appears as a Technical Monograph by special aJ"rangement ...·ith the publishers. RefeJ"~nces in the Ii terature should be:- made to the _"!'OL·,-,',~;r:gs, as the texts are identical and the Symposia Sl?ries is gcaerally available in libraries. ABSTRACT Compilers for high-level languages aTe generally constructed to give the complete translation of the programs into machme language. As machines merely juggle bit patterns, the concepts of the original language may be lost or at least obscured during this passage. The purpose of a mathematical semantics is to give a correct and meaningful correspondence between programs and mathematical entities in a way that is entirely independent of an implementation.
    [Show full text]
  • Why Mathematical Proof?
    Why Mathematical Proof? Dana S. Scott, FBA, FNAS University Professor Emeritus Carnegie Mellon University Visiting Scholar University of California, Berkeley NOTICE! The author has plagiarized text and graphics from innumerable publications and sites, and he has failed to record attributions! But, as this lecture is intended as an entertainment and is not intended for publication, he regards such copying, therefore, as “fair use”. Keep this quiet, and do please forgive him. A Timeline for Geometry Some Greek Geometers Thales of Miletus (ca. 624 – 548 BC). Pythagoras of Samos (ca. 580 – 500 BC). Plato (428 – 347 BC). Archytas (428 – 347 BC). Theaetetus (ca. 417 – 369 BC). Eudoxus of Cnidus (ca. 408 – 347 BC). Aristotle (384 – 322 BC). Euclid (ca. 325 – ca. 265 BC). Archimedes of Syracuse (ca. 287 – ca. 212 BC). Apollonius of Perga (ca. 262 – ca. 190 BC). Claudius Ptolemaeus (Ptolemy)(ca. 90 AD – ca. 168 AD). Diophantus of Alexandria (ca. 200 – 298 AD). Pappus of Alexandria (ca. 290 – ca. 350 AD). Proclus Lycaeus (412 – 485 AD). There is no Royal Road to Geometry Euclid of Alexandria ca. 325 — ca. 265 BC Euclid taught at Alexandria in the time of Ptolemy I Soter, who reigned over Egypt from 323 to 285 BC. He authored the most successful textbook ever produced — and put his sources into obscurity! Moreover, he made us struggle with proofs ever since. Why Has Euclidean Geometry Been So Successful? • Our naive feeling for space is Euclidean. • Its methods have been very useful. • Euclid also shows us a mysterious connection between (visual) intuition and proof. The Pythagorean Theorem Euclid's Elements: Proposition 47 of Book 1 The Pythagorean Theorem Generalized If it holds for one Three triple, Similar it holds Figures for all.
    [Show full text]
  • The Space and Motion of Communicating Agents
    The space and motion of communicating agents Robin Milner December 1, 2008 ii to my family: Lucy, Barney, Chloe,¨ and in memory of Gabriel iv Contents Prologue vii Part I : Space 1 1 The idea of bigraphs 3 2 Defining bigraphs 15 2.1 Bigraphsandtheirassembly . 15 2.2 Mathematicalframework . 19 2.3 Bigraphicalcategories . 24 3 Algebra for bigraphs 27 3.1 Elementarybigraphsandnormalforms. 27 3.2 Derivedoperations ........................... 31 4 Relative and minimal bounds 37 5 Bigraphical structure 43 5.1 RPOsforbigraphs............................ 43 5.2 IPOsinbigraphs ............................ 48 5.3 AbstractbigraphslackRPOs . 53 6 Sorting 55 6.1 PlacesortingandCCS ......................... 55 6.2 Linksorting,arithmeticnetsandPetrinets . ..... 60 6.3 Theimpactofsorting .......................... 64 Part II : Motion 66 7 Reactions and transitions 67 7.1 Reactivesystems ............................ 68 7.2 Transitionsystems ........................... 71 7.3 Subtransitionsystems .. .... ... .... .... .... .... 76 v vi CONTENTS 7.4 Abstracttransitionsystems . 77 8 Bigraphical reactive systems 81 8.1 DynamicsforaBRS .......................... 82 8.2 DynamicsforaniceBRS.... ... .... .... .... ... .. 87 9 Behaviour in link graphs 93 9.1 Arithmeticnets ............................. 93 9.2 Condition-eventnets .. .... ... .... .... .... ... .. 95 10 Behavioural theory for CCS 103 10.1 SyntaxandreactionsforCCSinbigraphs . 103 10.2 TransitionsforCCSinbigraphs . 107 Part III : Development 113 11 Further topics 115 11.1Tracking................................
    [Show full text]
  • The Origins of Structural Operational Semantics
    The Origins of Structural Operational Semantics Gordon D. Plotkin Laboratory for Foundations of Computer Science, School of Informatics, University of Edinburgh, King’s Buildings, Edinburgh EH9 3JZ, Scotland I am delighted to see my Aarhus notes [59] on SOS, Structural Operational Semantics, published as part of this special issue. The notes already contain some historical remarks, but the reader may be interested to know more of the personal intellectual context in which they arose. I must straightaway admit that at this distance in time I do not claim total accuracy or completeness: what I write should rather be considered as a reconstruction, based on (possibly faulty) memory, papers, old notes and consultations with colleagues. As a postgraduate I learnt the untyped λ-calculus from Rod Burstall. I was further deeply impressed by the work of Peter Landin on the semantics of pro- gramming languages [34–37] which includes his abstract SECD machine. One should also single out John McCarthy’s contributions [45–48], which include his 1962 introduction of abstract syntax, an essential tool, then and since, for all approaches to the semantics of programming languages. The IBM Vienna school [42, 41] were interested in specifying real programming languages, and, in particular, worked on an abstract interpreting machine for PL/I using VDL, their Vienna Definition Language; they were influenced by the ideas of McCarthy, Landin and Elgot [18]. I remember attending a seminar at Edinburgh where the intricacies of their PL/I abstract machine were explained. The states of these machines are tuples of various kinds of complex trees and there is also a stack of environments; the transition rules involve much tree traversal to access syntactical control points, handle jumps, and to manage concurrency.
    [Show full text]
  • Curriculum Vitae Thomas A
    Curriculum Vitae Thomas A. Henzinger February 6, 2021 Address IST Austria (Institute of Science and Technology Austria) Phone: +43 2243 9000 1033 Am Campus 1 Fax: +43 2243 9000 2000 A-3400 Klosterneuburg Email: [email protected] Austria Web: pub.ist.ac.at/~tah Research Mathematical logic, automata and game theory, models of computation. Analysis of reactive, stochastic, real-time, and hybrid systems. Formal software and hardware verification, especially model checking. Design and implementation of concurrent and embedded software. Executable modeling of biological systems. Education September 1991 Ph.D., Computer Science Stanford University July 1987 Dipl.-Ing., Computer Science Kepler University, Linz August 1986 M.S., Computer and Information Sciences University of Delaware Employment September 2009 President IST Austria April 2004 to Adjunct Professor, University of California, June 2011 Electrical Engineering and Computer Sciences Berkeley April 2004 to Professor, EPFL August 2009 Computer and Communication Sciences January 1999 to Director Max-Planck Institute March 2000 for Computer Science, Saarbr¨ucken July 1998 to Professor, University of California, March 2004 Electrical Engineering and Computer Sciences Berkeley July 1997 to Associate Professor, University of California, June 1998 Electrical Engineering and Computer Sciences Berkeley January 1996 to Assistant Professor, University of California, June 1997 Electrical Engineering and Computer Sciences Berkeley January 1992 to Assistant Professor, Cornell University December 1996 Computer Science October 1991 to Postdoctoral Scientist, Universit´eJoseph Fourier, December 1991 IMAG Laboratory Grenoble 1 Honors Member, US National Academy of Sciences, 2020. Member, American Academy of Arts and Sciences, 2020. ESWEEK (Embedded Systems Week) Test-of-Time Award, 2020. LICS (Logic in Computer Science) Test-of-Time Award, 2020.
    [Show full text]
  • Sooner Is Safer Than Later Department of Computer Science
    May 1991 Report No. STAN-CS-91-1360 Sooner is Safer Than Later bY Thomas A. Henzinger Department of Computer Science Stanford University Stanford, California 94305 f- Awwtd REPORT DOCUMENTATION PAGE ma No. 07044188 rt8d to wwq8 I how ou r-. lncllJdlng the ttm8 for nvmwlng tn8uuctl -. wrrtruq 82lsung e8t8 wurcg% Wv*lnQ th8 cOlM(0n Of dormatlon Sand comrrmo I ‘-‘9 th* -om mmate Q arty otwr m ol tha bwdm. to Wnkqtoft ~*dourrtw~ Sewc~. Duator8toT or tnformrt8oe ooer0tm aw v, 121~ - O(cltr of Muwgrmw wbd beget. ?8oemon adato + @~o*olI(i. Woahington. DC 2oSO3. I. AGENCY USE ONLY (Lea- bhd) 2. REPORT DATE 3. REPORT TYPE AND DATES COVERED s/28 p?( I. TITLE AND SulTlTLt 5. FUNDING NUMbERI SomEFz, 15 BIER T&W L-Am 1. PERFORMING ORGANIZATION NAME(S) AND ADDRESS 8. PERFORMING ORGANJZATION REPORT NUMIER jhpx OF- CO~PU’i-ER scii&E STANWD I)tdfhzs’;p/ . 5q-JWFi3RD) CA 9&S I. SPONSORING I’ MONITORING AGENCY NAME(S) AND ADDRESS 10. SPONSORING / MONlTORiNG AGENCY REPORT NUMBER 3ARi’A bJQx39 - 84 c - 020 fd&XW, VA 2220~ I 1. SUPPLEMENTARY NOTES . 12r. DISTRIBUTION / AVAILABILITY STATEMENT lib. DiStRlBUfiON CODE urjL?M:m E. ABSTRACT (Maxrmum 200 words) Abstract. It has been repeatedly observed that the standard safety-liveness classification of properties of reactive systems does not fit for real-time proper- ties. This is because the implicit “liveness” of time shifts the spectrum towards the safety side. While, for example, response - that “something good” will happen, eventually - is a classical liveness property, bounded response - that “something good” will happen soon, within a certain amount of time - has many characteristics of safety.
    [Show full text]
  • Purely Functional Data Structures
    Purely Functional Data Structures Chris Okasaki September 1996 CMU-CS-96-177 School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 Submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy. Thesis Committee: Peter Lee, Chair Robert Harper Daniel Sleator Robert Tarjan, Princeton University Copyright c 1996 Chris Okasaki This research was sponsored by the Advanced Research Projects Agency (ARPA) under Contract No. F19628- 95-C-0050. The views and conclusions contained in this document are those of the author and should not be interpreted as representing the official policies, either expressed or implied, of ARPA or the U.S. Government. Keywords: functional programming, data structures, lazy evaluation, amortization For Maria Abstract When a C programmer needs an efficient data structure for a particular prob- lem, he or she can often simply look one up in any of a number of good text- books or handbooks. Unfortunately, programmers in functional languages such as Standard ML or Haskell do not have this luxury. Although some data struc- tures designed for imperative languages such as C can be quite easily adapted to a functional setting, most cannot, usually because they depend in crucial ways on as- signments, which are disallowed, or at least discouraged, in functional languages. To address this imbalance, we describe several techniques for designing functional data structures, and numerous original data structures based on these techniques, including multiple variations of lists, queues, double-ended queues, and heaps, many supporting more exotic features such as random access or efficient catena- tion. In addition, we expose the fundamental role of lazy evaluation in amortized functional data structures.
    [Show full text]
  • Insight, Inspiration and Collaboration
    Chapter 1 Insight, inspiration and collaboration C. B. Jones, A. W. Roscoe Abstract Tony Hoare's many contributions to computing science are marked by insight that was grounded in practical programming. Many of his papers have had a profound impact on the evolution of our field; they have moreover provided a source of inspiration to several generations of researchers. We examine the development of his work through a review of the development of some of his most influential pieces of work such as Hoare logic, CSP and Unifying Theories. 1.1 Introduction To many who know Tony Hoare only through his publications, they must often look like polished gems that come from a mind that rarely makes false steps, nor even perhaps has to work at their creation. As so often, this impres- sion is a further compliment to someone who actually adds to very hard work and many discarded attempts the final polish that makes complex ideas rel- atively easy for the reader to comprehend. As indicated on page xi of [HJ89], his ideas typically go through many revisions. The two authors of the current paper each had the honour of Tony Hoare supervising their doctoral studies in Oxford. They know at first hand his kind and generous style and will count it as an achievement if this paper can convey something of the working style of someone big enough to eschew competition and point scoring. Indeed it will be apparent from the following sections how often, having started some new way of thinking or exciting ideas, he happily leaves their exploration and development to others.
    [Show full text]