Parsing Unranked Tree Languages, Folded Once †
Abstract
:1. Introduction
Outline
2. Preliminaries
3. Regular Tree Foldings
4. Unfolding Folded Trees
4.1. Reassembly Sequences by Vector Addition Systems
- Let j be the smallest index such that, with , the vector is nonzero at position i.
- If , return the empty sequence.
- Letting , take to be the unique (as V is metered) position in , which equals .
- Return . That is, the sequence constructed by finding a short visit of in steps 1 through (one must exist as step subtracted 1 from that position) followed by the operation (which visits i).
- is an operation sequence visiting I;
- S is a multiset over V such that for all the vectors s and are zero in all positions ;
- The vector is a node in the graph.
- If the vector is a node in the graph and there exists an operation such that:
- , (vector elements can be negative);
- The next smaller vector than b is ;
- u and v are zero in all positions not in I.
then there is a node and an edge from to labelled p.
- An S found this way does make a valid destructured sequence, as by construction and S only visits I. All other needed properties derive from an exhaustive enumeration of possible operation sequences P.
- If a destructured sequence does exist, this procedure will find it. Note that the only real pruning happening is requiring the budget to decrease according to the next smaller order. This is necessary to limit the effect l has on the size of the graph, but as S is itself unordered requiring the budget to be used in a certain order is not a real restriction.
4.2. Combining the Pieces
- If the graph contains no merged nodes, it is a tree, and the folding having had no effect. In this case, run the tree automaton on the tree and halt with that result.
- If it contains a single merged node, apply Theorem 1 and halt with that result.
- If there is no edge e which can bisect the graph in a way that separates two merged nodes, reject it. As argued above, it cannot be in the language.
- Pick an edge e which bisects the graph into subgraphs and , which both contain merged nodes, letting be the subgraph which has e outgoing and the subgraph that has e incoming. Additionally, pick e such that node that is the source of e has no incoming edge which would bisect the graph in this way. Observe that such a choice always exists if any bisecting edge does, as one can then pick instead of e, and repeating this argument cannot lead to a cycle (as removing an edge from a cycle would not bisect the graph). Picking e in this way ensures that the folding operator creating the merged node in is also in .
- If the graph is in the language, then the edge e was generated by some rule in the tree automaton. For each state q, attempt to parse and separately as follows:
- (a)
- Add e to letting it go to a new single node labelled , where is a new symbol not previously in the alphabet. Then, recursively apply this procedure to , modifying the automaton with the new rule .
- (b)
- Add e to , letting it be outgoing from a new node labelled with a new symbol , add a new (unique) accepting state to the automaton, add the rule . Then, recursively apply this procedure to with this modified automaton.
- (c)
- If 5a and 5b, accept and , respectively, and accept the graph g.
- If all states have been tried without accepting, reject.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Tang, L.; Liu, H. Graph mining applications to social network analysis. In Managing and Mining Graph Data; Springer: Boston, MA, USA, 2010; pp. 487–513. [Google Scholar]
- Plump, D. The graph programming language GP. In Algebraic Informatics, Proceedings of the 3rd International Conference on Algebraic Informatics, CAI 2009, Thessaloniki, Greece, 19–22 May 2009; Springer: Berlin/Heidelberg, Germany, 2009; pp. 99–122. [Google Scholar]
- You, J.; Leskovec, J.; He, K.; Xie, S. Graph structure of neural networks. In Proceedings of the International Conference on Machine Learning, PMLR, Virtual, 13–18 July 2020; pp. 10881–10891. [Google Scholar]
- Björklund, H.; Björklund, J.; Ericson, P. On the regularity and learnability of ordered DAG languages. In Implementation and Application of Automata, Proceedings of the 22nd International Conference, CIAA 2017, Marne-la-Vallée, France, 27–30 June 2017; Springer: Cham, Switzerland, 2017; pp. 27–39. [Google Scholar]
- Lautemann, C. The complexity of graph languages generated by hyperedge replacement. Acta Inform. 1990, 27, 399–421. [Google Scholar] [CrossRef]
- Quernheim, D.; Knight, K. DAGGER: A Toolkit for Automata on Directed Acyclic Graphs. In Proceedings of the 10th International Workshop Finite-State Methods and Natural Language Processing, FSMNLP 2012, Donostia-San Sebastian, Spain, 23–25 July 2012; Association for Computational Linguistics: Stroudsburg, PA, USA, 2012; pp. 40–44. [Google Scholar]
- Koller, A. Semantic construction with graph grammars. In Proceedings of the 11th International Conference on Computational Semantics, IWCS, London, UK, 14–17 April 2015. [Google Scholar]
- Drewes, F.; Kreowski, H.J.; Habel, A. Hyperedge Replacement Graph Grammars. In Handbook of Graph Grammars and Computing by Graph Transformation; Rozenberg, G., Ed.; World Scientific: River Edge, NJ, USA, 1997; pp. 95–162. [Google Scholar]
- Langkilde, I.; Knight, K. Generation That Exploits Corpus-based Statistical Knowledge. In Proceedings of the 36th Annual Meeting of the Association for Computational Linguistics and 17th International Conference on Computational Linguistics (Volume 1), Montreal, QC, Canada, 10–14 August 1998; pp. 704–710. [Google Scholar] [CrossRef]
- Kasper, R.T. A flexible interface for linking applications to Penman’s sentence generator. In Proceedings of the Workshop on Speech and Natural Language, Philadelphia, PA, USA, 21–23 February 1989; Association for Computational Linguistics: Stroudsburg, PA, USA, 1989; pp. 153–158. [Google Scholar] [CrossRef]
- Banarescu, L.; Bonial, C.; Cai, S.; Georgescu, M.; Griffitt, K.; Hermjakob, U.; Knight, K.; Koehn, P.; Palmer, M.; Schneider, N. Abstract Meaning Representation for Sembanking. In Proceedings of the 7th Linguistic Annotation Workshop and Interoperability with Discourse, Sofia, Bulgaria, 8–9 August 2013; Association for Computational Linguistics: Stroudsburg, PA, USA, 2013; pp. 178–186. [Google Scholar]
- Braune, F.; Bauer, D.; Knight, K. Mapping Between English Strings and Reentrant Semantic Graphs. In Proceedings of the Ninth International Conference on Language Resources and Evaluation, LREC 2014, Reykjavik, Iceland, 26–31 May 2014; European Language Resources Association: Paris, France, 2014; pp. 4493–4498. [Google Scholar]
- Arnborg, S.; Corneil, D.; Proskurowski, A. Complexity of Finding Embeddings in a k-Tree. SIAM J. Algebr. Discret. Methods 1987, 8, 277–284. [Google Scholar] [CrossRef]
- Drewes, F.; Hoffmann, B.; Minas, M. Extending Predictive Shift-Reduce Parsing to Contextual Hyperedge Replacement Grammars. In Graph Transformation, Proceedings of the 12th International Conference, ICGT 2019, Eindhoven, The Netherlands, 15–16 July 2019; Guerra, E., Orejas, F., Eds.; Lecture Notes in Computer Science; Springer International Publishing: Cham, Switzerland, 2019; Volume 11629, pp. 55–72. [Google Scholar]
- Drewes, F.; Hoffmann, B.; Minas, M. Rule-Based Top-Down Parsing for Acyclic Contextual Hyperedge Replacement Grammars. In Graph Transformation, Proceedings of the 14th International Conference, ICGT 2021, Virtual Event, 24–25 June 2021; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2021. [Google Scholar]
- Drewes, F.; Hoffmann, B.; Minas, M. Acyclic Contextual Hyperedge Replacement: Decidability of Acyclicity and Generative Power. In Graph Transformation, Proceedings of the 15th International Conference, ICGT 2022, Held as Part of STAF 2022, Nantes, France, 7–8 July 2022; Behr, N., Strüber, D., Eds.; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2022; Volume 13349, pp. 3–19. [Google Scholar]
- Minas, M. The Graph-Parsing Tool Grappa. Available online: https://www.unibw.de/inf2/grappa (accessed on 18 June 2024).
- Björklund, J. Tree-to-graph transductions with scope. In Developments in Language Theory, Proceedings of the 22nd International Conference, DLT 2018, Tokyo, Japan, 10–14 September 2018; Springer: Cham, Switzerland, 2018; pp. 133–144. [Google Scholar]
- Berglund, M.; Björklund, H.; Björklund, J.; Boiret, A. Transduction from trees to graphs through folding. Inf. Comput. 2023, 295, 105111. [Google Scholar] [CrossRef]
- Brüggemann-Klein, A.; Murata, M.; Wood, D. Regular Tree and Regular Hedge Languages over Unranked Alphabets: Version 1; Technical Report HKUST-TCSC-2001-0; The Hong Kong University of Science and Technology: Hong Kong, China, 2001. [Google Scholar]
- Gécseg, F.; Steinby, M. Tree Automata. arXiv 2015, arXiv:1509.06233. [Google Scholar] [CrossRef]
- Björklund, J.; Drewes, F.; Satta, G. Z-Automata for Compact and Direct Representation of Unranked Tree Languages. In Implementation and Application of Automata, Proceedings of the 24th International Conference, CIAA 2019, Košice, Slovakia, 22–25 July 2019; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2019; Volume 11601, pp. 83–94. [Google Scholar]
- Martens, W.; Niehren, J. Minimizing Tree Automata for Unranked Trees. In Database Programming Languages, Proceedings of the 10th International Symposium, DBPL 2005, Trondheim, Norway, 28–29 August 2005; Bierman, G., Koch, C., Eds.; Springer: Berlin/Heidelberg, Germany, 2005; pp. 232–246. [Google Scholar]
- Parikh, R. Language Generating Devices; Technical Report; Research Laboratory of Electronics, MIT: Cambridge, MA, USA, 1961. [Google Scholar]
- Karp, R.M.; Miller, R.E. Parallel program schemata. J. Comput. Syst. Sci. 1969, 3, 147–195. [Google Scholar] [CrossRef]
- Czerwiński, W.; Orlikowski, Ł. Reachability in Vector Addition Systems is Ackermann-complete. In Proceedings of the 2021 IEEE 62nd Annual Symposium on Foundations of Computer Science (FOCS), Denver, CO, USA, 7–10 February 2022; pp. 1229–1240. [Google Scholar] [CrossRef]
- Jones, N.D.; Landweber, L.H.; Lien, Y.E. Complexity of some problems in Petri nets. Theor. Comput. Sci. 1977, 4, 277–299. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Berglund, M.; Björklund, H.; Björklund, J. Parsing Unranked Tree Languages, Folded Once. Algorithms 2024, 17, 268. https://doi.org/10.3390/a17060268
Berglund M, Björklund H, Björklund J. Parsing Unranked Tree Languages, Folded Once. Algorithms. 2024; 17(6):268. https://doi.org/10.3390/a17060268
Chicago/Turabian StyleBerglund, Martin, Henrik Björklund, and Johanna Björklund. 2024. "Parsing Unranked Tree Languages, Folded Once" Algorithms 17, no. 6: 268. https://doi.org/10.3390/a17060268
APA StyleBerglund, M., Björklund, H., & Björklund, J. (2024). Parsing Unranked Tree Languages, Folded Once. Algorithms, 17(6), 268. https://doi.org/10.3390/a17060268