Hostname: page-component-76fb5796d-25wd4 Total loading time: 0 Render date: 2024-04-25T13:03:53.159Z Has data issue: false hasContentIssue false

Linear pattern matching of compressed terms and polynomial rewriting

Published online by Cambridge University Press:  02 August 2018

MANFRED SCHMIDT-SCHAUß*
Affiliation:
Institut für Informatik, Fachbereich Informatik und Mathematik, Johann Wolfgang Goethe-Universität, Postfach 11 19 32, D-60054 Frankfurt, Germany Email: schauss@cs.uni-frankfurt.de

Abstract

We consider term rewriting under sharing in the form of compression by singleton tree grammars (STG), which is more general than the term dags. Algorithms for the subtasks of rewriting are analysed: finding a redex for rewriting by locating a position for a match, performing a rewrite step by constructing the compressed result and executing a sequence of rewrite steps. The first main result is that locating a match of a linear term s in another term t can be performed in polynomial time if s, t are both STG-compressed. This generalizes results on matching of STG-compressed terms, matching of straight-line-program-compressed strings with character-variables, where every variable occurs at most once, and on fully compressed matching of strings. Also, for the case where s is directed-acyclic-graph (DAG)-compressed, it is shown that submatching can be performed in polynomial time. The general case of compressed submatching can be computed in non-deterministic polynomial time, and an algorithm is described that may be exponential in the worst case, its complexity is nO(k), where k is the number of variables with double occurrences in s and n is the size of the input. The second main result is that in case there is an oracle for the redex position, a sequence of m parallel or single-step rewriting steps under STG-compression can be performed in polynomial time. This generalizes results on DAG-compressed rewriting sequences. Combining these results implies that for an STG-compressed term rewrite system with left-linear rules, m parallel or single-step term rewrite steps can be performed in polynomial time in the input size n and m.

