Expressive Power of Graph Languages

Total Page:16

File Type:pdf, Size:1020Kb

Expressive Power of Graph Languages Expressive Power of Graph Languages Timos Antonopoulos University of Cambridge Computer Laboratory St. Catharine’s College This dissertation is submitted for the degree of Doctor of Philosophy Abstract Finite model theory is a field of logic that originated from computer science and studies properties of finite logical structures. Algorithmic properties of problems are interpreted over structures and inspected using logical languages, and thus connections are made between the latter and computational models. The expressive power of such logical languages is examined and matched with classes of problems and algorithmic classifications. In this thesis, we look into the expressive power of Graph Logic and also its extension with a recursion operator, that was introduced by Cardelli, Gardner and Ghelli, and later systematically investigated by Dawar, Gardner and Ghelli. Graph Logic was introduced as a query language on labelled directed graphs and is an extension of first-order logic with a spatial connective that allows one to express that a graph can be decomposed into two subgraphs, and reason thereafter about the properties definable over the two subgraphs in isolation from each other. It was known that Graph Logic is contained in monadic second-order logic over graphs and we show that the containment is strict. Furthermore, we investigate the expressive power of the logic over restricted classes of graphs. In addition, the expressive power of Graph Logic with the recursion operator, which over many classes of graphs exceeds the one of monadic second-order logic, is studied and compared to the expressive power of other related languages. 2 Preface First of all, I would like to thank my supervisor Dr. Anuj Dawar, without whose continued support and guidance none of this work would have been possible. I am also very grateful for his encouragement and patience throughout my studies. I am especially thankful to Dr. Jerzy Marcinkowski for a series of valuable discussions and sharing his insight with me. I would also like to thank Prof. Wolfgang Thomas and Prof. Martin Lange for kindly discussing specific aspects relating to my work. Furthermore, I would like to acknowledge Dr. Philippa Gardner for her advice prior to my taking up my PhD studies. Finally, I would like to dedicate my thesis to my father, mother and sister, without whom I could have never accomplished any of this work. This dissertation is the result of my own work and includes nothing which is the outcome of work done in collaboration except where specifically indicated in the text. Parts of Chapter 2 and Chapter 3 are based on [AD09]. This dissertation does not exceed 60,000 words, including footnotes. 3 Contents Abstract 2 Preface 3 1 Introduction 6 1.1 Preliminaries . 8 1.1.1 Graphs . 9 1.1.2 Words . 11 1.1.3 Trees . 12 1.2 Monadic Second-Order Logic . 13 1.2.1 MS1 and MS2 .................................. 17 1.3 Word and Tree Automata . 19 1.4 Fixed-Point Logics . 20 1.5 Graph Logic . 21 1.5.1 GL Games . 24 1.6 Graph Logic with Recursion . 26 1.7 Contributions of this Thesis . 27 2 Graph Logic 29 2.1 On Graphs . 31 2.2 On Words . 32 2.3 On Trees . 37 2.3.1 Chain and Antichain Logic . 42 2.3.2 Tree Walking Automata . 50 3 GL(MSO on Forests 53 3.1 Main Theorem . 53 3.2 FO Interpretations and MSO Transductions . 68 3.3 Separation Logic . 73 4 4 Graph Logic with Recursion 78 4.1 On Graphs . 78 4.2 On Words . 79 4.2.1 PSPACE-complete problems on strings . 79 4.2.2 Conjunctive Grammars and their Boolean Closure . 85 4.3 On Trees . 96 5 Conclusion 104 5.1 GL . 104 5.2 GLµ ...........................................105 Bibliography 106 5 Chapter 1 Introduction A connection between Mathematical Logic and Automata Theory was first established by B¨uchi and Elgot’s result ([B¨uc60],[Elg61]) stating that the Monadic fragment of Second Order Logic (the one where second order variables range over subsets of the universe of the structure) can define exactly the same languages over finite words as the ones recognized by finite word au- tomata. This result was among the first that established a connection between a logic and a class of problems decidable by some theoretical machine model, such as automata or Turing machines, which is one of the fundamental issues of Finite Model Theory, along with the search for the exact expressive power of logical languages. Other similar connections made between a machine model and a logic include Fagin’s famous result showing that ∃SO logic, the existential fragment of Second-Order Logic, describes exactly the problems in NP ([Fag74]), as well as Immerman and Vardi’s result on LFP and P over ordered structures ([Imm86],[Var82]). It has been observed that Monadic Second-Order Logic (MSO), over some classes of graphs which include words and trees, has linear data complexity. In other words, evaluating a fixed MSO formula on some arbitrary structure contained in one of these classes, takes linear time with respect to the size of the structure. This is possible due to a translation of MSO formulae to finite automata. Due to this connection between MSO and finite automata, MSO has been the standard to which many other logics are usually compared, especially when it comes to structures such as words and trees. Graph Logic (GL), introduced by Cardelli et al. in [CGG02], is a spatial logic for querying graphs, with its characteristic operator being a spatial connective that allows for decomposing a graph into two edge-disjoint components, akin to how Separation Logic ([Rey02],[IO01]) is designed to work on memory heaps and other structures used for reasoning in programs with direct memory management through pointer variables. In [CG00], Cardelli et al. introduced Ambient Logic that allow for reasoning on the way the properties of processes change through time as well as spatially. In other words, through the logic, one can express what are the allowable changes on the spatial properties of a process, which are represented as a graph algebra, and for this, Ambient Logic makes use of a composition operator, similar to the one in GL. On the other hand, logics in finite model theory are traditionally used to reason on what is expressible over 6 CHAPTER 1. INTRODUCTION 7 certain classes of structures. The version of GL introduced in [CGG02] allows for expressing properties about graphs, and in addition includes operators allowing for querying graphs, and as a result creating new graphs from input graphs. Furthermore, one can also define transducers through the logic, which are mappings from graphs to graphs. A fragment of GL introduced in [CGG02], which includes only the connectives used for expressing properties of graphs, was further studied in [DGG07] in order to resolve questions regarding the expressiveness of the logic as well as the complexity of the graphs definable in it and the complexity of evaluating the formulae. Two versions where investigated, one equipped with a recursion operator similar to the one in [CGG02], and the other version being without it. The two versions were termed GLµ and GL respectively. The characteristic spatial connective in the version of Graph Logic considered in [DGG07], is a composition operator that allows for reasoning about disjoint subgraphs in a graph. It is essentially a restricted form of second-order quantification overs edges, where in particular, one can express that a graph can be decomposed into two edge disjoint subgraphs, and then reason in the same way about definable properties of the subgraphs in isolation from each other. This spatial connective can be simulated in monadic second-order logic with quantification over edges, as shown in [DGG07], and hence all properties definable in Graph Logic are definable in MSO as well. The opposite direction of the containment is the one of interest. Dawar et al. observed in [DGG07] that GL is of equal expressive power to MSO when restricted to the class of words, and hence captures the regular word languages. Despite this result, it was conjectured that it is strictly less expressive than MSO over graphs in general. In [Mar06], Marcinkowski showed that this is indeed the case for the GL version studied in [DGG07] and a corresponding extension of MSO that allows for quantification over a countable set of labels which label the edges of the structures. The two logics were termed GL+ and MSO+ in [Mar06], to avoid confusion with the version of GL and MSO that lacks this extra quantification over edge labels. The question whether GL is strictly less expressive than MSO was thus left open. Graph Logic with an additional operator for recursion (GLµ) was also introduced in [CGG02] and the expressive power of a version of it was studied further in [DGG07]. The latter operator increases the expressive power of GL, and in some classes of graphs such as trees and words, it is shown that it becomes more expressive than MSO. On the other hand, over graphs in general it is believed that there are MSO definable properties, such as 3-colourability, that are not definable in GLµ. Despite the fact that the expressive power is increased with the use of the recursion operator, and the fact that PSPACE-complete problems are expressible in GLµ, model checking as well as evaluating a fixed formula on an arbitrary graph, both remain in PSPACE. This is interesting since not many logics have data complexity and model-checking complexity that are both complete for the same complexity class. Least Fixed-Point Logic for example can only define problems in P but its model-checking complexity is EXPTIME-complete and it should be noted that model-checking of Graph Logic without the recursion operator is also PSPACE- complete.
Recommended publications
  • Cs.FL] 7 Dec 2020 4 a Model Programming Language and Its Grammar 11 4.1 Alphabet
    Describing the syntax of programming languages using conjunctive and Boolean grammars∗ Alexander Okhotin† December 8, 2020 Abstract A classical result by Floyd (\On the non-existence of a phrase structure grammar for ALGOL 60", 1962) states that the complete syntax of any sensible programming language cannot be described by the ordinary kind of formal grammars (Chomsky's \context-free"). This paper uses grammars extended with conjunction and negation operators, known as con- junctive grammars and Boolean grammars, to describe the set of well-formed programs in a simple typeless procedural programming language. A complete Boolean grammar, which defines such concepts as declaration of variables and functions before their use, is constructed and explained. Using the Generalized LR parsing algorithm for Boolean grammars, a pro- gram can then be parsed in time O(n4) in its length, while another known algorithm allows subcubic-time parsing. Next, it is shown how to transform this grammar to an unambiguous conjunctive grammar, with square-time parsing. This becomes apparently the first specifica- tion of the syntax of a programming language entirely by a computationally feasible formal grammar. Contents 1 Introduction 2 2 Conjunctive and Boolean grammars 5 2.1 Conjunctive grammars . .5 2.2 Boolean grammars . .6 2.3 Ambiguity . .7 3 Language specification with conjunctive and Boolean grammars 8 arXiv:2012.03538v1 [cs.FL] 7 Dec 2020 4 A model programming language and its grammar 11 4.1 Alphabet . 11 4.2 Lexical conventions . 12 4.3 Identifier matching . 13 4.4 Expressions . 14 4.5 Statements . 15 4.6 Function declarations . 16 4.7 Declaration of variables before use .
    [Show full text]
  • A Boolean Grammar for a Simple Programming Language
    A Boolean grammar for a simple programming language Alexander Okhotin [email protected] Technical report 2004–478 School of Computing, Queen’s University, Kingston, Ontario, Canada K7L 3N6 March 2004 Abstract A toy procedural programming language is defined, and a Boolean grammar for the set of well-formed programs in this language is constructed. This is apparently the first specification of a programming language entirely by a formal grammar. Contents 1 Introduction 2 2 Definition of the language 2 3 Boolean grammars 6 4 A Boolean grammar for the language 8 5 Conclusion 16 A A parser 19 B Test suite 22 C Performance 33 1 1 Introduction Formal methods have been employed in the specification of programming languages since the early days of computer science. Already the Algol 60 report [5, 6] used a context-free grammar to specify the complete lexical contents of the language, and, partially, its syntax. But still many actually syntactical requirements, such as the rules requiring the declaration of variables, were described in plain words together with the semantics of the language. The hope of inventing a more sophisticated context-free grammar that would specify the entire syntax of Algol 60 was buried by Floyd [3], who used a formal language- theoretic argument based upon the non-context-freeness of the language fanbncnjn > 0g to prove that identifier checking cannot be performed by a context-free grammar, and hence the set of well-formed Algol 60 programs is not context-free. The appealing prospects of giving a completely formal specification of the syntax of programming languages were not entirely abandoned, though.
    [Show full text]
  • Using Contextual Representations to Efficiently Learn Context-Free
    JournalofMachineLearningResearch11(2010)2707-2744 Submitted 12/09; Revised 9/10; Published 10/10 Using Contextual Representations to Efficiently Learn Context-Free Languages Alexander Clark [email protected] Department of Computer Science, Royal Holloway, University of London Egham, Surrey, TW20 0EX United Kingdom Remi´ Eyraud [email protected] Amaury Habrard [email protected] Laboratoire d’Informatique Fondamentale de Marseille CNRS UMR 6166, Aix-Marseille Universite´ 39, rue Fred´ eric´ Joliot-Curie, 13453 Marseille cedex 13, France Editor: Fernando Pereira Abstract We present a polynomial update time algorithm for the inductive inference of a large class of context-free languages using the paradigm of positive data and a membership oracle. We achieve this result by moving to a novel representation, called Contextual Binary Feature Grammars (CBFGs), which are capable of representing richly structured context-free languages as well as some context sensitive languages. These representations explicitly model the lattice structure of the distribution of a set of substrings and can be inferred using a generalisation of distributional learning. This formalism is an attempt to bridge the gap between simple learnable classes and the sorts of highly expressive representations necessary for linguistic representation: it allows the learnability of a large class of context-free languages, that includes all regular languages and those context-free languages that satisfy two simple constraints. The formalism and the algorithm seem well suited to natural language and in particular to the modeling of first language acquisition. Pre- liminary experimental results confirm the effectiveness of this approach. Keywords: grammatical inference, context-free language, positive data only, membership queries 1.
    [Show full text]
  • Proceedings of the EACL 2009 Workshop on Computational Linguistic Aspects of Grammatical Inference
    EACL 2009 Proceedings of the EACL 2009 Workshop on Computational Linguistic Aspects of Grammatical Inference CLAGI 2009 30 March – 2009 Megaron Athens International Conference Centre Athens, Greece Production and Manufacturing by TEHNOGRAFIA DIGITAL PRESS 7 Ektoros Street 152 35 Vrilissia Athens, Greece c 2009 The Association for Computational Linguistics Order copies of this and other ACL proceedings from: Association for Computational Linguistics (ACL) 209 N. Eighth Street Stroudsburg, PA 18360 USA Tel: +1-570-476-8006 Fax: +1-570-476-0860 [email protected] ii Preface We are delighted to present you with this volume containing the papers accepted for presentation at the 1st workshop CLAGI 2009, held in Athens, Greece, on March 30th 2009. We want to acknowledge the help of the PASCAL 2 network of excellence. Thanks also to Damir Cavar´ for giving an invited talk and to the programme committee for the reviewing and advising. We are indebted to the general chair of EACL 2009, Alex Lascarides, to the publication chairs, Kemal Oflazer and David Schlangen, and to the Workshop chairs Stephen Clark and Miriam Butt, for all their help. We are also grateful for Thierry Murgue’s assistance when putting together the proceedings. Wishing you a very enjoyable time at CLAGI 2009! Menno van Zaanen and Colin de la Higuera CLAGI 2009 Programme Chairs iii CLAGI 2009 Program Committee Program Chairs: Menno van Zaanen, Tilburg University (The Netherlands) Colin de la Higuera, University of Saint-Etienne,´ (France) Program Committee Members: Pieter Adriaans,
    [Show full text]
  • Representing a P-Complete Problem by Small Trellis Automata
    Representing a P-complete problem by small trellis automata Alexander Okhotin Department of Mathematics, University of Turku, Turku FIN–20014, Finland, and Academy of Finland.∗ [email protected] A restricted case of the Circuit Value Problem known as the Sequential NOR Circuit Value Problem was recently used to obtain very succinct examples of conjunctive gram- mars, Boolean grammars and language equations representing P-complete languages (Okhotin, “A simple P-complete problem and its representations by language equations”, MCU 2007). In this paper, a new encoding of the same problem is proposed, and a trellis automaton (one-way real-time cellular automaton) with 11 states solving this problem is constructed. 1 Introduction Many kinds of automata and formal grammars have the property that all sets they define are contained in some complexity class C , and at the same time they can define some particular set complete for C (in the sense that every set in C can be reduced to that set). When C is the family of recursively enumerable sets and many-one reductions are considered, such models are known as computationally universal, and the same phenomenon occurs in formalisms of widely different expressive power. For instance, for linear context-free grammars it is known that all languages they generate are con- tained in NLOGSPACE, and Sudborough [15] constructed a small example of a linear context-free gram- mar that generates an NLOGSPACE-complete language. Such a result is essential, in particular, to un- derstand the complexity of parsing these grammars. Having a succinct example is especially good, as it shows the refined essense of the expressive power of linear context-free grammars in an easily perceiv- able form.
    [Show full text]
  • Conjunctive Grammars Over a Unary Alphabet: Undecidability and Unbounded Growth
    Theory of Computing Systems manuscript No. (will be inserted by the editor) Conjunctive grammars over a unary alphabet: undecidability and unbounded growth Artur Je˙z · Alexander Okhotin the date of receipt and acceptance should be inserted later Abstract It has recently been proved (Je˙z, DLT 2007) that conjunctive grammars (that is, context-free grammars augmented by conjunction) generate some non-regular languages over a one-letter alphabet. The present paper improves this result by con- structing conjunctive grammars for a larger class of unary languages. The results imply undecidability of a number of decision problems of unary conjunctive grammars, as well as non-existence of a recursive function bounding the growth rate of the generated languages. An essential step of the argument is a simulation of a cellular automaton recognizing positional notation of numbers using language equations. Keywords: Conjunctive grammars, unary languages, language equations, trellis automata, cellular automata. 1 Introduction Formal languages over an alphabet consisting of a single letter, known as unary lan- guages, can be regarded as sets of natural numbers, and the questions of representation of such sets by the standard devices of formal language theory form a special topic of study. Regular unary languages are just ultimately periodic sets, though there remain nontrivial questions, such as their descriptional complexity studied by Chrobak [2]. Context-free unary languages are well-known to be regular, though, as shown by Do- maratzki et al. [5], context-free grammars give very succinct descriptions of ultimately periodic sets. Simple types of cellular automata, such as trellis automata studied by Culik et al.
    [Show full text]
  • Boolean Grammars✩
    Theoretical Computer Science 412 (2011) 5132–5155 Contents lists available at ScienceDirect Theoretical Computer Science journal homepage: www.elsevier.com/locate/tcs Expressive power of LL(k) Boolean grammarsI Alexander Okhotin ∗ Department of Mathematics, University of Turku, Turku FI–20014, Finland Academy of Finland, Helsinki, Finland article info a b s t r a c t Article history: The paper studies the family of Boolean LL languages, generated by Boolean grammars Received 2 April 2008 and usable with the recursive descent parsing. It is demonstrated that over a one-letter Received in revised form 4 May 2011 alphabet, these languages are always regular, while Boolean LL subsets of Σ∗a∗ obey a n Accepted 9 May 2011 certain periodicity property, which, in particular, makes the language fanb2 jn 0g non- Communicated by D. Perrin > representable. It is also shown that linear conjunctive LL grammars cannot generate any language of the form L · fa; bg, with L non-regular, and that no languages of the form L · c∗, Keywords: with non-regular L, can be generated by any linear Boolean LL grammars. These results are Boolean grammars Conjunctive grammars used to establish a detailed hierarchy and closure properties of these and related families Context-free grammars of formal languages. LL grammars ' 2011 Elsevier B.V. All rights reserved. Language equations Parsing Recursive descent 1. Introduction Boolean grammars [15] extend the definition of the context-free grammars by allowing explicit Boolean operations in the rules. While standard context-free grammars can combine syntactical conditions using only disjunction, effectively specified by multiple rules for a single symbol, conjunctive grammars [12] additionally allow conjunction, and Boolean grammars further support negation.
    [Show full text]
  • The Complete Literature References
    18 Annotated Bibliography The purpose of this annotated bibliography is to supply the reader with more material and with more detail than was possible in the preceding chapters, rather than to just list the works referenced in the text. The annotations cover a considerable number of subjects that have not been treated in the rest of the book. The printed version of this book includes only those literature references and their summaries that are actually referred to in it. The full literature list with summaries as far as available can be found on the web site of this book; it includes its own authors index and subject index. This annotated bibliography differs in several respects from the habitual literature list. • The annotated bibliography consists of five sections: – Main parsing material — papers about the main parsing techniques. – Further parsing material — papers about extensions of and refinements to the main parsing techniques, non-Chomsky systems, error recovery, etc. – Parser writing and application — both in computer science and in natural languages. – Support material — books and papers useful to the study of parsers. – Secondary Material — unannotated papers of peripheral interest (Internet version only). • The entries in each section have been grouped into more detailed categories; for example, the main section contains categories for general CF parsing, LR parsing, precedence parsing, etc. For details see the Table of Contents at the beginning of this book. Most publications in parsing can easily be assigned a single category. Some that span two categories have been placed in one, with a reference in the other. • The majority of the entries are annotated.
    [Show full text]
  • Conjunctive and Boolean Grammars
    National and Kapodistrian University of Athens Graduate Program in Logic, Algorithms and Computation M.Sc. Thesis: Conjunctive and Boolean Grammars Alexandros Palioudakis Supervised by: Panos Rondogiannis Athens, July 2010 Acknowledgements First and foremost, I would like to thank my sister Irini Palioudaki for her help in whatever I needed. I should thank her for the figures in this thesis, for her help in my English, for her support and for being always there. Also, I would like to thank my father for his financial support, that without it I couldn't real- ize my studies. Moreover, I would like to thank Dimitris Paparas and Aristotelis Misios for helping me when they could. Furthermore, I would like to thank my professors in MPLA for transmiting us their knowledge. Like professor Elias Koutsoupias whose lectures were inspiring. Last but not least, I feel the need to thank my thesis advisor Panos Rondogiannis, who believed in me, supported me and carefully corrected my thesis, which before had plenty mistakes. I am sorry if I am forgetting someone who helped me durring this thesis and I don't have in mind at the moment. This work is dedicated to my professors, who influenced me the most, Cornelia Kalfa and George Chantampis. 2 Contents 1 Preliminaries 6 1.1 Basics Notions . 6 1.1.1 Baby Sets and Functions . 6 1.1.2 Alphabets, Words and Languages . 7 1.2 Finite Automata . 8 1.3 Regular Languages . 10 1.4 Closure Properties and Pumping Lemma for Regular Languages 12 2 Context-Free Grammars 14 2.1 Basic Notions .
    [Show full text]
  • Hardest Languages for Conjunctive and Boolean Grammars$
    Hardest languages for conjunctive and Boolean grammarsI Alexander Okhotin St. Petersburg State University, 14th Line V.O., 29B, Saint Petersburg 199178, Russia Abstract A famous theorem by Greibach (\The hardest context-free language", SIAM J. Comp., 1973) states that there exists such a context-free language L0, that every context-free language over any alphabet is reducible to L0 by a homomorphic reduction|in other words, is representable as an inverse homomorphic image −1 h (L0), for a suitable homomorphism h. This paper establishes similar characterizations for conjunctive grammars, that is, for grammars extended with a conjunction operator, as well as for Boolean grammars, which are further equipped with a negation operator. At the same time, it is shown that no such character- ization is possible for several subclasses of linear grammars. Key words: Context-free grammars, conjunctive grammars, Boolean grammars, homomorphisms, hardest language 1. Introduction One of the central notions in the theory of computation is that of a complete set for a class, to which all other sets from that class can be reduced: that is to say, the membership problem for each set in this class can be solved by mapping an element to be tested to an instance of the membership problem for the complete set, using a relatively easily computable reduction function. All basic complexity classes have their complete sets, and their existence forms the fundamental knowledge in the area. For example, the set 3 of Turing machines recognizing co-finite languages is complete for Σ0 under recursive reductions, whereas Boolean formula satisfiability is complete for NP under polynomial-time reductions.
    [Show full text]
  • On State-Alternating Context-Free Grammars
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Elsevier - Publisher Connector Theoretical Computer Science 337 (2005) 183–216 www.elsevier.com/locate/tcs On state-alternating context-free grammarsଁ Etsuro Moriyaa,∗, Dieter Hofbauerb, Maria Huberb, Friedrich Ottob aDepartment of Mathematics, School of Education, Waseda University, 1-6-1, Nishi-Waseda, Shinjuku-ku, Tokyo 169-8050, Japan bFachbereich Mathematik/Informatik, Universität Kassel, 34109 Kassel, Germany Received 22 February 2004; received in revised form 15 September 2004; accepted 30 December 2004 Communicated by M. Ito Abstract State-alternating context-free grammars are introduced, and the language classes obtained from them are compared to the classes of the Chomsky hierarchy as well as to some well-known complexity classes. In particular, state-alternating context-free grammars are compared to alternating context-free grammars (Theoret. Comput. Sci. 67 (1989) 75–85) and to alternating pushdown automata. Further, various derivation strategies are considered, and their influence on the expressive power of (state-) alternating context-free grammars is investigated. © 2005 Elsevier B.V. All rights reserved. MSC: 68Q45; 68Q10 Keywords: Alternating context-free grammar; Context-free grammar with states; State-alternating context-free grammar; Alternating pushdown automaton 1. Introduction Alternation is a powerful generalization of non-determinism that has led to many inter- esting results in automata and complexity theory. It was first introduced by Chandra and ଁ The main part of this work was done while Etsuro Moriya was visiting the Fachbereich Mathematik/Informatik, Universität Kassel. ∗ Corresponding author. E-mail addresses: [email protected] (E. Moriya), [email protected] (D.
    [Show full text]