Regular Programming Over Data Streams

Total Page:16

File Type:pdf, Size:1020Kb

Regular Programming Over Data Streams University of Pennsylvania ScholarlyCommons Publicly Accessible Penn Dissertations 2017 Regular Programming Over Data Streams Mukund Raghothaman University of Pennsylvania, [email protected] Follow this and additional works at: https://repository.upenn.edu/edissertations Part of the Computer Sciences Commons Recommended Citation Raghothaman, Mukund, "Regular Programming Over Data Streams" (2017). Publicly Accessible Penn Dissertations. 2540. https://repository.upenn.edu/edissertations/2540 This paper is posted at ScholarlyCommons. https://repository.upenn.edu/edissertations/2540 For more information, please contact [email protected]. Regular Programming Over Data Streams Abstract Data streams arise in a variety of applications, such as feeds from financial markets, event streams from sensors and medical devices, logs produced by long-running programs, click-streams from websites, and packet sequences passing through internet routers. In this thesis, we are concerned with computing quantitative statistics over these streams, and with expressing transformations in the related domain of strings. Many string transformations are instances of simple patterns, such as inserting, deleting and replacing substrings, or applying a function to each element in the stream. Over data streams, the task is usually to compute some simple quantitative statistic, such as counting the number of occurrences of a pattern or the mean time between occurrences of an event. There has traditionally been limited programming language support for stream processing, and programmers are forced to write low-level code, by manually maintaining state and updating it on seeing each new input element. This sacrifices both ease of expression and amenability to static analysis. We propose a simple, expressive programming model for stream transformations, with strong theoretical foundations and fast evaluation algorithms. We present two concrete systems: DReX, to express string-to-string transformations, and quantitative regular expressions (QREs) for numerical queries. Both formalisms start with a set of basic functions and a small collection of hierarchically composable combinators, analogous to the operations of regular expressions. The operators are simple to describe, and can be used to combine small, easy-to-understand expressions into more complicated expressions. The functions expressible using DReX and QREs coincide with the class of regular string transformations, which is a robust class with multiple characterizations and appealing closure properties (under composition, input reversal, and regular look-ahead). We present a single-pass linear-time evaluation algorithm for function expressions, and study efficient approximate representations of numerical terms, so that some numerical QREs can also be evaluated with sub-linear memory requirements. Degree Type Dissertation Degree Name Doctor of Philosophy (PhD) Graduate Group Computer and Information Science First Advisor Rajeev Alur Keywords Data streams, Programming languages, Quantitative analysis, Regular expressions Subject Categories Computer Sciences This dissertation is available at ScholarlyCommons: https://repository.upenn.edu/edissertations/2540 REGULAR PROGRAMMING OVER DATA STREAMS Mukund Raghothaman A DISSERTATION in Computer and Information Science Presented to the Faculties of the University of Pennsylvania in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy 2017 Supervisor of Dissertation Graduate Group Chairperson Rajeev Alur Lyle Ungar Zisman Family Professor of Professor of Computer and Computer and Information Science Information Science Dissertation Committee Susan Davidson, Weiss Professor of Computer and Information Science Sanjeev Khanna, Henry Salvatori Professor of Computer and Information Science Benjamin Pierce, Henry Salvatori Professor of Computer and Information Science Moshe Vardi, Karen Ostrum George Distinguished Service Professor in Computational Engineering, Rice University Acknowledgements First and foremost, I would like to thank my advisor, Rajeev Alur. This thesis would not have been possible without his support and guidance. My thesis committee consisted of Susan Davidson, Sanjeev Khanna, Benjamin Pierce, and Moshe Vardi: I thank them for the careful reading of this document and suggestions for improvement. I would also like to thank Youssef Hamadi and Yi Wei for hosting me at Microsoft Research Cambridge for two exciting and productive summers. One of the best parts about working with Rajeev is the wonderful group of postdocs and research scientists he assembles. Dana Fisman, Kostas Mamouras, and Arjun Radhakrishna deserve special mention: their keen eye for detail has contributed immeasurably towards making this a more rigorous and better presented thesis. Christos Stergiou, Ashutosh Trivedi, and Jyotirmoy Deshmukh provided great guidance at various stages of this Ph.D. journey. Jyotirmoy was the one who pushed me to follow up what would become my first research paper, and continues to be a rich source of technical problems and an excellent sounding board for ideas. Over six years and innumerable cups of coffee, Abhishek Udupa and I have become close friends and professional collaborators. The cohort of Rajeev’s Ph.D. students—Abhishek, Loris D’Antoni, Salar Moarref, Yifei Yuan, and Nimit Singhania—formed an amazing and lively peer group with which to discuss research problems. My office-mates in GRW 571—Salar, Nan Zheng, Kai Hong, and Shaheen Jabbari—have each contributed in their little way to the successful completion of this thesis. Arjun Ravi Narayan taught me a lot: from writing code to economics trivia and general wisdom about life. Mike Felker greatly simplified and helped me navigate the bureaucracy associated with being an international Ph.D. student. Outside the department, Varun Aggarwala, Carin Molenaar, the ECE Lobby from college, and Abhishek Anand were all always there. Finally, I thank my parents, my grandmother, and my brother, without whom I would not even have begun work on this thesis. For them, no words of gratitude will ever be enough. Mukund Raghothaman March 8, 2017 ii ABSTRACT REGULAR PROGRAMMING OVER DATA STREAMS Mukund Raghothaman Rajeev Alur Data streams arise in a variety of applications, such as feeds from financial markets, event streams from sensors and medical devices, logs produced by long-running programs, click-streams from websites, and packet sequences passing through internet routers. In this thesis, we are concerned with computing quantitative statistics over these streams, and with expressing transformations in the related domain of strings. Many string transformations are instances of simple patterns, such as inserting, deleting and replacing substrings, or applying a function to each element in the stream. Over data streams, the task is usually to compute some simple quantitative statistic, such as counting the number of occurrences of a pattern or the mean time between occurrences of an event. There has traditionally been limited programming language support for stream processing, and programmers are forced to write low-level code, by manually maintaining state and updating it on seeing each new input element. This sacrifices both ease of expression and amenability to static analysis. We propose a simple, expressive programming model for stream transformations, with strong theoretical foundations and fast evaluation algorithms. We present two concrete systems: DReX, to express string-to-string transformations, and quantitative regular expressions (QREs) for numerical queries. Both formalisms start with a set of basic functions and a small collection of hierarchically composable combinators, analogous to the operations of regular expressions. The operators are simple to describe, and can be used to combine small, easy-to-understand expressions into more complicated expressions. iii iv The functions expressible using DReX and QREs coincide with the class of regular string transformations, which is a robust class with multiple characterizations and appealing closure properties (under composition, input reversal, and regular look-ahead). We present a single- pass linear-time evaluation algorithm for function expressions, and study efficient approximate representations of numerical terms, so that some numerical QREs can also be evaluated with sub-linear memory requirements. This thesis is based on material drawn from the following publications: 1. Rajeev Alur, Adam Freilich, and Mukund Raghothaman. Regular combinators for string transformations. In Proceedings of the Joint Meeting of the 23rd EACSL Annual Conference on Computer Science Logic and the 29th Annual ACM/IEEE Symposium on Logic in Computer Science, CSL-LICS 2014, pages 9:1–9:10. ACM, 2014. 2. Rajeev Alur, Loris D’Antoni, and Mukund Raghothaman. DReX: A declarative language for efficiently evaluating regular string transformations. In Proceedings of the 42nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2015, pages 125–137. ACM, 2015. 3. Rajeev Alur, Dana Fisman, and Mukund Raghothaman. Regular programming for quantitative properties of data streams. In Peter Thiemann, editor, Programming Languages and Systems: Proceedings of the 25th European Symposium on Programming, ESOP 2016, pages 15–40. Springer, 2016. 4. Rajeev Alur, Sanjeev Khanna, Zachary Ives, Konstantinos Mamouras, and Mukund Raghothaman. StreamQRE: Modular specification and efficient evaluation of quantita- tive queries over streaming data.
Recommended publications
  • On Structural Similarities of Finite Automata and Turing Machine Enumerability Classes
    On Structural Similarities of Finite Automata and Turing Machine Enumerability Classes Till Tantau A A¯ × A A A¯ A¯ × × On Structural Similarities of Finite Automata and Turing Machine Enumerability Classes vorgelegt von Diplom-Informatiker und Diplom-Mathematiker Till Tantau von der Fakult¨at iv { Elektrotechnik und Informatik der Technischen Universit¨atBerlin zur Erlangung des akademischen Grades Doktor der Naturwissenschaften { Dr. rer. nat. { genehmigte Dissertation Promotionsausschuss: Vorsitzender: Prof. Dr. Bernd Mahr Berichter: Prof. Dr. Dirk Siefkes Berichter: Prof. Dr. Johannes K¨obler Tag der wissenschaftlichen Aussprache: 17. Februar 2003 Berlin 2003 D 83 Preface This dissertation presents the lion's share of the research I did since I started working at the Technical University of Berlin at the end of 1999. Unfortunately, since I failed to focus my research on a single subject during the last three years, the results of several interesting research projects could not be included. If I had included them, the title would have had to be `On a Bunch of Interesting, but Unrelated Theorems of Theoretical Computer Science'. When I went to my advisor Dirk Siefkes at the beginning of 2002, we pondered on which papers would be fit to form the basis of a dissertation. There were two alternatives: either two papers on a new concept, namely enumerability by finite automata; or different technical reports on reducibility to selective languages, prover-verifier protocols, and reachability problems. Reducibility classes of selective languages would have been more `en vogue' and the results applicable in standard complexity theory and in practice (like a constant parallel time reachability algorithm for tournaments).
    [Show full text]
  • Stal Aanderaa Hao Wang Lars Aarvik Martin Abadi Zohar Manna James
    Don Heller J. von zur Gathen Rodney Howell Mark Buckingham Moshe VardiHagit Attiya Raymond Greenlaw Henry Foley Tak-Wah Lam Chul KimEitan Gurari Jerrold W. GrossmanM. Kifer J.F. Traub Brian Leininger Martin Golumbic Amotz Bar-Noy Volker Strassen Catriel Beeri Prabhakar Raghavan Louis E. Rosier Daniel M. Kan Danny Dolev Larry Ruzzo Bala Ravikumar Hsu-Chun Yen David Eppstein Herve Gallaire Clark Thomborson Rajeev Raman Miriam Balaban Arthur Werschulz Stuart Haber Amir Ben-Amram Hui Wang Oscar H. Ibarra Samuel Eilenberg Jim Gray Jik Chang Vardi Amdursky H.T. Kung Konrad Jacobs William Bultman Jacob Gonczarowski Tao Jiang Orli Waarts Richard ColePaul Dietz Zvi Galil Vivek Gore Arnaldo V. Moura Daniel Cohen Kunsoo Park Raffaele Giancarlo Qi Zheng Eli Shamir James Thatcher Cathy McGeoch Clark Thompson Sam Kim Karol Borsuk G.M. Baudet Steve Fortune Michael Harrison Julius Plucker NicholasMichael Tran Palis Daniel Lehmann Wilhelm MaakMartin Dietzfelbinger Arthur Banks Wolfgang Maass Kimberly King Dan Gordon Shafee Give'on Jean Musinski Eric Allender Pino Italiano Serge Plotkin Anil Kamath Jeanette Schmidt-Prozan Moti Yung Amiram Yehudai Felix Klein Joseph Naor John H. Holland Donald Stanat Jon Bentley Trudy Weibel Stefan Mazurkiewicz Daniela Rus Walter Kirchherr Harvey Garner Erich Hecke Martin Strauss Shalom Tsur Ivan Havel Marc Snir John Hopcroft E.F. Codd Chandrajit Bajaj Eli Upfal Guy Blelloch T.K. Dey Ferdinand Lindemann Matt GellerJohn Beatty Bernhard Zeigler James Wyllie Kurt Schutte Norman Scott Ogden Rood Karl Lieberherr Waclaw Sierpinski Carl V. Page Ronald Greenberg Erwin Engeler Robert Millikan Al Aho Richard Courant Fred Kruher W.R. Ham Jim Driscoll David Hilbert Lloyd Devore Shmuel Agmon Charles E.
    [Show full text]
  • LOGIC AS REGULAR BEHAVIOUR 1. Expressions to Logic Fix a Finite Set
    LOGIC AS REGULAR BEHAVIOUR KAMAL LODAYA 1. Expressions to logic Fix a finite set A as an alphabet. Its elements are called letters. A finite sequence of letters w : f1; : : : ; ng ! A, such as aabab, is called a word over the alphabet. A set of words is called a language. The set of all words over A is written A∗. The empty word is written ". In general, given a language L, its iteration L∗ is the language formed by concatenating words from L to form another word. For instance, given the language faa; ab; bg, also written aa [ ab [ b, the word aabab is in faa; ab; bg∗, but the word ba is not. The null word " is always in any L∗ (by taking words from L zero times). This notation, with some ad hoc extensions, can be used to describe languages. We will not look into the details of the notation: these are called regular expressions, and are defined in any book on automata theory. We assume that the reader is familiar with such material. With this background, the aim of this article is to examine some subclasses of regular languages which can be characterized using logic as well as algebra. Proofs are barely sketched. The interested reader should try to follow up the material and construct more detailed proofs. 1.1. Expressions. The starfree expressions are those where the iteration L∗ is not allowed. The dot depth of a starfree expression is the maximum number of nested alternations of the boolean operations (e1 [ e2 and e) and concatenations (e1e2 : : : en).
    [Show full text]
  • Mathematical Logic in Computer Science
    Mathematical Logic in Computer Science Assaf Kfoury June 1, 2017 (last update: February 1, 2018) 1 Introduction Others have written about the influences of mathematical logic on computer science. I single out two articles, which I have read and re-read over the years: 1. “Influences of Mathematical Logic on Computer Science,” by M. Davis [29], 2. “On the Unusual Effectiveness of Logic in Computer Science,” by J. Halpern, R. Harper, N. Immerman, P. Kolaitis, M. Vardi, and V. Vianu [60]. The first of these two articles takes stock of what had already become a productive cross-fertilization by the mid-1980’s; it is one of several interesting articles of historical character by M. Davis [27, 28, 30] which all bring to light particular aspects of the relationship between the two fields. The second article gives an account of this relationship in five areas of computer science by the year 2000. More on the second article, denoted by the acronym UEL, in Section 3 below. I wanted to write an addendum to the two forementioned articles, in the form of a timeline of significant moments in the history relating the two fields, from the very beginning of computer science in the mid-1950’s till the present. The result is this paper. One way of judging what I produced is to first read the penultimate section entitled ‘Timeline’, Section 5 below, and then go back to earlier sections whenever in need of a justification for one of my inclusions or one of my omissions. Disclaimer: This is not a comprehensive history, not even an attempt at one, of mathematical logic arXiv:1802.03292v1 [cs.LO] 7 Feb 2018 in computer science.
    [Show full text]
  • Lecture Notes in Computer Science 4800 Commenced Publication in 1973 Founding and Former Series Editors: Gerhard Goos, Juris Hartmanis, and Jan Van Leeuwen
    Lecture Notes in Computer Science 4800 Commenced Publication in 1973 Founding and Former Series Editors: Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen Editorial Board David Hutchison Lancaster University, UK Takeo Kanade Carnegie Mellon University, Pittsburgh, PA, USA Josef Kittler University of Surrey, Guildford, UK Jon M. Kleinberg Cornell University, Ithaca, NY, USA Alfred Kobsa University of California, Irvine, CA, USA Friedemann Mattern ETH Zurich, Switzerland John C. Mitchell Stanford University, CA, USA Moni Naor Weizmann Institute of Science, Rehovot, Israel Oscar Nierstrasz University of Bern, Switzerland C. Pandu Rangan Indian Institute of Technology, Madras, India Bernhard Steffen University of Dortmund, Germany Madhu Sudan Massachusetts Institute of Technology, MA, USA Demetri Terzopoulos University of California, Los Angeles, CA, USA Doug Tygar University of California, Berkeley, CA, USA Gerhard Weikum Max-Planck Institute of Computer Science, Saarbruecken, Germany Arnon Avron Nachum Dershowitz Alexander Rabinovich (Eds.) Pillars of Computer Science Essays Dedicated to Boris (Boaz) Trakhtenbrot on the Occasion of His 85th Birthday 13 Volume Editors Arnon Avron Nachum Dershowitz Alexander Rabinovich Tel Aviv University School of Computer Science Ramat Aviv, Tel Aviv, 69978 Israel E-mail: {aa; nachumd; rabinoa}@post.tau.ac.il Library of Congress Control Number: 2008920893 CR Subject Classification (1998): F.1, F.2.1-2, F.4.1, F.3, D.2.4, D.2-3, I.2.2 LNCS Sublibrary: SL 1 – Theoretical Computer Science and General Issues ISSN 0302-9743 ISBN-10 3-540-78126-9 Springer Berlin Heidelberg New York ISBN-13 978-3-540-78126-4 Springer Berlin Heidelberg New York This work is subject to copyright.
    [Show full text]
  • Regular Programming Over Data Streams
    Regular Programming over Data Streams Mukund Raghothaman A DISSERTATION in Computer and Information Science Presented to the Faculties of the University of Pennsylvania in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy 2017 Supervisor of Dissertation Graduate Group Chairperson Rajeev Alur Lyle Ungar Professor of Computer and Professor of Computer and Information Science Information Science Dissertation Committee Susan Davidson, Professor of Computer and Information Science Sanjeev Khanna, Professor of Computer and Information Science Benjamin Pierce, Professor of Computer and Information Science Moshe Vardi, Professor of Computational Science, Rice University Acknowledgements First and foremost, I would like to thank my advisor, Rajeev Alur. This thesis would not have been possible without his support and guidance. My thesis committee consisted of Susan Davidson, Sanjeev Khanna, Benjamin Pierce, and Moshe Vardi: I thank them for the careful reading of this document and suggestions for improvement. I would also like to thank Youssef Hamadi and Yi Wei for hosting me at Microsoft Research Cambridge for two exciting and productive summers. One of the best parts about working with Rajeev is the wonderful group of postdocs and research scientists he assembles. Dana Fisman, Kostas Mamouras, and Arjun Radhakrishna deserve special mention: their keen eye for detail has contributed immeasurably towards making this a more rigorous and better presented thesis. Christos Stergiou, Ashutosh Trivedi, and Jyotirmoy Deshmukh provided great guidance at various stages of this Ph.D. journey. Jyotirmoy was the one who pushed me to follow up what would become my first research paper, and continues to be a rich source of technical problems and an excellent sounding board for ideas.
    [Show full text]