Type
Paper
Copyright
Copyright © Cambridge University Press 2018 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Avanzini, M. and Moser, G. (2010). Closing the gap between runtime complexity and polytime computability. In: Lynch, C. (ed.) Proceedings of the 21st International Conference on Rewriting Techniques and Applications (RTA '10), Leibnitz International Proceedings in Informatics, vol. 6, Schloss Dagstuhl, Germany 3348.Google Scholar
Baader, F. and Nipkow, T. (1998). Term Rewriting and All That, Cambridge University Press, New York, NY, USA.Google Scholar
Berman, P., Karpinski, M., Larmore, L.L., Plandowski, W. and Rytter, W. (2002). On the complexity of pattern matching for highly compressed two-dimensional texts. Journal of Computer and System Sciences 65 (2) 332350.Google Scholar
Busatto, G., Lohrey, M. and Maneth, S. (2005). Efficient memory representation of XML documents. In: Proceedings of the International Workshop on Database Programming Languages (DBPL 2005), Lecture Notes in Computer Science, vol. 3774, Springer 199–216.Google Scholar
Busatto, G., Lohrey, M. and Maneth, S. (2008). Efficient memory representation of XML document trees Information Systems 33 (4–5) 456474.Google Scholar
Comon, H. (1995). On unification of terms with integer exponents. Mathematical Systems Theory, 28 (1) 67883.Google Scholar
Comon, H., Dauchet, M., Gilleron, R., Jacquemard, F., Lugiez, D., Tison, S. and Tommasi, M. (1997). Tree automata techniques and applications. release October 2002. Available at http://tata.gforge.inria.fr/Google Scholar
Gascón, A., Godoy, G. and Schmidt-Schauß, M. (2008). Context matching for compressed terms. In: Proceedings of the 23rd Annual IEEE Symposium on Logic in Computer Science (LICS 2008), IEEE Computer Society 93–102.Google Scholar
Gascón, A., Godoy, G. and Schmidt-Schauß, M. (2011). Unification and matching on compressed terms ACM Transactions on Computational Logic 12 (4) 26:126:37.Google Scholar
Gasieniec, L., Karpinski, M., Plandowski, W. and Rytter, W. (1996a). Efficient algorithms for Lempel–Ziv encoding (extended abstract). In: Karlsson, R. G. and Lingas, A. (eds.) Proceedings of the SWAT, Lecture Notes in Computer Science, vol. 1097, Springer 392–403.Google Scholar
Gasieniec, L., Karpinski, M., Plandowski, W. and Rytter, W. (1996b). Randomized efficient algorithms for compressed strings: The finger-print approach (extended abstract). In: Proceedings of the 7th Annual Symposium on Combinatorial Pattern Matching (CPM' 96), Lecture Notes in Computer Science, vol. 1075, Springer 39–49.Google Scholar
Hermann, M. and Galbavý, R. (1997). Unification of infinite sets of terms schematized by primal grammars Theoretical Computer Science 176 (1–2) 111158.Google Scholar
Jez, A. (2012). Faster fully compressed pattern matching by recompression. In: Proceedings of the International Colloquium on Automata, Languages, and Programming (ICALP), Part I, Lecture Notes in Computer Science, vol. 7391, Springer 533–544.Google Scholar
Karpinski, M., Rytter, W. and Shinohara, A. (1995). Pattern-matching for strings with short description. In: Proceedings of the Annual Symposium on Combinatorial Pattern Matching (CPM '95), Lecture Notes in Computer Science, vol. 937, Springer-Verlag 205–214.Google Scholar
Lago, U.D. and Martini, S. (2009). Derivational complexity is an invariant cost model. In: Proceedings of the FOPARA, Lecture Notes in Computer Science, vol. 6324, Springer 100–113.Google Scholar
Lago, U.D. and Martini, S. (2012). On constructor rewrite systems and the lambda calculus Logical Methods in Computer Science 8 (3:12) 127.Google Scholar
Levy, J., Schmidt-Schauß, M. and Villaret, M. (2006). Bounded second-order unification is NP-complete. In: Proceedings of the 17th International Conference on Term Rewriting and Applications (RTA), Lecture Notes in Computer Science, vol. 4098, Springer 400–414.Google Scholar
Levy, J., Schmidt-Schauß, M. and Villaret, M. (2008). The complexity of monadic second-order unification SIAM Journal of Computing 38 (3) 11131140.Google Scholar
Levy, J., Schmidt-Schauß, M. and Villaret, M. (2011). On the complexity of bounded second-order unification and stratified context unification Logic Journal of the IGPL 19 (6) 763789.Google Scholar
Lifshits, Y. (2007). Processing compressed texts: A tractability border. In: Proceedings of the Annual Symposium on Combinatorial Pattern Matching (CPM 2007), Lecture Notes in Computer Science, vol. 4580, Springer, 228–240.Google Scholar
Lohrey, M. (2012). Algorithmics on SLP-compressed strings. A survey Groups Complexity Cryptology 4 (2) 241299.Google Scholar
Lohrey, M. and Maneth, S. (2005). The complexity of tree automata and XPath on grammar-compressed trees. In: Proceedings of the 10th International Conference on Implementation and Application of Automata (CIAA'05) 225–237.Google Scholar
Lohrey, M., Maneth, S. and Mennicke, R. (2011). Tree structure compression with RePair. In: 2011 Data Compression Conference (DCC 2011), March 29–31, 2011, Snowbird, UT, USA, IEEE Computer Society 2011, 353–362.Google Scholar
Lohrey, M., Maneth, S. and Schmidt-Schauß, M. (2009). Parameter reduction in grammar-compressed trees. In: Proceedings of the 12th International Conference on Foundations of Software Science and Computational Structures (FoSSaCS), Lecture Notes in Computer Science, vol. 5504, Springer 212–226.Google Scholar
Lohrey, M., Maneth, S. and Schmidt-Schauß, M. (2012). Parameter reduction and automata evaluation for grammar-compressed trees. Journal of Computer and System Sciences 78 (5) 16511669.Google Scholar
Plandowski, W. (1994). Testing equivalence of morphisms in context-free languages. In: Proceedings of the Annual European Symposium on Algorithms (ESA '94), Lecture Notes in Computer Science, vol. 855, Springer 460–470.Google Scholar
Plandowski, W. and Rytter, W. (1999). Complexity of language recognition problems for compressed words. In: Jewels are Forever, Springer 262272.Google Scholar
Rytter, W. (2004). Grammar Compression, LZ-encodings, and string algorithms with implicit input. In Díaz, J.et al., (eds.), Proceedings of the ICALP 2004, Lecture Notes in Computer Science, vol. 3142, Springer-Verlag 1527.Google Scholar
Salzer, G. (1992). The unification of infinite sets of terms and its applications. In: Proceedings of the LPAR '92, Lecture Notes in Computer Science, vol. 624, 409–420.Google Scholar
Schmidt-Schauß, M. (2005). Polynomial equality testing for terms with shared substructures. Frank report 21, Institut für Informatik. FB Informatik und Mathematik. Goethe-Universität Frankfurt.Google Scholar
Schmidt-Schauß, M. (2012). Matching of compressed patterns with character-variables. In: Tiwari, A., (ed.) Proceedings of the 23rd International Conference on Rewriting Techniques and Applications (RTA '12), Leibniz International Proceedings in Informatics, vol. 624, Schloss Dagstuhl 272–287.Google Scholar
Schmidt-Schauß, M., Sabel, D. and Anis, A. (2011). Congruence closure of compressed terms in polynomial time. In: Proceedings of the FroCos, Lecture Notes in Computer, vol. 624, Springer 227–242.Google Scholar
Schmidt-Schauß, M. and Schnitger, G. (2012). Fast equality test for straight-line compressed strings Information Processing Letters 112 (8–9) 341345.Google Scholar
Ziv, J. and Lempel, A. (1977). A universal algorithm for sequential data compression IEEE Transactions on Information Theory 23 (3) 337343.Google Scholar